OSDN Git Service

585901e29dac98ceee235c92321f41878fabe544
[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
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} @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}
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++0x-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} -Wjump-misses-init -Wignored-qualifiers @gol
248 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
249 -Winit-self  -Winline -Wmaybe-uninitialized @gol
250 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
251 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
252 -Wlogical-op -Wlong-long @gol
253 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
254 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
255 -Wno-mudflap @gol
256 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
257 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
258 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
259 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
260 -Wredundant-decls @gol
261 -Wreturn-type  -Wsequence-point  -Wshadow @gol
262 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
263 -Wstack-usage=@var{len} -Wstrict-aliasing -Wstrict-aliasing=n @gol
264 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
265 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]} @gol
266 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
267 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
268 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
269 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
270 -Wunused-label  -Wunused-parameter -Wno-unused-result -Wunused-value @gol
271 -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable @gol
272 -Wvariadic-macros -Wvla -Wvolatile-register-var  -Wwrite-strings}
273
274 @item C and Objective-C-only Warning Options
275 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
276 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
277 -Wold-style-declaration  -Wold-style-definition @gol
278 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
279 -Wdeclaration-after-statement -Wpointer-sign}
280
281 @item Debugging Options
282 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
283 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
284 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
285 -fdisable-ipa-@var{pass_name} @gol
286 -fdisable-rtl-@var{pass_name} @gol
287 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
288 -fdisable-tree-@var{pass_name} @gol
289 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
290 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
291 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
292 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
293 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
294 -fdump-statistics @gol
295 -fdump-tree-all @gol
296 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
297 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
298 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
299 -fdump-tree-ch @gol
300 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
301 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
302 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
303 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
304 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
305 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
306 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
307 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
308 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-nrv -fdump-tree-vect @gol
310 -fdump-tree-sink @gol
311 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
315 -ftree-vectorizer-verbose=@var{n} @gol
316 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
317 -fdump-final-insns=@var{file} @gol
318 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
319 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
320 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
321 -fenable-@var{kind}-@var{pass} @gol
322 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
323 -fdebug-types-section @gol
324 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
325 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
326 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
327 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
328 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
329 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
330 -ggdb  -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
331 -gvms  -gxcoff  -gxcoff+ @gol
332 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
333 -fdebug-prefix-map=@var{old}=@var{new} @gol
334 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
335 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
336 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
337 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
338 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
339 -print-sysroot -print-sysroot-headers-suffix @gol
340 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
341
342 @item Optimization Options
343 @xref{Optimize Options,,Options that Control Optimization}.
344 @gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
345 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
346 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
347 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
348 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
349 -fcompare-elim -fcprop-registers -fcrossjumping @gol
350 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
351 -fcx-limited-range @gol
352 -fdata-sections -fdce -fdce -fdelayed-branch @gol
353 -fdelete-null-pointer-checks -fdse -fdevirtualize -fdse @gol
354 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol
355 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
356 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
357 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
358 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
359 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
360 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg @gol
361 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
362 -fira-algorithm=@var{algorithm} @gol
363 -fira-region=@var{region} @gol
364 -fira-loop-pressure -fno-ira-share-save-slots @gol
365 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
366 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
367 -floop-block -floop-flatten -floop-interchange -floop-strip-mine @gol
368 -floop-parallelize-all -flto -flto-compression-level @gol
369 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
370 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
371 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
372 -fno-default-inline @gol
373 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
374 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
375 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
376 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
377 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
378 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
379 -fprefetch-loop-arrays @gol
380 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
381 -fprofile-generate=@var{path} @gol
382 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
383 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
384 -freorder-blocks-and-partition -freorder-functions @gol
385 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
386 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
387 -fsched-spec-load -fsched-spec-load-dangerous @gol
388 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
389 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
390 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
391 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
392 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
393 -fselective-scheduling -fselective-scheduling2 @gol
394 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
395 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
396 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
397 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
398 -ftree-bit-ccp @gol
399 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
400 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
401 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
402 -ftree-loop-if-convert-stores -ftree-loop-im @gol
403 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
404 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
405 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
406 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
407 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
408 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
409 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
410 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
411 -fwhole-program -fwpa -fuse-linker-plugin @gol
412 --param @var{name}=@var{value}
413 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
414
415 @item Preprocessor Options
416 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
417 @gccoptlist{-A@var{question}=@var{answer} @gol
418 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
419 -C  -dD  -dI  -dM  -dN @gol
420 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
421 -idirafter @var{dir} @gol
422 -include @var{file}  -imacros @var{file} @gol
423 -iprefix @var{file}  -iwithprefix @var{dir} @gol
424 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
425 -imultilib @var{dir} -isysroot @var{dir} @gol
426 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
427 -P  -fworking-directory  -remap @gol
428 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
429 -Xpreprocessor @var{option}}
430
431 @item Assembler Option
432 @xref{Assembler Options,,Passing Options to the Assembler}.
433 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
434
435 @item Linker Options
436 @xref{Link Options,,Options for Linking}.
437 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
438 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
439 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
440 -shared-libgcc  -symbolic @gol
441 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
442 -u @var{symbol}}
443
444 @item Directory Options
445 @xref{Directory Options,,Options for Directory Search}.
446 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
447 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
448 --sysroot=@var{dir}}
449
450 @item Machine Dependent Options
451 @xref{Submodel Options,,Hardware Models and Configurations}.
452 @c This list is ordered alphanumerically by subsection name.
453 @c Try and put the significant identifier (CPU or system) first,
454 @c so users have a clue at guessing where the ones they want will be.
455
456 @emph{ARM Options}
457 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
458 -mabi=@var{name} @gol
459 -mapcs-stack-check  -mno-apcs-stack-check @gol
460 -mapcs-float  -mno-apcs-float @gol
461 -mapcs-reentrant  -mno-apcs-reentrant @gol
462 -msched-prolog  -mno-sched-prolog @gol
463 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
464 -mfloat-abi=@var{name}  -mfpe @gol
465 -mfp16-format=@var{name}
466 -mthumb-interwork  -mno-thumb-interwork @gol
467 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
468 -mstructure-size-boundary=@var{n} @gol
469 -mabort-on-noreturn @gol
470 -mlong-calls  -mno-long-calls @gol
471 -msingle-pic-base  -mno-single-pic-base @gol
472 -mpic-register=@var{reg} @gol
473 -mnop-fun-dllimport @gol
474 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
475 -mpoke-function-name @gol
476 -mthumb  -marm @gol
477 -mtpcs-frame  -mtpcs-leaf-frame @gol
478 -mcaller-super-interworking  -mcallee-super-interworking @gol
479 -mtp=@var{name} @gol
480 -mword-relocations @gol
481 -mfix-cortex-m3-ldrd}
482
483 @emph{AVR Options}
484 @gccoptlist{-mmcu=@var{mcu}  -mno-interrupts @gol
485 -mcall-prologues  -mtiny-stack  -mint8}
486
487 @emph{Blackfin Options}
488 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
489 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
490 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
491 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
492 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
493 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
494 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
495 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
496 -micplb}
497
498 @emph{CRIS Options}
499 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
500 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
501 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
502 -mstack-align  -mdata-align  -mconst-align @gol
503 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
504 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
505 -mmul-bug-workaround  -mno-mul-bug-workaround}
506
507 @emph{Darwin Options}
508 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
509 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
510 -client_name  -compatibility_version  -current_version @gol
511 -dead_strip @gol
512 -dependency-file  -dylib_file  -dylinker_install_name @gol
513 -dynamic  -dynamiclib  -exported_symbols_list @gol
514 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
515 -force_flat_namespace  -headerpad_max_install_names @gol
516 -iframework @gol
517 -image_base  -init  -install_name  -keep_private_externs @gol
518 -multi_module  -multiply_defined  -multiply_defined_unused @gol
519 -noall_load   -no_dead_strip_inits_and_terms @gol
520 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
521 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
522 -private_bundle  -read_only_relocs  -sectalign @gol
523 -sectobjectsymbols  -whyload  -seg1addr @gol
524 -sectcreate  -sectobjectsymbols  -sectorder @gol
525 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
526 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
527 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
528 -single_module  -static  -sub_library  -sub_umbrella @gol
529 -twolevel_namespace  -umbrella  -undefined @gol
530 -unexported_symbols_list  -weak_reference_mismatches @gol
531 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
532 -mkernel -mone-byte-bool}
533
534 @emph{DEC Alpha Options}
535 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
536 -mieee  -mieee-with-inexact  -mieee-conformant @gol
537 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
538 -mtrap-precision=@var{mode}  -mbuild-constants @gol
539 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
540 -mbwx  -mmax  -mfix  -mcix @gol
541 -mfloat-vax  -mfloat-ieee @gol
542 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
543 -msmall-text  -mlarge-text @gol
544 -mmemory-latency=@var{time}}
545
546 @emph{DEC Alpha/VMS Options}
547 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
548
549 @emph{FR30 Options}
550 @gccoptlist{-msmall-model -mno-lsim}
551
552 @emph{FRV Options}
553 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
554 -mhard-float  -msoft-float @gol
555 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
556 -mdouble  -mno-double @gol
557 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
558 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
559 -mlinked-fp  -mlong-calls  -malign-labels @gol
560 -mlibrary-pic  -macc-4  -macc-8 @gol
561 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
562 -moptimize-membar -mno-optimize-membar @gol
563 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
564 -mvliw-branch  -mno-vliw-branch @gol
565 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
566 -mno-nested-cond-exec  -mtomcat-stats @gol
567 -mTLS -mtls @gol
568 -mcpu=@var{cpu}}
569
570 @emph{GNU/Linux Options}
571 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
572 -tno-android-cc -tno-android-ld}
573
574 @emph{H8/300 Options}
575 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
576
577 @emph{HPPA Options}
578 @gccoptlist{-march=@var{architecture-type} @gol
579 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
580 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
581 -mfixed-range=@var{register-range} @gol
582 -mjump-in-delay -mlinker-opt -mlong-calls @gol
583 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
584 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
585 -mno-jump-in-delay  -mno-long-load-store @gol
586 -mno-portable-runtime  -mno-soft-float @gol
587 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
588 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
589 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
590 -munix=@var{unix-std}  -nolibdld  -static  -threads}
591
592 @emph{i386 and x86-64 Options}
593 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
594 -mfpmath=@var{unit} @gol
595 -masm=@var{dialect}  -mno-fancy-math-387 @gol
596 -mno-fp-ret-in-387  -msoft-float @gol
597 -mno-wide-multiply  -mrtd  -malign-double @gol
598 -mpreferred-stack-boundary=@var{num} @gol
599 -mincoming-stack-boundary=@var{num} @gol
600 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip -mvzeroupper @gol
601 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
602 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfused-madd @gol
603 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlwp @gol
604 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
605 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
606 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
607 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
608 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
609 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
610 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
611 -mcmodel=@var{code-model} -mabi=@var{name} @gol
612 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
613 -msse2avx -mfentry -m8bit-idiv @gol
614 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
615
616 @emph{i386 and x86-64 Windows Options}
617 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
618 -mnop-fun-dllimport -mthread @gol
619 -municode -mwin32 -mwindows -fno-set-stack-executable}
620
621 @emph{IA-64 Options}
622 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
623 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
624 -mconstant-gp  -mauto-pic  -mfused-madd @gol
625 -minline-float-divide-min-latency @gol
626 -minline-float-divide-max-throughput @gol
627 -mno-inline-float-divide @gol
628 -minline-int-divide-min-latency @gol
629 -minline-int-divide-max-throughput  @gol
630 -mno-inline-int-divide @gol
631 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
632 -mno-inline-sqrt @gol
633 -mdwarf2-asm -mearly-stop-bits @gol
634 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
635 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
636 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
637 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
638 -msched-spec-ldc -msched-spec-control-ldc @gol
639 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
640 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
641 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
642 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
643
644 @emph{IA-64/VMS Options}
645 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
646
647 @emph{LM32 Options}
648 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
649 -msign-extend-enabled -muser-enabled}
650
651 @emph{M32R/D Options}
652 @gccoptlist{-m32r2 -m32rx -m32r @gol
653 -mdebug @gol
654 -malign-loops -mno-align-loops @gol
655 -missue-rate=@var{number} @gol
656 -mbranch-cost=@var{number} @gol
657 -mmodel=@var{code-size-model-type} @gol
658 -msdata=@var{sdata-type} @gol
659 -mno-flush-func -mflush-func=@var{name} @gol
660 -mno-flush-trap -mflush-trap=@var{number} @gol
661 -G @var{num}}
662
663 @emph{M32C Options}
664 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
665
666 @emph{M680x0 Options}
667 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
668 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
669 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
670 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
671 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
672 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
673 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
674 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
675 -mxgot -mno-xgot}
676
677 @emph{MCore Options}
678 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
679 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
680 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
681 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
682 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
683
684 @emph{MeP Options}
685 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
686 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
687 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
688 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
689 -mtiny=@var{n}}
690
691 @emph{MicroBlaze Options}
692 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
693 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
694 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
695 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
696 -mxl-mode-@var{app-model}}
697
698 @emph{MIPS Options}
699 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
700 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
701 -mips64  -mips64r2 @gol
702 -mips16  -mno-mips16  -mflip-mips16 @gol
703 -minterlink-mips16  -mno-interlink-mips16 @gol
704 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
705 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
706 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
707 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
708 -mfpu=@var{fpu-type} @gol
709 -msmartmips  -mno-smartmips @gol
710 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
711 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
712 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
713 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
714 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
715 -membedded-data  -mno-embedded-data @gol
716 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
717 -mcode-readable=@var{setting} @gol
718 -msplit-addresses  -mno-split-addresses @gol
719 -mexplicit-relocs  -mno-explicit-relocs @gol
720 -mcheck-zero-division  -mno-check-zero-division @gol
721 -mdivide-traps  -mdivide-breaks @gol
722 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
723 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
724 -mfix-24k -mno-fix-24k @gol
725 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
726 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
727 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
728 -mflush-func=@var{func}  -mno-flush-func @gol
729 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
730 -mfp-exceptions -mno-fp-exceptions @gol
731 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
732 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
733
734 @emph{MMIX Options}
735 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
736 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
737 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
738 -mno-base-addresses  -msingle-exit  -mno-single-exit}
739
740 @emph{MN10300 Options}
741 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
742 -mno-am33 -mam33 -mam33-2 -mam34 @gol
743 -mtune=@var{cpu-type} @gol
744 -mreturn-pointer-on-d0 @gol
745 -mno-crt0  -mrelax -mliw -msetlb}
746
747 @emph{PDP-11 Options}
748 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
749 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
750 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
751 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
752 -mbranch-expensive  -mbranch-cheap @gol
753 -munix-asm  -mdec-asm}
754
755 @emph{picoChip Options}
756 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
757 -msymbol-as-address -mno-inefficient-warnings}
758
759 @emph{PowerPC Options}
760 See RS/6000 and PowerPC Options.
761
762 @emph{RS/6000 and PowerPC Options}
763 @gccoptlist{-mcpu=@var{cpu-type} @gol
764 -mtune=@var{cpu-type} @gol
765 -mcmodel=@var{code-model} @gol
766 -mpower  -mno-power  -mpower2  -mno-power2 @gol
767 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
768 -maltivec  -mno-altivec @gol
769 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
770 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
771 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
772 -mfprnd  -mno-fprnd @gol
773 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
774 -mnew-mnemonics  -mold-mnemonics @gol
775 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
776 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
777 -malign-power  -malign-natural @gol
778 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
779 -msingle-float -mdouble-float -msimple-fpu @gol
780 -mstring  -mno-string  -mupdate  -mno-update @gol
781 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
782 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
783 -mstrict-align  -mno-strict-align  -mrelocatable @gol
784 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
785 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
786 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
787 -mprioritize-restricted-insns=@var{priority} @gol
788 -msched-costly-dep=@var{dependence_type} @gol
789 -minsert-sched-nops=@var{scheme} @gol
790 -mcall-sysv  -mcall-netbsd @gol
791 -maix-struct-return  -msvr4-struct-return @gol
792 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
793 -mblock-move-inline-limit=@var{num} @gol
794 -misel -mno-isel @gol
795 -misel=yes  -misel=no @gol
796 -mspe -mno-spe @gol
797 -mspe=yes  -mspe=no @gol
798 -mpaired @gol
799 -mgen-cell-microcode -mwarn-cell-microcode @gol
800 -mvrsave -mno-vrsave @gol
801 -mmulhw -mno-mulhw @gol
802 -mdlmzb -mno-dlmzb @gol
803 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
804 -mprototype  -mno-prototype @gol
805 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
806 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
807 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
808 -mno-recip-precision @gol
809 -mveclibabi=@var{type} -mfriz -mno-friz}
810
811 @emph{RX Options}
812 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
813 -mcpu=@gol
814 -mbig-endian-data -mlittle-endian-data @gol
815 -msmall-data @gol
816 -msim  -mno-sim@gol
817 -mas100-syntax -mno-as100-syntax@gol
818 -mrelax@gol
819 -mmax-constant-size=@gol
820 -mint-register=@gol
821 -msave-acc-in-interrupts}
822
823 @emph{S/390 and zSeries Options}
824 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
825 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
826 -mlong-double-64 -mlong-double-128 @gol
827 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
828 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
829 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
830 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
831 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
832
833 @emph{Score Options}
834 @gccoptlist{-meb -mel @gol
835 -mnhwloop @gol
836 -muls @gol
837 -mmac @gol
838 -mscore5 -mscore5u -mscore7 -mscore7d}
839
840 @emph{SH Options}
841 @gccoptlist{-m1  -m2  -m2e @gol
842 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
843 -m3  -m3e @gol
844 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
845 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
846 -m5-64media  -m5-64media-nofpu @gol
847 -m5-32media  -m5-32media-nofpu @gol
848 -m5-compact  -m5-compact-nofpu @gol
849 -mb  -ml  -mdalign  -mrelax @gol
850 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
851 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
852 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
853 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
854 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
855 -maccumulate-outgoing-args -minvalid-symbols}
856
857 @emph{Solaris 2 Options}
858 @gccoptlist{-mimpure-text  -mno-impure-text @gol
859 -pthreads -pthread}
860
861 @emph{SPARC Options}
862 @gccoptlist{-mcpu=@var{cpu-type} @gol
863 -mtune=@var{cpu-type} @gol
864 -mcmodel=@var{code-model} @gol
865 -m32  -m64  -mapp-regs  -mno-app-regs @gol
866 -mfaster-structs  -mno-faster-structs @gol
867 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
868 -mhard-quad-float  -msoft-quad-float @gol
869 -mlittle-endian @gol
870 -mstack-bias  -mno-stack-bias @gol
871 -munaligned-doubles  -mno-unaligned-doubles @gol
872 -mv8plus  -mno-v8plus  -mvis  -mno-vis}
873
874 @emph{SPU Options}
875 @gccoptlist{-mwarn-reloc -merror-reloc @gol
876 -msafe-dma -munsafe-dma @gol
877 -mbranch-hints @gol
878 -msmall-mem -mlarge-mem -mstdmain @gol
879 -mfixed-range=@var{register-range} @gol
880 -mea32 -mea64 @gol
881 -maddress-space-conversion -mno-address-space-conversion @gol
882 -mcache-size=@var{cache-size} @gol
883 -matomic-updates -mno-atomic-updates}
884
885 @emph{System V Options}
886 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
887
888 @emph{V850 Options}
889 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
890 -mprolog-function  -mno-prolog-function  -mspace @gol
891 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
892 -mapp-regs  -mno-app-regs @gol
893 -mdisable-callt  -mno-disable-callt @gol
894 -mv850e2v3 @gol
895 -mv850e2 @gol
896 -mv850e1 -mv850es @gol
897 -mv850e @gol
898 -mv850  -mbig-switch}
899
900 @emph{VAX Options}
901 @gccoptlist{-mg  -mgnu  -munix}
902
903 @emph{VxWorks Options}
904 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
905 -Xbind-lazy  -Xbind-now}
906
907 @emph{x86-64 Options}
908 See i386 and x86-64 Options.
909
910 @emph{Xstormy16 Options}
911 @gccoptlist{-msim}
912
913 @emph{Xtensa Options}
914 @gccoptlist{-mconst16 -mno-const16 @gol
915 -mfused-madd  -mno-fused-madd @gol
916 -mforce-no-pic @gol
917 -mserialize-volatile  -mno-serialize-volatile @gol
918 -mtext-section-literals  -mno-text-section-literals @gol
919 -mtarget-align  -mno-target-align @gol
920 -mlongcalls  -mno-longcalls}
921
922 @emph{zSeries Options}
923 See S/390 and zSeries Options.
924
925 @item Code Generation Options
926 @xref{Code Gen Options,,Options for Code Generation Conventions}.
927 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
928 -ffixed-@var{reg}  -fexceptions @gol
929 -fnon-call-exceptions  -funwind-tables @gol
930 -fasynchronous-unwind-tables @gol
931 -finhibit-size-directive  -finstrument-functions @gol
932 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
933 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
934 -fno-common  -fno-ident @gol
935 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
936 -fno-jump-tables @gol
937 -frecord-gcc-switches @gol
938 -freg-struct-return  -fshort-enums @gol
939 -fshort-double  -fshort-wchar @gol
940 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
941 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
942 -fno-stack-limit -fsplit-stack @gol
943 -fleading-underscore  -ftls-model=@var{model} @gol
944 -ftrapv  -fwrapv  -fbounds-check @gol
945 -fvisibility -fstrict-volatile-bitfields}
946 @end table
947
948 @menu
949 * Overall Options::     Controlling the kind of output:
950                         an executable, object files, assembler files,
951                         or preprocessed source.
952 * C Dialect Options::   Controlling the variant of C language compiled.
953 * C++ Dialect Options:: Variations on C++.
954 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
955                         and Objective-C++.
956 * Language Independent Options:: Controlling how diagnostics should be
957                         formatted.
958 * Warning Options::     How picky should the compiler be?
959 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
960 * Optimize Options::    How much optimization?
961 * Preprocessor Options:: Controlling header files and macro definitions.
962                          Also, getting dependency information for Make.
963 * Assembler Options::   Passing options to the assembler.
964 * Link Options::        Specifying libraries and so on.
965 * Directory Options::   Where to find header files and libraries.
966                         Where to find the compiler executable files.
967 * Spec Files::          How to pass switches to sub-processes.
968 * Target Options::      Running a cross-compiler, or an old version of GCC.
969 @end menu
970
971 @node Overall Options
972 @section Options Controlling the Kind of Output
973
974 Compilation can involve up to four stages: preprocessing, compilation
975 proper, assembly and linking, always in that order.  GCC is capable of
976 preprocessing and compiling several files either into several
977 assembler input files, or into one assembler input file; then each
978 assembler input file produces an object file, and linking combines all
979 the object files (those newly compiled, and those specified as input)
980 into an executable file.
981
982 @cindex file name suffix
983 For any given input file, the file name suffix determines what kind of
984 compilation is done:
985
986 @table @gcctabopt
987 @item @var{file}.c
988 C source code which must be preprocessed.
989
990 @item @var{file}.i
991 C source code which should not be preprocessed.
992
993 @item @var{file}.ii
994 C++ source code which should not be preprocessed.
995
996 @item @var{file}.m
997 Objective-C source code.  Note that you must link with the @file{libobjc}
998 library to make an Objective-C program work.
999
1000 @item @var{file}.mi
1001 Objective-C source code which should not be preprocessed.
1002
1003 @item @var{file}.mm
1004 @itemx @var{file}.M
1005 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1006 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1007 to a literal capital M@.
1008
1009 @item @var{file}.mii
1010 Objective-C++ source code which should not be preprocessed.
1011
1012 @item @var{file}.h
1013 C, C++, Objective-C or Objective-C++ header file to be turned into a
1014 precompiled header (default), or C, C++ header file to be turned into an
1015 Ada spec (via the @option{-fdump-ada-spec} switch).
1016
1017 @item @var{file}.cc
1018 @itemx @var{file}.cp
1019 @itemx @var{file}.cxx
1020 @itemx @var{file}.cpp
1021 @itemx @var{file}.CPP
1022 @itemx @var{file}.c++
1023 @itemx @var{file}.C
1024 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
1025 the last two letters must both be literally @samp{x}.  Likewise,
1026 @samp{.C} refers to a literal capital C@.
1027
1028 @item @var{file}.mm
1029 @itemx @var{file}.M
1030 Objective-C++ source code which must be preprocessed.
1031
1032 @item @var{file}.mii
1033 Objective-C++ source code which should not be preprocessed.
1034
1035 @item @var{file}.hh
1036 @itemx @var{file}.H
1037 @itemx @var{file}.hp
1038 @itemx @var{file}.hxx
1039 @itemx @var{file}.hpp
1040 @itemx @var{file}.HPP
1041 @itemx @var{file}.h++
1042 @itemx @var{file}.tcc
1043 C++ header file to be turned into a precompiled header or Ada spec.
1044
1045 @item @var{file}.f
1046 @itemx @var{file}.for
1047 @itemx @var{file}.ftn
1048 Fixed form Fortran source code which should not be preprocessed.
1049
1050 @item @var{file}.F
1051 @itemx @var{file}.FOR
1052 @itemx @var{file}.fpp
1053 @itemx @var{file}.FPP
1054 @itemx @var{file}.FTN
1055 Fixed form Fortran source code which must be preprocessed (with the traditional
1056 preprocessor).
1057
1058 @item @var{file}.f90
1059 @itemx @var{file}.f95
1060 @itemx @var{file}.f03
1061 @itemx @var{file}.f08
1062 Free form Fortran source code which should not be preprocessed.
1063
1064 @item @var{file}.F90
1065 @itemx @var{file}.F95
1066 @itemx @var{file}.F03
1067 @itemx @var{file}.F08
1068 Free form Fortran source code which must be preprocessed (with the
1069 traditional preprocessor).
1070
1071 @item @var{file}.go
1072 Go source code.
1073
1074 @c FIXME: Descriptions of Java file types.
1075 @c @var{file}.java
1076 @c @var{file}.class
1077 @c @var{file}.zip
1078 @c @var{file}.jar
1079
1080 @item @var{file}.ads
1081 Ada source code file which contains a library unit declaration (a
1082 declaration of a package, subprogram, or generic, or a generic
1083 instantiation), or a library unit renaming declaration (a package,
1084 generic, or subprogram renaming declaration).  Such files are also
1085 called @dfn{specs}.
1086
1087 @item @var{file}.adb
1088 Ada source code file containing a library unit body (a subprogram or
1089 package body).  Such files are also called @dfn{bodies}.
1090
1091 @c GCC also knows about some suffixes for languages not yet included:
1092 @c Pascal:
1093 @c @var{file}.p
1094 @c @var{file}.pas
1095 @c Ratfor:
1096 @c @var{file}.r
1097
1098 @item @var{file}.s
1099 Assembler code.
1100
1101 @item @var{file}.S
1102 @itemx @var{file}.sx
1103 Assembler code which must be preprocessed.
1104
1105 @item @var{other}
1106 An object file to be fed straight into linking.
1107 Any file name with no recognized suffix is treated this way.
1108 @end table
1109
1110 @opindex x
1111 You can specify the input language explicitly with the @option{-x} option:
1112
1113 @table @gcctabopt
1114 @item -x @var{language}
1115 Specify explicitly the @var{language} for the following input files
1116 (rather than letting the compiler choose a default based on the file
1117 name suffix).  This option applies to all following input files until
1118 the next @option{-x} option.  Possible values for @var{language} are:
1119 @smallexample
1120 c  c-header  cpp-output
1121 c++  c++-header  c++-cpp-output
1122 objective-c  objective-c-header  objective-c-cpp-output
1123 objective-c++ objective-c++-header objective-c++-cpp-output
1124 assembler  assembler-with-cpp
1125 ada
1126 f77  f77-cpp-input f95  f95-cpp-input
1127 go
1128 java
1129 @end smallexample
1130
1131 @item -x none
1132 Turn off any specification of a language, so that subsequent files are
1133 handled according to their file name suffixes (as they are if @option{-x}
1134 has not been used at all).
1135
1136 @item -pass-exit-codes
1137 @opindex pass-exit-codes
1138 Normally the @command{gcc} program will exit with the code of 1 if any
1139 phase of the compiler returns a non-success return code.  If you specify
1140 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1141 numerically highest error produced by any phase that returned an error
1142 indication.  The C, C++, and Fortran frontends return 4, if an internal
1143 compiler error is encountered.
1144 @end table
1145
1146 If you only want some of the stages of compilation, you can use
1147 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1148 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1149 @command{gcc} is to stop.  Note that some combinations (for example,
1150 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1151
1152 @table @gcctabopt
1153 @item -c
1154 @opindex c
1155 Compile or assemble the source files, but do not link.  The linking
1156 stage simply is not done.  The ultimate output is in the form of an
1157 object file for each source file.
1158
1159 By default, the object file name for a source file is made by replacing
1160 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1161
1162 Unrecognized input files, not requiring compilation or assembly, are
1163 ignored.
1164
1165 @item -S
1166 @opindex S
1167 Stop after the stage of compilation proper; do not assemble.  The output
1168 is in the form of an assembler code file for each non-assembler input
1169 file specified.
1170
1171 By default, the assembler file name for a source file is made by
1172 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1173
1174 Input files that don't require compilation are ignored.
1175
1176 @item -E
1177 @opindex E
1178 Stop after the preprocessing stage; do not run the compiler proper.  The
1179 output is in the form of preprocessed source code, which is sent to the
1180 standard output.
1181
1182 Input files which don't require preprocessing are ignored.
1183
1184 @cindex output file option
1185 @item -o @var{file}
1186 @opindex o
1187 Place output in file @var{file}.  This applies regardless to whatever
1188 sort of output is being produced, whether it be an executable file,
1189 an object file, an assembler file or preprocessed C code.
1190
1191 If @option{-o} is not specified, the default is to put an executable
1192 file in @file{a.out}, the object file for
1193 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1194 assembler file in @file{@var{source}.s}, a precompiled header file in
1195 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1196 standard output.
1197
1198 @item -v
1199 @opindex v
1200 Print (on standard error output) the commands executed to run the stages
1201 of compilation.  Also print the version number of the compiler driver
1202 program and of the preprocessor and the compiler proper.
1203
1204 @item -###
1205 @opindex ###
1206 Like @option{-v} except the commands are not executed and arguments
1207 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1208 This is useful for shell scripts to capture the driver-generated command lines.
1209
1210 @item -pipe
1211 @opindex pipe
1212 Use pipes rather than temporary files for communication between the
1213 various stages of compilation.  This fails to work on some systems where
1214 the assembler is unable to read from a pipe; but the GNU assembler has
1215 no trouble.
1216
1217 @item --help
1218 @opindex help
1219 Print (on the standard output) a description of the command line options
1220 understood by @command{gcc}.  If the @option{-v} option is also specified
1221 then @option{--help} will also be passed on to the various processes
1222 invoked by @command{gcc}, so that they can display the command line options
1223 they accept.  If the @option{-Wextra} option has also been specified
1224 (prior to the @option{--help} option), then command line options which
1225 have no documentation associated with them will also be displayed.
1226
1227 @item --target-help
1228 @opindex target-help
1229 Print (on the standard output) a description of target-specific command
1230 line options for each tool.  For some targets extra target-specific
1231 information may also be printed.
1232
1233 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1234 Print (on the standard output) a description of the command line
1235 options understood by the compiler that fit into all specified classes
1236 and qualifiers.  These are the supported classes:
1237
1238 @table @asis
1239 @item @samp{optimizers}
1240 This will display all of the optimization options supported by the
1241 compiler.
1242
1243 @item @samp{warnings}
1244 This will display all of the options controlling warning messages
1245 produced by the compiler.
1246
1247 @item @samp{target}
1248 This will display target-specific options.  Unlike the
1249 @option{--target-help} option however, target-specific options of the
1250 linker and assembler will not be displayed.  This is because those
1251 tools do not currently support the extended @option{--help=} syntax.
1252
1253 @item @samp{params}
1254 This will display the values recognized by the @option{--param}
1255 option.
1256
1257 @item @var{language}
1258 This will display the options supported for @var{language}, where
1259 @var{language} is the name of one of the languages supported in this
1260 version of GCC.
1261
1262 @item @samp{common}
1263 This will display the options that are common to all languages.
1264 @end table
1265
1266 These are the supported qualifiers:
1267
1268 @table @asis
1269 @item @samp{undocumented}
1270 Display only those options which are undocumented.
1271
1272 @item @samp{joined}
1273 Display options which take an argument that appears after an equal
1274 sign in the same continuous piece of text, such as:
1275 @samp{--help=target}.
1276
1277 @item @samp{separate}
1278 Display options which take an argument that appears as a separate word
1279 following the original option, such as: @samp{-o output-file}.
1280 @end table
1281
1282 Thus for example to display all the undocumented target-specific
1283 switches supported by the compiler the following can be used:
1284
1285 @smallexample
1286 --help=target,undocumented
1287 @end smallexample
1288
1289 The sense of a qualifier can be inverted by prefixing it with the
1290 @samp{^} character, so for example to display all binary warning
1291 options (i.e., ones that are either on or off and that do not take an
1292 argument), which have a description the following can be used:
1293
1294 @smallexample
1295 --help=warnings,^joined,^undocumented
1296 @end smallexample
1297
1298 The argument to @option{--help=} should not consist solely of inverted
1299 qualifiers.
1300
1301 Combining several classes is possible, although this usually
1302 restricts the output by so much that there is nothing to display.  One
1303 case where it does work however is when one of the classes is
1304 @var{target}.  So for example to display all the target-specific
1305 optimization options the following can be used:
1306
1307 @smallexample
1308 --help=target,optimizers
1309 @end smallexample
1310
1311 The @option{--help=} option can be repeated on the command line.  Each
1312 successive use will display its requested class of options, skipping
1313 those that have already been displayed.
1314
1315 If the @option{-Q} option appears on the command line before the
1316 @option{--help=} option, then the descriptive text displayed by
1317 @option{--help=} is changed.  Instead of describing the displayed
1318 options, an indication is given as to whether the option is enabled,
1319 disabled or set to a specific value (assuming that the compiler
1320 knows this at the point where the @option{--help=} option is used).
1321
1322 Here is a truncated example from the ARM port of @command{gcc}:
1323
1324 @smallexample
1325   % gcc -Q -mabi=2 --help=target -c
1326   The following options are target specific:
1327   -mabi=                                2
1328   -mabort-on-noreturn                   [disabled]
1329   -mapcs                                [disabled]
1330 @end smallexample
1331
1332 The output is sensitive to the effects of previous command line
1333 options, so for example it is possible to find out which optimizations
1334 are enabled at @option{-O2} by using:
1335
1336 @smallexample
1337 -Q -O2 --help=optimizers
1338 @end smallexample
1339
1340 Alternatively you can discover which binary optimizations are enabled
1341 by @option{-O3} by using:
1342
1343 @smallexample
1344 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1345 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1346 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1347 @end smallexample
1348
1349 @item -no-canonical-prefixes
1350 @opindex no-canonical-prefixes
1351 Do not expand any symbolic links, resolve references to @samp{/../}
1352 or @samp{/./}, or make the path absolute when generating a relative
1353 prefix.
1354
1355 @item --version
1356 @opindex version
1357 Display the version number and copyrights of the invoked GCC@.
1358
1359 @item -wrapper
1360 @opindex wrapper
1361 Invoke all subcommands under a wrapper program.  The name of the
1362 wrapper program and its parameters are passed as a comma separated
1363 list.
1364
1365 @smallexample
1366 gcc -c t.c -wrapper gdb,--args
1367 @end smallexample
1368
1369 This will invoke all subprograms of @command{gcc} under
1370 @samp{gdb --args}, thus the invocation of @command{cc1} will be
1371 @samp{gdb --args cc1 @dots{}}.
1372
1373 @item -fplugin=@var{name}.so
1374 Load the plugin code in file @var{name}.so, assumed to be a
1375 shared object to be dlopen'd by the compiler.  The base name of
1376 the shared object file is used to identify the plugin for the
1377 purposes of argument parsing (See
1378 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1379 Each plugin should define the callback functions specified in the
1380 Plugins API.
1381
1382 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1383 Define an argument called @var{key} with a value of @var{value}
1384 for the plugin called @var{name}.
1385
1386 @item -fdump-ada-spec@r{[}-slim@r{]}
1387 For C and C++ source and include files, generate corresponding Ada
1388 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1389 GNAT User's Guide}, which provides detailed documentation on this feature.
1390
1391 @item -fdump-go-spec=@var{file}
1392 For input files in any language, generate corresponding Go
1393 declarations in @var{file}.  This generates Go @code{const},
1394 @code{type}, @code{var}, and @code{func} declarations which may be a
1395 useful way to start writing a Go interface to code written in some
1396 other language.
1397
1398 @include @value{srcdir}/../libiberty/at-file.texi
1399 @end table
1400
1401 @node Invoking G++
1402 @section Compiling C++ Programs
1403
1404 @cindex suffixes for C++ source
1405 @cindex C++ source file suffixes
1406 C++ source files conventionally use one of the suffixes @samp{.C},
1407 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1408 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1409 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1410 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1411 files with these names and compiles them as C++ programs even if you
1412 call the compiler the same way as for compiling C programs (usually
1413 with the name @command{gcc}).
1414
1415 @findex g++
1416 @findex c++
1417 However, the use of @command{gcc} does not add the C++ library.
1418 @command{g++} is a program that calls GCC and treats @samp{.c},
1419 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1420 files unless @option{-x} is used, and automatically specifies linking
1421 against the C++ library.  This program is also useful when
1422 precompiling a C header file with a @samp{.h} extension for use in C++
1423 compilations.  On many systems, @command{g++} is also installed with
1424 the name @command{c++}.
1425
1426 @cindex invoking @command{g++}
1427 When you compile C++ programs, you may specify many of the same
1428 command-line options that you use for compiling programs in any
1429 language; or command-line options meaningful for C and related
1430 languages; or options that are meaningful only for C++ programs.
1431 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1432 explanations of options for languages related to C@.
1433 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1434 explanations of options that are meaningful only for C++ programs.
1435
1436 @node C Dialect Options
1437 @section Options Controlling C Dialect
1438 @cindex dialect options
1439 @cindex language dialect options
1440 @cindex options, dialect
1441
1442 The following options control the dialect of C (or languages derived
1443 from C, such as C++, Objective-C and Objective-C++) that the compiler
1444 accepts:
1445
1446 @table @gcctabopt
1447 @cindex ANSI support
1448 @cindex ISO support
1449 @item -ansi
1450 @opindex ansi
1451 In C mode, this is equivalent to @samp{-std=c90}. In C++ mode, it is
1452 equivalent to @samp{-std=c++98}.
1453
1454 This turns off certain features of GCC that are incompatible with ISO
1455 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1456 such as the @code{asm} and @code{typeof} keywords, and
1457 predefined macros such as @code{unix} and @code{vax} that identify the
1458 type of system you are using.  It also enables the undesirable and
1459 rarely used ISO trigraph feature.  For the C compiler,
1460 it disables recognition of C++ style @samp{//} comments as well as
1461 the @code{inline} keyword.
1462
1463 The alternate keywords @code{__asm__}, @code{__extension__},
1464 @code{__inline__} and @code{__typeof__} continue to work despite
1465 @option{-ansi}.  You would not want to use them in an ISO C program, of
1466 course, but it is useful to put them in header files that might be included
1467 in compilations done with @option{-ansi}.  Alternate predefined macros
1468 such as @code{__unix__} and @code{__vax__} are also available, with or
1469 without @option{-ansi}.
1470
1471 The @option{-ansi} option does not cause non-ISO programs to be
1472 rejected gratuitously.  For that, @option{-pedantic} is required in
1473 addition to @option{-ansi}.  @xref{Warning Options}.
1474
1475 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1476 option is used.  Some header files may notice this macro and refrain
1477 from declaring certain functions or defining certain macros that the
1478 ISO standard doesn't call for; this is to avoid interfering with any
1479 programs that might use these names for other things.
1480
1481 Functions that would normally be built in but do not have semantics
1482 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1483 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1484 built-in functions provided by GCC}, for details of the functions
1485 affected.
1486
1487 @item -std=
1488 @opindex std
1489 Determine the language standard. @xref{Standards,,Language Standards
1490 Supported by GCC}, for details of these standard versions.  This option
1491 is currently only supported when compiling C or C++.
1492
1493 The compiler can accept several base standards, such as @samp{c90} or
1494 @samp{c++98}, and GNU dialects of those standards, such as
1495 @samp{gnu90} or @samp{gnu++98}.  By specifying a base standard, the
1496 compiler will accept all programs following that standard and those
1497 using GNU extensions that do not contradict it.  For example,
1498 @samp{-std=c90} turns off certain features of GCC that are
1499 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1500 keywords, but not other GNU extensions that do not have a meaning in
1501 ISO C90, such as omitting the middle term of a @code{?:}
1502 expression. On the other hand, by specifying a GNU dialect of a
1503 standard, all features the compiler support are enabled, even when
1504 those features change the meaning of the base standard and some
1505 strict-conforming programs may be rejected.  The particular standard
1506 is used by @option{-pedantic} to identify which features are GNU
1507 extensions given that version of the standard. For example
1508 @samp{-std=gnu90 -pedantic} would warn about C++ style @samp{//}
1509 comments, while @samp{-std=gnu99 -pedantic} would not.
1510
1511 A value for this option must be provided; possible values are
1512
1513 @table @samp
1514 @item c90
1515 @itemx c89
1516 @itemx iso9899:1990
1517 Support all ISO C90 programs (certain GNU extensions that conflict
1518 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1519
1520 @item iso9899:199409
1521 ISO C90 as modified in amendment 1.
1522
1523 @item c99
1524 @itemx c9x
1525 @itemx iso9899:1999
1526 @itemx iso9899:199x
1527 ISO C99.  Note that this standard is not yet fully supported; see
1528 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1529 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1530
1531 @item c1x
1532 ISO C1X, the draft of the next revision of the ISO C standard.
1533 Support is limited and experimental and features enabled by this
1534 option may be changed or removed if changed in or removed from the
1535 standard draft.
1536
1537 @item gnu90
1538 @itemx gnu89
1539 GNU dialect of ISO C90 (including some C99 features). This
1540 is the default for C code.
1541
1542 @item gnu99
1543 @itemx gnu9x
1544 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1545 this will become the default.  The name @samp{gnu9x} is deprecated.
1546
1547 @item gnu1x
1548 GNU dialect of ISO C1X.  Support is limited and experimental and
1549 features enabled by this option may be changed or removed if changed
1550 in or removed from the standard draft.
1551
1552 @item c++98
1553 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1554 C++ code.
1555
1556 @item gnu++98
1557 GNU dialect of @option{-std=c++98}.  This is the default for
1558 C++ code.
1559
1560 @item c++0x
1561 The working draft of the upcoming ISO C++0x standard. This option
1562 enables experimental features that are likely to be included in
1563 C++0x. The working draft is constantly changing, and any feature that is
1564 enabled by this flag may be removed from future versions of GCC if it is
1565 not part of the C++0x standard.
1566
1567 @item gnu++0x
1568 GNU dialect of @option{-std=c++0x}. This option enables
1569 experimental features that may be removed in future versions of GCC.
1570 @end table
1571
1572 @item -fgnu89-inline
1573 @opindex fgnu89-inline
1574 The option @option{-fgnu89-inline} tells GCC to use the traditional
1575 GNU semantics for @code{inline} functions when in C99 mode.
1576 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1577 is accepted and ignored by GCC versions 4.1.3 up to but not including
1578 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1579 C99 mode.  Using this option is roughly equivalent to adding the
1580 @code{gnu_inline} function attribute to all inline functions
1581 (@pxref{Function Attributes}).
1582
1583 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1584 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1585 specifies the default behavior).  This option was first supported in
1586 GCC 4.3.  This option is not supported in @option{-std=c90} or
1587 @option{-std=gnu90} mode.
1588
1589 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1590 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1591 in effect for @code{inline} functions.  @xref{Common Predefined
1592 Macros,,,cpp,The C Preprocessor}.
1593
1594 @item -aux-info @var{filename}
1595 @opindex aux-info
1596 Output to the given filename prototyped declarations for all functions
1597 declared and/or defined in a translation unit, including those in header
1598 files.  This option is silently ignored in any language other than C@.
1599
1600 Besides declarations, the file indicates, in comments, the origin of
1601 each declaration (source file and line), whether the declaration was
1602 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1603 @samp{O} for old, respectively, in the first character after the line
1604 number and the colon), and whether it came from a declaration or a
1605 definition (@samp{C} or @samp{F}, respectively, in the following
1606 character).  In the case of function definitions, a K&R-style list of
1607 arguments followed by their declarations is also provided, inside
1608 comments, after the declaration.
1609
1610 @item -fno-asm
1611 @opindex fno-asm
1612 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1613 keyword, so that code can use these words as identifiers.  You can use
1614 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1615 instead.  @option{-ansi} implies @option{-fno-asm}.
1616
1617 In C++, this switch only affects the @code{typeof} keyword, since
1618 @code{asm} and @code{inline} are standard keywords.  You may want to
1619 use the @option{-fno-gnu-keywords} flag instead, which has the same
1620 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1621 switch only affects the @code{asm} and @code{typeof} keywords, since
1622 @code{inline} is a standard keyword in ISO C99.
1623
1624 @item -fno-builtin
1625 @itemx -fno-builtin-@var{function}
1626 @opindex fno-builtin
1627 @cindex built-in functions
1628 Don't recognize built-in functions that do not begin with
1629 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1630 functions provided by GCC}, for details of the functions affected,
1631 including those which are not built-in functions when @option{-ansi} or
1632 @option{-std} options for strict ISO C conformance are used because they
1633 do not have an ISO standard meaning.
1634
1635 GCC normally generates special code to handle certain built-in functions
1636 more efficiently; for instance, calls to @code{alloca} may become single
1637 instructions that adjust the stack directly, and calls to @code{memcpy}
1638 may become inline copy loops.  The resulting code is often both smaller
1639 and faster, but since the function calls no longer appear as such, you
1640 cannot set a breakpoint on those calls, nor can you change the behavior
1641 of the functions by linking with a different library.  In addition,
1642 when a function is recognized as a built-in function, GCC may use
1643 information about that function to warn about problems with calls to
1644 that function, or to generate more efficient code, even if the
1645 resulting code still contains calls to that function.  For example,
1646 warnings are given with @option{-Wformat} for bad calls to
1647 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1648 known not to modify global memory.
1649
1650 With the @option{-fno-builtin-@var{function}} option
1651 only the built-in function @var{function} is
1652 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1653 function is named that is not built-in in this version of GCC, this
1654 option is ignored.  There is no corresponding
1655 @option{-fbuiltin-@var{function}} option; if you wish to enable
1656 built-in functions selectively when using @option{-fno-builtin} or
1657 @option{-ffreestanding}, you may define macros such as:
1658
1659 @smallexample
1660 #define abs(n)          __builtin_abs ((n))
1661 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1662 @end smallexample
1663
1664 @item -fhosted
1665 @opindex fhosted
1666 @cindex hosted environment
1667
1668 Assert that compilation takes place in a hosted environment.  This implies
1669 @option{-fbuiltin}.  A hosted environment is one in which the
1670 entire standard library is available, and in which @code{main} has a return
1671 type of @code{int}.  Examples are nearly everything except a kernel.
1672 This is equivalent to @option{-fno-freestanding}.
1673
1674 @item -ffreestanding
1675 @opindex ffreestanding
1676 @cindex hosted environment
1677
1678 Assert that compilation takes place in a freestanding environment.  This
1679 implies @option{-fno-builtin}.  A freestanding environment
1680 is one in which the standard library may not exist, and program startup may
1681 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1682 This is equivalent to @option{-fno-hosted}.
1683
1684 @xref{Standards,,Language Standards Supported by GCC}, for details of
1685 freestanding and hosted environments.
1686
1687 @item -fopenmp
1688 @opindex fopenmp
1689 @cindex OpenMP parallel
1690 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1691 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1692 compiler generates parallel code according to the OpenMP Application
1693 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1694 implies @option{-pthread}, and thus is only supported on targets that
1695 have support for @option{-pthread}.
1696
1697 @item -fms-extensions
1698 @opindex fms-extensions
1699 Accept some non-standard constructs used in Microsoft header files.
1700
1701 In C++ code, this allows member names in structures to be similar
1702 to previous types declarations.
1703
1704 @smallexample
1705 typedef int UOW;
1706 struct ABC @{
1707   UOW UOW;
1708 @};
1709 @end smallexample
1710
1711 Some cases of unnamed fields in structures and unions are only
1712 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1713 fields within structs/unions}, for details.
1714
1715 @item -fplan9-extensions
1716 Accept some non-standard constructs used in Plan 9 code.
1717
1718 This enables @option{-fms-extensions}, permits passing pointers to
1719 structures with anonymous fields to functions which expect pointers to
1720 elements of the type of the field, and permits referring to anonymous
1721 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1722 struct/union fields within structs/unions}, for details.  This is only
1723 supported for C, not C++.
1724
1725 @item -trigraphs
1726 @opindex trigraphs
1727 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1728 options for strict ISO C conformance) implies @option{-trigraphs}.
1729
1730 @item -no-integrated-cpp
1731 @opindex no-integrated-cpp
1732 Performs a compilation in two passes: preprocessing and compiling.  This
1733 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1734 @option{-B} option.  The user supplied compilation step can then add in
1735 an additional preprocessing step after normal preprocessing but before
1736 compiling.  The default is to use the integrated cpp (internal cpp)
1737
1738 The semantics of this option will change if "cc1", "cc1plus", and
1739 "cc1obj" are merged.
1740
1741 @cindex traditional C language
1742 @cindex C language, traditional
1743 @item -traditional
1744 @itemx -traditional-cpp
1745 @opindex traditional-cpp
1746 @opindex traditional
1747 Formerly, these options caused GCC to attempt to emulate a pre-standard
1748 C compiler.  They are now only supported with the @option{-E} switch.
1749 The preprocessor continues to support a pre-standard mode.  See the GNU
1750 CPP manual for details.
1751
1752 @item -fcond-mismatch
1753 @opindex fcond-mismatch
1754 Allow conditional expressions with mismatched types in the second and
1755 third arguments.  The value of such an expression is void.  This option
1756 is not supported for C++.
1757
1758 @item -flax-vector-conversions
1759 @opindex flax-vector-conversions
1760 Allow implicit conversions between vectors with differing numbers of
1761 elements and/or incompatible element types.  This option should not be
1762 used for new code.
1763
1764 @item -funsigned-char
1765 @opindex funsigned-char
1766 Let the type @code{char} be unsigned, like @code{unsigned char}.
1767
1768 Each kind of machine has a default for what @code{char} should
1769 be.  It is either like @code{unsigned char} by default or like
1770 @code{signed char} by default.
1771
1772 Ideally, a portable program should always use @code{signed char} or
1773 @code{unsigned char} when it depends on the signedness of an object.
1774 But many programs have been written to use plain @code{char} and
1775 expect it to be signed, or expect it to be unsigned, depending on the
1776 machines they were written for.  This option, and its inverse, let you
1777 make such a program work with the opposite default.
1778
1779 The type @code{char} is always a distinct type from each of
1780 @code{signed char} or @code{unsigned char}, even though its behavior
1781 is always just like one of those two.
1782
1783 @item -fsigned-char
1784 @opindex fsigned-char
1785 Let the type @code{char} be signed, like @code{signed char}.
1786
1787 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1788 the negative form of @option{-funsigned-char}.  Likewise, the option
1789 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1790
1791 @item -fsigned-bitfields
1792 @itemx -funsigned-bitfields
1793 @itemx -fno-signed-bitfields
1794 @itemx -fno-unsigned-bitfields
1795 @opindex fsigned-bitfields
1796 @opindex funsigned-bitfields
1797 @opindex fno-signed-bitfields
1798 @opindex fno-unsigned-bitfields
1799 These options control whether a bit-field is signed or unsigned, when the
1800 declaration does not use either @code{signed} or @code{unsigned}.  By
1801 default, such a bit-field is signed, because this is consistent: the
1802 basic integer types such as @code{int} are signed types.
1803 @end table
1804
1805 @node C++ Dialect Options
1806 @section Options Controlling C++ Dialect
1807
1808 @cindex compiler options, C++
1809 @cindex C++ options, command line
1810 @cindex options, C++
1811 This section describes the command-line options that are only meaningful
1812 for C++ programs; but you can also use most of the GNU compiler options
1813 regardless of what language your program is in.  For example, you
1814 might compile a file @code{firstClass.C} like this:
1815
1816 @smallexample
1817 g++ -g -frepo -O -c firstClass.C
1818 @end smallexample
1819
1820 @noindent
1821 In this example, only @option{-frepo} is an option meant
1822 only for C++ programs; you can use the other options with any
1823 language supported by GCC@.
1824
1825 Here is a list of options that are @emph{only} for compiling C++ programs:
1826
1827 @table @gcctabopt
1828
1829 @item -fabi-version=@var{n}
1830 @opindex fabi-version
1831 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1832 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1833 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1834 the version that conforms most closely to the C++ ABI specification.
1835 Therefore, the ABI obtained using version 0 will change as ABI bugs
1836 are fixed.
1837
1838 The default is version 2.
1839
1840 Version 3 corrects an error in mangling a constant address as a
1841 template argument.
1842
1843 Version 4 implements a standard mangling for vector types.
1844
1845 Version 5 corrects the mangling of attribute const/volatile on
1846 function pointer types, decltype of a plain decl, and use of a
1847 function parameter in the declaration of another parameter.
1848
1849 Version 6 corrects the promotion behavior of C++0x scoped enums.
1850
1851 See also @option{-Wabi}.
1852
1853 @item -fno-access-control
1854 @opindex fno-access-control
1855 Turn off all access checking.  This switch is mainly useful for working
1856 around bugs in the access control code.
1857
1858 @item -fcheck-new
1859 @opindex fcheck-new
1860 Check that the pointer returned by @code{operator new} is non-null
1861 before attempting to modify the storage allocated.  This check is
1862 normally unnecessary because the C++ standard specifies that
1863 @code{operator new} will only return @code{0} if it is declared
1864 @samp{throw()}, in which case the compiler will always check the
1865 return value even without this option.  In all other cases, when
1866 @code{operator new} has a non-empty exception specification, memory
1867 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1868 @samp{new (nothrow)}.
1869
1870 @item -fconserve-space
1871 @opindex fconserve-space
1872 Put uninitialized or runtime-initialized global variables into the
1873 common segment, as C does.  This saves space in the executable at the
1874 cost of not diagnosing duplicate definitions.  If you compile with this
1875 flag and your program mysteriously crashes after @code{main()} has
1876 completed, you may have an object that is being destroyed twice because
1877 two definitions were merged.
1878
1879 This option is no longer useful on most targets, now that support has
1880 been added for putting variables into BSS without making them common.
1881
1882 @item -fconstexpr-depth=@var{n}
1883 @opindex fconstexpr-depth
1884 Set the maximum nested evaluation depth for C++0x constexpr functions
1885 to @var{n}.  A limit is needed to detect endless recursion during
1886 constant expression evaluation.  The minimum specified by the standard
1887 is 512.
1888
1889 @item -fno-deduce-init-list
1890 @opindex fno-deduce-init-list
1891 Disable deduction of a template type parameter as
1892 std::initializer_list from a brace-enclosed initializer list, i.e.
1893
1894 @smallexample
1895 template <class T> auto forward(T t) -> decltype (realfn (t))
1896 @{
1897   return realfn (t);
1898 @}
1899
1900 void f()
1901 @{
1902   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1903 @}
1904 @end smallexample
1905
1906 This option is present because this deduction is an extension to the
1907 current specification in the C++0x working draft, and there was
1908 some concern about potential overload resolution problems.
1909
1910 @item -ffriend-injection
1911 @opindex ffriend-injection
1912 Inject friend functions into the enclosing namespace, so that they are
1913 visible outside the scope of the class in which they are declared.
1914 Friend functions were documented to work this way in the old Annotated
1915 C++ Reference Manual, and versions of G++ before 4.1 always worked
1916 that way.  However, in ISO C++ a friend function which is not declared
1917 in an enclosing scope can only be found using argument dependent
1918 lookup.  This option causes friends to be injected as they were in
1919 earlier releases.
1920
1921 This option is for compatibility, and may be removed in a future
1922 release of G++.
1923
1924 @item -fno-elide-constructors
1925 @opindex fno-elide-constructors
1926 The C++ standard allows an implementation to omit creating a temporary
1927 which is only used to initialize another object of the same type.
1928 Specifying this option disables that optimization, and forces G++ to
1929 call the copy constructor in all cases.
1930
1931 @item -fno-enforce-eh-specs
1932 @opindex fno-enforce-eh-specs
1933 Don't generate code to check for violation of exception specifications
1934 at runtime.  This option violates the C++ standard, but may be useful
1935 for reducing code size in production builds, much like defining
1936 @samp{NDEBUG}.  This does not give user code permission to throw
1937 exceptions in violation of the exception specifications; the compiler
1938 will still optimize based on the specifications, so throwing an
1939 unexpected exception will result in undefined behavior.
1940
1941 @item -ffor-scope
1942 @itemx -fno-for-scope
1943 @opindex ffor-scope
1944 @opindex fno-for-scope
1945 If @option{-ffor-scope} is specified, the scope of variables declared in
1946 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1947 as specified by the C++ standard.
1948 If @option{-fno-for-scope} is specified, the scope of variables declared in
1949 a @i{for-init-statement} extends to the end of the enclosing scope,
1950 as was the case in old versions of G++, and other (traditional)
1951 implementations of C++.
1952
1953 The default if neither flag is given to follow the standard,
1954 but to allow and give a warning for old-style code that would
1955 otherwise be invalid, or have different behavior.
1956
1957 @item -fno-gnu-keywords
1958 @opindex fno-gnu-keywords
1959 Do not recognize @code{typeof} as a keyword, so that code can use this
1960 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1961 @option{-ansi} implies @option{-fno-gnu-keywords}.
1962
1963 @item -fno-implicit-templates
1964 @opindex fno-implicit-templates
1965 Never emit code for non-inline templates which are instantiated
1966 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1967 @xref{Template Instantiation}, for more information.
1968
1969 @item -fno-implicit-inline-templates
1970 @opindex fno-implicit-inline-templates
1971 Don't emit code for implicit instantiations of inline templates, either.
1972 The default is to handle inlines differently so that compiles with and
1973 without optimization will need the same set of explicit instantiations.
1974
1975 @item -fno-implement-inlines
1976 @opindex fno-implement-inlines
1977 To save space, do not emit out-of-line copies of inline functions
1978 controlled by @samp{#pragma implementation}.  This will cause linker
1979 errors if these functions are not inlined everywhere they are called.
1980
1981 @item -fms-extensions
1982 @opindex fms-extensions
1983 Disable pedantic warnings about constructs used in MFC, such as implicit
1984 int and getting a pointer to member function via non-standard syntax.
1985
1986 @item -fno-nonansi-builtins
1987 @opindex fno-nonansi-builtins
1988 Disable built-in declarations of functions that are not mandated by
1989 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1990 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1991
1992 @item -fnothrow-opt
1993 @opindex fnothrow-opt
1994 Treat a @code{throw()} exception specification as though it were a
1995 @code{noexcept} specification to reduce or eliminate the text size
1996 overhead relative to a function with no exception specification.  If
1997 the function has local variables of types with non-trivial
1998 destructors, the exception specification will actually make the
1999 function smaller because the EH cleanups for those variables can be
2000 optimized away.  The semantic effect is that an exception thrown out of
2001 a function with such an exception specification will result in a call
2002 to @code{terminate} rather than @code{unexpected}.
2003
2004 @item -fno-operator-names
2005 @opindex fno-operator-names
2006 Do not treat the operator name keywords @code{and}, @code{bitand},
2007 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2008 synonyms as keywords.
2009
2010 @item -fno-optional-diags
2011 @opindex fno-optional-diags
2012 Disable diagnostics that the standard says a compiler does not need to
2013 issue.  Currently, the only such diagnostic issued by G++ is the one for
2014 a name having multiple meanings within a class.
2015
2016 @item -fpermissive
2017 @opindex fpermissive
2018 Downgrade some diagnostics about nonconformant code from errors to
2019 warnings.  Thus, using @option{-fpermissive} will allow some
2020 nonconforming code to compile.
2021
2022 @item -fno-pretty-templates
2023 @opindex fno-pretty-templates
2024 When an error message refers to a specialization of a function
2025 template, the compiler will normally print the signature of the
2026 template followed by the template arguments and any typedefs or
2027 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2028 rather than @code{void f(int)}) so that it's clear which template is
2029 involved.  When an error message refers to a specialization of a class
2030 template, the compiler will omit any template arguments which match
2031 the default template arguments for that template.  If either of these
2032 behaviors make it harder to understand the error message rather than
2033 easier, using @option{-fno-pretty-templates} will disable them.
2034
2035 @item -frepo
2036 @opindex frepo
2037 Enable automatic template instantiation at link time.  This option also
2038 implies @option{-fno-implicit-templates}.  @xref{Template
2039 Instantiation}, for more information.
2040
2041 @item -fno-rtti
2042 @opindex fno-rtti
2043 Disable generation of information about every class with virtual
2044 functions for use by the C++ runtime type identification features
2045 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2046 of the language, you can save some space by using this flag.  Note that
2047 exception handling uses the same information, but it will generate it as
2048 needed. The @samp{dynamic_cast} operator can still be used for casts that
2049 do not require runtime type information, i.e.@: casts to @code{void *} or to
2050 unambiguous base classes.
2051
2052 @item -fstats
2053 @opindex fstats
2054 Emit statistics about front-end processing at the end of the compilation.
2055 This information is generally only useful to the G++ development team.
2056
2057 @item -fstrict-enums
2058 @opindex fstrict-enums
2059 Allow the compiler to optimize using the assumption that a value of
2060 enumeration type can only be one of the values of the enumeration (as
2061 defined in the C++ standard; basically, a value which can be
2062 represented in the minimum number of bits needed to represent all the
2063 enumerators).  This assumption may not be valid if the program uses a
2064 cast to convert an arbitrary integer value to the enumeration type.
2065
2066 @item -ftemplate-depth=@var{n}
2067 @opindex ftemplate-depth
2068 Set the maximum instantiation depth for template classes to @var{n}.
2069 A limit on the template instantiation depth is needed to detect
2070 endless recursions during template class instantiation.  ANSI/ISO C++
2071 conforming programs must not rely on a maximum depth greater than 17
2072 (changed to 1024 in C++0x).
2073
2074 @item -fno-threadsafe-statics
2075 @opindex fno-threadsafe-statics
2076 Do not emit the extra code to use the routines specified in the C++
2077 ABI for thread-safe initialization of local statics.  You can use this
2078 option to reduce code size slightly in code that doesn't need to be
2079 thread-safe.
2080
2081 @item -fuse-cxa-atexit
2082 @opindex fuse-cxa-atexit
2083 Register destructors for objects with static storage duration with the
2084 @code{__cxa_atexit} function rather than the @code{atexit} function.
2085 This option is required for fully standards-compliant handling of static
2086 destructors, but will only work if your C library supports
2087 @code{__cxa_atexit}.
2088
2089 @item -fno-use-cxa-get-exception-ptr
2090 @opindex fno-use-cxa-get-exception-ptr
2091 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2092 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
2093 if the runtime routine is not available.
2094
2095 @item -fvisibility-inlines-hidden
2096 @opindex fvisibility-inlines-hidden
2097 This switch declares that the user does not attempt to compare
2098 pointers to inline methods where the addresses of the two functions
2099 were taken in different shared objects.
2100
2101 The effect of this is that GCC may, effectively, mark inline methods with
2102 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2103 appear in the export table of a DSO and do not require a PLT indirection
2104 when used within the DSO@.  Enabling this option can have a dramatic effect
2105 on load and link times of a DSO as it massively reduces the size of the
2106 dynamic export table when the library makes heavy use of templates.
2107
2108 The behavior of this switch is not quite the same as marking the
2109 methods as hidden directly, because it does not affect static variables
2110 local to the function or cause the compiler to deduce that
2111 the function is defined in only one shared object.
2112
2113 You may mark a method as having a visibility explicitly to negate the
2114 effect of the switch for that method.  For example, if you do want to
2115 compare pointers to a particular inline method, you might mark it as
2116 having default visibility.  Marking the enclosing class with explicit
2117 visibility will have no effect.
2118
2119 Explicitly instantiated inline methods are unaffected by this option
2120 as their linkage might otherwise cross a shared library boundary.
2121 @xref{Template Instantiation}.
2122
2123 @item -fvisibility-ms-compat
2124 @opindex fvisibility-ms-compat
2125 This flag attempts to use visibility settings to make GCC's C++
2126 linkage model compatible with that of Microsoft Visual Studio.
2127
2128 The flag makes these changes to GCC's linkage model:
2129
2130 @enumerate
2131 @item
2132 It sets the default visibility to @code{hidden}, like
2133 @option{-fvisibility=hidden}.
2134
2135 @item
2136 Types, but not their members, are not hidden by default.
2137
2138 @item
2139 The One Definition Rule is relaxed for types without explicit
2140 visibility specifications which are defined in more than one different
2141 shared object: those declarations are permitted if they would have
2142 been permitted when this option was not used.
2143 @end enumerate
2144
2145 In new code it is better to use @option{-fvisibility=hidden} and
2146 export those classes which are intended to be externally visible.
2147 Unfortunately it is possible for code to rely, perhaps accidentally,
2148 on the Visual Studio behavior.
2149
2150 Among the consequences of these changes are that static data members
2151 of the same type with the same name but defined in different shared
2152 objects will be different, so changing one will not change the other;
2153 and that pointers to function members defined in different shared
2154 objects may not compare equal.  When this flag is given, it is a
2155 violation of the ODR to define types with the same name differently.
2156
2157 @item -fno-weak
2158 @opindex fno-weak
2159 Do not use weak symbol support, even if it is provided by the linker.
2160 By default, G++ will use weak symbols if they are available.  This
2161 option exists only for testing, and should not be used by end-users;
2162 it will result in inferior code and has no benefits.  This option may
2163 be removed in a future release of G++.
2164
2165 @item -nostdinc++
2166 @opindex nostdinc++
2167 Do not search for header files in the standard directories specific to
2168 C++, but do still search the other standard directories.  (This option
2169 is used when building the C++ library.)
2170 @end table
2171
2172 In addition, these optimization, warning, and code generation options
2173 have meanings only for C++ programs:
2174
2175 @table @gcctabopt
2176 @item -fno-default-inline
2177 @opindex fno-default-inline
2178 Do not assume @samp{inline} for functions defined inside a class scope.
2179 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2180 functions will have linkage like inline functions; they just won't be
2181 inlined by default.
2182
2183 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2184 @opindex Wabi
2185 @opindex Wno-abi
2186 Warn when G++ generates code that is probably not compatible with the
2187 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2188 all such cases, there are probably some cases that are not warned about,
2189 even though G++ is generating incompatible code.  There may also be
2190 cases where warnings are emitted even though the code that is generated
2191 will be compatible.
2192
2193 You should rewrite your code to avoid these warnings if you are
2194 concerned about the fact that code generated by G++ may not be binary
2195 compatible with code generated by other compilers.
2196
2197 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2198
2199 @itemize @bullet
2200
2201 @item
2202 A template with a non-type template parameter of reference type is
2203 mangled incorrectly:
2204 @smallexample
2205 extern int N;
2206 template <int &> struct S @{@};
2207 void n (S<N>) @{2@}
2208 @end smallexample
2209
2210 This is fixed in @option{-fabi-version=3}.
2211
2212 @item
2213 SIMD vector types declared using @code{__attribute ((vector_size))} are
2214 mangled in a non-standard way that does not allow for overloading of
2215 functions taking vectors of different sizes.
2216
2217 The mangling is changed in @option{-fabi-version=4}.
2218 @end itemize
2219
2220 The known incompatibilities in @option{-fabi-version=1} include:
2221
2222 @itemize @bullet
2223
2224 @item
2225 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2226 pack data into the same byte as a base class.  For example:
2227
2228 @smallexample
2229 struct A @{ virtual void f(); int f1 : 1; @};
2230 struct B : public A @{ int f2 : 1; @};
2231 @end smallexample
2232
2233 @noindent
2234 In this case, G++ will place @code{B::f2} into the same byte
2235 as@code{A::f1}; other compilers will not.  You can avoid this problem
2236 by explicitly padding @code{A} so that its size is a multiple of the
2237 byte size on your platform; that will cause G++ and other compilers to
2238 layout @code{B} identically.
2239
2240 @item
2241 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2242 tail padding when laying out virtual bases.  For example:
2243
2244 @smallexample
2245 struct A @{ virtual void f(); char c1; @};
2246 struct B @{ B(); char c2; @};
2247 struct C : public A, public virtual B @{@};
2248 @end smallexample
2249
2250 @noindent
2251 In this case, G++ will not place @code{B} into the tail-padding for
2252 @code{A}; other compilers will.  You can avoid this problem by
2253 explicitly padding @code{A} so that its size is a multiple of its
2254 alignment (ignoring virtual base classes); that will cause G++ and other
2255 compilers to layout @code{C} identically.
2256
2257 @item
2258 Incorrect handling of bit-fields with declared widths greater than that
2259 of their underlying types, when the bit-fields appear in a union.  For
2260 example:
2261
2262 @smallexample
2263 union U @{ int i : 4096; @};
2264 @end smallexample
2265
2266 @noindent
2267 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2268 union too small by the number of bits in an @code{int}.
2269
2270 @item
2271 Empty classes can be placed at incorrect offsets.  For example:
2272
2273 @smallexample
2274 struct A @{@};
2275
2276 struct B @{
2277   A a;
2278   virtual void f ();
2279 @};
2280
2281 struct C : public B, public A @{@};
2282 @end smallexample
2283
2284 @noindent
2285 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2286 it should be placed at offset zero.  G++ mistakenly believes that the
2287 @code{A} data member of @code{B} is already at offset zero.
2288
2289 @item
2290 Names of template functions whose types involve @code{typename} or
2291 template template parameters can be mangled incorrectly.
2292
2293 @smallexample
2294 template <typename Q>
2295 void f(typename Q::X) @{@}
2296
2297 template <template <typename> class Q>
2298 void f(typename Q<int>::X) @{@}
2299 @end smallexample
2300
2301 @noindent
2302 Instantiations of these templates may be mangled incorrectly.
2303
2304 @end itemize
2305
2306 It also warns psABI related changes.  The known psABI changes at this
2307 point include:
2308
2309 @itemize @bullet
2310
2311 @item
2312 For SYSV/x86-64, when passing union with long double, it is changed to
2313 pass in memory as specified in psABI.  For example:
2314
2315 @smallexample
2316 union U @{
2317   long double ld;
2318   int i;
2319 @};
2320 @end smallexample
2321
2322 @noindent
2323 @code{union U} will always be passed in memory.
2324
2325 @end itemize
2326
2327 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2328 @opindex Wctor-dtor-privacy
2329 @opindex Wno-ctor-dtor-privacy
2330 Warn when a class seems unusable because all the constructors or
2331 destructors in that class are private, and it has neither friends nor
2332 public static member functions.
2333
2334 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2335 @opindex Wnoexcept
2336 @opindex Wno-noexcept
2337 Warn when a noexcept-expression evaluates to false because of a call
2338 to a function that does not have a non-throwing exception
2339 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2340 the compiler to never throw an exception.
2341
2342 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2343 @opindex Wnon-virtual-dtor
2344 @opindex Wno-non-virtual-dtor
2345 Warn when a class has virtual functions and accessible non-virtual
2346 destructor, in which case it would be possible but unsafe to delete
2347 an instance of a derived class through a pointer to the base class.
2348 This warning is also enabled if -Weffc++ is specified.
2349
2350 @item -Wreorder @r{(C++ and Objective-C++ only)}
2351 @opindex Wreorder
2352 @opindex Wno-reorder
2353 @cindex reordering, warning
2354 @cindex warning for reordering of member initializers
2355 Warn when the order of member initializers given in the code does not
2356 match the order in which they must be executed.  For instance:
2357
2358 @smallexample
2359 struct A @{
2360   int i;
2361   int j;
2362   A(): j (0), i (1) @{ @}
2363 @};
2364 @end smallexample
2365
2366 The compiler will rearrange the member initializers for @samp{i}
2367 and @samp{j} to match the declaration order of the members, emitting
2368 a warning to that effect.  This warning is enabled by @option{-Wall}.
2369 @end table
2370
2371 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2372
2373 @table @gcctabopt
2374 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2375 @opindex Weffc++
2376 @opindex Wno-effc++
2377 Warn about violations of the following style guidelines from Scott Meyers'
2378 @cite{Effective C++} book:
2379
2380 @itemize @bullet
2381 @item
2382 Item 11:  Define a copy constructor and an assignment operator for classes
2383 with dynamically allocated memory.
2384
2385 @item
2386 Item 12:  Prefer initialization to assignment in constructors.
2387
2388 @item
2389 Item 14:  Make destructors virtual in base classes.
2390
2391 @item
2392 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2393
2394 @item
2395 Item 23:  Don't try to return a reference when you must return an object.
2396
2397 @end itemize
2398
2399 Also warn about violations of the following style guidelines from
2400 Scott Meyers' @cite{More Effective C++} book:
2401
2402 @itemize @bullet
2403 @item
2404 Item 6:  Distinguish between prefix and postfix forms of increment and
2405 decrement operators.
2406
2407 @item
2408 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2409
2410 @end itemize
2411
2412 When selecting this option, be aware that the standard library
2413 headers do not obey all of these guidelines; use @samp{grep -v}
2414 to filter out those warnings.
2415
2416 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2417 @opindex Wstrict-null-sentinel
2418 @opindex Wno-strict-null-sentinel
2419 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2420 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2421 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2422 it is guaranteed to be of the same size as a pointer.  But this use is
2423 not portable across different compilers.
2424
2425 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2426 @opindex Wno-non-template-friend
2427 @opindex Wnon-template-friend
2428 Disable warnings when non-templatized friend functions are declared
2429 within a template.  Since the advent of explicit template specification
2430 support in G++, if the name of the friend is an unqualified-id (i.e.,
2431 @samp{friend foo(int)}), the C++ language specification demands that the
2432 friend declare or define an ordinary, nontemplate function.  (Section
2433 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2434 could be interpreted as a particular specialization of a templatized
2435 function.  Because this non-conforming behavior is no longer the default
2436 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2437 check existing code for potential trouble spots and is on by default.
2438 This new compiler behavior can be turned off with
2439 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2440 but disables the helpful warning.
2441
2442 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2443 @opindex Wold-style-cast
2444 @opindex Wno-old-style-cast
2445 Warn if an old-style (C-style) cast to a non-void type is used within
2446 a C++ program.  The new-style casts (@samp{dynamic_cast},
2447 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2448 less vulnerable to unintended effects and much easier to search for.
2449
2450 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2451 @opindex Woverloaded-virtual
2452 @opindex Wno-overloaded-virtual
2453 @cindex overloaded virtual function, warning
2454 @cindex warning for overloaded virtual function
2455 Warn when a function declaration hides virtual functions from a
2456 base class.  For example, in:
2457
2458 @smallexample
2459 struct A @{
2460   virtual void f();
2461 @};
2462
2463 struct B: public A @{
2464   void f(int);
2465 @};
2466 @end smallexample
2467
2468 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2469 like:
2470
2471 @smallexample
2472 B* b;
2473 b->f();
2474 @end smallexample
2475
2476 will fail to compile.
2477
2478 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2479 @opindex Wno-pmf-conversions
2480 @opindex Wpmf-conversions
2481 Disable the diagnostic for converting a bound pointer to member function
2482 to a plain pointer.
2483
2484 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2485 @opindex Wsign-promo
2486 @opindex Wno-sign-promo
2487 Warn when overload resolution chooses a promotion from unsigned or
2488 enumerated type to a signed type, over a conversion to an unsigned type of
2489 the same size.  Previous versions of G++ would try to preserve
2490 unsignedness, but the standard mandates the current behavior.
2491
2492 @smallexample
2493 struct A @{
2494   operator int ();
2495   A& operator = (int);
2496 @};
2497
2498 main ()
2499 @{
2500   A a,b;
2501   a = b;
2502 @}
2503 @end smallexample
2504
2505 In this example, G++ will synthesize a default @samp{A& operator =
2506 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2507 @end table
2508
2509 @node Objective-C and Objective-C++ Dialect Options
2510 @section Options Controlling Objective-C and Objective-C++ Dialects
2511
2512 @cindex compiler options, Objective-C and Objective-C++
2513 @cindex Objective-C and Objective-C++ options, command line
2514 @cindex options, Objective-C and Objective-C++
2515 (NOTE: This manual does not describe the Objective-C and Objective-C++
2516 languages themselves.  @xref{Standards,,Language Standards
2517 Supported by GCC}, for references.)
2518
2519 This section describes the command-line options that are only meaningful
2520 for Objective-C and Objective-C++ programs, but you can also use most of
2521 the language-independent GNU compiler options.
2522 For example, you might compile a file @code{some_class.m} like this:
2523
2524 @smallexample
2525 gcc -g -fgnu-runtime -O -c some_class.m
2526 @end smallexample
2527
2528 @noindent
2529 In this example, @option{-fgnu-runtime} is an option meant only for
2530 Objective-C and Objective-C++ programs; you can use the other options with
2531 any language supported by GCC@.
2532
2533 Note that since Objective-C is an extension of the C language, Objective-C
2534 compilations may also use options specific to the C front-end (e.g.,
2535 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2536 C++-specific options (e.g., @option{-Wabi}).
2537
2538 Here is a list of options that are @emph{only} for compiling Objective-C
2539 and Objective-C++ programs:
2540
2541 @table @gcctabopt
2542 @item -fconstant-string-class=@var{class-name}
2543 @opindex fconstant-string-class
2544 Use @var{class-name} as the name of the class to instantiate for each
2545 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2546 class name is @code{NXConstantString} if the GNU runtime is being used, and
2547 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2548 @option{-fconstant-cfstrings} option, if also present, will override the
2549 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2550 to be laid out as constant CoreFoundation strings.
2551
2552 @item -fgnu-runtime
2553 @opindex fgnu-runtime
2554 Generate object code compatible with the standard GNU Objective-C
2555 runtime.  This is the default for most types of systems.
2556
2557 @item -fnext-runtime
2558 @opindex fnext-runtime
2559 Generate output compatible with the NeXT runtime.  This is the default
2560 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2561 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2562 used.
2563
2564 @item -fno-nil-receivers
2565 @opindex fno-nil-receivers
2566 Assume that all Objective-C message dispatches (@code{[receiver
2567 message:arg]}) in this translation unit ensure that the receiver is
2568 not @code{nil}.  This allows for more efficient entry points in the
2569 runtime to be used.  This option is only available in conjunction with
2570 the NeXT runtime and ABI version 0 or 1.
2571
2572 @item -fobjc-abi-version=@var{n}
2573 @opindex fobjc-abi-version
2574 Use version @var{n} of the Objective-C ABI for the selected runtime.
2575 This option is currently supported only for the NeXT runtime.  In that
2576 case, Version 0 is the traditional (32-bit) ABI without support for
2577 properties and other Objective-C 2.0 additions.  Version 1 is the
2578 traditional (32-bit) ABI with support for properties and other
2579 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2580 nothing is specified, the default is Version 0 on 32-bit target
2581 machines, and Version 2 on 64-bit target machines.
2582
2583 @item -fobjc-call-cxx-cdtors
2584 @opindex fobjc-call-cxx-cdtors
2585 For each Objective-C class, check if any of its instance variables is a
2586 C++ object with a non-trivial default constructor.  If so, synthesize a
2587 special @code{- (id) .cxx_construct} instance method that will run
2588 non-trivial default constructors on any such instance variables, in order,
2589 and then return @code{self}.  Similarly, check if any instance variable
2590 is a C++ object with a non-trivial destructor, and if so, synthesize a
2591 special @code{- (void) .cxx_destruct} method that will run
2592 all such default destructors, in reverse order.
2593
2594 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2595 methods thusly generated will only operate on instance variables
2596 declared in the current Objective-C class, and not those inherited
2597 from superclasses.  It is the responsibility of the Objective-C
2598 runtime to invoke all such methods in an object's inheritance
2599 hierarchy.  The @code{- (id) .cxx_construct} methods will be invoked
2600 by the runtime immediately after a new object instance is allocated;
2601 the @code{- (void) .cxx_destruct} methods will be invoked immediately
2602 before the runtime deallocates an object instance.
2603
2604 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2605 support for invoking the @code{- (id) .cxx_construct} and
2606 @code{- (void) .cxx_destruct} methods.
2607
2608 @item -fobjc-direct-dispatch
2609 @opindex fobjc-direct-dispatch
2610 Allow fast jumps to the message dispatcher.  On Darwin this is
2611 accomplished via the comm page.
2612
2613 @item -fobjc-exceptions
2614 @opindex fobjc-exceptions
2615 Enable syntactic support for structured exception handling in
2616 Objective-C, similar to what is offered by C++ and Java.  This option
2617 is required to use the Objective-C keywords @code{@@try},
2618 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2619 @code{@@synchronized}.  This option is available with both the GNU
2620 runtime and the NeXT runtime (but not available in conjunction with
2621 the NeXT runtime on Mac OS X 10.2 and earlier).
2622
2623 @item -fobjc-gc
2624 @opindex fobjc-gc
2625 Enable garbage collection (GC) in Objective-C and Objective-C++
2626 programs.  This option is only available with the NeXT runtime; the
2627 GNU runtime has a different garbage collection implementation that
2628 does not require special compiler flags.
2629
2630 @item -fobjc-nilcheck
2631 @opindex fobjc-nilcheck
2632 For the NeXT runtime with version 2 of the ABI, check for a nil
2633 receiver in method invocations before doing the actual method call.
2634 This is the default and can be disabled using
2635 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2636 checked for nil in this way no matter what this flag is set to.
2637 Currently this flag does nothing when the GNU runtime, or an older
2638 version of the NeXT runtime ABI, is used.
2639
2640 @item -fobjc-std=objc1
2641 @opindex fobjc-std
2642 Conform to the language syntax of Objective-C 1.0, the language
2643 recognized by GCC 4.0.  This only affects the Objective-C additions to
2644 the C/C++ language; it does not affect conformance to C/C++ standards,
2645 which is controlled by the separate C/C++ dialect option flags.  When
2646 this option is used with the Objective-C or Objective-C++ compiler,
2647 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2648 This is useful if you need to make sure that your Objective-C code can
2649 be compiled with older versions of GCC.
2650
2651 @item -freplace-objc-classes
2652 @opindex freplace-objc-classes
2653 Emit a special marker instructing @command{ld(1)} not to statically link in
2654 the resulting object file, and allow @command{dyld(1)} to load it in at
2655 run time instead.  This is used in conjunction with the Fix-and-Continue
2656 debugging mode, where the object file in question may be recompiled and
2657 dynamically reloaded in the course of program execution, without the need
2658 to restart the program itself.  Currently, Fix-and-Continue functionality
2659 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2660 and later.
2661
2662 @item -fzero-link
2663 @opindex fzero-link
2664 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2665 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2666 compile time) with static class references that get initialized at load time,
2667 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2668 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2669 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2670 for individual class implementations to be modified during program execution.
2671 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2672 regardless of command line options.
2673
2674 @item -gen-decls
2675 @opindex gen-decls
2676 Dump interface declarations for all classes seen in the source file to a
2677 file named @file{@var{sourcename}.decl}.
2678
2679 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2680 @opindex Wassign-intercept
2681 @opindex Wno-assign-intercept
2682 Warn whenever an Objective-C assignment is being intercepted by the
2683 garbage collector.
2684
2685 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2686 @opindex Wno-protocol
2687 @opindex Wprotocol
2688 If a class is declared to implement a protocol, a warning is issued for
2689 every method in the protocol that is not implemented by the class.  The
2690 default behavior is to issue a warning for every method not explicitly
2691 implemented in the class, even if a method implementation is inherited
2692 from the superclass.  If you use the @option{-Wno-protocol} option, then
2693 methods inherited from the superclass are considered to be implemented,
2694 and no warning is issued for them.
2695
2696 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2697 @opindex Wselector
2698 @opindex Wno-selector
2699 Warn if multiple methods of different types for the same selector are
2700 found during compilation.  The check is performed on the list of methods
2701 in the final stage of compilation.  Additionally, a check is performed
2702 for each selector appearing in a @code{@@selector(@dots{})}
2703 expression, and a corresponding method for that selector has been found
2704 during compilation.  Because these checks scan the method table only at
2705 the end of compilation, these warnings are not produced if the final
2706 stage of compilation is not reached, for example because an error is
2707 found during compilation, or because the @option{-fsyntax-only} option is
2708 being used.
2709
2710 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2711 @opindex Wstrict-selector-match
2712 @opindex Wno-strict-selector-match
2713 Warn if multiple methods with differing argument and/or return types are
2714 found for a given selector when attempting to send a message using this
2715 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2716 is off (which is the default behavior), the compiler will omit such warnings
2717 if any differences found are confined to types which share the same size
2718 and alignment.
2719
2720 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2721 @opindex Wundeclared-selector
2722 @opindex Wno-undeclared-selector
2723 Warn if a @code{@@selector(@dots{})} expression referring to an
2724 undeclared selector is found.  A selector is considered undeclared if no
2725 method with that name has been declared before the
2726 @code{@@selector(@dots{})} expression, either explicitly in an
2727 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2728 an @code{@@implementation} section.  This option always performs its
2729 checks as soon as a @code{@@selector(@dots{})} expression is found,
2730 while @option{-Wselector} only performs its checks in the final stage of
2731 compilation.  This also enforces the coding style convention
2732 that methods and selectors must be declared before being used.
2733
2734 @item -print-objc-runtime-info
2735 @opindex print-objc-runtime-info
2736 Generate C header describing the largest structure that is passed by
2737 value, if any.
2738
2739 @end table
2740
2741 @node Language Independent Options
2742 @section Options to Control Diagnostic Messages Formatting
2743 @cindex options to control diagnostics formatting
2744 @cindex diagnostic messages
2745 @cindex message formatting
2746
2747 Traditionally, diagnostic messages have been formatted irrespective of
2748 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2749 below can be used to control the diagnostic messages formatting
2750 algorithm, e.g.@: how many characters per line, how often source location
2751 information should be reported.  Right now, only the C++ front end can
2752 honor these options.  However it is expected, in the near future, that
2753 the remaining front ends would be able to digest them correctly.
2754
2755 @table @gcctabopt
2756 @item -fmessage-length=@var{n}
2757 @opindex fmessage-length
2758 Try to format error messages so that they fit on lines of about @var{n}
2759 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2760 the front ends supported by GCC@.  If @var{n} is zero, then no
2761 line-wrapping will be done; each error message will appear on a single
2762 line.
2763
2764 @opindex fdiagnostics-show-location
2765 @item -fdiagnostics-show-location=once
2766 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2767 reporter to emit @emph{once} source location information; that is, in
2768 case the message is too long to fit on a single physical line and has to
2769 be wrapped, the source location won't be emitted (as prefix) again,
2770 over and over, in subsequent continuation lines.  This is the default
2771 behavior.
2772
2773 @item -fdiagnostics-show-location=every-line
2774 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2775 messages reporter to emit the same source location information (as
2776 prefix) for physical lines that result from the process of breaking
2777 a message which is too long to fit on a single line.
2778
2779 @item -fno-diagnostics-show-option
2780 @opindex fno-diagnostics-show-option
2781 @opindex fdiagnostics-show-option
2782 By default, each diagnostic emitted includes text which indicates the
2783 command line option that directly controls the diagnostic (if such an
2784 option is known to the diagnostic machinery).  Specifying the
2785 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2786
2787 @item -Wcoverage-mismatch
2788 @opindex Wcoverage-mismatch
2789 Warn if feedback profiles do not match when using the
2790 @option{-fprofile-use} option.
2791 If a source file was changed between @option{-fprofile-gen} and
2792 @option{-fprofile-use}, the files with the profile feedback can fail
2793 to match the source file and GCC can not use the profile feedback
2794 information.  By default, this warning is enabled and is treated as an
2795 error.  @option{-Wno-coverage-mismatch} can be used to disable the
2796 warning or @option{-Wno-error=coverage-mismatch} can be used to
2797 disable the error.  Disable the error for this warning can result in
2798 poorly optimized code, so disabling the error is useful only in the
2799 case of very minor changes such as bug fixes to an existing code-base.
2800 Completely disabling the warning is not recommended.
2801
2802 @end table
2803
2804 @node Warning Options
2805 @section Options to Request or Suppress Warnings
2806 @cindex options to control warnings
2807 @cindex warning messages
2808 @cindex messages, warning
2809 @cindex suppressing warnings
2810
2811 Warnings are diagnostic messages that report constructions which
2812 are not inherently erroneous but which are risky or suggest there
2813 may have been an error.
2814
2815 The following language-independent options do not enable specific
2816 warnings but control the kinds of diagnostics produced by GCC.
2817
2818 @table @gcctabopt
2819 @cindex syntax checking
2820 @item -fsyntax-only
2821 @opindex fsyntax-only
2822 Check the code for syntax errors, but don't do anything beyond that.
2823
2824 @item -fmax-errors=@var{n}
2825 @opindex fmax-errors
2826 Limits the maximum number of error messages to @var{n}, at which point
2827 GCC bails out rather than attempting to continue processing the source
2828 code.  If @var{n} is 0 (the default), there is no limit on the number
2829 of error messages produced.  If @option{-Wfatal-errors} is also
2830 specified, then @option{-Wfatal-errors} takes precedence over this
2831 option.
2832
2833 @item -w
2834 @opindex w
2835 Inhibit all warning messages.
2836
2837 @item -Werror
2838 @opindex Werror
2839 @opindex Wno-error
2840 Make all warnings into errors.
2841
2842 @item -Werror=
2843 @opindex Werror=
2844 @opindex Wno-error=
2845 Make the specified warning into an error.  The specifier for a warning
2846 is appended, for example @option{-Werror=switch} turns the warnings
2847 controlled by @option{-Wswitch} into errors.  This switch takes a
2848 negative form, to be used to negate @option{-Werror} for specific
2849 warnings, for example @option{-Wno-error=switch} makes
2850 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2851 is in effect.
2852
2853 The warning message for each controllable warning includes the
2854 option which controls the warning.  That option can then be used with
2855 @option{-Werror=} and @option{-Wno-error=} as described above.
2856 (Printing of the option in the warning message can be disabled using the
2857 @option{-fno-diagnostics-show-option} flag.)
2858
2859 Note that specifying @option{-Werror=}@var{foo} automatically implies
2860 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2861 imply anything.
2862
2863 @item -Wfatal-errors
2864 @opindex Wfatal-errors
2865 @opindex Wno-fatal-errors
2866 This option causes the compiler to abort compilation on the first error
2867 occurred rather than trying to keep going and printing further error
2868 messages.
2869
2870 @end table
2871
2872 You can request many specific warnings with options beginning
2873 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2874 implicit declarations.  Each of these specific warning options also
2875 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2876 example, @option{-Wno-implicit}.  This manual lists only one of the
2877 two forms, whichever is not the default.  For further,
2878 language-specific options also refer to @ref{C++ Dialect Options} and
2879 @ref{Objective-C and Objective-C++ Dialect Options}.
2880
2881 When an unrecognized warning option is requested (e.g.,
2882 @option{-Wunknown-warning}), GCC will emit a diagnostic stating
2883 that the option is not recognized.  However, if the @option{-Wno-} form
2884 is used, the behavior is slightly different: No diagnostic will be
2885 produced for @option{-Wno-unknown-warning} unless other diagnostics
2886 are being produced.  This allows the use of new @option{-Wno-} options
2887 with old compilers, but if something goes wrong, the compiler will
2888 warn that an unrecognized option was used.
2889
2890 @table @gcctabopt
2891 @item -pedantic
2892 @opindex pedantic
2893 Issue all the warnings demanded by strict ISO C and ISO C++;
2894 reject all programs that use forbidden extensions, and some other
2895 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2896 version of the ISO C standard specified by any @option{-std} option used.
2897
2898 Valid ISO C and ISO C++ programs should compile properly with or without
2899 this option (though a rare few will require @option{-ansi} or a
2900 @option{-std} option specifying the required version of ISO C)@.  However,
2901 without this option, certain GNU extensions and traditional C and C++
2902 features are supported as well.  With this option, they are rejected.
2903
2904 @option{-pedantic} does not cause warning messages for use of the
2905 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2906 warnings are also disabled in the expression that follows
2907 @code{__extension__}.  However, only system header files should use
2908 these escape routes; application programs should avoid them.
2909 @xref{Alternate Keywords}.
2910
2911 Some users try to use @option{-pedantic} to check programs for strict ISO
2912 C conformance.  They soon find that it does not do quite what they want:
2913 it finds some non-ISO practices, but not all---only those for which
2914 ISO C @emph{requires} a diagnostic, and some others for which
2915 diagnostics have been added.
2916
2917 A feature to report any failure to conform to ISO C might be useful in
2918 some instances, but would require considerable additional work and would
2919 be quite different from @option{-pedantic}.  We don't have plans to
2920 support such a feature in the near future.
2921
2922 Where the standard specified with @option{-std} represents a GNU
2923 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
2924 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2925 extended dialect is based.  Warnings from @option{-pedantic} are given
2926 where they are required by the base standard.  (It would not make sense
2927 for such warnings to be given only for features not in the specified GNU
2928 C dialect, since by definition the GNU dialects of C include all
2929 features the compiler supports with the given option, and there would be
2930 nothing to warn about.)
2931
2932 @item -pedantic-errors
2933 @opindex pedantic-errors
2934 Like @option{-pedantic}, except that errors are produced rather than
2935 warnings.
2936
2937 @item -Wall
2938 @opindex Wall
2939 @opindex Wno-all
2940 This enables all the warnings about constructions that some users
2941 consider questionable, and that are easy to avoid (or modify to
2942 prevent the warning), even in conjunction with macros.  This also
2943 enables some language-specific warnings described in @ref{C++ Dialect
2944 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2945
2946 @option{-Wall} turns on the following warning flags:
2947
2948 @gccoptlist{-Waddress   @gol
2949 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2950 -Wc++0x-compat  @gol
2951 -Wchar-subscripts  @gol
2952 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2953 -Wimplicit-int @r{(C and Objective-C only)} @gol
2954 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
2955 -Wcomment  @gol
2956 -Wformat   @gol
2957 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2958 -Wmaybe-uninitialized @gol
2959 -Wmissing-braces  @gol
2960 -Wnonnull  @gol
2961 -Wparentheses  @gol
2962 -Wpointer-sign  @gol
2963 -Wreorder   @gol
2964 -Wreturn-type  @gol
2965 -Wsequence-point  @gol
2966 -Wsign-compare @r{(only in C++)}  @gol
2967 -Wstrict-aliasing  @gol
2968 -Wstrict-overflow=1  @gol
2969 -Wswitch  @gol
2970 -Wtrigraphs  @gol
2971 -Wuninitialized  @gol
2972 -Wunknown-pragmas  @gol
2973 -Wunused-function  @gol
2974 -Wunused-label     @gol
2975 -Wunused-value     @gol
2976 -Wunused-variable  @gol
2977 -Wvolatile-register-var @gol
2978 }
2979
2980 Note that some warning flags are not implied by @option{-Wall}.  Some of
2981 them warn about constructions that users generally do not consider
2982 questionable, but which occasionally you might wish to check for;
2983 others warn about constructions that are necessary or hard to avoid in
2984 some cases, and there is no simple way to modify the code to suppress
2985 the warning. Some of them are enabled by @option{-Wextra} but many of
2986 them must be enabled individually.
2987
2988 @item -Wextra
2989 @opindex W
2990 @opindex Wextra
2991 @opindex Wno-extra
2992 This enables some extra warning flags that are not enabled by
2993 @option{-Wall}. (This option used to be called @option{-W}.  The older
2994 name is still supported, but the newer name is more descriptive.)
2995
2996 @gccoptlist{-Wclobbered  @gol
2997 -Wempty-body  @gol
2998 -Wignored-qualifiers @gol
2999 -Wmissing-field-initializers  @gol
3000 -Wmissing-parameter-type @r{(C only)}  @gol
3001 -Wold-style-declaration @r{(C only)}  @gol
3002 -Woverride-init  @gol
3003 -Wsign-compare  @gol
3004 -Wtype-limits  @gol
3005 -Wuninitialized  @gol
3006 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3007 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3008 }
3009
3010 The option @option{-Wextra} also prints warning messages for the
3011 following cases:
3012
3013 @itemize @bullet
3014
3015 @item
3016 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3017 @samp{>}, or @samp{>=}.
3018
3019 @item
3020 (C++ only) An enumerator and a non-enumerator both appear in a
3021 conditional expression.
3022
3023 @item
3024 (C++ only) Ambiguous virtual bases.
3025
3026 @item
3027 (C++ only) Subscripting an array which has been declared @samp{register}.
3028
3029 @item
3030 (C++ only) Taking the address of a variable which has been declared
3031 @samp{register}.
3032
3033 @item
3034 (C++ only) A base class is not initialized in a derived class' copy
3035 constructor.
3036
3037 @end itemize
3038
3039 @item -Wchar-subscripts
3040 @opindex Wchar-subscripts
3041 @opindex Wno-char-subscripts
3042 Warn if an array subscript has type @code{char}.  This is a common cause
3043 of error, as programmers often forget that this type is signed on some
3044 machines.
3045 This warning is enabled by @option{-Wall}.
3046
3047 @item -Wcomment
3048 @opindex Wcomment
3049 @opindex Wno-comment
3050 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3051 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3052 This warning is enabled by @option{-Wall}.
3053
3054 @item -Wno-cpp
3055 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3056
3057 Suppress warning messages emitted by @code{#warning} directives.
3058
3059 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3060 @opindex Wdouble-promotion
3061 @opindex Wno-double-promotion
3062 Give a warning when a value of type @code{float} is implicitly
3063 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3064 floating-point unit implement @code{float} in hardware, but emulate
3065 @code{double} in software.  On such a machine, doing computations
3066 using @code{double} values is much more expensive because of the
3067 overhead required for software emulation.
3068
3069 It is easy to accidentally do computations with @code{double} because
3070 floating-point literals are implicitly of type @code{double}.  For
3071 example, in:
3072 @smallexample
3073 @group
3074 float area(float radius)
3075 @{
3076    return 3.14159 * radius * radius;
3077 @}
3078 @end group
3079 @end smallexample
3080 the compiler will perform the entire computation with @code{double}
3081 because the floating-point literal is a @code{double}.
3082
3083 @item -Wformat
3084 @opindex Wformat
3085 @opindex Wno-format
3086 @opindex ffreestanding
3087 @opindex fno-builtin
3088 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3089 the arguments supplied have types appropriate to the format string
3090 specified, and that the conversions specified in the format string make
3091 sense.  This includes standard functions, and others specified by format
3092 attributes (@pxref{Function Attributes}), in the @code{printf},
3093 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3094 not in the C standard) families (or other target-specific families).
3095 Which functions are checked without format attributes having been
3096 specified depends on the standard version selected, and such checks of
3097 functions without the attribute specified are disabled by
3098 @option{-ffreestanding} or @option{-fno-builtin}.
3099
3100 The formats are checked against the format features supported by GNU
3101 libc version 2.2.  These include all ISO C90 and C99 features, as well
3102 as features from the Single Unix Specification and some BSD and GNU
3103 extensions.  Other library implementations may not support all these
3104 features; GCC does not support warning about features that go beyond a
3105 particular library's limitations.  However, if @option{-pedantic} is used
3106 with @option{-Wformat}, warnings will be given about format features not
3107 in the selected standard version (but not for @code{strfmon} formats,
3108 since those are not in any version of the C standard).  @xref{C Dialect
3109 Options,,Options Controlling C Dialect}.
3110
3111 Since @option{-Wformat} also checks for null format arguments for
3112 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3113
3114 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3115 aspects of format checking, the options @option{-Wformat-y2k},
3116 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3117 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3118 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3119
3120 @item -Wformat-y2k
3121 @opindex Wformat-y2k
3122 @opindex Wno-format-y2k
3123 If @option{-Wformat} is specified, also warn about @code{strftime}
3124 formats which may yield only a two-digit year.
3125
3126 @item -Wno-format-contains-nul
3127 @opindex Wno-format-contains-nul
3128 @opindex Wformat-contains-nul
3129 If @option{-Wformat} is specified, do not warn about format strings that
3130 contain NUL bytes.
3131
3132 @item -Wno-format-extra-args
3133 @opindex Wno-format-extra-args
3134 @opindex Wformat-extra-args
3135 If @option{-Wformat} is specified, do not warn about excess arguments to a
3136 @code{printf} or @code{scanf} format function.  The C standard specifies
3137 that such arguments are ignored.
3138
3139 Where the unused arguments lie between used arguments that are
3140 specified with @samp{$} operand number specifications, normally
3141 warnings are still given, since the implementation could not know what
3142 type to pass to @code{va_arg} to skip the unused arguments.  However,
3143 in the case of @code{scanf} formats, this option will suppress the
3144 warning if the unused arguments are all pointers, since the Single
3145 Unix Specification says that such unused arguments are allowed.
3146
3147 @item -Wno-format-zero-length @r{(C and Objective-C only)}
3148 @opindex Wno-format-zero-length
3149 @opindex Wformat-zero-length
3150 If @option{-Wformat} is specified, do not warn about zero-length formats.
3151 The C standard specifies that zero-length formats are allowed.
3152
3153 @item -Wformat-nonliteral
3154 @opindex Wformat-nonliteral
3155 @opindex Wno-format-nonliteral
3156 If @option{-Wformat} is specified, also warn if the format string is not a
3157 string literal and so cannot be checked, unless the format function
3158 takes its format arguments as a @code{va_list}.
3159
3160 @item -Wformat-security
3161 @opindex Wformat-security
3162 @opindex Wno-format-security
3163 If @option{-Wformat} is specified, also warn about uses of format
3164 functions that represent possible security problems.  At present, this
3165 warns about calls to @code{printf} and @code{scanf} functions where the
3166 format string is not a string literal and there are no format arguments,
3167 as in @code{printf (foo);}.  This may be a security hole if the format
3168 string came from untrusted input and contains @samp{%n}.  (This is
3169 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3170 in future warnings may be added to @option{-Wformat-security} that are not
3171 included in @option{-Wformat-nonliteral}.)
3172
3173 @item -Wformat=2
3174 @opindex Wformat=2
3175 @opindex Wno-format=2
3176 Enable @option{-Wformat} plus format checks not included in
3177 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
3178 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3179
3180 @item -Wnonnull @r{(C and Objective-C only)}
3181 @opindex Wnonnull
3182 @opindex Wno-nonnull
3183 Warn about passing a null pointer for arguments marked as
3184 requiring a non-null value by the @code{nonnull} function attribute.
3185
3186 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3187 can be disabled with the @option{-Wno-nonnull} option.
3188
3189 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3190 @opindex Winit-self
3191 @opindex Wno-init-self
3192 Warn about uninitialized variables which are initialized with themselves.
3193 Note this option can only be used with the @option{-Wuninitialized} option.
3194
3195 For example, GCC will warn about @code{i} being uninitialized in the
3196 following snippet only when @option{-Winit-self} has been specified:
3197 @smallexample
3198 @group
3199 int f()
3200 @{
3201   int i = i;
3202   return i;
3203 @}
3204 @end group
3205 @end smallexample
3206
3207 @item -Wimplicit-int @r{(C and Objective-C only)}
3208 @opindex Wimplicit-int
3209 @opindex Wno-implicit-int
3210 Warn when a declaration does not specify a type.
3211 This warning is enabled by @option{-Wall}.
3212
3213 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3214 @opindex Wimplicit-function-declaration
3215 @opindex Wno-implicit-function-declaration
3216 Give a warning whenever a function is used before being declared. In
3217 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3218 enabled by default and it is made into an error by
3219 @option{-pedantic-errors}. This warning is also enabled by
3220 @option{-Wall}.
3221
3222 @item -Wimplicit @r{(C and Objective-C only)}
3223 @opindex Wimplicit
3224 @opindex Wno-implicit
3225 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3226 This warning is enabled by @option{-Wall}.
3227
3228 @item -Wignored-qualifiers @r{(C and C++ only)}
3229 @opindex Wignored-qualifiers
3230 @opindex Wno-ignored-qualifiers
3231 Warn if the return type of a function has a type qualifier
3232 such as @code{const}.  For ISO C such a type qualifier has no effect,
3233 since the value returned by a function is not an lvalue.
3234 For C++, the warning is only emitted for scalar types or @code{void}.
3235 ISO C prohibits qualified @code{void} return types on function
3236 definitions, so such return types always receive a warning
3237 even without this option.
3238
3239 This warning is also enabled by @option{-Wextra}.
3240
3241 @item -Wmain
3242 @opindex Wmain
3243 @opindex Wno-main
3244 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3245 a function with external linkage, returning int, taking either zero
3246 arguments, two, or three arguments of appropriate types.  This warning
3247 is enabled by default in C++ and is enabled by either @option{-Wall}
3248 or @option{-pedantic}.
3249
3250 @item -Wmissing-braces
3251 @opindex Wmissing-braces
3252 @opindex Wno-missing-braces
3253 Warn if an aggregate or union initializer is not fully bracketed.  In
3254 the following example, the initializer for @samp{a} is not fully
3255 bracketed, but that for @samp{b} is fully bracketed.
3256
3257 @smallexample
3258 int a[2][2] = @{ 0, 1, 2, 3 @};
3259 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3260 @end smallexample
3261
3262 This warning is enabled by @option{-Wall}.
3263
3264 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3265 @opindex Wmissing-include-dirs
3266 @opindex Wno-missing-include-dirs
3267 Warn if a user-supplied include directory does not exist.
3268
3269 @item -Wparentheses
3270 @opindex Wparentheses
3271 @opindex Wno-parentheses
3272 Warn if parentheses are omitted in certain contexts, such
3273 as when there is an assignment in a context where a truth value
3274 is expected, or when operators are nested whose precedence people
3275 often get confused about.
3276
3277 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3278 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3279 interpretation from that of ordinary mathematical notation.
3280
3281 Also warn about constructions where there may be confusion to which
3282 @code{if} statement an @code{else} branch belongs.  Here is an example of
3283 such a case:
3284
3285 @smallexample
3286 @group
3287 @{
3288   if (a)
3289     if (b)
3290       foo ();
3291   else
3292     bar ();
3293 @}
3294 @end group
3295 @end smallexample
3296
3297 In C/C++, every @code{else} branch belongs to the innermost possible
3298 @code{if} statement, which in this example is @code{if (b)}.  This is
3299 often not what the programmer expected, as illustrated in the above
3300 example by indentation the programmer chose.  When there is the
3301 potential for this confusion, GCC will issue a warning when this flag
3302 is specified.  To eliminate the warning, add explicit braces around
3303 the innermost @code{if} statement so there is no way the @code{else}
3304 could belong to the enclosing @code{if}.  The resulting code would
3305 look like this:
3306
3307 @smallexample
3308 @group
3309 @{
3310   if (a)
3311     @{
3312       if (b)
3313         foo ();
3314       else
3315         bar ();
3316     @}
3317 @}
3318 @end group
3319 @end smallexample
3320
3321 Also warn for dangerous uses of the
3322 ?: with omitted middle operand GNU extension. When the condition
3323 in the ?: operator is a boolean expression the omitted value will
3324 be always 1. Often the user expects it to be a value computed
3325 inside the conditional expression instead.
3326
3327 This warning is enabled by @option{-Wall}.
3328
3329 @item -Wsequence-point
3330 @opindex Wsequence-point
3331 @opindex Wno-sequence-point
3332 Warn about code that may have undefined semantics because of violations
3333 of sequence point rules in the C and C++ standards.
3334
3335 The C and C++ standards defines the order in which expressions in a C/C++
3336 program are evaluated in terms of @dfn{sequence points}, which represent
3337 a partial ordering between the execution of parts of the program: those
3338 executed before the sequence point, and those executed after it.  These
3339 occur after the evaluation of a full expression (one which is not part
3340 of a larger expression), after the evaluation of the first operand of a
3341 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3342 function is called (but after the evaluation of its arguments and the
3343 expression denoting the called function), and in certain other places.
3344 Other than as expressed by the sequence point rules, the order of
3345 evaluation of subexpressions of an expression is not specified.  All
3346 these rules describe only a partial order rather than a total order,
3347 since, for example, if two functions are called within one expression
3348 with no sequence point between them, the order in which the functions
3349 are called is not specified.  However, the standards committee have
3350 ruled that function calls do not overlap.
3351
3352 It is not specified when between sequence points modifications to the
3353 values of objects take effect.  Programs whose behavior depends on this
3354 have undefined behavior; the C and C++ standards specify that ``Between
3355 the previous and next sequence point an object shall have its stored
3356 value modified at most once by the evaluation of an expression.
3357 Furthermore, the prior value shall be read only to determine the value
3358 to be stored.''.  If a program breaks these rules, the results on any
3359 particular implementation are entirely unpredictable.
3360
3361 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3362 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3363 diagnosed by this option, and it may give an occasional false positive
3364 result, but in general it has been found fairly effective at detecting
3365 this sort of problem in programs.
3366
3367 The standard is worded confusingly, therefore there is some debate
3368 over the precise meaning of the sequence point rules in subtle cases.
3369 Links to discussions of the problem, including proposed formal
3370 definitions, may be found on the GCC readings page, at
3371 @uref{http://gcc.gnu.org/@/readings.html}.
3372
3373 This warning is enabled by @option{-Wall} for C and C++.
3374
3375 @item -Wreturn-type
3376 @opindex Wreturn-type
3377 @opindex Wno-return-type
3378 Warn whenever a function is defined with a return-type that defaults
3379 to @code{int}.  Also warn about any @code{return} statement with no
3380 return-value in a function whose return-type is not @code{void}
3381 (falling off the end of the function body is considered returning
3382 without a value), and about a @code{return} statement with an
3383 expression in a function whose return-type is @code{void}.
3384
3385 For C++, a function without return type always produces a diagnostic
3386 message, even when @option{-Wno-return-type} is specified.  The only
3387 exceptions are @samp{main} and functions defined in system headers.
3388
3389 This warning is enabled by @option{-Wall}.
3390
3391 @item -Wswitch
3392 @opindex Wswitch
3393 @opindex Wno-switch
3394 Warn whenever a @code{switch} statement has an index of enumerated type
3395 and lacks a @code{case} for one or more of the named codes of that
3396 enumeration.  (The presence of a @code{default} label prevents this
3397 warning.)  @code{case} labels outside the enumeration range also
3398 provoke warnings when this option is used (even if there is a
3399 @code{default} label).
3400 This warning is enabled by @option{-Wall}.
3401
3402 @item -Wswitch-default
3403 @opindex Wswitch-default
3404 @opindex Wno-switch-default
3405 Warn whenever a @code{switch} statement does not have a @code{default}
3406 case.
3407
3408 @item -Wswitch-enum
3409 @opindex Wswitch-enum
3410 @opindex Wno-switch-enum
3411 Warn whenever a @code{switch} statement has an index of enumerated type
3412 and lacks a @code{case} for one or more of the named codes of that
3413 enumeration.  @code{case} labels outside the enumeration range also
3414 provoke warnings when this option is used.  The only difference
3415 between @option{-Wswitch} and this option is that this option gives a
3416 warning about an omitted enumeration code even if there is a
3417 @code{default} label.
3418
3419 @item -Wsync-nand @r{(C and C++ only)}
3420 @opindex Wsync-nand
3421 @opindex Wno-sync-nand
3422 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3423 built-in functions are used.  These functions changed semantics in GCC 4.4.
3424
3425 @item -Wtrigraphs
3426 @opindex Wtrigraphs
3427 @opindex Wno-trigraphs
3428 Warn if any trigraphs are encountered that might change the meaning of
3429 the program (trigraphs within comments are not warned about).
3430 This warning is enabled by @option{-Wall}.
3431
3432 @item -Wunused-but-set-parameter
3433 @opindex Wunused-but-set-parameter
3434 @opindex Wno-unused-but-set-parameter
3435 Warn whenever a function parameter is assigned to, but otherwise unused
3436 (aside from its declaration).
3437
3438 To suppress this warning use the @samp{unused} attribute
3439 (@pxref{Variable Attributes}).
3440
3441 This warning is also enabled by @option{-Wunused} together with
3442 @option{-Wextra}.
3443
3444 @item -Wunused-but-set-variable
3445 @opindex Wunused-but-set-variable
3446 @opindex Wno-unused-but-set-variable
3447 Warn whenever a local variable is assigned to, but otherwise unused
3448 (aside from its declaration).
3449 This warning is enabled by @option{-Wall}.
3450
3451 To suppress this warning use the @samp{unused} attribute
3452 (@pxref{Variable Attributes}).
3453
3454 This warning is also enabled by @option{-Wunused}, which is enabled
3455 by @option{-Wall}.
3456
3457 @item -Wunused-function
3458 @opindex Wunused-function
3459 @opindex Wno-unused-function
3460 Warn whenever a static function is declared but not defined or a
3461 non-inline static function is unused.
3462 This warning is enabled by @option{-Wall}.
3463
3464 @item -Wunused-label
3465 @opindex Wunused-label
3466 @opindex Wno-unused-label
3467 Warn whenever a label is declared but not used.
3468 This warning is enabled by @option{-Wall}.
3469
3470 To suppress this warning use the @samp{unused} attribute
3471 (@pxref{Variable Attributes}).
3472
3473 @item -Wunused-parameter
3474 @opindex Wunused-parameter
3475 @opindex Wno-unused-parameter
3476 Warn whenever a function parameter is unused aside from its declaration.
3477
3478 To suppress this warning use the @samp{unused} attribute
3479 (@pxref{Variable Attributes}).
3480
3481 @item -Wno-unused-result
3482 @opindex Wunused-result
3483 @opindex Wno-unused-result
3484 Do not warn if a caller of a function marked with attribute
3485 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3486 its return value. The default is @option{-Wunused-result}.
3487
3488 @item -Wunused-variable
3489 @opindex Wunused-variable
3490 @opindex Wno-unused-variable
3491 Warn whenever a local variable or non-constant static variable is unused
3492 aside from its declaration.
3493 This warning is enabled by @option{-Wall}.
3494
3495 To suppress this warning use the @samp{unused} attribute
3496 (@pxref{Variable Attributes}).
3497
3498 @item -Wunused-value
3499 @opindex Wunused-value
3500 @opindex Wno-unused-value
3501 Warn whenever a statement computes a result that is explicitly not
3502 used. To suppress this warning cast the unused expression to
3503 @samp{void}. This includes an expression-statement or the left-hand
3504 side of a comma expression that contains no side effects. For example,
3505 an expression such as @samp{x[i,j]} will cause a warning, while
3506 @samp{x[(void)i,j]} will not.
3507
3508 This warning is enabled by @option{-Wall}.
3509
3510 @item -Wunused
3511 @opindex Wunused
3512 @opindex Wno-unused
3513 All the above @option{-Wunused} options combined.
3514
3515 In order to get a warning about an unused function parameter, you must
3516 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3517 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3518
3519 @item -Wuninitialized
3520 @opindex Wuninitialized
3521 @opindex Wno-uninitialized
3522 Warn if an automatic variable is used without first being initialized
3523 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3524 warn if a non-static reference or non-static @samp{const} member
3525 appears in a class without constructors.
3526
3527 If you want to warn about code which uses the uninitialized value of the
3528 variable in its own initializer, use the @option{-Winit-self} option.
3529
3530 These warnings occur for individual uninitialized or clobbered
3531 elements of structure, union or array variables as well as for
3532 variables which are uninitialized or clobbered as a whole.  They do
3533 not occur for variables or elements declared @code{volatile}.  Because
3534 these warnings depend on optimization, the exact variables or elements
3535 for which there are warnings will depend on the precise optimization
3536 options and version of GCC used.
3537
3538 Note that there may be no warning about a variable that is used only
3539 to compute a value that itself is never used, because such
3540 computations may be deleted by data flow analysis before the warnings
3541 are printed.
3542
3543 @item -Wmaybe-uninitialized
3544 @opindex Wmaybe-uninitialized
3545 @opindex Wno-maybe-uninitialized
3546 For an automatic variable, if there exists a path from the function
3547 entry to a use of the variable that is initialized, but there exist
3548 some other paths the variable is not initialized, the compiler will
3549 emit a warning if it can not prove the uninitialized paths do not
3550 happen at runtime. These warnings are made optional because GCC is
3551 not smart enough to see all the reasons why the code might be correct
3552 despite appearing to have an error.  Here is one example of how
3553 this can happen:
3554
3555 @smallexample
3556 @group
3557 @{
3558   int x;
3559   switch (y)
3560     @{
3561     case 1: x = 1;
3562       break;
3563     case 2: x = 4;
3564       break;
3565     case 3: x = 5;
3566     @}
3567   foo (x);
3568 @}
3569 @end group
3570 @end smallexample
3571
3572 @noindent
3573 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3574 always initialized, but GCC doesn't know this. To suppress the
3575 warning, the user needs to provide a default case with assert(0) or
3576 similar code.
3577
3578 @cindex @code{longjmp} warnings
3579 This option also warns when a non-volatile automatic variable might be
3580 changed by a call to @code{longjmp}.  These warnings as well are possible
3581 only in optimizing compilation.
3582
3583 The compiler sees only the calls to @code{setjmp}.  It cannot know
3584 where @code{longjmp} will be called; in fact, a signal handler could
3585 call it at any point in the code.  As a result, you may get a warning
3586 even when there is in fact no problem because @code{longjmp} cannot
3587 in fact be called at the place which would cause a problem.
3588
3589 Some spurious warnings can be avoided if you declare all the functions
3590 you use that never return as @code{noreturn}.  @xref{Function
3591 Attributes}.
3592
3593 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3594
3595 @item -Wunknown-pragmas
3596 @opindex Wunknown-pragmas
3597 @opindex Wno-unknown-pragmas
3598 @cindex warning for unknown pragmas
3599 @cindex unknown pragmas, warning
3600 @cindex pragmas, warning of unknown
3601 Warn when a #pragma directive is encountered which is not understood by
3602 GCC@.  If this command line option is used, warnings will even be issued
3603 for unknown pragmas in system header files.  This is not the case if
3604 the warnings were only enabled by the @option{-Wall} command line option.
3605
3606 @item -Wno-pragmas
3607 @opindex Wno-pragmas
3608 @opindex Wpragmas
3609 Do not warn about misuses of pragmas, such as incorrect parameters,
3610 invalid syntax, or conflicts between pragmas.  See also
3611 @samp{-Wunknown-pragmas}.
3612
3613 @item -Wstrict-aliasing
3614 @opindex Wstrict-aliasing
3615 @opindex Wno-strict-aliasing
3616 This option is only active when @option{-fstrict-aliasing} is active.
3617 It warns about code which might break the strict aliasing rules that the
3618 compiler is using for optimization.  The warning does not catch all
3619 cases, but does attempt to catch the more common pitfalls.  It is
3620 included in @option{-Wall}.
3621 It is equivalent to @option{-Wstrict-aliasing=3}
3622
3623 @item -Wstrict-aliasing=n
3624 @opindex Wstrict-aliasing=n
3625 @opindex Wno-strict-aliasing=n
3626 This option is only active when @option{-fstrict-aliasing} is active.
3627 It warns about code which might break the strict aliasing rules that the
3628 compiler is using for optimization.
3629 Higher levels correspond to higher accuracy (fewer false positives).
3630 Higher levels also correspond to more effort, similar to the way -O works.
3631 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3632 with n=3.
3633
3634 Level 1: Most aggressive, quick, least accurate.
3635 Possibly useful when higher levels
3636 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3637 false negatives.  However, it has many false positives.
3638 Warns for all pointer conversions between possibly incompatible types,
3639 even if never dereferenced.  Runs in the frontend only.
3640
3641 Level 2: Aggressive, quick, not too precise.
3642 May still have many false positives (not as many as level 1 though),
3643 and few false negatives (but possibly more than level 1).
3644 Unlike level 1, it only warns when an address is taken.  Warns about
3645 incomplete types.  Runs in the frontend only.
3646
3647 Level 3 (default for @option{-Wstrict-aliasing}):
3648 Should have very few false positives and few false
3649 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3650 Takes care of the common pun+dereference pattern in the frontend:
3651 @code{*(int*)&some_float}.
3652 If optimization is enabled, it also runs in the backend, where it deals
3653 with multiple statement cases using flow-sensitive points-to information.
3654 Only warns when the converted pointer is dereferenced.
3655 Does not warn about incomplete types.
3656
3657 @item -Wstrict-overflow
3658 @itemx -Wstrict-overflow=@var{n}
3659 @opindex Wstrict-overflow
3660 @opindex Wno-strict-overflow
3661 This option is only active when @option{-fstrict-overflow} is active.
3662 It warns about cases where the compiler optimizes based on the
3663 assumption that signed overflow does not occur.  Note that it does not
3664 warn about all cases where the code might overflow: it only warns
3665 about cases where the compiler implements some optimization.  Thus
3666 this warning depends on the optimization level.
3667
3668 An optimization which assumes that signed overflow does not occur is
3669 perfectly safe if the values of the variables involved are such that
3670 overflow never does, in fact, occur.  Therefore this warning can
3671 easily give a false positive: a warning about code which is not
3672 actually a problem.  To help focus on important issues, several
3673 warning levels are defined.  No warnings are issued for the use of
3674 undefined signed overflow when estimating how many iterations a loop
3675 will require, in particular when determining whether a loop will be
3676 executed at all.
3677
3678 @table @gcctabopt
3679 @item -Wstrict-overflow=1
3680 Warn about cases which are both questionable and easy to avoid.  For
3681 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3682 compiler will simplify this to @code{1}.  This level of
3683 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3684 are not, and must be explicitly requested.
3685
3686 @item -Wstrict-overflow=2
3687 Also warn about other cases where a comparison is simplified to a
3688 constant.  For example: @code{abs (x) >= 0}.  This can only be
3689 simplified when @option{-fstrict-overflow} is in effect, because
3690 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3691 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3692 @option{-Wstrict-overflow=2}.
3693
3694 @item -Wstrict-overflow=3
3695 Also warn about other cases where a comparison is simplified.  For
3696 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3697
3698 @item -Wstrict-overflow=4
3699 Also warn about other simplifications not covered by the above cases.
3700 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3701
3702 @item -Wstrict-overflow=5
3703 Also warn about cases where the compiler reduces the magnitude of a
3704 constant involved in a comparison.  For example: @code{x + 2 > y} will
3705 be simplified to @code{x + 1 >= y}.  This is reported only at the
3706 highest warning level because this simplification applies to many
3707 comparisons, so this warning level will give a very large number of
3708 false positives.
3709 @end table
3710
3711 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3712 @opindex Wsuggest-attribute=
3713 @opindex Wno-suggest-attribute=
3714 Warn for cases where adding an attribute may be beneficial. The
3715 attributes currently supported are listed below.
3716
3717 @table @gcctabopt
3718 @item -Wsuggest-attribute=pure
3719 @itemx -Wsuggest-attribute=const
3720 @itemx -Wsuggest-attribute=noreturn
3721 @opindex Wsuggest-attribute=pure
3722 @opindex Wno-suggest-attribute=pure
3723 @opindex Wsuggest-attribute=const
3724 @opindex Wno-suggest-attribute=const
3725 @opindex Wsuggest-attribute=noreturn
3726 @opindex Wno-suggest-attribute=noreturn
3727
3728 Warn about functions which might be candidates for attributes
3729 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3730 functions visible in other compilation units or (in the case of @code{pure} and
3731 @code{const}) if it cannot prove that the function returns normally. A function
3732 returns normally if it doesn't contain an infinite loop nor returns abnormally
3733 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3734 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3735 higher.  Higher optimization levels improve the accuracy of the analysis.
3736 @end table
3737
3738 @item -Warray-bounds
3739 @opindex Wno-array-bounds
3740 @opindex Warray-bounds
3741 This option is only active when @option{-ftree-vrp} is active
3742 (default for @option{-O2} and above). It warns about subscripts to arrays
3743 that are always out of bounds. This warning is enabled by @option{-Wall}.
3744
3745 @item -Wno-div-by-zero
3746 @opindex Wno-div-by-zero
3747 @opindex Wdiv-by-zero
3748 Do not warn about compile-time integer division by zero.  Floating point
3749 division by zero is not warned about, as it can be a legitimate way of
3750 obtaining infinities and NaNs.
3751
3752 @item -Wsystem-headers
3753 @opindex Wsystem-headers
3754 @opindex Wno-system-headers
3755 @cindex warnings from system headers
3756 @cindex system headers, warnings from
3757 Print warning messages for constructs found in system header files.
3758 Warnings from system headers are normally suppressed, on the assumption
3759 that they usually do not indicate real problems and would only make the
3760 compiler output harder to read.  Using this command line option tells
3761 GCC to emit warnings from system headers as if they occurred in user
3762 code.  However, note that using @option{-Wall} in conjunction with this
3763 option will @emph{not} warn about unknown pragmas in system
3764 headers---for that, @option{-Wunknown-pragmas} must also be used.
3765
3766 @item -Wtrampolines
3767 @opindex Wtrampolines
3768 @opindex Wno-trampolines
3769  Warn about trampolines generated for pointers to nested functions.
3770
3771  A trampoline is a small piece of data or code that is created at run
3772  time on the stack when the address of a nested function is taken, and
3773  is used to call the nested function indirectly.  For some targets, it
3774  is made up of data only and thus requires no special treatment.  But,
3775  for most targets, it is made up of code and thus requires the stack
3776  to be made executable in order for the program to work properly.
3777
3778 @item -Wfloat-equal
3779 @opindex Wfloat-equal
3780 @opindex Wno-float-equal
3781 Warn if floating point values are used in equality comparisons.
3782
3783 The idea behind this is that sometimes it is convenient (for the
3784 programmer) to consider floating-point values as approximations to
3785 infinitely precise real numbers.  If you are doing this, then you need
3786 to compute (by analyzing the code, or in some other way) the maximum or
3787 likely maximum error that the computation introduces, and allow for it
3788 when performing comparisons (and when producing output, but that's a
3789 different problem).  In particular, instead of testing for equality, you
3790 would check to see whether the two values have ranges that overlap; and
3791 this is done with the relational operators, so equality comparisons are
3792 probably mistaken.
3793
3794 @item -Wtraditional @r{(C and Objective-C only)}
3795 @opindex Wtraditional
3796 @opindex Wno-traditional
3797 Warn about certain constructs that behave differently in traditional and
3798 ISO C@.  Also warn about ISO C constructs that have no traditional C
3799 equivalent, and/or problematic constructs which should be avoided.
3800
3801 @itemize @bullet
3802 @item
3803 Macro parameters that appear within string literals in the macro body.
3804 In traditional C macro replacement takes place within string literals,
3805 but does not in ISO C@.
3806
3807 @item
3808 In traditional C, some preprocessor directives did not exist.
3809 Traditional preprocessors would only consider a line to be a directive
3810 if the @samp{#} appeared in column 1 on the line.  Therefore
3811 @option{-Wtraditional} warns about directives that traditional C
3812 understands but would ignore because the @samp{#} does not appear as the
3813 first character on the line.  It also suggests you hide directives like
3814 @samp{#pragma} not understood by traditional C by indenting them.  Some
3815 traditional implementations would not recognize @samp{#elif}, so it
3816 suggests avoiding it altogether.
3817
3818 @item
3819 A function-like macro that appears without arguments.
3820
3821 @item
3822 The unary plus operator.
3823
3824 @item
3825 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3826 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3827 constants.)  Note, these suffixes appear in macros defined in the system
3828 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3829 Use of these macros in user code might normally lead to spurious
3830 warnings, however GCC's integrated preprocessor has enough context to
3831 avoid warning in these cases.
3832
3833 @item
3834 A function declared external in one block and then used after the end of
3835 the block.
3836
3837 @item
3838 A @code{switch} statement has an operand of type @code{long}.
3839
3840 @item
3841 A non-@code{static} function declaration follows a @code{static} one.
3842 This construct is not accepted by some traditional C compilers.
3843
3844 @item
3845 The ISO type of an integer constant has a different width or
3846 signedness from its traditional type.  This warning is only issued if
3847 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3848 typically represent bit patterns, are not warned about.
3849
3850 @item
3851 Usage of ISO string concatenation is detected.
3852
3853 @item
3854 Initialization of automatic aggregates.
3855
3856 @item
3857 Identifier conflicts with labels.  Traditional C lacks a separate
3858 namespace for labels.
3859
3860 @item
3861 Initialization of unions.  If the initializer is zero, the warning is
3862 omitted.  This is done under the assumption that the zero initializer in
3863 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3864 initializer warnings and relies on default initialization to zero in the
3865 traditional C case.
3866
3867 @item
3868 Conversions by prototypes between fixed/floating point values and vice
3869 versa.  The absence of these prototypes when compiling with traditional
3870 C would cause serious problems.  This is a subset of the possible
3871 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3872
3873 @item
3874 Use of ISO C style function definitions.  This warning intentionally is
3875 @emph{not} issued for prototype declarations or variadic functions
3876 because these ISO C features will appear in your code when using
3877 libiberty's traditional C compatibility macros, @code{PARAMS} and
3878 @code{VPARAMS}.  This warning is also bypassed for nested functions
3879 because that feature is already a GCC extension and thus not relevant to
3880 traditional C compatibility.
3881 @end itemize
3882
3883 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3884 @opindex Wtraditional-conversion
3885 @opindex Wno-traditional-conversion
3886 Warn if a prototype causes a type conversion that is different from what
3887 would happen to the same argument in the absence of a prototype.  This
3888 includes conversions of fixed point to floating and vice versa, and
3889 conversions changing the width or signedness of a fixed point argument
3890 except when the same as the default promotion.
3891
3892 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3893 @opindex Wdeclaration-after-statement
3894 @opindex Wno-declaration-after-statement
3895 Warn when a declaration is found after a statement in a block.  This
3896 construct, known from C++, was introduced with ISO C99 and is by default
3897 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3898 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3899
3900 @item -Wundef
3901 @opindex Wundef
3902 @opindex Wno-undef
3903 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3904
3905 @item -Wno-endif-labels
3906 @opindex Wno-endif-labels
3907 @opindex Wendif-labels
3908 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3909
3910 @item -Wshadow
3911 @opindex Wshadow
3912 @opindex Wno-shadow
3913 Warn whenever a local variable or type declaration shadows another variable,
3914 parameter, type, or class member (in C++), or whenever a built-in function
3915 is shadowed. Note that in C++, the compiler will not warn if a local variable
3916 shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
3917
3918 @item -Wlarger-than=@var{len}
3919 @opindex Wlarger-than=@var{len}
3920 @opindex Wlarger-than-@var{len}
3921 Warn whenever an object of larger than @var{len} bytes is defined.
3922
3923 @item -Wframe-larger-than=@var{len}
3924 @opindex Wframe-larger-than
3925 Warn if the size of a function frame is larger than @var{len} bytes.
3926 The computation done to determine the stack frame size is approximate
3927 and not conservative.
3928 The actual requirements may be somewhat greater than @var{len}
3929 even if you do not get a warning.  In addition, any space allocated
3930 via @code{alloca}, variable-length arrays, or related constructs
3931 is not included by the compiler when determining
3932 whether or not to issue a warning.
3933
3934 @item -Wstack-usage=@var{len}
3935 @opindex Wstack-usage
3936 Warn if the stack usage of a function might be larger than @var{len} bytes.
3937 The computation done to determine the stack usage is conservative.
3938 Any space allocated via @code{alloca}, variable-length arrays, or related
3939 constructs is included by the compiler when determining whether or not to
3940 issue a warning.
3941
3942 The message is in keeping with the output of @option{-fstack-usage}.
3943
3944 @itemize
3945 @item
3946 If the stack usage is fully static but exceeds the specified amount, it's:
3947
3948 @smallexample
3949   warning: stack usage is 1120 bytes
3950 @end smallexample
3951 @item
3952 If the stack usage is (partly) dynamic but bounded, it's:
3953
3954 @smallexample
3955   warning: stack usage might be 1648 bytes
3956 @end smallexample
3957 @item
3958 If the stack usage is (partly) dynamic and not bounded, it's:
3959
3960 @smallexample
3961   warning: stack usage might be unbounded
3962 @end smallexample
3963 @end itemize
3964
3965 @item -Wunsafe-loop-optimizations
3966 @opindex Wunsafe-loop-optimizations
3967 @opindex Wno-unsafe-loop-optimizations
3968 Warn if the loop cannot be optimized because the compiler could not
3969 assume anything on the bounds of the loop indices.  With
3970 @option{-funsafe-loop-optimizations} warn if the compiler made
3971 such assumptions.
3972
3973 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3974 @opindex Wno-pedantic-ms-format
3975 @opindex Wpedantic-ms-format
3976 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3977 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3978 depending on the MS runtime, when you are using the options @option{-Wformat}
3979 and @option{-pedantic} without gnu-extensions.
3980
3981 @item -Wpointer-arith
3982 @opindex Wpointer-arith
3983 @opindex Wno-pointer-arith
3984 Warn about anything that depends on the ``size of'' a function type or
3985 of @code{void}.  GNU C assigns these types a size of 1, for
3986 convenience in calculations with @code{void *} pointers and pointers
3987 to functions.  In C++, warn also when an arithmetic operation involves
3988 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3989
3990 @item -Wtype-limits
3991 @opindex Wtype-limits
3992 @opindex Wno-type-limits
3993 Warn if a comparison is always true or always false due to the limited
3994 range of the data type, but do not warn for constant expressions.  For
3995 example, warn if an unsigned variable is compared against zero with
3996 @samp{<} or @samp{>=}.  This warning is also enabled by
3997 @option{-Wextra}.
3998
3999 @item -Wbad-function-cast @r{(C and Objective-C only)}
4000 @opindex Wbad-function-cast
4001 @opindex Wno-bad-function-cast
4002 Warn whenever a function call is cast to a non-matching type.
4003 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4004
4005 @item -Wc++-compat @r{(C and Objective-C only)}
4006 Warn about ISO C constructs that are outside of the common subset of
4007 ISO C and ISO C++, e.g.@: request for implicit conversion from
4008 @code{void *} to a pointer to non-@code{void} type.
4009
4010 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
4011 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
4012 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
4013 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
4014
4015 @item -Wcast-qual
4016 @opindex Wcast-qual
4017 @opindex Wno-cast-qual
4018 Warn whenever a pointer is cast so as to remove a type qualifier from
4019 the target type.  For example, warn if a @code{const char *} is cast
4020 to an ordinary @code{char *}.
4021
4022 Also warn when making a cast which introduces a type qualifier in an
4023 unsafe way.  For example, casting @code{char **} to @code{const char **}
4024 is unsafe, as in this example:
4025
4026 @smallexample
4027   /* p is char ** value.  */
4028   const char **q = (const char **) p;
4029   /* Assignment of readonly string to const char * is OK.  */
4030   *q = "string";
4031   /* Now char** pointer points to read-only memory.  */
4032   **p = 'b';
4033 @end smallexample
4034
4035 @item -Wcast-align
4036 @opindex Wcast-align
4037 @opindex Wno-cast-align
4038 Warn whenever a pointer is cast such that the required alignment of the
4039 target is increased.  For example, warn if a @code{char *} is cast to
4040 an @code{int *} on machines where integers can only be accessed at
4041 two- or four-byte boundaries.
4042
4043 @item -Wwrite-strings
4044 @opindex Wwrite-strings
4045 @opindex Wno-write-strings
4046 When compiling C, give string constants the type @code{const
4047 char[@var{length}]} so that copying the address of one into a
4048 non-@code{const} @code{char *} pointer will get a warning.  These
4049 warnings will help you find at compile time code that can try to write
4050 into a string constant, but only if you have been very careful about
4051 using @code{const} in declarations and prototypes.  Otherwise, it will
4052 just be a nuisance. This is why we did not make @option{-Wall} request
4053 these warnings.
4054
4055 When compiling C++, warn about the deprecated conversion from string
4056 literals to @code{char *}.  This warning is enabled by default for C++
4057 programs.
4058
4059 @item -Wclobbered
4060 @opindex Wclobbered
4061 @opindex Wno-clobbered
4062 Warn for variables that might be changed by @samp{longjmp} or
4063 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4064
4065 @item -Wconversion
4066 @opindex Wconversion
4067 @opindex Wno-conversion
4068 Warn for implicit conversions that may alter a value. This includes
4069 conversions between real and integer, like @code{abs (x)} when
4070 @code{x} is @code{double}; conversions between signed and unsigned,
4071 like @code{unsigned ui = -1}; and conversions to smaller types, like
4072 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4073 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4074 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4075 conversions between signed and unsigned integers can be disabled by
4076 using @option{-Wno-sign-conversion}.
4077
4078 For C++, also warn for confusing overload resolution for user-defined
4079 conversions; and conversions that will never use a type conversion
4080 operator: conversions to @code{void}, the same type, a base class or a
4081 reference to them. Warnings about conversions between signed and
4082 unsigned integers are disabled by default in C++ unless
4083 @option{-Wsign-conversion} is explicitly enabled.
4084
4085 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4086 @opindex Wconversion-null
4087 @opindex Wno-conversion-null
4088 Do not warn for conversions between @code{NULL} and non-pointer
4089 types. @option{-Wconversion-null} is enabled by default.
4090
4091 @item -Wempty-body
4092 @opindex Wempty-body
4093 @opindex Wno-empty-body
4094 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4095 while} statement.  This warning is also enabled by @option{-Wextra}.
4096
4097 @item -Wenum-compare
4098 @opindex Wenum-compare
4099 @opindex Wno-enum-compare
4100 Warn about a comparison between values of different enum types. In C++
4101 this warning is enabled by default.  In C this warning is enabled by
4102 @option{-Wall}.
4103
4104 @item -Wjump-misses-init @r{(C, Objective-C only)}
4105 @opindex Wjump-misses-init
4106 @opindex Wno-jump-misses-init
4107 Warn if a @code{goto} statement or a @code{switch} statement jumps
4108 forward across the initialization of a variable, or jumps backward to a
4109 label after the variable has been initialized.  This only warns about
4110 variables which are initialized when they are declared.  This warning is
4111 only supported for C and Objective C; in C++ this sort of branch is an
4112 error in any case.
4113
4114 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4115 can be disabled with the @option{-Wno-jump-misses-init} option.
4116
4117 @item -Wsign-compare
4118 @opindex Wsign-compare
4119 @opindex Wno-sign-compare
4120 @cindex warning for comparison of signed and unsigned values
4121 @cindex comparison of signed and unsigned values, warning
4122 @cindex signed and unsigned values, comparison warning
4123 Warn when a comparison between signed and unsigned values could produce
4124 an incorrect result when the signed value is converted to unsigned.
4125 This warning is also enabled by @option{-Wextra}; to get the other warnings
4126 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
4127
4128 @item -Wsign-conversion
4129 @opindex Wsign-conversion
4130 @opindex Wno-sign-conversion
4131 Warn for implicit conversions that may change the sign of an integer
4132 value, like assigning a signed integer expression to an unsigned
4133 integer variable. An explicit cast silences the warning. In C, this
4134 option is enabled also by @option{-Wconversion}.
4135
4136 @item -Waddress
4137 @opindex Waddress
4138 @opindex Wno-address
4139 Warn about suspicious uses of memory addresses. These include using
4140 the address of a function in a conditional expression, such as
4141 @code{void func(void); if (func)}, and comparisons against the memory
4142 address of a string literal, such as @code{if (x == "abc")}.  Such
4143 uses typically indicate a programmer error: the address of a function
4144 always evaluates to true, so their use in a conditional usually
4145 indicate that the programmer forgot the parentheses in a function
4146 call; and comparisons against string literals result in unspecified
4147 behavior and are not portable in C, so they usually indicate that the
4148 programmer intended to use @code{strcmp}.  This warning is enabled by
4149 @option{-Wall}.
4150
4151 @item -Wlogical-op
4152 @opindex Wlogical-op
4153 @opindex Wno-logical-op
4154 Warn about suspicious uses of logical operators in expressions.
4155 This includes using logical operators in contexts where a
4156 bit-wise operator is likely to be expected.
4157
4158 @item -Waggregate-return
4159 @opindex Waggregate-return
4160 @opindex Wno-aggregate-return
4161 Warn if any functions that return structures or unions are defined or
4162 called.  (In languages where you can return an array, this also elicits
4163 a warning.)
4164
4165 @item -Wno-attributes
4166 @opindex Wno-attributes
4167 @opindex Wattributes
4168 Do not warn if an unexpected @code{__attribute__} is used, such as
4169 unrecognized attributes, function attributes applied to variables,
4170 etc.  This will not stop errors for incorrect use of supported
4171 attributes.
4172
4173 @item -Wno-builtin-macro-redefined
4174 @opindex Wno-builtin-macro-redefined
4175 @opindex Wbuiltin-macro-redefined
4176 Do not warn if certain built-in macros are redefined.  This suppresses
4177 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4178 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4179
4180 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4181 @opindex Wstrict-prototypes
4182 @opindex Wno-strict-prototypes
4183 Warn if a function is declared or defined without specifying the
4184 argument types.  (An old-style function definition is permitted without
4185 a warning if preceded by a declaration which specifies the argument
4186 types.)
4187
4188 @item -Wold-style-declaration @r{(C and Objective-C only)}
4189 @opindex Wold-style-declaration
4190 @opindex Wno-old-style-declaration
4191 Warn for obsolescent usages, according to the C Standard, in a
4192 declaration. For example, warn if storage-class specifiers like
4193 @code{static} are not the first things in a declaration.  This warning
4194 is also enabled by @option{-Wextra}.
4195
4196 @item -Wold-style-definition @r{(C and Objective-C only)}
4197 @opindex Wold-style-definition
4198 @opindex Wno-old-style-definition
4199 Warn if an old-style function definition is used.  A warning is given
4200 even if there is a previous prototype.
4201
4202 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4203 @opindex Wmissing-parameter-type
4204 @opindex Wno-missing-parameter-type
4205 A function parameter is declared without a type specifier in K&R-style
4206 functions:
4207
4208 @smallexample
4209 void foo(bar) @{ @}
4210 @end smallexample
4211
4212 This warning is also enabled by @option{-Wextra}.
4213
4214 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4215 @opindex Wmissing-prototypes
4216 @opindex Wno-missing-prototypes
4217 Warn if a global function is defined without a previous prototype
4218 declaration.  This warning is issued even if the definition itself
4219 provides a prototype.  The aim is to detect global functions that fail
4220 to be declared in header files.
4221
4222 @item -Wmissing-declarations
4223 @opindex Wmissing-declarations
4224 @opindex Wno-missing-declarations
4225 Warn if a global function is defined without a previous declaration.
4226 Do so even if the definition itself provides a prototype.
4227 Use this option to detect global functions that are not declared in
4228 header files.  In C++, no warnings are issued for function templates,
4229 or for inline functions, or for functions in anonymous namespaces.
4230
4231 @item -Wmissing-field-initializers
4232 @opindex Wmissing-field-initializers
4233 @opindex Wno-missing-field-initializers
4234 @opindex W
4235 @opindex Wextra
4236 @opindex Wno-extra
4237 Warn if a structure's initializer has some fields missing.  For
4238 example, the following code would cause such a warning, because
4239 @code{x.h} is implicitly zero:
4240
4241 @smallexample
4242 struct s @{ int f, g, h; @};
4243 struct s x = @{ 3, 4 @};
4244 @end smallexample
4245
4246 This option does not warn about designated initializers, so the following
4247 modification would not trigger a warning:
4248
4249 @smallexample
4250 struct s @{ int f, g, h; @};
4251 struct s x = @{ .f = 3, .g = 4 @};
4252 @end smallexample
4253
4254 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4255 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
4256
4257 @item -Wmissing-format-attribute
4258 @opindex Wmissing-format-attribute
4259 @opindex Wno-missing-format-attribute
4260 @opindex Wformat
4261 @opindex Wno-format
4262 Warn about function pointers which might be candidates for @code{format}
4263 attributes.  Note these are only possible candidates, not absolute ones.
4264 GCC will guess that function pointers with @code{format} attributes that
4265 are used in assignment, initialization, parameter passing or return
4266 statements should have a corresponding @code{format} attribute in the
4267 resulting type.  I.e.@: the left-hand side of the assignment or
4268 initialization, the type of the parameter variable, or the return type
4269 of the containing function respectively should also have a @code{format}
4270 attribute to avoid the warning.
4271
4272 GCC will also warn about function definitions which might be
4273 candidates for @code{format} attributes.  Again, these are only
4274 possible candidates.  GCC will guess that @code{format} attributes
4275 might be appropriate for any function that calls a function like
4276 @code{vprintf} or @code{vscanf}, but this might not always be the
4277 case, and some functions for which @code{format} attributes are
4278 appropriate may not be detected.
4279
4280 @item -Wno-multichar
4281 @opindex Wno-multichar
4282 @opindex Wmultichar
4283 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4284 Usually they indicate a typo in the user's code, as they have
4285 implementation-defined values, and should not be used in portable code.
4286
4287 @item -Wnormalized=<none|id|nfc|nfkc>
4288 @opindex Wnormalized=
4289 @cindex NFC
4290 @cindex NFKC
4291 @cindex character set, input normalization
4292 In ISO C and ISO C++, two identifiers are different if they are
4293 different sequences of characters.  However, sometimes when characters
4294 outside the basic ASCII character set are used, you can have two
4295 different character sequences that look the same.  To avoid confusion,
4296 the ISO 10646 standard sets out some @dfn{normalization rules} which
4297 when applied ensure that two sequences that look the same are turned into
4298 the same sequence.  GCC can warn you if you are using identifiers which
4299 have not been normalized; this option controls that warning.
4300
4301 There are four levels of warning that GCC supports.  The default is
4302 @option{-Wnormalized=nfc}, which warns about any identifier which is
4303 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4304 recommended form for most uses.
4305
4306 Unfortunately, there are some characters which ISO C and ISO C++ allow
4307 in identifiers that when turned into NFC aren't allowable as
4308 identifiers.  That is, there's no way to use these symbols in portable
4309 ISO C or C++ and have all your identifiers in NFC@.
4310 @option{-Wnormalized=id} suppresses the warning for these characters.
4311 It is hoped that future versions of the standards involved will correct
4312 this, which is why this option is not the default.
4313
4314 You can switch the warning off for all characters by writing
4315 @option{-Wnormalized=none}.  You would only want to do this if you
4316 were using some other normalization scheme (like ``D''), because
4317 otherwise you can easily create bugs that are literally impossible to see.
4318
4319 Some characters in ISO 10646 have distinct meanings but look identical
4320 in some fonts or display methodologies, especially once formatting has
4321 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4322 LETTER N'', will display just like a regular @code{n} which has been
4323 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4324 normalization scheme to convert all these into a standard form as
4325 well, and GCC will warn if your code is not in NFKC if you use
4326 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4327 about every identifier that contains the letter O because it might be
4328 confused with the digit 0, and so is not the default, but may be
4329 useful as a local coding convention if the programming environment is
4330 unable to be fixed to display these characters distinctly.
4331
4332 @item -Wno-deprecated
4333 @opindex Wno-deprecated
4334 @opindex Wdeprecated
4335 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4336
4337 @item -Wno-deprecated-declarations
4338 @opindex Wno-deprecated-declarations
4339 @opindex Wdeprecated-declarations
4340 Do not warn about uses of functions (@pxref{Function Attributes}),
4341 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4342 Attributes}) marked as deprecated by using the @code{deprecated}
4343 attribute.
4344
4345 @item -Wno-overflow
4346 @opindex Wno-overflow
4347 @opindex Woverflow
4348 Do not warn about compile-time overflow in constant expressions.
4349
4350 @item -Woverride-init @r{(C and Objective-C only)}
4351 @opindex Woverride-init
4352 @opindex Wno-override-init
4353 @opindex W
4354 @opindex Wextra
4355 @opindex Wno-extra
4356 Warn if an initialized field without side effects is overridden when
4357 using designated initializers (@pxref{Designated Inits, , Designated
4358 Initializers}).
4359
4360 This warning is included in @option{-Wextra}.  To get other
4361 @option{-Wextra} warnings without this one, use @samp{-Wextra
4362 -Wno-override-init}.
4363
4364 @item -Wpacked
4365 @opindex Wpacked
4366 @opindex Wno-packed
4367 Warn if a structure is given the packed attribute, but the packed
4368 attribute has no effect on the layout or size of the structure.
4369 Such structures may be mis-aligned for little benefit.  For
4370 instance, in this code, the variable @code{f.x} in @code{struct bar}
4371 will be misaligned even though @code{struct bar} does not itself
4372 have the packed attribute:
4373
4374 @smallexample
4375 @group
4376 struct foo @{
4377   int x;
4378   char a, b, c, d;
4379 @} __attribute__((packed));
4380 struct bar @{
4381   char z;
4382   struct foo f;
4383 @};
4384 @end group
4385 @end smallexample
4386
4387 @item -Wpacked-bitfield-compat
4388 @opindex Wpacked-bitfield-compat
4389 @opindex Wno-packed-bitfield-compat
4390 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4391 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4392 the change can lead to differences in the structure layout.  GCC
4393 informs you when the offset of such a field has changed in GCC 4.4.
4394 For example there is no longer a 4-bit padding between field @code{a}
4395 and @code{b} in this structure:
4396
4397 @smallexample
4398 struct foo
4399 @{
4400   char a:4;
4401   char b:8;
4402 @} __attribute__ ((packed));
4403 @end smallexample
4404
4405 This warning is enabled by default.  Use
4406 @option{-Wno-packed-bitfield-compat} to disable this warning.
4407
4408 @item -Wpadded
4409 @opindex Wpadded
4410 @opindex Wno-padded
4411 Warn if padding is included in a structure, either to align an element
4412 of the structure or to align the whole structure.  Sometimes when this
4413 happens it is possible to rearrange the fields of the structure to
4414 reduce the padding and so make the structure smaller.
4415
4416 @item -Wredundant-decls
4417 @opindex Wredundant-decls
4418 @opindex Wno-redundant-decls
4419 Warn if anything is declared more than once in the same scope, even in
4420 cases where multiple declaration is valid and changes nothing.
4421
4422 @item -Wnested-externs @r{(C and Objective-C only)}
4423 @opindex Wnested-externs
4424 @opindex Wno-nested-externs
4425 Warn if an @code{extern} declaration is encountered within a function.
4426
4427 @item -Winline
4428 @opindex Winline
4429 @opindex Wno-inline
4430 Warn if a function can not be inlined and it was declared as inline.
4431 Even with this option, the compiler will not warn about failures to
4432 inline functions declared in system headers.
4433
4434 The compiler uses a variety of heuristics to determine whether or not
4435 to inline a function.  For example, the compiler takes into account
4436 the size of the function being inlined and the amount of inlining
4437 that has already been done in the current function.  Therefore,
4438 seemingly insignificant changes in the source program can cause the
4439 warnings produced by @option{-Winline} to appear or disappear.
4440
4441 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4442 @opindex Wno-invalid-offsetof
4443 @opindex Winvalid-offsetof
4444 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4445 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4446 to a non-POD type is undefined.  In existing C++ implementations,
4447 however, @samp{offsetof} typically gives meaningful results even when
4448 applied to certain kinds of non-POD types. (Such as a simple
4449 @samp{struct} that fails to be a POD type only by virtue of having a
4450 constructor.)  This flag is for users who are aware that they are
4451 writing nonportable code and who have deliberately chosen to ignore the
4452 warning about it.
4453
4454 The restrictions on @samp{offsetof} may be relaxed in a future version
4455 of the C++ standard.
4456
4457 @item -Wno-int-to-pointer-cast
4458 @opindex Wno-int-to-pointer-cast
4459 @opindex Wint-to-pointer-cast
4460 Suppress warnings from casts to pointer type of an integer of a
4461 different size. In C++, casting to a pointer type of smaller size is
4462 an error. @option{Wint-to-pointer-cast} is enabled by default.
4463
4464
4465 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4466 @opindex Wno-pointer-to-int-cast
4467 @opindex Wpointer-to-int-cast
4468 Suppress warnings from casts from a pointer to an integer type of a
4469 different size.
4470
4471 @item -Winvalid-pch
4472 @opindex Winvalid-pch
4473 @opindex Wno-invalid-pch
4474 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4475 the search path but can't be used.
4476
4477 @item -Wlong-long
4478 @opindex Wlong-long
4479 @opindex Wno-long-long
4480 Warn if @samp{long long} type is used.  This is enabled by either
4481 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4482 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4483
4484 @item -Wvariadic-macros
4485 @opindex Wvariadic-macros
4486 @opindex Wno-variadic-macros
4487 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4488 alternate syntax when in pedantic ISO C99 mode.  This is default.
4489 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4490
4491 @item -Wvla
4492 @opindex Wvla
4493 @opindex Wno-vla
4494 Warn if variable length array is used in the code.
4495 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4496 the variable length array.
4497
4498 @item -Wvolatile-register-var
4499 @opindex Wvolatile-register-var
4500 @opindex Wno-volatile-register-var
4501 Warn if a register variable is declared volatile.  The volatile
4502 modifier does not inhibit all optimizations that may eliminate reads
4503 and/or writes to register variables.  This warning is enabled by
4504 @option{-Wall}.
4505
4506 @item -Wdisabled-optimization
4507 @opindex Wdisabled-optimization
4508 @opindex Wno-disabled-optimization
4509 Warn if a requested optimization pass is disabled.  This warning does
4510 not generally indicate that there is anything wrong with your code; it
4511 merely indicates that GCC's optimizers were unable to handle the code
4512 effectively.  Often, the problem is that your code is too big or too
4513 complex; GCC will refuse to optimize programs when the optimization
4514 itself is likely to take inordinate amounts of time.
4515
4516 @item -Wpointer-sign @r{(C and Objective-C only)}
4517 @opindex Wpointer-sign
4518 @opindex Wno-pointer-sign
4519 Warn for pointer argument passing or assignment with different signedness.
4520 This option is only supported for C and Objective-C@.  It is implied by
4521 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4522 @option{-Wno-pointer-sign}.
4523
4524 @item -Wstack-protector
4525 @opindex Wstack-protector
4526 @opindex Wno-stack-protector
4527 This option is only active when @option{-fstack-protector} is active.  It
4528 warns about functions that will not be protected against stack smashing.
4529
4530 @item -Wno-mudflap
4531 @opindex Wno-mudflap
4532 Suppress warnings about constructs that cannot be instrumented by
4533 @option{-fmudflap}.
4534
4535 @item -Woverlength-strings
4536 @opindex Woverlength-strings
4537 @opindex Wno-overlength-strings
4538 Warn about string constants which are longer than the ``minimum
4539 maximum'' length specified in the C standard.  Modern compilers
4540 generally allow string constants which are much longer than the
4541 standard's minimum limit, but very portable programs should avoid
4542 using longer strings.
4543
4544 The limit applies @emph{after} string constant concatenation, and does
4545 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4546 C99, it was raised to 4095.  C++98 does not specify a normative
4547 minimum maximum, so we do not diagnose overlength strings in C++@.
4548
4549 This option is implied by @option{-pedantic}, and can be disabled with
4550 @option{-Wno-overlength-strings}.
4551
4552 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4553 @opindex Wunsuffixed-float-constants
4554
4555 GCC will issue a warning for any floating constant that does not have
4556 a suffix.  When used together with @option{-Wsystem-headers} it will
4557 warn about such constants in system header files.  This can be useful
4558 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4559 from the decimal floating-point extension to C99.
4560 @end table
4561
4562 @node Debugging Options
4563 @section Options for Debugging Your Program or GCC
4564 @cindex options, debugging
4565 @cindex debugging information options
4566
4567 GCC has various special options that are used for debugging
4568 either your program or GCC:
4569
4570 @table @gcctabopt
4571 @item -g
4572 @opindex g
4573 Produce debugging information in the operating system's native format
4574 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4575 information.
4576
4577 On most systems that use stabs format, @option{-g} enables use of extra
4578 debugging information that only GDB can use; this extra information
4579 makes debugging work better in GDB but will probably make other debuggers
4580 crash or
4581 refuse to read the program.  If you want to control for certain whether
4582 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4583 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4584
4585 GCC allows you to use @option{-g} with
4586 @option{-O}.  The shortcuts taken by optimized code may occasionally
4587 produce surprising results: some variables you declared may not exist
4588 at all; flow of control may briefly move where you did not expect it;
4589 some statements may not be executed because they compute constant
4590 results or their values were already at hand; some statements may
4591 execute in different places because they were moved out of loops.
4592
4593 Nevertheless it proves possible to debug optimized output.  This makes
4594 it reasonable to use the optimizer for programs that might have bugs.
4595
4596 The following options are useful when GCC is generated with the
4597 capability for more than one debugging format.
4598
4599 @item -ggdb
4600 @opindex ggdb
4601 Produce debugging information for use by GDB@.  This means to use the
4602 most expressive format available (DWARF 2, stabs, or the native format
4603 if neither of those are supported), including GDB extensions if at all
4604 possible.
4605
4606 @item -gstabs
4607 @opindex gstabs
4608 Produce debugging information in stabs format (if that is supported),
4609 without GDB extensions.  This is the format used by DBX on most BSD
4610 systems.  On MIPS, Alpha and System V Release 4 systems this option
4611 produces stabs debugging output which is not understood by DBX or SDB@.
4612 On System V Release 4 systems this option requires the GNU assembler.
4613
4614 @item -feliminate-unused-debug-symbols
4615 @opindex feliminate-unused-debug-symbols
4616 Produce debugging information in stabs format (if that is supported),
4617 for only symbols that are actually used.
4618
4619 @item -femit-class-debug-always
4620 Instead of emitting debugging information for a C++ class in only one
4621 object file, emit it in all object files using the class.  This option
4622 should be used only with debuggers that are unable to handle the way GCC
4623 normally emits debugging information for classes because using this
4624 option will increase the size of debugging information by as much as a
4625 factor of two.
4626
4627 @item -fno-debug-types-section
4628 @opindex fno-debug-types-section
4629 @opindex fdebug-types-section
4630 By default when using DWARF v4 or higher type DIEs will be put into
4631 their own .debug_types section instead of making them part of the
4632 .debug_info section.  It is more efficient to put them in a separate
4633 comdat sections since the linker will then be able to remove duplicates.
4634 But not all DWARF consumers support .debug_types sections yet.
4635
4636 @item -gstabs+
4637 @opindex gstabs+
4638 Produce debugging information in stabs format (if that is supported),
4639 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4640 use of these extensions is likely to make other debuggers crash or
4641 refuse to read the program.
4642
4643 @item -gcoff
4644 @opindex gcoff
4645 Produce debugging information in COFF format (if that is supported).
4646 This is the format used by SDB on most System V systems prior to
4647 System V Release 4.
4648
4649 @item -gxcoff
4650 @opindex gxcoff
4651 Produce debugging information in XCOFF format (if that is supported).
4652 This is the format used by the DBX debugger on IBM RS/6000 systems.
4653
4654 @item -gxcoff+
4655 @opindex gxcoff+
4656 Produce debugging information in XCOFF format (if that is supported),
4657 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4658 use of these extensions is likely to make other debuggers crash or
4659 refuse to read the program, and may cause assemblers other than the GNU
4660 assembler (GAS) to fail with an error.
4661
4662 @item -gdwarf-@var{version}
4663 @opindex gdwarf-@var{version}
4664 Produce debugging information in DWARF format (if that is
4665 supported).  This is the format used by DBX on IRIX 6.  The value
4666 of @var{version} may be either 2, 3 or 4; the default version is 2.
4667
4668 Note that with DWARF version 2 some ports require, and will always
4669 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4670
4671 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4672 for maximum benefit.
4673
4674 @item -gstrict-dwarf
4675 @opindex gstrict-dwarf
4676 Disallow using extensions of later DWARF standard version than selected
4677 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4678 DWARF extensions from later standard versions is allowed.
4679
4680 @item -gno-strict-dwarf
4681 @opindex gno-strict-dwarf
4682 Allow using extensions of later DWARF standard version than selected with
4683 @option{-gdwarf-@var{version}}.
4684
4685 @item -gvms
4686 @opindex gvms
4687 Produce debugging information in VMS debug format (if that is
4688 supported).  This is the format used by DEBUG on VMS systems.
4689
4690 @item -g@var{level}
4691 @itemx -ggdb@var{level}
4692 @itemx -gstabs@var{level}
4693 @itemx -gcoff@var{level}
4694 @itemx -gxcoff@var{level}
4695 @itemx -gvms@var{level}
4696 Request debugging information and also use @var{level} to specify how
4697 much information.  The default level is 2.
4698
4699 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4700 @option{-g}.
4701
4702 Level 1 produces minimal information, enough for making backtraces in
4703 parts of the program that you don't plan to debug.  This includes
4704 descriptions of functions and external variables, but no information
4705 about local variables and no line numbers.
4706
4707 Level 3 includes extra information, such as all the macro definitions
4708 present in the program.  Some debuggers support macro expansion when
4709 you use @option{-g3}.
4710
4711 @option{-gdwarf-2} does not accept a concatenated debug level, because
4712 GCC used to support an option @option{-gdwarf} that meant to generate
4713 debug information in version 1 of the DWARF format (which is very
4714 different from version 2), and it would have been too confusing.  That
4715 debug format is long obsolete, but the option cannot be changed now.
4716 Instead use an additional @option{-g@var{level}} option to change the
4717 debug level for DWARF.
4718
4719 @item -gtoggle
4720 @opindex gtoggle
4721 Turn off generation of debug info, if leaving out this option would have
4722 generated it, or turn it on at level 2 otherwise.  The position of this
4723 argument in the command line does not matter, it takes effect after all
4724 other options are processed, and it does so only once, no matter how
4725 many times it is given.  This is mainly intended to be used with
4726 @option{-fcompare-debug}.
4727
4728 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4729 @opindex fdump-final-insns
4730 Dump the final internal representation (RTL) to @var{file}.  If the
4731 optional argument is omitted (or if @var{file} is @code{.}), the name
4732 of the dump file will be determined by appending @code{.gkd} to the
4733 compilation output file name.
4734
4735 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4736 @opindex fcompare-debug
4737 @opindex fno-compare-debug
4738 If no error occurs during compilation, run the compiler a second time,
4739 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4740 passed to the second compilation.  Dump the final internal
4741 representation in both compilations, and print an error if they differ.
4742
4743 If the equal sign is omitted, the default @option{-gtoggle} is used.
4744
4745 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4746 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4747 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4748 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4749 is used.
4750
4751 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4752 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4753 of the final representation and the second compilation, preventing even
4754 @env{GCC_COMPARE_DEBUG} from taking effect.
4755
4756 To verify full coverage during @option{-fcompare-debug} testing, set
4757 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4758 which GCC will reject as an invalid option in any actual compilation
4759 (rather than preprocessing, assembly or linking).  To get just a
4760 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4761 not overridden} will do.
4762
4763 @item -fcompare-debug-second
4764 @opindex fcompare-debug-second
4765 This option is implicitly passed to the compiler for the second
4766 compilation requested by @option{-fcompare-debug}, along with options to
4767 silence warnings, and omitting other options that would cause
4768 side-effect compiler outputs to files or to the standard output.  Dump
4769 files and preserved temporary files are renamed so as to contain the
4770 @code{.gk} additional extension during the second compilation, to avoid
4771 overwriting those generated by the first.
4772
4773 When this option is passed to the compiler driver, it causes the
4774 @emph{first} compilation to be skipped, which makes it useful for little
4775 other than debugging the compiler proper.
4776
4777 @item -feliminate-dwarf2-dups
4778 @opindex feliminate-dwarf2-dups
4779 Compress DWARF2 debugging information by eliminating duplicated
4780 information about each symbol.  This option only makes sense when
4781 generating DWARF2 debugging information with @option{-gdwarf-2}.
4782
4783 @item -femit-struct-debug-baseonly
4784 Emit debug information for struct-like types
4785 only when the base name of the compilation source file
4786 matches the base name of file in which the struct was defined.
4787
4788 This option substantially reduces the size of debugging information,
4789 but at significant potential loss in type information to the debugger.
4790 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4791 See @option{-femit-struct-debug-detailed} for more detailed control.
4792
4793 This option works only with DWARF 2.
4794
4795 @item -femit-struct-debug-reduced
4796 Emit debug information for struct-like types
4797 only when the base name of the compilation source file
4798 matches the base name of file in which the type was defined,
4799 unless the struct is a template or defined in a system header.
4800
4801 This option significantly reduces the size of debugging information,
4802 with some potential loss in type information to the debugger.
4803 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4804 See @option{-femit-struct-debug-detailed} for more detailed control.
4805
4806 This option works only with DWARF 2.
4807
4808 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4809 Specify the struct-like types
4810 for which the compiler will generate debug information.
4811 The intent is to reduce duplicate struct debug information
4812 between different object files within the same program.
4813
4814 This option is a detailed version of
4815 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4816 which will serve for most needs.
4817
4818 A specification has the syntax@*
4819 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4820
4821 The optional first word limits the specification to
4822 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4823 A struct type is used directly when it is the type of a variable, member.
4824 Indirect uses arise through pointers to structs.
4825 That is, when use of an incomplete struct would be legal, the use is indirect.
4826 An example is
4827 @samp{struct one direct; struct two * indirect;}.
4828
4829 The optional second word limits the specification to
4830 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4831 Generic structs are a bit complicated to explain.
4832 For C++, these are non-explicit specializations of template classes,
4833 or non-template classes within the above.
4834 Other programming languages have generics,
4835 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4836
4837 The third word specifies the source files for those
4838 structs for which the compiler will emit debug information.
4839 The values @samp{none} and @samp{any} have the normal meaning.
4840 The value @samp{base} means that
4841 the base of name of the file in which the type declaration appears
4842 must match the base of the name of the main compilation file.
4843 In practice, this means that
4844 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4845 but types declared in other header will not.
4846 The value @samp{sys} means those types satisfying @samp{base}
4847 or declared in system or compiler headers.
4848
4849 You may need to experiment to determine the best settings for your application.
4850
4851 The default is @samp{-femit-struct-debug-detailed=all}.
4852
4853 This option works only with DWARF 2.
4854
4855 @item -fno-merge-debug-strings
4856 @opindex fmerge-debug-strings
4857 @opindex fno-merge-debug-strings
4858 Direct the linker to not merge together strings in the debugging
4859 information which are identical in different object files.  Merging is
4860 not supported by all assemblers or linkers.  Merging decreases the size
4861 of the debug information in the output file at the cost of increasing
4862 link processing time.  Merging is enabled by default.
4863
4864 @item -fdebug-prefix-map=@var{old}=@var{new}
4865 @opindex fdebug-prefix-map
4866 When compiling files in directory @file{@var{old}}, record debugging
4867 information describing them as in @file{@var{new}} instead.
4868
4869 @item -fno-dwarf2-cfi-asm
4870 @opindex fdwarf2-cfi-asm
4871 @opindex fno-dwarf2-cfi-asm
4872 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4873 instead of using GAS @code{.cfi_*} directives.
4874
4875 @cindex @command{prof}
4876 @item -p
4877 @opindex p
4878 Generate extra code to write profile information suitable for the
4879 analysis program @command{prof}.  You must use this option when compiling
4880 the source files you want data about, and you must also use it when
4881 linking.
4882
4883 @cindex @command{gprof}
4884 @item -pg
4885 @opindex pg
4886 Generate extra code to write profile information suitable for the
4887 analysis program @command{gprof}.  You must use this option when compiling
4888 the source files you want data about, and you must also use it when
4889 linking.
4890
4891 @item -Q
4892 @opindex Q
4893 Makes the compiler print out each function name as it is compiled, and
4894 print some statistics about each pass when it finishes.
4895
4896 @item -ftime-report
4897 @opindex ftime-report
4898 Makes the compiler print some statistics about the time consumed by each
4899 pass when it finishes.
4900
4901 @item -fmem-report
4902 @opindex fmem-report
4903 Makes the compiler print some statistics about permanent memory
4904 allocation when it finishes.
4905
4906 @item -fpre-ipa-mem-report
4907 @opindex fpre-ipa-mem-report
4908 @item -fpost-ipa-mem-report
4909 @opindex fpost-ipa-mem-report
4910 Makes the compiler print some statistics about permanent memory
4911 allocation before or after interprocedural optimization.
4912
4913 @item -fstack-usage
4914 @opindex fstack-usage
4915 Makes the compiler output stack usage information for the program, on a
4916 per-function basis.  The filename for the dump is made by appending
4917 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
4918 the output file, if explicitly specified and it is not an executable,
4919 otherwise it is the basename of the source file.  An entry is made up
4920 of three fields:
4921
4922 @itemize
4923 @item
4924 The name of the function.
4925 @item
4926 A number of bytes.
4927 @item
4928 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
4929 @end itemize
4930
4931 The qualifier @code{static} means that the function manipulates the stack
4932 statically: a fixed number of bytes are allocated for the frame on function
4933 entry and released on function exit; no stack adjustments are otherwise made
4934 in the function.  The second field is this fixed number of bytes.
4935
4936 The qualifier @code{dynamic} means that the function manipulates the stack
4937 dynamically: in addition to the static allocation described above, stack
4938 adjustments are made in the body of the function, for example to push/pop
4939 arguments around function calls.  If the qualifier @code{bounded} is also
4940 present, the amount of these adjustments is bounded at compile-time and
4941 the second field is an upper bound of the total amount of stack used by
4942 the function.  If it is not present, the amount of these adjustments is
4943 not bounded at compile-time and the second field only represents the
4944 bounded part.
4945
4946 @item -fprofile-arcs
4947 @opindex fprofile-arcs
4948 Add code so that program flow @dfn{arcs} are instrumented.  During
4949 execution the program records how many times each branch and call is
4950 executed and how many times it is taken or returns.  When the compiled
4951 program exits it saves this data to a file called
4952 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4953 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4954 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4955 @var{auxname} is generated from the name of the output file, if
4956 explicitly specified and it is not the final executable, otherwise it is
4957 the basename of the source file.  In both cases any suffix is removed
4958 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4959 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4960 @xref{Cross-profiling}.
4961
4962 @cindex @command{gcov}
4963 @item --coverage
4964 @opindex coverage
4965
4966 This option is used to compile and link code instrumented for coverage
4967 analysis.  The option is a synonym for @option{-fprofile-arcs}
4968 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4969 linking).  See the documentation for those options for more details.
4970
4971 @itemize
4972
4973 @item
4974 Compile the source files with @option{-fprofile-arcs} plus optimization
4975 and code generation options.  For test coverage analysis, use the
4976 additional @option{-ftest-coverage} option.  You do not need to profile
4977 every source file in a program.
4978
4979 @item
4980 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4981 (the latter implies the former).
4982
4983 @item
4984 Run the program on a representative workload to generate the arc profile
4985 information.  This may be repeated any number of times.  You can run
4986 concurrent instances of your program, and provided that the file system
4987 supports locking, the data files will be correctly updated.  Also
4988 @code{fork} calls are detected and correctly handled (double counting
4989 will not happen).
4990
4991 @item
4992 For profile-directed optimizations, compile the source files again with
4993 the same optimization and code generation options plus
4994 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4995 Control Optimization}).
4996
4997 @item
4998 For test coverage analysis, use @command{gcov} to produce human readable
4999 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5000 @command{gcov} documentation for further information.
5001
5002 @end itemize
5003
5004 With @option{-fprofile-arcs}, for each function of your program GCC
5005 creates a program flow graph, then finds a spanning tree for the graph.
5006 Only arcs that are not on the spanning tree have to be instrumented: the
5007 compiler adds code to count the number of times that these arcs are
5008 executed.  When an arc is the only exit or only entrance to a block, the
5009 instrumentation code can be added to the block; otherwise, a new basic
5010 block must be created to hold the instrumentation code.
5011
5012 @need 2000
5013 @item -ftest-coverage
5014 @opindex ftest-coverage
5015 Produce a notes file that the @command{gcov} code-coverage utility
5016 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5017 show program coverage.  Each source file's note file is called
5018 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5019 above for a description of @var{auxname} and instructions on how to
5020 generate test coverage data.  Coverage data will match the source files
5021 more closely, if you do not optimize.
5022
5023 @item -fdbg-cnt-list
5024 @opindex fdbg-cnt-list
5025 Print the name and the counter upper bound for all debug counters.
5026
5027
5028 @item -fdbg-cnt=@var{counter-value-list}
5029 @opindex fdbg-cnt
5030 Set the internal debug counter upper bound.  @var{counter-value-list}
5031 is a comma-separated list of @var{name}:@var{value} pairs
5032 which sets the upper bound of each debug counter @var{name} to @var{value}.
5033 All debug counters have the initial upper bound of @var{UINT_MAX},
5034 thus dbg_cnt() returns true always unless the upper bound is set by this option.
5035 e.g. With -fdbg-cnt=dce:10,tail_call:0
5036 dbg_cnt(dce) will return true only for first 10 invocations
5037
5038 @itemx -fenable-@var{kind}-@var{pass}
5039 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5040 @opindex fdisable-
5041 @opindex fenable-
5042
5043 This is a set of debugging options that are used to explicitly disable/enable
5044 optimization passes. For compiler users, regular options for enabling/disabling
5045 passes should be used instead.
5046
5047 @itemize
5048
5049 @item -fdisable-ipa-@var{pass}
5050 Disable ipa pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5051 statically invoked in the compiler multiple times, the pass name should be
5052 appended with a sequential number starting from 1.
5053
5054 @item -fdisable-rtl-@var{pass}
5055 @item -fdisable-rtl-@var{pass}=@var{range-list}
5056 Disable rtl pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5057 statically invoked in the compiler multiple times, the pass name should be
5058 appended with a sequential number starting from 1.  @var{range-list} is a comma
5059 seperated list of function ranges.  Each range is a number pair seperated by a colon.
5060 The range is inclusive in both ends.  If the range is trivial, the number pair can be
5061 simplified a a single number.  If the function's cgraph node's @var{uid} is falling
5062 within one of the specified ranges, the @var{pass} is disabled for that function.
5063 The @var{uid} is shown in the function header of a dump file.
5064
5065 @item -fdisable-tree-@var{pass}
5066 @item -fdisable-tree-@var{pass}=@var{range-list}
5067 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5068 option arguments.
5069
5070 @item -fenable-ipa-@var{pass}
5071 Enable ipa pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5072 statically invoked in the compiler multiple times, the pass name should be
5073 appended with a sequential number starting from 1.
5074
5075 @item -fenable-rtl-@var{pass}
5076 @item -fenable-rtl-@var{pass}=@var{range-list}
5077 Enable rtl pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5078 description and examples.
5079
5080 @item -fenable-tree-@var{pass}
5081 @item -fenable-tree-@var{pass}=@var{range-list}
5082 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5083 of option arguments.
5084
5085 @smallexample
5086
5087 # disable ccp1 for all functions
5088    -fdisable-tree-ccp1
5089 # disable complete unroll for function whose cgraph node uid is 1
5090    -fenable-tree-cunroll=1
5091 # disable gcse2 for functions at the following ranges [1,1],
5092 # [300,400], and [400,1000]
5093    -fdisable-rtl-gcse2=1:100,300,400:1000
5094 # disable early inlining
5095    -fdisable-tree-einline
5096 # disable ipa inlining
5097    -fdisable-ipa-inline
5098 # enable tree full unroll
5099    -fenable-tree-unroll
5100
5101 @end smallexample
5102
5103 @end itemize
5104
5105 @item -d@var{letters}
5106 @itemx -fdump-rtl-@var{pass}
5107 @opindex d
5108 Says to make debugging dumps during compilation at times specified by
5109 @var{letters}.  This is used for debugging the RTL-based passes of the
5110 compiler.  The file names for most of the dumps are made by appending
5111 a pass number and a word to the @var{dumpname}, and the files are
5112 created in the directory of the output file.  Note that the pass
5113 number is computed statically as passes get registered into the pass
5114 manager.  Thus the numbering is not related to the dynamic order of
5115 execution of passes.  In particular, a pass installed by a plugin
5116 could have a number over 200 even if it executed quite early.
5117 @var{dumpname} is generated from the name of the output file, if
5118 explicitly specified and it is not an executable, otherwise it is the
5119 basename of the source file. These switches may have different effects
5120 when @option{-E} is used for preprocessing.
5121
5122 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5123 @option{-d} option @var{letters}.  Here are the possible
5124 letters for use in @var{pass} and @var{letters}, and their meanings:
5125
5126 @table @gcctabopt
5127
5128 @item -fdump-rtl-alignments
5129 @opindex fdump-rtl-alignments
5130 Dump after branch alignments have been computed.
5131
5132 @item -fdump-rtl-asmcons
5133 @opindex fdump-rtl-asmcons
5134 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5135
5136 @item -fdump-rtl-auto_inc_dec
5137 @opindex fdump-rtl-auto_inc_dec
5138 Dump after auto-inc-dec discovery.  This pass is only run on
5139 architectures that have auto inc or auto dec instructions.
5140
5141 @item -fdump-rtl-barriers
5142 @opindex fdump-rtl-barriers
5143 Dump after cleaning up the barrier instructions.
5144
5145 @item -fdump-rtl-bbpart
5146 @opindex fdump-rtl-bbpart
5147 Dump after partitioning hot and cold basic blocks.
5148
5149 @item -fdump-rtl-bbro
5150 @opindex fdump-rtl-bbro
5151 Dump after block reordering.
5152
5153 @item -fdump-rtl-btl1
5154 @itemx -fdump-rtl-btl2
5155 @opindex fdump-rtl-btl2
5156 @opindex fdump-rtl-btl2
5157 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5158 after the two branch
5159 target load optimization passes.
5160
5161 @item -fdump-rtl-bypass
5162 @opindex fdump-rtl-bypass
5163 Dump after jump bypassing and control flow optimizations.
5164
5165 @item -fdump-rtl-combine
5166 @opindex fdump-rtl-combine
5167 Dump after the RTL instruction combination pass.
5168
5169 @item -fdump-rtl-compgotos
5170 @opindex fdump-rtl-compgotos
5171 Dump after duplicating the computed gotos.
5172
5173 @item -fdump-rtl-ce1
5174 @itemx -fdump-rtl-ce2
5175 @itemx -fdump-rtl-ce3
5176 @opindex fdump-rtl-ce1
5177 @opindex fdump-rtl-ce2
5178 @opindex fdump-rtl-ce3
5179 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5180 @option{-fdump-rtl-ce3} enable dumping after the three
5181 if conversion passes.
5182
5183 @itemx -fdump-rtl-cprop_hardreg
5184 @opindex fdump-rtl-cprop_hardreg
5185 Dump after hard register copy propagation.
5186
5187 @itemx -fdump-rtl-csa
5188 @opindex fdump-rtl-csa
5189 Dump after combining stack adjustments.
5190
5191 @item -fdump-rtl-cse1
5192 @itemx -fdump-rtl-cse2
5193 @opindex fdump-rtl-cse1
5194 @opindex fdump-rtl-cse2
5195 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5196 the two common sub-expression elimination passes.
5197
5198 @itemx -fdump-rtl-dce
5199 @opindex fdump-rtl-dce
5200 Dump after the standalone dead code elimination passes.
5201
5202 @itemx -fdump-rtl-dbr
5203 @opindex fdump-rtl-dbr
5204 Dump after delayed branch scheduling.
5205
5206 @item -fdump-rtl-dce1
5207 @itemx -fdump-rtl-dce2
5208 @opindex fdump-rtl-dce1
5209 @opindex fdump-rtl-dce2
5210 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5211 the two dead store elimination passes.
5212
5213 @item -fdump-rtl-eh
5214 @opindex fdump-rtl-eh
5215 Dump after finalization of EH handling code.
5216
5217 @item -fdump-rtl-eh_ranges
5218 @opindex fdump-rtl-eh_ranges
5219 Dump after conversion of EH handling range regions.
5220
5221 @item -fdump-rtl-expand
5222 @opindex fdump-rtl-expand
5223 Dump after RTL generation.
5224
5225 @item -fdump-rtl-fwprop1
5226 @itemx -fdump-rtl-fwprop2
5227 @opindex fdump-rtl-fwprop1
5228 @opindex fdump-rtl-fwprop2
5229 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5230 dumping after the two forward propagation passes.
5231
5232 @item -fdump-rtl-gcse1
5233 @itemx -fdump-rtl-gcse2
5234 @opindex fdump-rtl-gcse1
5235 @opindex fdump-rtl-gcse2
5236 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5237 after global common subexpression elimination.
5238
5239 @item -fdump-rtl-init-regs
5240 @opindex fdump-rtl-init-regs
5241 Dump after the initialization of the registers.
5242
5243 @item -fdump-rtl-initvals
5244 @opindex fdump-rtl-initvals
5245 Dump after the computation of the initial value sets.
5246
5247 @itemx -fdump-rtl-into_cfglayout
5248 @opindex fdump-rtl-into_cfglayout
5249 Dump after converting to cfglayout mode.
5250
5251 @item -fdump-rtl-ira
5252 @opindex fdump-rtl-ira
5253 Dump after iterated register allocation.
5254
5255 @item -fdump-rtl-jump
5256 @opindex fdump-rtl-jump
5257 Dump after the second jump optimization.
5258
5259 @item -fdump-rtl-loop2
5260 @opindex fdump-rtl-loop2
5261 @option{-fdump-rtl-loop2} enables dumping after the rtl
5262 loop optimization passes.
5263
5264 @item -fdump-rtl-mach
5265 @opindex fdump-rtl-mach
5266 Dump after performing the machine dependent reorganization pass, if that
5267 pass exists.
5268
5269 @item -fdump-rtl-mode_sw
5270 @opindex fdump-rtl-mode_sw
5271 Dump after removing redundant mode switches.
5272
5273 @item -fdump-rtl-rnreg
5274 @opindex fdump-rtl-rnreg
5275 Dump after register renumbering.
5276
5277 @itemx -fdump-rtl-outof_cfglayout
5278 @opindex fdump-rtl-outof_cfglayout
5279 Dump after converting from cfglayout mode.
5280
5281 @item -fdump-rtl-peephole2
5282 @opindex fdump-rtl-peephole2
5283 Dump after the peephole pass.
5284
5285 @item -fdump-rtl-postreload
5286 @opindex fdump-rtl-postreload
5287 Dump after post-reload optimizations.
5288
5289 @itemx -fdump-rtl-pro_and_epilogue
5290 @opindex fdump-rtl-pro_and_epilogue
5291 Dump after generating the function pro and epilogues.
5292
5293 @item -fdump-rtl-regmove
5294 @opindex fdump-rtl-regmove
5295 Dump after the register move pass.
5296
5297 @item -fdump-rtl-sched1
5298 @itemx -fdump-rtl-sched2
5299 @opindex fdump-rtl-sched1
5300 @opindex fdump-rtl-sched2
5301 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5302 after the basic block scheduling passes.
5303
5304 @item -fdump-rtl-see
5305 @opindex fdump-rtl-see
5306 Dump after sign extension elimination.
5307
5308 @item -fdump-rtl-seqabstr
5309 @opindex fdump-rtl-seqabstr
5310 Dump after common sequence discovery.
5311
5312 @item -fdump-rtl-shorten
5313 @opindex fdump-rtl-shorten
5314 Dump after shortening branches.
5315
5316 @item -fdump-rtl-sibling
5317 @opindex fdump-rtl-sibling
5318 Dump after sibling call optimizations.
5319
5320 @item -fdump-rtl-split1
5321 @itemx -fdump-rtl-split2
5322 @itemx -fdump-rtl-split3
5323 @itemx -fdump-rtl-split4
5324 @itemx -fdump-rtl-split5
5325 @opindex fdump-rtl-split1
5326 @opindex fdump-rtl-split2
5327 @opindex fdump-rtl-split3
5328 @opindex fdump-rtl-split4
5329 @opindex fdump-rtl-split5
5330 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5331 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5332 @option{-fdump-rtl-split5} enable dumping after five rounds of
5333 instruction splitting.
5334
5335 @item -fdump-rtl-sms
5336 @opindex fdump-rtl-sms
5337 Dump after modulo scheduling.  This pass is only run on some
5338 architectures.
5339
5340 @item -fdump-rtl-stack
5341 @opindex fdump-rtl-stack
5342 Dump after conversion from GCC's "flat register file" registers to the
5343 x87's stack-like registers.  This pass is only run on x86 variants.
5344
5345 @item -fdump-rtl-subreg1
5346 @itemx -fdump-rtl-subreg2
5347 @opindex fdump-rtl-subreg1
5348 @opindex fdump-rtl-subreg2
5349 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5350 the two subreg expansion passes.
5351
5352 @item -fdump-rtl-unshare
5353 @opindex fdump-rtl-unshare
5354 Dump after all rtl has been unshared.
5355
5356 @item -fdump-rtl-vartrack
5357 @opindex fdump-rtl-vartrack
5358 Dump after variable tracking.
5359
5360 @item -fdump-rtl-vregs
5361 @opindex fdump-rtl-vregs
5362 Dump after converting virtual registers to hard registers.
5363
5364 @item -fdump-rtl-web
5365 @opindex fdump-rtl-web
5366 Dump after live range splitting.
5367
5368 @item -fdump-rtl-regclass
5369 @itemx -fdump-rtl-subregs_of_mode_init
5370 @itemx -fdump-rtl-subregs_of_mode_finish
5371 @itemx -fdump-rtl-dfinit
5372 @itemx -fdump-rtl-dfinish
5373 @opindex fdump-rtl-regclass
5374 @opindex fdump-rtl-subregs_of_mode_init
5375 @opindex fdump-rtl-subregs_of_mode_finish
5376 @opindex fdump-rtl-dfinit
5377 @opindex fdump-rtl-dfinish
5378 These dumps are defined but always produce empty files.
5379
5380 @item -fdump-rtl-all
5381 @opindex fdump-rtl-all
5382 Produce all the dumps listed above.
5383
5384 @item -dA
5385 @opindex dA
5386 Annotate the assembler output with miscellaneous debugging information.
5387
5388 @item -dD
5389 @opindex dD
5390 Dump all macro definitions, at the end of preprocessing, in addition to
5391 normal output.
5392
5393 @item -dH
5394 @opindex dH
5395 Produce a core dump whenever an error occurs.
5396
5397 @item -dm
5398 @opindex dm
5399 Print statistics on memory usage, at the end of the run, to
5400 standard error.
5401
5402 @item -dp
5403 @opindex dp
5404 Annotate the assembler output with a comment indicating which
5405 pattern and alternative was used.  The length of each instruction is
5406 also printed.
5407
5408 @item -dP
5409 @opindex dP
5410 Dump the RTL in the assembler output as a comment before each instruction.
5411 Also turns on @option{-dp} annotation.
5412
5413 @item -dv
5414 @opindex dv
5415 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5416 dump a representation of the control flow graph suitable for viewing with VCG
5417 to @file{@var{file}.@var{pass}.vcg}.
5418
5419 @item -dx
5420 @opindex dx
5421 Just generate RTL for a function instead of compiling it.  Usually used
5422 with @option{-fdump-rtl-expand}.
5423 @end table
5424
5425 @item -fdump-noaddr
5426 @opindex fdump-noaddr
5427 When doing debugging dumps, suppress address output.  This makes it more
5428 feasible to use diff on debugging dumps for compiler invocations with
5429 different compiler binaries and/or different
5430 text / bss / data / heap / stack / dso start locations.
5431
5432 @item -fdump-unnumbered
5433 @opindex fdump-unnumbered
5434 When doing debugging dumps, suppress instruction numbers and address output.
5435 This makes it more feasible to use diff on debugging dumps for compiler
5436 invocations with different options, in particular with and without
5437 @option{-g}.
5438
5439 @item -fdump-unnumbered-links
5440 @opindex fdump-unnumbered-links
5441 When doing debugging dumps (see @option{-d} option above), suppress
5442 instruction numbers for the links to the previous and next instructions
5443 in a sequence.
5444
5445 @item -fdump-translation-unit @r{(C++ only)}
5446 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5447 @opindex fdump-translation-unit
5448 Dump a representation of the tree structure for the entire translation
5449 unit to a file.  The file name is made by appending @file{.tu} to the
5450 source file name, and the file is created in the same directory as the
5451 output file.  If the @samp{-@var{options}} form is used, @var{options}
5452 controls the details of the dump as described for the
5453 @option{-fdump-tree} options.
5454
5455 @item -fdump-class-hierarchy @r{(C++ only)}
5456 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5457 @opindex fdump-class-hierarchy
5458 Dump a representation of each class's hierarchy and virtual function
5459 table layout to a file.  The file name is made by appending
5460 @file{.class} to the source file name, and the file is created in the
5461 same directory as the output file.  If the @samp{-@var{options}} form
5462 is used, @var{options} controls the details of the dump as described
5463 for the @option{-fdump-tree} options.
5464
5465 @item -fdump-ipa-@var{switch}
5466 @opindex fdump-ipa
5467 Control the dumping at various stages of inter-procedural analysis
5468 language tree to a file.  The file name is generated by appending a
5469 switch specific suffix to the source file name, and the file is created
5470 in the same directory as the output file.  The following dumps are
5471 possible:
5472
5473 @table @samp
5474 @item all
5475 Enables all inter-procedural analysis dumps.
5476
5477 @item cgraph
5478 Dumps information about call-graph optimization, unused function removal,
5479 and inlining decisions.
5480
5481 @item inline
5482 Dump after function inlining.
5483
5484 @end table
5485
5486 @item -fdump-statistics-@var{option}
5487 @opindex fdump-statistics
5488 Enable and control dumping of pass statistics in a separate file.  The
5489 file name is generated by appending a suffix ending in
5490 @samp{.statistics} to the source file name, and the file is created in
5491 the same directory as the output file.  If the @samp{-@var{option}}
5492 form is used, @samp{-stats} will cause counters to be summed over the
5493 whole compilation unit while @samp{-details} will dump every event as
5494 the passes generate them.  The default with no option is to sum
5495 counters for each function compiled.
5496
5497 @item -fdump-tree-@var{switch}
5498 @itemx -fdump-tree-@var{switch}-@var{options}
5499 @opindex fdump-tree
5500 Control the dumping at various stages of processing the intermediate
5501 language tree to a file.  The file name is generated by appending a
5502 switch specific suffix to the source file name, and the file is
5503 created in the same directory as the output file.  If the
5504 @samp{-@var{options}} form is used, @var{options} is a list of
5505 @samp{-} separated options that control the details of the dump.  Not
5506 all options are applicable to all dumps, those which are not
5507 meaningful will be ignored.  The following options are available
5508
5509 @table @samp
5510 @item address
5511 Print the address of each node.  Usually this is not meaningful as it
5512 changes according to the environment and source file.  Its primary use
5513 is for tying up a dump file with a debug environment.
5514 @item asmname
5515 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5516 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5517 use working backward from mangled names in the assembly file.
5518 @item slim
5519 Inhibit dumping of members of a scope or body of a function merely
5520 because that scope has been reached.  Only dump such items when they
5521 are directly reachable by some other path.  When dumping pretty-printed
5522 trees, this option inhibits dumping the bodies of control structures.
5523 @item raw
5524 Print a raw representation of the tree.  By default, trees are
5525 pretty-printed into a C-like representation.
5526 @item details
5527 Enable more detailed dumps (not honored by every dump option).
5528 @item stats
5529 Enable dumping various statistics about the pass (not honored by every dump
5530 option).
5531 @item blocks
5532 Enable showing basic block boundaries (disabled in raw dumps).
5533 @item vops
5534 Enable showing virtual operands for every statement.
5535 @item lineno
5536 Enable showing line numbers for statements.
5537 @item uid
5538 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5539 @item verbose
5540 Enable showing the tree dump for each statement.
5541 @item eh
5542 Enable showing the EH region number holding each statement.
5543 @item all
5544 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5545 and @option{lineno}.
5546 @end table
5547
5548 The following tree dumps are possible:
5549 @table @samp
5550
5551 @item original
5552 @opindex fdump-tree-original
5553 Dump before any tree based optimization, to @file{@var{file}.original}.
5554
5555 @item optimized
5556 @opindex fdump-tree-optimized
5557 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5558
5559 @item gimple
5560 @opindex fdump-tree-gimple
5561 Dump each function before and after the gimplification pass to a file.  The
5562 file name is made by appending @file{.gimple} to the source file name.
5563
5564 @item cfg
5565 @opindex fdump-tree-cfg
5566 Dump the control flow graph of each function to a file.  The file name is
5567 made by appending @file{.cfg} to the source file name.
5568
5569 @item vcg
5570 @opindex fdump-tree-vcg
5571 Dump the control flow graph of each function to a file in VCG format.  The
5572 file name is made by appending @file{.vcg} to the source file name.  Note
5573 that if the file contains more than one function, the generated file cannot
5574 be used directly by VCG@.  You will need to cut and paste each function's
5575 graph into its own separate file first.
5576
5577 @item ch
5578 @opindex fdump-tree-ch
5579 Dump each function after copying loop headers.  The file name is made by
5580 appending @file{.ch} to the source file name.
5581
5582 @item ssa
5583 @opindex fdump-tree-ssa
5584 Dump SSA related information to a file.  The file name is made by appending
5585 @file{.ssa} to the source file name.
5586
5587 @item alias
5588 @opindex fdump-tree-alias
5589 Dump aliasing information for each function.  The file name is made by
5590 appending @file{.alias} to the source file name.
5591
5592 @item ccp
5593 @opindex fdump-tree-ccp
5594 Dump each function after CCP@.  The file name is made by appending
5595 @file{.ccp} to the source file name.
5596
5597 @item storeccp
5598 @opindex fdump-tree-storeccp
5599 Dump each function after STORE-CCP@.  The file name is made by appending
5600 @file{.storeccp} to the source file name.
5601
5602 @item pre
5603 @opindex fdump-tree-pre
5604 Dump trees after partial redundancy elimination.  The file name is made
5605 by appending @file{.pre} to the source file name.
5606
5607 @item fre
5608 @opindex fdump-tree-fre
5609 Dump trees after full redundancy elimination.  The file name is made
5610 by appending @file{.fre} to the source file name.
5611
5612 @item copyprop
5613 @opindex fdump-tree-copyprop
5614 Dump trees after copy propagation.  The file name is made
5615 by appending @file{.copyprop} to the source file name.
5616
5617 @item store_copyprop
5618 @opindex fdump-tree-store_copyprop
5619 Dump trees after store copy-propagation.  The file name is made
5620 by appending @file{.store_copyprop} to the source file name.
5621
5622 @item dce
5623 @opindex fdump-tree-dce
5624 Dump each function after dead code elimination.  The file name is made by
5625 appending @file{.dce} to the source file name.
5626
5627 @item mudflap
5628 @opindex fdump-tree-mudflap
5629 Dump each function after adding mudflap instrumentation.  The file name is
5630 made by appending @file{.mudflap} to the source file name.
5631
5632 @item sra
5633 @opindex fdump-tree-sra
5634 Dump each function after performing scalar replacement of aggregates.  The
5635 file name is made by appending @file{.sra} to the source file name.
5636
5637 @item sink
5638 @opindex fdump-tree-sink
5639 Dump each function after performing code sinking.  The file name is made
5640 by appending @file{.sink} to the source file name.
5641
5642 @item dom
5643 @opindex fdump-tree-dom
5644 Dump each function after applying dominator tree optimizations.  The file
5645 name is made by appending @file{.dom} to the source file name.
5646
5647 @item dse
5648 @opindex fdump-tree-dse
5649 Dump each function after applying dead store elimination.  The file
5650 name is made by appending @file{.dse} to the source file name.
5651
5652 @item phiopt
5653 @opindex fdump-tree-phiopt
5654 Dump each function after optimizing PHI nodes into straightline code.  The file
5655 name is made by appending @file{.phiopt} to the source file name.
5656
5657 @item forwprop
5658 @opindex fdump-tree-forwprop
5659 Dump each function after forward propagating single use variables.  The file
5660 name is made by appending @file{.forwprop} to the source file name.
5661
5662 @item copyrename
5663 @opindex fdump-tree-copyrename
5664 Dump each function after applying the copy rename optimization.  The file
5665 name is made by appending @file{.copyrename} to the source file name.
5666
5667 @item nrv
5668 @opindex fdump-tree-nrv
5669 Dump each function after applying the named return value optimization on
5670 generic trees.  The file name is made by appending @file{.nrv} to the source
5671 file name.
5672
5673 @item vect
5674 @opindex fdump-tree-vect
5675 Dump each function after applying vectorization of loops.  The file name is
5676 made by appending @file{.vect} to the source file name.
5677
5678 @item slp
5679 @opindex fdump-tree-slp
5680 Dump each function after applying vectorization of basic blocks.  The file name
5681 is made by appending @file{.slp} to the source file name.
5682
5683 @item vrp
5684 @opindex fdump-tree-vrp
5685 Dump each function after Value Range Propagation (VRP).  The file name
5686 is made by appending @file{.vrp} to the source file name.
5687
5688 @item all
5689 @opindex fdump-tree-all
5690 Enable all the available tree dumps with the flags provided in this option.
5691 @end table
5692
5693 @item -ftree-vectorizer-verbose=@var{n}
5694 @opindex ftree-vectorizer-verbose
5695 This option controls the amount of debugging output the vectorizer prints.
5696 This information is written to standard error, unless
5697 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5698 in which case it is output to the usual dump listing file, @file{.vect}.
5699 For @var{n}=0 no diagnostic information is reported.
5700 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5701 and the total number of loops that got vectorized.
5702 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5703 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5704 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5705 level that @option{-fdump-tree-vect-stats} uses.
5706 Higher verbosity levels mean either more information dumped for each
5707 reported loop, or same amount of information reported for more loops:
5708 if @var{n}=3, vectorizer cost model information is reported.
5709 If @var{n}=4, alignment related information is added to the reports.
5710 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5711 memory access-patterns) is added to the reports.
5712 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5713 that did not pass the first analysis phase (i.e., may not be countable, or
5714 may have complicated control-flow).
5715 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5716 If @var{n}=8, SLP related information is added to the reports.
5717 For @var{n}=9, all the information the vectorizer generates during its
5718 analysis and transformation is reported.  This is the same verbosity level
5719 that @option{-fdump-tree-vect-details} uses.
5720
5721 @item -frandom-seed=@var{string}
5722 @opindex frandom-seed
5723 This option provides a seed that GCC uses when it would otherwise use
5724 random numbers.  It is used to generate certain symbol names
5725 that have to be different in every compiled file.  It is also used to
5726 place unique stamps in coverage data files and the object files that
5727 produce them.  You can use the @option{-frandom-seed} option to produce
5728 reproducibly identical object files.
5729
5730 The @var{string} should be different for every file you compile.
5731
5732 @item -fsched-verbose=@var{n}
5733 @opindex fsched-verbose
5734 On targets that use instruction scheduling, this option controls the
5735 amount of debugging output the scheduler prints.  This information is
5736 written to standard error, unless @option{-fdump-rtl-sched1} or
5737 @option{-fdump-rtl-sched2} is specified, in which case it is output
5738 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5739 respectively.  However for @var{n} greater than nine, the output is
5740 always printed to standard error.
5741
5742 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5743 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5744 For @var{n} greater than one, it also output basic block probabilities,
5745 detailed ready list information and unit/insn info.  For @var{n} greater
5746 than two, it includes RTL at abort point, control-flow and regions info.
5747 And for @var{n} over four, @option{-fsched-verbose} also includes
5748 dependence info.
5749
5750 @item -save-temps
5751 @itemx -save-temps=cwd
5752 @opindex save-temps
5753 Store the usual ``temporary'' intermediate files permanently; place them
5754 in the current directory and name them based on the source file.  Thus,
5755 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5756 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5757 preprocessed @file{foo.i} output file even though the compiler now
5758 normally uses an integrated preprocessor.
5759
5760 When used in combination with the @option{-x} command line option,
5761 @option{-save-temps} is sensible enough to avoid over writing an
5762 input source file with the same extension as an intermediate file.
5763 The corresponding intermediate file may be obtained by renaming the
5764 source file before using @option{-save-temps}.
5765
5766 If you invoke GCC in parallel, compiling several different source
5767 files that share a common base name in different subdirectories or the
5768 same source file compiled for multiple output destinations, it is
5769 likely that the different parallel compilers will interfere with each
5770 other, and overwrite the temporary files.  For instance:
5771
5772 @smallexample
5773 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5774 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5775 @end smallexample
5776
5777 may result in @file{foo.i} and @file{foo.o} being written to
5778 simultaneously by both compilers.
5779
5780 @item -save-temps=obj
5781 @opindex save-temps=obj
5782 Store the usual ``temporary'' intermediate files permanently.  If the
5783 @option{-o} option is used, the temporary files are based on the
5784 object file.  If the @option{-o} option is not used, the
5785 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5786
5787 For example:
5788
5789 @smallexample
5790 gcc -save-temps=obj -c foo.c
5791 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5792 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5793 @end smallexample
5794
5795 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5796 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5797 @file{dir2/yfoobar.o}.
5798
5799 @item -time@r{[}=@var{file}@r{]}
5800 @opindex time
5801 Report the CPU time taken by each subprocess in the compilation
5802 sequence.  For C source files, this is the compiler proper and assembler
5803 (plus the linker if linking is done).
5804
5805 Without the specification of an output file, the output looks like this:
5806
5807 @smallexample
5808 # cc1 0.12 0.01
5809 # as 0.00 0.01
5810 @end smallexample
5811
5812 The first number on each line is the ``user time'', that is time spent
5813 executing the program itself.  The second number is ``system time'',
5814 time spent executing operating system routines on behalf of the program.
5815 Both numbers are in seconds.
5816
5817 With the specification of an output file, the output is appended to the
5818 named file, and it looks like this:
5819
5820 @smallexample
5821 0.12 0.01 cc1 @var{options}
5822 0.00 0.01 as @var{options}
5823 @end smallexample
5824
5825 The ``user time'' and the ``system time'' are moved before the program
5826 name, and the options passed to the program are displayed, so that one
5827 can later tell what file was being compiled, and with which options.
5828
5829 @item -fvar-tracking
5830 @opindex fvar-tracking
5831 Run variable tracking pass.  It computes where variables are stored at each
5832 position in code.  Better debugging information is then generated
5833 (if the debugging information format supports this information).
5834
5835 It is enabled by default when compiling with optimization (@option{-Os},
5836 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5837 the debug info format supports it.
5838
5839 @item -fvar-tracking-assignments
5840 @opindex fvar-tracking-assignments
5841 @opindex fno-var-tracking-assignments
5842 Annotate assignments to user variables early in the compilation and
5843 attempt to carry the annotations over throughout the compilation all the
5844 way to the end, in an attempt to improve debug information while
5845 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
5846
5847 It can be enabled even if var-tracking is disabled, in which case
5848 annotations will be created and maintained, but discarded at the end.
5849
5850 @item -fvar-tracking-assignments-toggle
5851 @opindex fvar-tracking-assignments-toggle
5852 @opindex fno-var-tracking-assignments-toggle
5853 Toggle @option{-fvar-tracking-assignments}, in the same way that
5854 @option{-gtoggle} toggles @option{-g}.
5855
5856 @item -print-file-name=@var{library}
5857 @opindex print-file-name
5858 Print the full absolute name of the library file @var{library} that
5859 would be used when linking---and don't do anything else.  With this
5860 option, GCC does not compile or link anything; it just prints the
5861 file name.
5862
5863 @item -print-multi-directory
5864 @opindex print-multi-directory
5865 Print the directory name corresponding to the multilib selected by any
5866 other switches present in the command line.  This directory is supposed
5867 to exist in @env{GCC_EXEC_PREFIX}.
5868
5869 @item -print-multi-lib
5870 @opindex print-multi-lib
5871 Print the mapping from multilib directory names to compiler switches
5872 that enable them.  The directory name is separated from the switches by
5873 @samp{;}, and each switch starts with an @samp{@@} instead of the
5874 @samp{-}, without spaces between multiple switches.  This is supposed to
5875 ease shell-processing.
5876
5877 @item -print-multi-os-directory
5878 @opindex print-multi-os-directory
5879 Print the path to OS libraries for the selected
5880 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
5881 present in the @file{lib} subdirectory and no multilibs are used, this is
5882 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
5883 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
5884 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
5885 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
5886
5887 @item -print-prog-name=@var{program}
5888 @opindex print-prog-name
5889 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5890
5891 @item -print-libgcc-file-name
5892 @opindex print-libgcc-file-name
5893 Same as @option{-print-file-name=libgcc.a}.
5894
5895 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5896 but you do want to link with @file{libgcc.a}.  You can do
5897
5898 @smallexample
5899 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5900 @end smallexample
5901
5902 @item -print-search-dirs
5903 @opindex print-search-dirs
5904 Print the name of the configured installation directory and a list of
5905 program and library directories @command{gcc} will search---and don't do anything else.
5906
5907 This is useful when @command{gcc} prints the error message
5908 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5909 To resolve this you either need to put @file{cpp0} and the other compiler
5910 components where @command{gcc} expects to find them, or you can set the environment
5911 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5912 Don't forget the trailing @samp{/}.
5913 @xref{Environment Variables}.
5914
5915 @item -print-sysroot
5916 @opindex print-sysroot
5917 Print the target sysroot directory that will be used during
5918 compilation.  This is the target sysroot specified either at configure
5919 time or using the @option{--sysroot} option, possibly with an extra
5920 suffix that depends on compilation options.  If no target sysroot is
5921 specified, the option prints nothing.
5922
5923 @item -print-sysroot-headers-suffix
5924 @opindex print-sysroot-headers-suffix
5925 Print the suffix added to the target sysroot when searching for
5926 headers, or give an error if the compiler is not configured with such
5927 a suffix---and don't do anything else.
5928
5929 @item -dumpmachine
5930 @opindex dumpmachine
5931 Print the compiler's target machine (for example,
5932 @samp{i686-pc-linux-gnu})---and don't do anything else.
5933
5934 @item -dumpversion
5935 @opindex dumpversion
5936 Print the compiler version (for example, @samp{3.0})---and don't do
5937 anything else.
5938
5939 @item -dumpspecs
5940 @opindex dumpspecs
5941 Print the compiler's built-in specs---and don't do anything else.  (This
5942 is used when GCC itself is being built.)  @xref{Spec Files}.
5943
5944 @item -feliminate-unused-debug-types
5945 @opindex feliminate-unused-debug-types
5946 Normally, when producing DWARF2 output, GCC will emit debugging
5947 information for all types declared in a compilation
5948 unit, regardless of whether or not they are actually used
5949 in that compilation unit.  Sometimes this is useful, such as
5950 if, in the debugger, you want to cast a value to a type that is
5951 not actually used in your program (but is declared).  More often,
5952 however, this results in a significant amount of wasted space.
5953 With this option, GCC will avoid producing debug symbol output
5954 for types that are nowhere used in the source file being compiled.
5955 @end table
5956
5957 @node Optimize Options
5958 @section Options That Control Optimization
5959 @cindex optimize options
5960 @cindex options, optimization
5961
5962 These options control various sorts of optimizations.
5963
5964 Without any optimization option, the compiler's goal is to reduce the
5965 cost of compilation and to make debugging produce the expected
5966 results.  Statements are independent: if you stop the program with a
5967 breakpoint between statements, you can then assign a new value to any
5968 variable or change the program counter to any other statement in the
5969 function and get exactly the results you would expect from the source
5970 code.
5971
5972 Turning on optimization flags makes the compiler attempt to improve
5973 the performance and/or code size at the expense of compilation time
5974 and possibly the ability to debug the program.
5975
5976 The compiler performs optimization based on the knowledge it has of the
5977 program.  Compiling multiple files at once to a single output file mode allows
5978 the compiler to use information gained from all of the files when compiling
5979 each of them.
5980
5981 Not all optimizations are controlled directly by a flag.  Only
5982 optimizations that have a flag are listed in this section.
5983
5984 Most optimizations are only enabled if an @option{-O} level is set on
5985 the command line.  Otherwise they are disabled, even if individual
5986 optimization flags are specified.
5987
5988 Depending on the target and how GCC was configured, a slightly different
5989 set of optimizations may be enabled at each @option{-O} level than
5990 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
5991 to find out the exact set of optimizations that are enabled at each level.
5992 @xref{Overall Options}, for examples.
5993
5994 @table @gcctabopt
5995 @item -O
5996 @itemx -O1
5997 @opindex O
5998 @opindex O1
5999 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6000 more memory for a large function.
6001
6002 With @option{-O}, the compiler tries to reduce code size and execution
6003 time, without performing any optimizations that take a great deal of
6004 compilation time.
6005
6006 @option{-O} turns on the following optimization flags:
6007 @gccoptlist{
6008 -fauto-inc-dec @gol
6009 -fcompare-elim @gol
6010 -fcprop-registers @gol
6011 -fdce @gol
6012 -fdefer-pop @gol
6013 -fdelayed-branch @gol
6014 -fdse @gol
6015 -fguess-branch-probability @gol
6016 -fif-conversion2 @gol
6017 -fif-conversion @gol
6018 -fipa-pure-const @gol
6019 -fipa-profile @gol
6020 -fipa-reference @gol
6021 -fmerge-constants
6022 -fsplit-wide-types @gol
6023 -ftree-bit-ccp @gol
6024 -ftree-builtin-call-dce @gol
6025 -ftree-ccp @gol
6026 -ftree-ch @gol
6027 -ftree-copyrename @gol
6028 -ftree-dce @gol
6029 -ftree-dominator-opts @gol
6030 -ftree-dse @gol
6031 -ftree-forwprop @gol
6032 -ftree-fre @gol
6033 -ftree-phiprop @gol
6034 -ftree-sra @gol
6035 -ftree-pta @gol
6036 -ftree-ter @gol
6037 -funit-at-a-time}
6038
6039 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6040 where doing so does not interfere with debugging.
6041
6042 @item -O2
6043 @opindex O2
6044 Optimize even more.  GCC performs nearly all supported optimizations
6045 that do not involve a space-speed tradeoff.
6046 As compared to @option{-O}, this option increases both compilation time
6047 and the performance of the generated code.
6048
6049 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6050 also turns on the following optimization flags:
6051 @gccoptlist{-fthread-jumps @gol
6052 -falign-functions  -falign-jumps @gol
6053 -falign-loops  -falign-labels @gol
6054 -fcaller-saves @gol
6055 -fcrossjumping @gol
6056 -fcse-follow-jumps  -fcse-skip-blocks @gol
6057 -fdelete-null-pointer-checks @gol
6058 -fdevirtualize @gol
6059 -fexpensive-optimizations @gol
6060 -fgcse  -fgcse-lm  @gol
6061 -finline-small-functions @gol
6062 -findirect-inlining @gol
6063 -fipa-sra @gol
6064 -foptimize-sibling-calls @gol
6065 -fpartial-inlining @gol
6066 -fpeephole2 @gol
6067 -fregmove @gol
6068 -freorder-blocks  -freorder-functions @gol
6069 -frerun-cse-after-loop  @gol
6070 -fsched-interblock  -fsched-spec @gol
6071 -fschedule-insns  -fschedule-insns2 @gol
6072 -fstrict-aliasing -fstrict-overflow @gol
6073 -ftree-switch-conversion @gol
6074 -ftree-pre @gol
6075 -ftree-vrp}
6076
6077 Please note the warning under @option{-fgcse} about
6078 invoking @option{-O2} on programs that use computed gotos.
6079
6080 @item -O3
6081 @opindex O3
6082 Optimize yet more.  @option{-O3} turns on all optimizations specified
6083 by @option{-O2} and also turns on the @option{-finline-functions},
6084 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6085 @option{-fgcse-after-reload}, @option{-ftree-vectorize} and
6086 @option{-fipa-cp-clone} options.
6087
6088 @item -O0
6089 @opindex O0
6090 Reduce compilation time and make debugging produce the expected
6091 results.  This is the default.
6092
6093 @item -Os
6094 @opindex Os
6095 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6096 do not typically increase code size.  It also performs further
6097 optimizations designed to reduce code size.
6098
6099 @option{-Os} disables the following optimization flags:
6100 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6101 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6102 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6103
6104 @item -Ofast
6105 @opindex Ofast
6106 Disregard strict standards compliance.  @option{-Ofast} enables all
6107 @option{-O3} optimizations.  It also enables optimizations that are not
6108 valid for all standard compliant programs.
6109 It turns on @option{-ffast-math} and the Fortran-specific
6110 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6111
6112 If you use multiple @option{-O} options, with or without level numbers,
6113 the last such option is the one that is effective.
6114 @end table
6115
6116 Options of the form @option{-f@var{flag}} specify machine-independent
6117 flags.  Most flags have both positive and negative forms; the negative
6118 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
6119 below, only one of the forms is listed---the one you typically will
6120 use.  You can figure out the other form by either removing @samp{no-}
6121 or adding it.
6122
6123 The following options control specific optimizations.  They are either
6124 activated by @option{-O} options or are related to ones that are.  You
6125 can use the following flags in the rare cases when ``fine-tuning'' of
6126 optimizations to be performed is desired.
6127
6128 @table @gcctabopt
6129 @item -fno-default-inline
6130 @opindex fno-default-inline
6131 Do not make member functions inline by default merely because they are
6132 defined inside the class scope (C++ only).  Otherwise, when you specify
6133 @w{@option{-O}}, member functions defined inside class scope are compiled
6134 inline by default; i.e., you don't need to add @samp{inline} in front of
6135 the member function name.
6136
6137 @item -fno-defer-pop
6138 @opindex fno-defer-pop
6139 Always pop the arguments to each function call as soon as that function
6140 returns.  For machines which must pop arguments after a function call,
6141 the compiler normally lets arguments accumulate on the stack for several
6142 function calls and pops them all at once.
6143
6144 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6145
6146 @item -fforward-propagate
6147 @opindex fforward-propagate
6148 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6149 instructions and checks if the result can be simplified.  If loop unrolling
6150 is active, two passes are performed and the second is scheduled after
6151 loop unrolling.
6152
6153 This option is enabled by default at optimization levels @option{-O},
6154 @option{-O2}, @option{-O3}, @option{-Os}.
6155
6156 @item -ffp-contract=@var{style}
6157 @opindex ffp-contract
6158 @option{-ffp-contract=off} disables floating-point expression contraction.
6159 @option{-ffp-contract=fast} enables floating-point expression contraction
6160 such as forming of fused multiply-add operations if the target has
6161 native support for them.
6162 @option{-ffp-contract=on} enables floating-point expression contraction
6163 if allowed by the language standard.  This is currently not implemented
6164 and treated equal to @option{-ffp-contract=off}.
6165
6166 The default is @option{-ffp-contract=fast}.
6167
6168 @item -fomit-frame-pointer
6169 @opindex fomit-frame-pointer
6170 Don't keep the frame pointer in a register for functions that
6171 don't need one.  This avoids the instructions to save, set up and
6172 restore frame pointers; it also makes an extra register available
6173 in many functions.  @strong{It also makes debugging impossible on
6174 some machines.}
6175
6176 On some machines, such as the VAX, this flag has no effect, because
6177 the standard calling sequence automatically handles the frame pointer
6178 and nothing is saved by pretending it doesn't exist.  The
6179 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6180 whether a target machine supports this flag.  @xref{Registers,,Register
6181 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6182
6183 Starting with GCC version 4.6, the default setting (when not optimizing for
6184 size) for 32-bit Linux x86 and 32-bit Darwin x86 targets has been changed to
6185 @option{-fomit-frame-pointer}.  The default can be reverted to
6186 @option{-fno-omit-frame-pointer} by configuring GCC with the
6187 @option{--enable-frame-pointer} configure option.
6188
6189 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6190
6191 @item -foptimize-sibling-calls
6192 @opindex foptimize-sibling-calls
6193 Optimize sibling and tail recursive calls.
6194
6195 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6196
6197 @item -fno-inline
6198 @opindex fno-inline
6199 Don't pay attention to the @code{inline} keyword.  Normally this option
6200 is used to keep the compiler from expanding any functions inline.
6201 Note that if you are not optimizing, no functions can be expanded inline.
6202
6203 @item -finline-small-functions
6204 @opindex finline-small-functions
6205 Integrate functions into their callers when their body is smaller than expected
6206 function call code (so overall size of program gets smaller).  The compiler
6207 heuristically decides which functions are simple enough to be worth integrating
6208 in this way.
6209
6210 Enabled at level @option{-O2}.
6211
6212 @item -findirect-inlining
6213 @opindex findirect-inlining
6214 Inline also indirect calls that are discovered to be known at compile
6215 time thanks to previous inlining.  This option has any effect only
6216 when inlining itself is turned on by the @option{-finline-functions}
6217 or @option{-finline-small-functions} options.
6218
6219 Enabled at level @option{-O2}.
6220
6221 @item -finline-functions
6222 @opindex finline-functions
6223 Integrate all simple functions into their callers.  The compiler
6224 heuristically decides which functions are simple enough to be worth
6225 integrating in this way.
6226
6227 If all calls to a given function are integrated, and the function is
6228 declared @code{static}, then the function is normally not output as
6229 assembler code in its own right.
6230
6231 Enabled at level @option{-O3}.
6232
6233 @item -finline-functions-called-once
6234 @opindex finline-functions-called-once
6235 Consider all @code{static} functions called once for inlining into their
6236 caller even if they are not marked @code{inline}.  If a call to a given
6237 function is integrated, then the function is not output as assembler code
6238 in its own right.
6239
6240 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6241
6242 @item -fearly-inlining
6243 @opindex fearly-inlining
6244 Inline functions marked by @code{always_inline} and functions whose body seems
6245 smaller than the function call overhead early before doing
6246 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6247 makes profiling significantly cheaper and usually inlining faster on programs
6248 having large chains of nested wrapper functions.
6249
6250 Enabled by default.
6251
6252 @item -fipa-sra
6253 @opindex fipa-sra
6254 Perform interprocedural scalar replacement of aggregates, removal of
6255 unused parameters and replacement of parameters passed by reference
6256 by parameters passed by value.
6257
6258 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6259
6260 @item -finline-limit=@var{n}
6261 @opindex finline-limit
6262 By default, GCC limits the size of functions that can be inlined.  This flag
6263 allows coarse control of this limit.  @var{n} is the size of functions that
6264 can be inlined in number of pseudo instructions.
6265
6266 Inlining is actually controlled by a number of parameters, which may be
6267 specified individually by using @option{--param @var{name}=@var{value}}.
6268 The @option{-finline-limit=@var{n}} option sets some of these parameters
6269 as follows:
6270
6271 @table @gcctabopt
6272 @item max-inline-insns-single
6273 is set to @var{n}/2.
6274 @item max-inline-insns-auto
6275 is set to @var{n}/2.
6276 @end table
6277
6278 See below for a documentation of the individual
6279 parameters controlling inlining and for the defaults of these parameters.
6280
6281 @emph{Note:} there may be no value to @option{-finline-limit} that results
6282 in default behavior.
6283
6284 @emph{Note:} pseudo instruction represents, in this particular context, an
6285 abstract measurement of function's size.  In no way does it represent a count
6286 of assembly instructions and as such its exact meaning might change from one
6287 release to an another.
6288
6289 @item -fno-keep-inline-dllexport
6290 @opindex -fno-keep-inline-dllexport
6291 This is a more fine-grained version of @option{-fkeep-inline-functions},
6292 which applies only to functions that are declared using the @code{dllexport}
6293 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6294 Functions}.)
6295
6296 @item -fkeep-inline-functions
6297 @opindex fkeep-inline-functions
6298 In C, emit @code{static} functions that are declared @code{inline}
6299 into the object file, even if the function has been inlined into all
6300 of its callers.  This switch does not affect functions using the
6301 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6302 inline functions into the object file.
6303
6304 @item -fkeep-static-consts
6305 @opindex fkeep-static-consts
6306 Emit variables declared @code{static const} when optimization isn't turned
6307 on, even if the variables aren't referenced.
6308
6309 GCC enables this option by default.  If you want to force the compiler to
6310 check if the variable was referenced, regardless of whether or not
6311 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6312
6313 @item -fmerge-constants
6314 @opindex fmerge-constants
6315 Attempt to merge identical constants (string constants and floating point
6316 constants) across compilation units.
6317
6318 This option is the default for optimized compilation if the assembler and
6319 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6320 behavior.
6321
6322 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6323
6324 @item -fmerge-all-constants
6325 @opindex fmerge-all-constants
6326 Attempt to merge identical constants and identical variables.
6327
6328 This option implies @option{-fmerge-constants}.  In addition to
6329 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6330 arrays or initialized constant variables with integral or floating point
6331 types.  Languages like C or C++ require each variable, including multiple
6332 instances of the same variable in recursive calls, to have distinct locations,
6333 so using this option will result in non-conforming
6334 behavior.
6335
6336 @item -fmodulo-sched
6337 @opindex fmodulo-sched
6338 Perform swing modulo scheduling immediately before the first scheduling
6339 pass.  This pass looks at innermost loops and reorders their
6340 instructions by overlapping different iterations.
6341
6342 @item -fmodulo-sched-allow-regmoves
6343 @opindex fmodulo-sched-allow-regmoves
6344 Perform more aggressive SMS based modulo scheduling with register moves
6345 allowed.  By setting this flag certain anti-dependences edges will be
6346 deleted which will trigger the generation of reg-moves based on the
6347 life-range analysis.  This option is effective only with
6348 @option{-fmodulo-sched} enabled.
6349
6350 @item -fno-branch-count-reg
6351 @opindex fno-branch-count-reg
6352 Do not use ``decrement and branch'' instructions on a count register,
6353 but instead generate a sequence of instructions that decrement a
6354 register, compare it against zero, then branch based upon the result.
6355 This option is only meaningful on architectures that support such
6356 instructions, which include x86, PowerPC, IA-64 and S/390.
6357
6358 The default is @option{-fbranch-count-reg}.
6359
6360 @item -fno-function-cse
6361 @opindex fno-function-cse
6362 Do not put function addresses in registers; make each instruction that
6363 calls a constant function contain the function's address explicitly.
6364
6365 This option results in less efficient code, but some strange hacks
6366 that alter the assembler output may be confused by the optimizations
6367 performed when this option is not used.
6368
6369 The default is @option{-ffunction-cse}
6370
6371 @item -fno-zero-initialized-in-bss
6372 @opindex fno-zero-initialized-in-bss
6373 If the target supports a BSS section, GCC by default puts variables that
6374 are initialized to zero into BSS@.  This can save space in the resulting
6375 code.
6376
6377 This option turns off this behavior because some programs explicitly
6378 rely on variables going to the data section.  E.g., so that the
6379 resulting executable can find the beginning of that section and/or make
6380 assumptions based on that.
6381
6382 The default is @option{-fzero-initialized-in-bss}.
6383
6384 @item -fmudflap -fmudflapth -fmudflapir
6385 @opindex fmudflap
6386 @opindex fmudflapth
6387 @opindex fmudflapir
6388 @cindex bounds checking
6389 @cindex mudflap
6390 For front-ends that support it (C and C++), instrument all risky
6391 pointer/array dereferencing operations, some standard library
6392 string/heap functions, and some other associated constructs with
6393 range/validity tests.  Modules so instrumented should be immune to
6394 buffer overflows, invalid heap use, and some other classes of C/C++
6395 programming errors.  The instrumentation relies on a separate runtime
6396 library (@file{libmudflap}), which will be linked into a program if
6397 @option{-fmudflap} is given at link time.  Run-time behavior of the
6398 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6399 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6400 for its options.
6401
6402 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6403 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6404 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6405 instrumentation should ignore pointer reads.  This produces less
6406 instrumentation (and therefore faster execution) and still provides
6407 some protection against outright memory corrupting writes, but allows
6408 erroneously read data to propagate within a program.
6409
6410 @item -fthread-jumps
6411 @opindex fthread-jumps
6412 Perform optimizations where we check to see if a jump branches to a
6413 location where another comparison subsumed by the first is found.  If
6414 so, the first branch is redirected to either the destination of the
6415 second branch or a point immediately following it, depending on whether
6416 the condition is known to be true or false.
6417
6418 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6419
6420 @item -fsplit-wide-types
6421 @opindex fsplit-wide-types
6422 When using a type that occupies multiple registers, such as @code{long
6423 long} on a 32-bit system, split the registers apart and allocate them
6424 independently.  This normally generates better code for those types,
6425 but may make debugging more difficult.
6426
6427 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6428 @option{-Os}.
6429
6430 @item -fcse-follow-jumps
6431 @opindex fcse-follow-jumps
6432 In common subexpression elimination (CSE), scan through jump instructions
6433 when the target of the jump is not reached by any other path.  For
6434 example, when CSE encounters an @code{if} statement with an
6435 @code{else} clause, CSE will follow the jump when the condition
6436 tested is false.
6437
6438 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6439
6440 @item -fcse-skip-blocks
6441 @opindex fcse-skip-blocks
6442 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6443 follow jumps which conditionally skip over blocks.  When CSE
6444 encounters a simple @code{if} statement with no else clause,
6445 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6446 body of the @code{if}.
6447
6448 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6449
6450 @item -frerun-cse-after-loop
6451 @opindex frerun-cse-after-loop
6452 Re-run common subexpression elimination after loop optimizations has been
6453 performed.
6454
6455 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6456
6457 @item -fgcse
6458 @opindex fgcse
6459 Perform a global common subexpression elimination pass.
6460 This pass also performs global constant and copy propagation.
6461
6462 @emph{Note:} When compiling a program using computed gotos, a GCC
6463 extension, you may get better runtime performance if you disable
6464 the global common subexpression elimination pass by adding
6465 @option{-fno-gcse} to the command line.
6466
6467 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6468
6469 @item -fgcse-lm
6470 @opindex fgcse-lm
6471 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
6472 attempt to move loads which are only killed by stores into themselves.  This
6473 allows a loop containing a load/store sequence to be changed to a load outside
6474 the loop, and a copy/store within the loop.
6475
6476 Enabled by default when gcse is enabled.
6477
6478 @item -fgcse-sm
6479 @opindex fgcse-sm
6480 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6481 global common subexpression elimination.  This pass will attempt to move
6482 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6483 loops containing a load/store sequence can be changed to a load before
6484 the loop and a store after the loop.
6485
6486 Not enabled at any optimization level.
6487
6488 @item -fgcse-las
6489 @opindex fgcse-las
6490 When @option{-fgcse-las} is enabled, the global common subexpression
6491 elimination pass eliminates redundant loads that come after stores to the
6492 same memory location (both partial and full redundancies).
6493
6494 Not enabled at any optimization level.
6495
6496 @item -fgcse-after-reload
6497 @opindex fgcse-after-reload
6498 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6499 pass is performed after reload.  The purpose of this pass is to cleanup
6500 redundant spilling.
6501
6502 @item -funsafe-loop-optimizations
6503 @opindex funsafe-loop-optimizations
6504 If given, the loop optimizer will assume that loop indices do not
6505 overflow, and that the loops with nontrivial exit condition are not
6506 infinite.  This enables a wider range of loop optimizations even if
6507 the loop optimizer itself cannot prove that these assumptions are valid.
6508 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6509 if it finds this kind of loop.
6510
6511 @item -fcrossjumping
6512 @opindex fcrossjumping
6513 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6514 resulting code may or may not perform better than without cross-jumping.
6515
6516 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6517
6518 @item -fauto-inc-dec
6519 @opindex fauto-inc-dec
6520 Combine increments or decrements of addresses with memory accesses.
6521 This pass is always skipped on architectures that do not have
6522 instructions to support this.  Enabled by default at @option{-O} and
6523 higher on architectures that support this.
6524
6525 @item -fdce
6526 @opindex fdce
6527 Perform dead code elimination (DCE) on RTL@.
6528 Enabled by default at @option{-O} and higher.
6529
6530 @item -fdse
6531 @opindex fdse
6532 Perform dead store elimination (DSE) on RTL@.
6533 Enabled by default at @option{-O} and higher.
6534
6535 @item -fif-conversion
6536 @opindex fif-conversion
6537 Attempt to transform conditional jumps into branch-less equivalents.  This
6538 include use of conditional moves, min, max, set flags and abs instructions, and
6539 some tricks doable by standard arithmetics.  The use of conditional execution
6540 on chips where it is available is controlled by @code{if-conversion2}.
6541
6542 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6543
6544 @item -fif-conversion2
6545 @opindex fif-conversion2
6546 Use conditional execution (where available) to transform conditional jumps into
6547 branch-less equivalents.
6548
6549 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6550
6551 @item -fdelete-null-pointer-checks
6552 @opindex fdelete-null-pointer-checks
6553 Assume that programs cannot safely dereference null pointers, and that
6554 no code or data element resides there.  This enables simple constant
6555 folding optimizations at all optimization levels.  In addition, other
6556 optimization passes in GCC use this flag to control global dataflow
6557 analyses that eliminate useless checks for null pointers; these assume
6558 that if a pointer is checked after it has already been dereferenced,
6559 it cannot be null.
6560
6561 Note however that in some environments this assumption is not true.
6562 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6563 for programs which depend on that behavior.
6564
6565 Some targets, especially embedded ones, disable this option at all levels.
6566 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6567 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6568 are enabled independently at different optimization levels.
6569
6570 @item -fdevirtualize
6571 @opindex fdevirtualize
6572 Attempt to convert calls to virtual functions to direct calls.  This
6573 is done both within a procedure and interprocedurally as part of
6574 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
6575 propagation (@option{-fipa-cp}).
6576 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6577
6578 @item -fexpensive-optimizations
6579 @opindex fexpensive-optimizations
6580 Perform a number of minor optimizations that are relatively expensive.
6581
6582 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6583
6584 @item -foptimize-register-move
6585 @itemx -fregmove
6586 @opindex foptimize-register-move
6587 @opindex fregmove
6588 Attempt to reassign register numbers in move instructions and as
6589 operands of other simple instructions in order to maximize the amount of
6590 register tying.  This is especially helpful on machines with two-operand
6591 instructions.
6592
6593 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6594 optimization.
6595
6596 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6597
6598 @item -fira-algorithm=@var{algorithm}
6599 Use specified coloring algorithm for the integrated register
6600 allocator.  The @var{algorithm} argument should be @code{priority} or
6601 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6602 the second one specifies Chaitin-Briggs coloring.  The second
6603 algorithm can be unimplemented for some architectures.  If it is
6604 implemented, it is the default because Chaitin-Briggs coloring as a
6605 rule generates a better code.
6606
6607 @item -fira-region=@var{region}
6608 Use specified regions for the integrated register allocator.  The
6609 @var{region} argument should be one of @code{all}, @code{mixed}, or
6610 @code{one}.  The first value means using all loops as register
6611 allocation regions, the second value which is the default means using
6612 all loops except for loops with small register pressure as the
6613 regions, and third one means using all function as a single region.
6614 The first value can give best result for machines with small size and
6615 irregular register set, the third one results in faster and generates
6616 decent code and the smallest size code, and the default value usually
6617 give the best results in most cases and for most architectures.
6618
6619 @item -fira-loop-pressure
6620 @opindex fira-loop-pressure
6621 Use IRA to evaluate register pressure in loops for decision to move
6622 loop invariants.  Usage of this option usually results in generation
6623 of faster and smaller code on machines with big register files (>= 32
6624 registers) but it can slow compiler down.
6625
6626 This option is enabled at level @option{-O3} for some targets.
6627
6628 @item -fno-ira-share-save-slots
6629 @opindex fno-ira-share-save-slots
6630 Switch off sharing stack slots used for saving call used hard
6631 registers living through a call.  Each hard register will get a
6632 separate stack slot and as a result function stack frame will be
6633 bigger.
6634
6635 @item -fno-ira-share-spill-slots
6636 @opindex fno-ira-share-spill-slots
6637 Switch off sharing stack slots allocated for pseudo-registers.  Each
6638 pseudo-register which did not get a hard register will get a separate
6639 stack slot and as a result function stack frame will be bigger.
6640
6641 @item -fira-verbose=@var{n}
6642 @opindex fira-verbose
6643 Set up how verbose dump file for the integrated register allocator
6644 will be.  Default value is 5.  If the value is greater or equal to 10,
6645 the dump file will be stderr as if the value were @var{n} minus 10.
6646
6647 @item -fdelayed-branch
6648 @opindex fdelayed-branch
6649 If supported for the target machine, attempt to reorder instructions
6650 to exploit instruction slots available after delayed branch
6651 instructions.
6652
6653 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6654
6655 @item -fschedule-insns
6656 @opindex fschedule-insns
6657 If supported for the target machine, attempt to reorder instructions to
6658 eliminate execution stalls due to required data being unavailable.  This
6659 helps machines that have slow floating point or memory load instructions
6660 by allowing other instructions to be issued until the result of the load
6661 or floating point instruction is required.
6662
6663 Enabled at levels @option{-O2}, @option{-O3}.
6664
6665 @item -fschedule-insns2
6666 @opindex fschedule-insns2
6667 Similar to @option{-fschedule-insns}, but requests an additional pass of
6668 instruction scheduling after register allocation has been done.  This is
6669 especially useful on machines with a relatively small number of
6670 registers and where memory load instructions take more than one cycle.
6671
6672 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6673
6674 @item -fno-sched-interblock
6675 @opindex fno-sched-interblock
6676 Don't schedule instructions across basic blocks.  This is normally
6677 enabled by default when scheduling before register allocation, i.e.@:
6678 with @option{-fschedule-insns} or at @option{-O2} or higher.
6679
6680 @item -fno-sched-spec
6681 @opindex fno-sched-spec
6682 Don't allow speculative motion of non-load instructions.  This is normally
6683 enabled by default when scheduling before register allocation, i.e.@:
6684 with @option{-fschedule-insns} or at @option{-O2} or higher.
6685
6686 @item -fsched-pressure
6687 @opindex fsched-pressure
6688 Enable register pressure sensitive insn scheduling before the register
6689 allocation.  This only makes sense when scheduling before register
6690 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6691 @option{-O2} or higher.  Usage of this option can improve the
6692 generated code and decrease its size by preventing register pressure
6693 increase above the number of available hard registers and as a
6694 consequence register spills in the register allocation.
6695
6696 @item -fsched-spec-load
6697 @opindex fsched-spec-load
6698 Allow speculative motion of some load instructions.  This only makes
6699 sense when scheduling before register allocation, i.e.@: with
6700 @option{-fschedule-insns} or at @option{-O2} or higher.
6701
6702 @item -fsched-spec-load-dangerous
6703 @opindex fsched-spec-load-dangerous
6704 Allow speculative motion of more load instructions.  This only makes
6705 sense when scheduling before register allocation, i.e.@: with
6706 @option{-fschedule-insns} or at @option{-O2} or higher.
6707
6708 @item -fsched-stalled-insns
6709 @itemx -fsched-stalled-insns=@var{n}
6710 @opindex fsched-stalled-insns
6711 Define how many insns (if any) can be moved prematurely from the queue
6712 of stalled insns into the ready list, during the second scheduling pass.
6713 @option{-fno-sched-stalled-insns} means that no insns will be moved
6714 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6715 on how many queued insns can be moved prematurely.
6716 @option{-fsched-stalled-insns} without a value is equivalent to
6717 @option{-fsched-stalled-insns=1}.
6718
6719 @item -fsched-stalled-insns-dep
6720 @itemx -fsched-stalled-insns-dep=@var{n}
6721 @opindex fsched-stalled-insns-dep
6722 Define how many insn groups (cycles) will be examined for a dependency
6723 on a stalled insn that is candidate for premature removal from the queue
6724 of stalled insns.  This has an effect only during the second scheduling pass,
6725 and only if @option{-fsched-stalled-insns} is used.
6726 @option{-fno-sched-stalled-insns-dep} is equivalent to
6727 @option{-fsched-stalled-insns-dep=0}.
6728 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6729 @option{-fsched-stalled-insns-dep=1}.
6730
6731 @item -fsched2-use-superblocks
6732 @opindex fsched2-use-superblocks
6733 When scheduling after register allocation, do use superblock scheduling
6734 algorithm.  Superblock scheduling allows motion across basic block boundaries
6735 resulting on faster schedules.  This option is experimental, as not all machine
6736 descriptions used by GCC model the CPU closely enough to avoid unreliable
6737 results from the algorithm.
6738
6739 This only makes sense when scheduling after register allocation, i.e.@: with
6740 @option{-fschedule-insns2} or at @option{-O2} or higher.
6741
6742 @item -fsched-group-heuristic
6743 @opindex fsched-group-heuristic
6744 Enable the group heuristic in the scheduler.  This heuristic favors
6745 the instruction that belongs to a schedule group.  This is enabled
6746 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6747 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6748
6749 @item -fsched-critical-path-heuristic
6750 @opindex fsched-critical-path-heuristic
6751 Enable the critical-path heuristic in the scheduler.  This heuristic favors
6752 instructions on the critical path.  This is enabled by default when
6753 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6754 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6755
6756 @item -fsched-spec-insn-heuristic
6757 @opindex fsched-spec-insn-heuristic
6758 Enable the speculative instruction heuristic in the scheduler.  This
6759 heuristic favors speculative instructions with greater dependency weakness.
6760 This is enabled by default when scheduling is enabled, i.e.@:
6761 with @option{-fschedule-insns} or @option{-fschedule-insns2}
6762 or at @option{-O2} or higher.
6763
6764 @item -fsched-rank-heuristic
6765 @opindex fsched-rank-heuristic
6766 Enable the rank heuristic in the scheduler.  This heuristic favors
6767 the instruction belonging to a basic block with greater size or frequency.
6768 This is enabled by default when scheduling is enabled, i.e.@:
6769 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6770 at @option{-O2} or higher.
6771
6772 @item -fsched-last-insn-heuristic
6773 @opindex fsched-last-insn-heuristic
6774 Enable the last-instruction heuristic in the scheduler.  This heuristic
6775 favors the instruction that is less dependent on the last instruction
6776 scheduled.  This is enabled by default when scheduling is enabled,
6777 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6778 at @option{-O2} or higher.
6779
6780 @item -fsched-dep-count-heuristic
6781 @opindex fsched-dep-count-heuristic
6782 Enable the dependent-count heuristic in the scheduler.  This heuristic
6783 favors the instruction that has more instructions depending on it.
6784 This is enabled by default when scheduling is enabled, i.e.@:
6785 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6786 at @option{-O2} or higher.
6787
6788 @item -freschedule-modulo-scheduled-loops
6789 @opindex freschedule-modulo-scheduled-loops
6790 The modulo scheduling comes before the traditional scheduling, if a loop
6791 was modulo scheduled we may want to prevent the later scheduling passes
6792 from changing its schedule, we use this option to control that.
6793
6794 @item -fselective-scheduling
6795 @opindex fselective-scheduling
6796 Schedule instructions using selective scheduling algorithm.  Selective
6797 scheduling runs instead of the first scheduler pass.
6798
6799 @item -fselective-scheduling2
6800 @opindex fselective-scheduling2
6801 Schedule instructions using selective scheduling algorithm.  Selective
6802 scheduling runs instead of the second scheduler pass.
6803
6804 @item -fsel-sched-pipelining
6805 @opindex fsel-sched-pipelining
6806 Enable software pipelining of innermost loops during selective scheduling.
6807 This option has no effect until one of @option{-fselective-scheduling} or
6808 @option{-fselective-scheduling2} is turned on.
6809
6810 @item -fsel-sched-pipelining-outer-loops
6811 @opindex fsel-sched-pipelining-outer-loops
6812 When pipelining loops during selective scheduling, also pipeline outer loops.
6813 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6814
6815 @item -fcaller-saves
6816 @opindex fcaller-saves
6817 Enable values to be allocated in registers that will be clobbered by
6818 function calls, by emitting extra instructions to save and restore the
6819 registers around such calls.  Such allocation is done only when it
6820 seems to result in better code than would otherwise be produced.
6821
6822 This option is always enabled by default on certain machines, usually
6823 those which have no call-preserved registers to use instead.
6824
6825 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6826
6827 @item -fcombine-stack-adjustments
6828 @opindex fcombine-stack-adjustments
6829 Tracks stack adjustments (pushes and pops) and stack memory references
6830 and then tries to find ways to combine them.
6831
6832 Enabled by default at @option{-O1} and higher.
6833
6834 @item -fconserve-stack
6835 @opindex fconserve-stack
6836 Attempt to minimize stack usage.  The compiler will attempt to use less
6837 stack space, even if that makes the program slower.  This option
6838 implies setting the @option{large-stack-frame} parameter to 100
6839 and the @option{large-stack-frame-growth} parameter to 400.
6840
6841 @item -ftree-reassoc
6842 @opindex ftree-reassoc
6843 Perform reassociation on trees.  This flag is enabled by default
6844 at @option{-O} and higher.
6845
6846 @item -ftree-pre
6847 @opindex ftree-pre
6848 Perform partial redundancy elimination (PRE) on trees.  This flag is
6849 enabled by default at @option{-O2} and @option{-O3}.
6850
6851 @item -ftree-forwprop
6852 @opindex ftree-forwprop
6853 Perform forward propagation on trees.  This flag is enabled by default
6854 at @option{-O} and higher.
6855
6856 @item -ftree-fre
6857 @opindex ftree-fre
6858 Perform full redundancy elimination (FRE) on trees.  The difference
6859 between FRE and PRE is that FRE only considers expressions
6860 that are computed on all paths leading to the redundant computation.
6861 This analysis is faster than PRE, though it exposes fewer redundancies.
6862 This flag is enabled by default at @option{-O} and higher.
6863
6864 @item -ftree-phiprop
6865 @opindex ftree-phiprop
6866 Perform hoisting of loads from conditional pointers on trees.  This
6867 pass is enabled by default at @option{-O} and higher.
6868
6869 @item -ftree-copy-prop
6870 @opindex ftree-copy-prop
6871 Perform copy propagation on trees.  This pass eliminates unnecessary
6872 copy operations.  This flag is enabled by default at @option{-O} and
6873 higher.
6874
6875 @item -fipa-pure-const
6876 @opindex fipa-pure-const
6877 Discover which functions are pure or constant.
6878 Enabled by default at @option{-O} and higher.
6879
6880 @item -fipa-reference
6881 @opindex fipa-reference
6882 Discover which static variables do not escape cannot escape the
6883 compilation unit.
6884 Enabled by default at @option{-O} and higher.
6885
6886 @item -fipa-pta
6887 @opindex fipa-pta
6888 Perform interprocedural pointer analysis and interprocedural modification
6889 and reference analysis.  This option can cause excessive memory and
6890 compile-time usage on large compilation units.  It is not enabled by
6891 default at any optimization level.
6892
6893 @item -fipa-profile
6894 @opindex fipa-profile
6895 Perform interprocedural profile propagation.  The functions called only from
6896 cold functions are marked as cold. Also functions executed once (such as
6897 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
6898 functions and loop less parts of functions executed once are then optimized for
6899 size.
6900 Enabled by default at @option{-O} and higher.
6901
6902 @item -fipa-cp
6903 @opindex fipa-cp
6904 Perform interprocedural constant propagation.
6905 This optimization analyzes the program to determine when values passed
6906 to functions are constants and then optimizes accordingly.
6907 This optimization can substantially increase performance
6908 if the application has constants passed to functions.
6909 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6910
6911 @item -fipa-cp-clone
6912 @opindex fipa-cp-clone
6913 Perform function cloning to make interprocedural constant propagation stronger.
6914 When enabled, interprocedural constant propagation will perform function cloning
6915 when externally visible function can be called with constant arguments.
6916 Because this optimization can create multiple copies of functions,
6917 it may significantly increase code size
6918 (see @option{--param ipcp-unit-growth=@var{value}}).
6919 This flag is enabled by default at @option{-O3}.
6920
6921 @item -fipa-matrix-reorg
6922 @opindex fipa-matrix-reorg
6923 Perform matrix flattening and transposing.
6924 Matrix flattening tries to replace an @math{m}-dimensional matrix
6925 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
6926 This reduces the level of indirection needed for accessing the elements
6927 of the matrix. The second optimization is matrix transposing that
6928 attempts to change the order of the matrix's dimensions in order to
6929 improve cache locality.
6930 Both optimizations need the @option{-fwhole-program} flag.
6931 Transposing is enabled only if profiling information is available.
6932
6933 @item -ftree-sink
6934 @opindex ftree-sink
6935 Perform forward store motion  on trees.  This flag is
6936 enabled by default at @option{-O} and higher.
6937
6938 @item -ftree-bit-ccp
6939 @opindex ftree-bit-ccp
6940 Perform sparse conditional bit constant propagation on trees and propagate
6941 pointer alignment information.
6942 This pass only operates on local scalar variables and is enabled by default
6943 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
6944
6945 @item -ftree-ccp
6946 @opindex ftree-ccp
6947 Perform sparse conditional constant propagation (CCP) on trees.  This
6948 pass only operates on local scalar variables and is enabled by default
6949 at @option{-O} and higher.
6950
6951 @item -ftree-switch-conversion
6952 Perform conversion of simple initializations in a switch to
6953 initializations from a scalar array.  This flag is enabled by default
6954 at @option{-O2} and higher.
6955
6956 @item -ftree-dce
6957 @opindex ftree-dce
6958 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6959 default at @option{-O} and higher.
6960
6961 @item -ftree-builtin-call-dce
6962 @opindex ftree-builtin-call-dce
6963 Perform conditional dead code elimination (DCE) for calls to builtin functions
6964 that may set @code{errno} but are otherwise side-effect free.  This flag is
6965 enabled by default at @option{-O2} and higher if @option{-Os} is not also
6966 specified.
6967
6968 @item -ftree-dominator-opts
6969 @opindex ftree-dominator-opts
6970 Perform a variety of simple scalar cleanups (constant/copy
6971 propagation, redundancy elimination, range propagation and expression
6972 simplification) based on a dominator tree traversal.  This also
6973 performs jump threading (to reduce jumps to jumps). This flag is
6974 enabled by default at @option{-O} and higher.
6975
6976 @item -ftree-dse
6977 @opindex ftree-dse
6978 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6979 a memory location which will later be overwritten by another store without
6980 any intervening loads.  In this case the earlier store can be deleted.  This
6981 flag is enabled by default at @option{-O} and higher.
6982
6983 @item -ftree-ch
6984 @opindex ftree-ch
6985 Perform loop header copying on trees.  This is beneficial since it increases
6986 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6987 is enabled by default at @option{-O} and higher.  It is not enabled
6988 for @option{-Os}, since it usually increases code size.
6989
6990 @item -ftree-loop-optimize
6991 @opindex ftree-loop-optimize
6992 Perform loop optimizations on trees.  This flag is enabled by default
6993 at @option{-O} and higher.
6994
6995 @item -ftree-loop-linear
6996 @opindex ftree-loop-linear
6997 Perform loop interchange transformations on tree.  Same as
6998 @option{-floop-interchange}.  To use this code transformation, GCC has
6999 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7000 enable the Graphite loop transformation infrastructure.
7001
7002 @item -floop-interchange
7003 @opindex floop-interchange
7004 Perform loop interchange transformations on loops.  Interchanging two
7005 nested loops switches the inner and outer loops.  For example, given a
7006 loop like:
7007 @smallexample
7008 DO J = 1, M
7009   DO I = 1, N
7010     A(J, I) = A(J, I) * C
7011   ENDDO
7012 ENDDO
7013 @end smallexample
7014 loop interchange will transform the loop as if the user had written:
7015 @smallexample
7016 DO I = 1, N
7017   DO J = 1, M
7018     A(J, I) = A(J, I) * C
7019   ENDDO
7020 ENDDO
7021 @end smallexample
7022 which can be beneficial when @code{N} is larger than the caches,
7023 because in Fortran, the elements of an array are stored in memory
7024 contiguously by column, and the original loop iterates over rows,
7025 potentially creating at each access a cache miss.  This optimization
7026 applies to all the languages supported by GCC and is not limited to
7027 Fortran.  To use this code transformation, GCC has to be configured
7028 with @option{--with-ppl} and @option{--with-cloog} to enable the
7029 Graphite loop transformation infrastructure.
7030
7031 @item -floop-strip-mine
7032 @opindex floop-strip-mine
7033 Perform loop strip mining transformations on loops.  Strip mining
7034 splits a loop into two nested loops.  The outer loop has strides
7035 equal to the strip size and the inner loop has strides of the
7036 original loop within a strip.  The strip length can be changed
7037 using the @option{loop-block-tile-size} parameter.  For example,
7038 given a loop like:
7039 @smallexample
7040 DO I = 1, N
7041   A(I) = A(I) + C
7042 ENDDO
7043 @end smallexample
7044 loop strip mining will transform the loop as if the user had written:
7045 @smallexample
7046 DO II = 1, N, 51
7047   DO I = II, min (II + 50, N)
7048     A(I) = A(I) + C
7049   ENDDO
7050 ENDDO
7051 @end smallexample
7052 This optimization applies to all the languages supported by GCC and is
7053 not limited to Fortran.  To use this code transformation, GCC has to
7054 be configured with @option{--with-ppl} and @option{--with-cloog} to
7055 enable the Graphite loop transformation infrastructure.
7056
7057 @item -floop-block
7058 @opindex floop-block
7059 Perform loop blocking transformations on loops.  Blocking strip mines
7060 each loop in the loop nest such that the memory accesses of the
7061 element loops fit inside caches.  The strip length can be changed
7062 using the @option{loop-block-tile-size} parameter.  For example, given
7063 a loop like:
7064 @smallexample
7065 DO I = 1, N
7066   DO J = 1, M
7067     A(J, I) = B(I) + C(J)
7068   ENDDO
7069 ENDDO
7070 @end smallexample
7071 loop blocking will transform the loop as if the user had written:
7072 @smallexample
7073 DO II = 1, N, 51
7074   DO JJ = 1, M, 51
7075     DO I = II, min (II + 50, N)
7076       DO J = JJ, min (JJ + 50, M)
7077         A(J, I) = B(I) + C(J)
7078       ENDDO
7079     ENDDO
7080   ENDDO
7081 ENDDO
7082 @end smallexample
7083 which can be beneficial when @code{M} is larger than the caches,
7084 because the innermost loop will iterate over a smaller amount of data
7085 that can be kept in the caches.  This optimization applies to all the
7086 languages supported by GCC and is not limited to Fortran.  To use this
7087 code transformation, GCC has to be configured with @option{--with-ppl}
7088 and @option{--with-cloog} to enable the Graphite loop transformation
7089 infrastructure.
7090
7091 @item -fgraphite-identity
7092 @opindex fgraphite-identity
7093 Enable the identity transformation for graphite.  For every SCoP we generate
7094 the polyhedral representation and transform it back to gimple.  Using
7095 @option{-fgraphite-identity} we can check the costs or benefits of the
7096 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7097 are also performed by the code generator CLooG, like index splitting and
7098 dead code elimination in loops.
7099
7100 @item -floop-flatten
7101 @opindex floop-flatten
7102 Removes the loop nesting structure: transforms the loop nest into a
7103 single loop.  This transformation can be useful to vectorize all the
7104 levels of the loop nest.
7105
7106 @item -floop-parallelize-all
7107 @opindex floop-parallelize-all
7108 Use the Graphite data dependence analysis to identify loops that can
7109 be parallelized.  Parallelize all the loops that can be analyzed to
7110 not contain loop carried dependences without checking that it is
7111 profitable to parallelize the loops.
7112
7113 @item -fcheck-data-deps
7114 @opindex fcheck-data-deps
7115 Compare the results of several data dependence analyzers.  This option
7116 is used for debugging the data dependence analyzers.
7117
7118 @item -ftree-loop-if-convert
7119 Attempt to transform conditional jumps in the innermost loops to
7120 branch-less equivalents.  The intent is to remove control-flow from
7121 the innermost loops in order to improve the ability of the
7122 vectorization pass to handle these loops.  This is enabled by default
7123 if vectorization is enabled.
7124
7125 @item -ftree-loop-if-convert-stores
7126 Attempt to also if-convert conditional jumps containing memory writes.
7127 This transformation can be unsafe for multi-threaded programs as it
7128 transforms conditional memory writes into unconditional memory writes.
7129 For example,
7130 @smallexample
7131 for (i = 0; i < N; i++)
7132   if (cond)
7133     A[i] = expr;
7134 @end smallexample
7135 would be transformed to
7136 @smallexample
7137 for (i = 0; i < N; i++)
7138   A[i] = cond ? expr : A[i];
7139 @end smallexample
7140 potentially producing data races.
7141
7142 @item -ftree-loop-distribution
7143 Perform loop distribution.  This flag can improve cache performance on
7144 big loop bodies and allow further loop optimizations, like
7145 parallelization or vectorization, to take place.  For example, the loop
7146 @smallexample
7147 DO I = 1, N
7148   A(I) = B(I) + C
7149   D(I) = E(I) * F
7150 ENDDO
7151 @end smallexample
7152 is transformed to
7153 @smallexample
7154 DO I = 1, N
7155    A(I) = B(I) + C
7156 ENDDO
7157 DO I = 1, N
7158    D(I) = E(I) * F
7159 ENDDO
7160 @end smallexample
7161
7162 @item -ftree-loop-distribute-patterns
7163 Perform loop distribution of patterns that can be code generated with
7164 calls to a library.  This flag is enabled by default at @option{-O3}.
7165
7166 This pass distributes the initialization loops and generates a call to
7167 memset zero.  For example, the loop
7168 @smallexample
7169 DO I = 1, N
7170   A(I) = 0
7171   B(I) = A(I) + I
7172 ENDDO
7173 @end smallexample
7174 is transformed to
7175 @smallexample
7176 DO I = 1, N
7177    A(I) = 0
7178 ENDDO
7179 DO I = 1, N
7180    B(I) = A(I) + I
7181 ENDDO
7182 @end smallexample
7183 and the initialization loop is transformed into a call to memset zero.
7184
7185 @item -ftree-loop-im
7186 @opindex ftree-loop-im
7187 Perform loop invariant motion on trees.  This pass moves only invariants that
7188 would be hard to handle at RTL level (function calls, operations that expand to
7189 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7190 operands of conditions that are invariant out of the loop, so that we can use
7191 just trivial invariantness analysis in loop unswitching.  The pass also includes
7192 store motion.
7193
7194 @item -ftree-loop-ivcanon
7195 @opindex ftree-loop-ivcanon
7196 Create a canonical counter for number of iterations in the loop for that
7197 determining number of iterations requires complicated analysis.  Later
7198 optimizations then may determine the number easily.  Useful especially
7199 in connection with unrolling.
7200
7201 @item -fivopts
7202 @opindex fivopts
7203 Perform induction variable optimizations (strength reduction, induction
7204 variable merging and induction variable elimination) on trees.
7205
7206 @item -ftree-parallelize-loops=n
7207 @opindex ftree-parallelize-loops
7208 Parallelize loops, i.e., split their iteration space to run in n threads.
7209 This is only possible for loops whose iterations are independent
7210 and can be arbitrarily reordered.  The optimization is only
7211 profitable on multiprocessor machines, for loops that are CPU-intensive,
7212 rather than constrained e.g.@: by memory bandwidth.  This option
7213 implies @option{-pthread}, and thus is only supported on targets
7214 that have support for @option{-pthread}.
7215
7216 @item -ftree-pta
7217 @opindex ftree-pta
7218 Perform function-local points-to analysis on trees.  This flag is
7219 enabled by default at @option{-O} and higher.
7220
7221 @item -ftree-sra
7222 @opindex ftree-sra
7223 Perform scalar replacement of aggregates.  This pass replaces structure
7224 references with scalars to prevent committing structures to memory too
7225 early.  This flag is enabled by default at @option{-O} and higher.
7226
7227 @item -ftree-copyrename
7228 @opindex ftree-copyrename
7229 Perform copy renaming on trees.  This pass attempts to rename compiler
7230 temporaries to other variables at copy locations, usually resulting in
7231 variable names which more closely resemble the original variables.  This flag
7232 is enabled by default at @option{-O} and higher.
7233
7234 @item -ftree-ter
7235 @opindex ftree-ter
7236 Perform temporary expression replacement during the SSA->normal phase.  Single
7237 use/single def temporaries are replaced at their use location with their
7238 defining expression.  This results in non-GIMPLE code, but gives the expanders
7239 much more complex trees to work on resulting in better RTL generation.  This is
7240 enabled by default at @option{-O} and higher.
7241
7242 @item -ftree-vectorize
7243 @opindex ftree-vectorize
7244 Perform loop vectorization on trees. This flag is enabled by default at
7245 @option{-O3}.
7246
7247 @item -ftree-slp-vectorize
7248 @opindex ftree-slp-vectorize
7249 Perform basic block vectorization on trees. This flag is enabled by default at
7250 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7251
7252 @item -ftree-vect-loop-version
7253 @opindex ftree-vect-loop-version
7254 Perform loop versioning when doing loop vectorization on trees.  When a loop
7255 appears to be vectorizable except that data alignment or data dependence cannot
7256 be determined at compile time then vectorized and non-vectorized versions of
7257 the loop are generated along with runtime checks for alignment or dependence
7258 to control which version is executed.  This option is enabled by default
7259 except at level @option{-Os} where it is disabled.
7260
7261 @item -fvect-cost-model
7262 @opindex fvect-cost-model
7263 Enable cost model for vectorization.
7264
7265 @item -ftree-vrp
7266 @opindex ftree-vrp
7267 Perform Value Range Propagation on trees.  This is similar to the
7268 constant propagation pass, but instead of values, ranges of values are
7269 propagated.  This allows the optimizers to remove unnecessary range
7270 checks like array bound checks and null pointer checks.  This is
7271 enabled by default at @option{-O2} and higher.  Null pointer check
7272 elimination is only done if @option{-fdelete-null-pointer-checks} is
7273 enabled.
7274
7275 @item -ftracer
7276 @opindex ftracer
7277 Perform tail duplication to enlarge superblock size.  This transformation
7278 simplifies the control flow of the function allowing other optimizations to do
7279 better job.
7280
7281 @item -funroll-loops
7282 @opindex funroll-loops
7283 Unroll loops whose number of iterations can be determined at compile
7284 time or upon entry to the loop.  @option{-funroll-loops} implies
7285 @option{-frerun-cse-after-loop}.  This option makes code larger,
7286 and may or may not make it run faster.
7287
7288 @item -funroll-all-loops
7289 @opindex funroll-all-loops
7290 Unroll all loops, even if their number of iterations is uncertain when
7291 the loop is entered.  This usually makes programs run more slowly.
7292 @option{-funroll-all-loops} implies the same options as
7293 @option{-funroll-loops},
7294
7295 @item -fsplit-ivs-in-unroller
7296 @opindex fsplit-ivs-in-unroller
7297 Enables expressing of values of induction variables in later iterations
7298 of the unrolled loop using the value in the first iteration.  This breaks
7299 long dependency chains, thus improving efficiency of the scheduling passes.
7300
7301 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7302 same effect.  However in cases the loop body is more complicated than
7303 a single basic block, this is not reliable.  It also does not work at all
7304 on some of the architectures due to restrictions in the CSE pass.
7305
7306 This optimization is enabled by default.
7307
7308 @item -fvariable-expansion-in-unroller
7309 @opindex fvariable-expansion-in-unroller
7310 With this option, the compiler will create multiple copies of some
7311 local variables when unrolling a loop which can result in superior code.
7312
7313 @item -fpartial-inlining
7314 @opindex fpartial-inlining
7315 Inline parts of functions.  This option has any effect only
7316 when inlining itself is turned on by the @option{-finline-functions}
7317 or @option{-finline-small-functions} options.
7318
7319 Enabled at level @option{-O2}.
7320
7321 @item -fpredictive-commoning
7322 @opindex fpredictive-commoning
7323 Perform predictive commoning optimization, i.e., reusing computations
7324 (especially memory loads and stores) performed in previous
7325 iterations of loops.
7326
7327 This option is enabled at level @option{-O3}.
7328
7329 @item -fprefetch-loop-arrays
7330 @opindex fprefetch-loop-arrays
7331 If supported by the target machine, generate instructions to prefetch
7332 memory to improve the performance of loops that access large arrays.
7333
7334 This option may generate better or worse code; results are highly
7335 dependent on the structure of loops within the source code.
7336
7337 Disabled at level @option{-Os}.
7338
7339 @item -fno-peephole
7340 @itemx -fno-peephole2
7341 @opindex fno-peephole
7342 @opindex fno-peephole2
7343 Disable any machine-specific peephole optimizations.  The difference
7344 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7345 are implemented in the compiler; some targets use one, some use the
7346 other, a few use both.
7347
7348 @option{-fpeephole} is enabled by default.
7349 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7350
7351 @item -fno-guess-branch-probability
7352 @opindex fno-guess-branch-probability
7353 Do not guess branch probabilities using heuristics.
7354
7355 GCC will use heuristics to guess branch probabilities if they are
7356 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7357 heuristics are based on the control flow graph.  If some branch probabilities
7358 are specified by @samp{__builtin_expect}, then the heuristics will be
7359 used to guess branch probabilities for the rest of the control flow graph,
7360 taking the @samp{__builtin_expect} info into account.  The interactions
7361 between the heuristics and @samp{__builtin_expect} can be complex, and in
7362 some cases, it may be useful to disable the heuristics so that the effects
7363 of @samp{__builtin_expect} are easier to understand.
7364
7365 The default is @option{-fguess-branch-probability} at levels
7366 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7367
7368 @item -freorder-blocks
7369 @opindex freorder-blocks
7370 Reorder basic blocks in the compiled function in order to reduce number of
7371 taken branches and improve code locality.
7372
7373 Enabled at levels @option{-O2}, @option{-O3}.
7374
7375 @item -freorder-blocks-and-partition
7376 @opindex freorder-blocks-and-partition
7377 In addition to reordering basic blocks in the compiled function, in order
7378 to reduce number of taken branches, partitions hot and cold basic blocks
7379 into separate sections of the assembly and .o files, to improve
7380 paging and cache locality performance.
7381
7382 This optimization is automatically turned off in the presence of
7383 exception handling, for linkonce sections, for functions with a user-defined
7384 section attribute and on any architecture that does not support named
7385 sections.
7386
7387 @item -freorder-functions
7388 @opindex freorder-functions
7389 Reorder functions in the object file in order to
7390 improve code locality.  This is implemented by using special
7391 subsections @code{.text.hot} for most frequently executed functions and
7392 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7393 the linker so object file format must support named sections and linker must
7394 place them in a reasonable way.
7395
7396 Also profile feedback must be available in to make this option effective.  See
7397 @option{-fprofile-arcs} for details.
7398
7399 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7400
7401 @item -fstrict-aliasing
7402 @opindex fstrict-aliasing
7403 Allow the compiler to assume the strictest aliasing rules applicable to
7404 the language being compiled.  For C (and C++), this activates
7405 optimizations based on the type of expressions.  In particular, an
7406 object of one type is assumed never to reside at the same address as an
7407 object of a different type, unless the types are almost the same.  For
7408 example, an @code{unsigned int} can alias an @code{int}, but not a
7409 @code{void*} or a @code{double}.  A character type may alias any other
7410 type.
7411
7412 @anchor{Type-punning}Pay special attention to code like this:
7413 @smallexample
7414 union a_union @{
7415   int i;
7416   double d;
7417 @};
7418
7419 int f() @{
7420   union a_union t;
7421   t.d = 3.0;
7422   return t.i;
7423 @}
7424 @end smallexample
7425 The practice of reading from a different union member than the one most
7426 recently written to (called ``type-punning'') is common.  Even with
7427 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7428 is accessed through the union type.  So, the code above will work as
7429 expected.  @xref{Structures unions enumerations and bit-fields
7430 implementation}.  However, this code might not:
7431 @smallexample
7432 int f() @{
7433   union a_union t;
7434   int* ip;
7435   t.d = 3.0;
7436   ip = &t.i;
7437   return *ip;
7438 @}
7439 @end smallexample
7440
7441 Similarly, access by taking the address, casting the resulting pointer
7442 and dereferencing the result has undefined behavior, even if the cast
7443 uses a union type, e.g.:
7444 @smallexample
7445 int f() @{
7446   double d = 3.0;
7447   return ((union a_union *) &d)->i;
7448 @}
7449 @end smallexample
7450
7451 The @option{-fstrict-aliasing} option is enabled at levels
7452 @option{-O2}, @option{-O3}, @option{-Os}.
7453
7454 @item -fstrict-overflow
7455 @opindex fstrict-overflow
7456 Allow the compiler to assume strict signed overflow rules, depending
7457 on the language being compiled.  For C (and C++) this means that
7458 overflow when doing arithmetic with signed numbers is undefined, which
7459 means that the compiler may assume that it will not happen.  This
7460 permits various optimizations.  For example, the compiler will assume
7461 that an expression like @code{i + 10 > i} will always be true for
7462 signed @code{i}.  This assumption is only valid if signed overflow is
7463 undefined, as the expression is false if @code{i + 10} overflows when
7464 using twos complement arithmetic.  When this option is in effect any
7465 attempt to determine whether an operation on signed numbers will
7466 overflow must be written carefully to not actually involve overflow.
7467
7468 This option also allows the compiler to assume strict pointer
7469 semantics: given a pointer to an object, if adding an offset to that
7470 pointer does not produce a pointer to the same object, the addition is
7471 undefined.  This permits the compiler to conclude that @code{p + u >
7472 p} is always true for a pointer @code{p} and unsigned integer
7473 @code{u}.  This assumption is only valid because pointer wraparound is
7474 undefined, as the expression is false if @code{p + u} overflows using
7475 twos complement arithmetic.
7476
7477 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7478 that integer signed overflow is fully defined: it wraps.  When
7479 @option{-fwrapv} is used, there is no difference between
7480 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7481 integers.  With @option{-fwrapv} certain types of overflow are
7482 permitted.  For example, if the compiler gets an overflow when doing
7483 arithmetic on constants, the overflowed value can still be used with
7484 @option{-fwrapv}, but not otherwise.
7485
7486 The @option{-fstrict-overflow} option is enabled at levels
7487 @option{-O2}, @option{-O3}, @option{-Os}.
7488
7489 @item -falign-functions
7490 @itemx -falign-functions=@var{n}
7491 @opindex falign-functions
7492 Align the start of functions to the next power-of-two greater than
7493 @var{n}, skipping up to @var{n} bytes.  For instance,
7494 @option{-falign-functions=32} aligns functions to the next 32-byte
7495 boundary, but @option{-falign-functions=24} would align to the next
7496 32-byte boundary only if this can be done by skipping 23 bytes or less.
7497
7498 @option{-fno-align-functions} and @option{-falign-functions=1} are
7499 equivalent and mean that functions will not be aligned.
7500
7501 Some assemblers only support this flag when @var{n} is a power of two;
7502 in that case, it is rounded up.
7503
7504 If @var{n} is not specified or is zero, use a machine-dependent default.
7505
7506 Enabled at levels @option{-O2}, @option{-O3}.
7507
7508 @item -falign-labels
7509 @itemx -falign-labels=@var{n}
7510 @opindex falign-labels
7511 Align all branch targets to a power-of-two boundary, skipping up to
7512 @var{n} bytes like @option{-falign-functions}.  This option can easily
7513 make code slower, because it must insert dummy operations for when the
7514 branch target is reached in the usual flow of the code.
7515
7516 @option{-fno-align-labels} and @option{-falign-labels=1} are
7517 equivalent and mean that labels will not be aligned.
7518
7519 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7520 are greater than this value, then their values are used instead.
7521
7522 If @var{n} is not specified or is zero, use a machine-dependent default
7523 which is very likely to be @samp{1}, meaning no alignment.
7524
7525 Enabled at levels @option{-O2}, @option{-O3}.
7526
7527 @item -falign-loops
7528 @itemx -falign-loops=@var{n}
7529 @opindex falign-loops
7530 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7531 like @option{-falign-functions}.  The hope is that the loop will be
7532 executed many times, which will make up for any execution of the dummy
7533 operations.
7534
7535 @option{-fno-align-loops} and @option{-falign-loops=1} are
7536 equivalent and mean that loops will not be aligned.
7537
7538 If @var{n} is not specified or is zero, use a machine-dependent default.
7539
7540 Enabled at levels @option{-O2}, @option{-O3}.
7541
7542 @item -falign-jumps
7543 @itemx -falign-jumps=@var{n}
7544 @opindex falign-jumps
7545 Align branch targets to a power-of-two boundary, for branch targets
7546 where the targets can only be reached by jumping, skipping up to @var{n}
7547 bytes like @option{-falign-functions}.  In this case, no dummy operations
7548 need be executed.
7549
7550 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7551 equivalent and mean that loops will not be aligned.
7552
7553 If @var{n} is not specified or is zero, use a machine-dependent default.
7554
7555 Enabled at levels @option{-O2}, @option{-O3}.
7556
7557 @item -funit-at-a-time
7558 @opindex funit-at-a-time
7559 This option is left for compatibility reasons. @option{-funit-at-a-time}
7560 has no effect, while @option{-fno-unit-at-a-time} implies
7561 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7562
7563 Enabled by default.
7564
7565 @item -fno-toplevel-reorder
7566 @opindex fno-toplevel-reorder
7567 Do not reorder top-level functions, variables, and @code{asm}
7568 statements.  Output them in the same order that they appear in the
7569 input file.  When this option is used, unreferenced static variables
7570 will not be removed.  This option is intended to support existing code
7571 which relies on a particular ordering.  For new code, it is better to
7572 use attributes.
7573
7574 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
7575 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
7576 targets.
7577
7578 @item -fweb
7579 @opindex fweb
7580 Constructs webs as commonly used for register allocation purposes and assign
7581 each web individual pseudo register.  This allows the register allocation pass
7582 to operate on pseudos directly, but also strengthens several other optimization
7583 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7584 however, make debugging impossible, since variables will no longer stay in a
7585 ``home register''.
7586
7587 Enabled by default with @option{-funroll-loops}.
7588
7589 @item -fwhole-program
7590 @opindex fwhole-program
7591 Assume that the current compilation unit represents the whole program being
7592 compiled.  All public functions and variables with the exception of @code{main}
7593 and those merged by attribute @code{externally_visible} become static functions
7594 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.
7595 While this option is equivalent to proper use of the @code{static} keyword for
7596 programs consisting of a single file, in combination with option
7597 @option{-flto} this flag can be used to
7598 compile many smaller scale programs since the functions and variables become
7599 local for the whole combined compilation unit, not for the single source file
7600 itself.
7601
7602 This option implies @option{-fwhole-file} for Fortran programs.
7603
7604 @item -flto[=@var{n}]
7605 @opindex flto
7606 This option runs the standard link-time optimizer.  When invoked
7607 with source code, it generates GIMPLE (one of GCC's internal
7608 representations) and writes it to special ELF sections in the object
7609 file.  When the object files are linked together, all the function
7610 bodies are read from these ELF sections and instantiated as if they
7611 had been part of the same translation unit.
7612
7613 To use the link-timer optimizer, @option{-flto} needs to be specified at
7614 compile time and during the final link.  For example,
7615
7616 @smallexample
7617 gcc -c -O2 -flto foo.c
7618 gcc -c -O2 -flto bar.c
7619 gcc -o myprog -flto -O2 foo.o bar.o
7620 @end smallexample
7621
7622 The first two invocations to GCC will save a bytecode representation
7623 of GIMPLE into special ELF sections inside @file{foo.o} and
7624 @file{bar.o}.  The final invocation will read the GIMPLE bytecode from
7625 @file{foo.o} and @file{bar.o}, merge the two files into a single
7626 internal image, and compile the result as usual.  Since both
7627 @file{foo.o} and @file{bar.o} are merged into a single image, this
7628 causes all the inter-procedural analyses and optimizations in GCC to
7629 work across the two files as if they were a single one.  This means,
7630 for example, that the inliner will be able to inline functions in
7631 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7632
7633 Another (simpler) way to enable link-time optimization is,
7634
7635 @smallexample
7636 gcc -o myprog -flto -O2 foo.c bar.c
7637 @end smallexample
7638
7639 The above will generate bytecode for @file{foo.c} and @file{bar.c},
7640 merge them together into a single GIMPLE representation and optimize
7641 them as usual to produce @file{myprog}.
7642
7643 The only important thing to keep in mind is that to enable link-time
7644 optimizations the @option{-flto} flag needs to be passed to both the
7645 compile and the link commands.
7646
7647 To make whole program optimization effective, it is necessary to make
7648 certain whole program assumptions.  The compiler needs to know
7649 what functions and variables can be accessed by libraries and runtime
7650 outside of the link time optimized unit.  When supported by the linker,
7651 the linker plugin (see @option{-fuse-linker-plugin}) passes to the
7652 compiler information about used and externally visible symbols.  When
7653 the linker plugin is not available, @option{-fwhole-program} should be
7654 used to allow the compiler to make these assumptions, which will lead
7655 to more aggressive optimization decisions.
7656
7657 Note that when a file is compiled with @option{-flto}, the generated
7658 object file will be larger than a regular object file because it will
7659 contain GIMPLE bytecodes and the usual final code.  This means that
7660 object files with LTO information can be linked as a normal object
7661 file.  So, in the previous example, if the final link is done with
7662
7663 @smallexample
7664 gcc -o myprog foo.o bar.o
7665 @end smallexample
7666
7667 The only difference will be that no inter-procedural optimizations
7668 will be applied to produce @file{myprog}.  The two object files
7669 @file{foo.o} and @file{bar.o} will be simply sent to the regular
7670 linker.
7671
7672 Additionally, the optimization flags used to compile individual files
7673 are not necessarily related to those used at link-time.  For instance,
7674
7675 @smallexample
7676 gcc -c -O0 -flto foo.c
7677 gcc -c -O0 -flto bar.c
7678 gcc -o myprog -flto -O3 foo.o bar.o
7679 @end smallexample
7680
7681 This will produce individual object files with unoptimized assembler
7682 code, but the resulting binary @file{myprog} will be optimized at
7683 @option{-O3}.  Now, if the final binary is generated without
7684 @option{-flto}, then @file{myprog} will not be optimized.
7685
7686 When producing the final binary with @option{-flto}, GCC will only
7687 apply link-time optimizations to those files that contain bytecode.
7688 Therefore, you can mix and match object files and libraries with
7689 GIMPLE bytecodes and final object code.  GCC will automatically select
7690 which files to optimize in LTO mode and which files to link without
7691 further processing.
7692
7693 There are some code generation flags that GCC will preserve when
7694 generating bytecodes, as they need to be used during the final link
7695 stage.  Currently, the following options are saved into the GIMPLE
7696 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7697 @option{-m} target flags.
7698
7699 At link time, these options are read-in and reapplied.  Note that the
7700 current implementation makes no attempt at recognizing conflicting
7701 values for these options.  If two or more files have a conflicting
7702 value (e.g., one file is compiled with @option{-fPIC} and another
7703 isn't), the compiler will simply use the last value read from the
7704 bytecode files.  It is recommended, then, that all the files
7705 participating in the same link be compiled with the same options.
7706
7707 Another feature of LTO is that it is possible to apply interprocedural
7708 optimizations on files written in different languages.  This requires
7709 some support in the language front end.  Currently, the C, C++ and
7710 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7711 something like this should work
7712
7713 @smallexample
7714 gcc -c -flto foo.c
7715 g++ -c -flto bar.cc
7716 gfortran -c -flto baz.f90
7717 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7718 @end smallexample
7719
7720 Notice that the final link is done with @command{g++} to get the C++
7721 runtime libraries and @option{-lgfortran} is added to get the Fortran
7722 runtime libraries.  In general, when mixing languages in LTO mode, you
7723 should use the same link command used when mixing languages in a
7724 regular (non-LTO) compilation.  This means that if your build process
7725 was mixing languages before, all you need to add is @option{-flto} to
7726 all the compile and link commands.
7727
7728 If LTO encounters objects with C linkage declared with incompatible
7729 types in separate translation units to be linked together (undefined
7730 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7731 issued.  The behavior is still undefined at runtime.
7732
7733 If object files containing GIMPLE bytecode are stored in a library archive, say
7734 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
7735 are using a linker with linker plugin support.  To enable this feature, use
7736 the flag @option{-fuse-linker-plugin} at link-time:
7737
7738 @smallexample
7739 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7740 @end smallexample
7741
7742 With the linker plugin enabled, the linker will extract the needed
7743 GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
7744 to make them part of the aggregated GIMPLE image to be optimized.
7745
7746 If you are not using a linker with linker plugin support and/or do not
7747 enable linker plugin then the objects inside @file{libfoo.a}
7748 will be extracted and linked as usual, but they will not participate
7749 in the LTO optimization process.
7750
7751 Link time optimizations do not require the presence of the whole program to
7752 operate.  If the program does not require any symbols to be exported, it is
7753 possible to combine @option{-flto} and with @option{-fwhole-program} to allow
7754 the interprocedural optimizers to use more aggressive assumptions which may
7755 lead to improved optimization opportunities.
7756 Use of @option{-fwhole-program} is not needed when linker plugin is
7757 active (see @option{-fuse-linker-plugin}).
7758
7759 Regarding portability: the current implementation of LTO makes no
7760 attempt at generating bytecode that can be ported between different
7761 types of hosts.  The bytecode files are versioned and there is a
7762 strict version check, so bytecode files generated in one version of
7763 GCC will not work with an older/newer version of GCC.
7764
7765 Link time optimization does not play well with generating debugging
7766 information.  Combining @option{-flto} with
7767 @option{-g} is currently experimental and expected to produce wrong
7768 results.
7769
7770 If you specify the optional @var{n}, the optimization and code
7771 generation done at link time is executed in parallel using @var{n}
7772 parallel jobs by utilizing an installed @command{make} program.  The
7773 environment variable @env{MAKE} may be used to override the program
7774 used.  The default value for @var{n} is 1.
7775
7776 You can also specify @option{-flto=jobserver} to use GNU make's
7777 job server mode to determine the number of parallel jobs. This
7778 is useful when the Makefile calling GCC is already executing in parallel.
7779 The parent Makefile will need a @samp{+} prepended to the command recipe
7780 for this to work. This will likely only work if @env{MAKE} is
7781 GNU make.
7782
7783 This option is disabled by default.
7784
7785 @item -flto-partition=@var{alg}
7786 @opindex flto-partition
7787 Specify the partitioning algorithm used by the link time optimizer.
7788 The value is either @code{1to1} to specify a partitioning mirroring
7789 the original source files or @code{balanced} to specify partitioning
7790 into equally sized chunks (whenever possible).  Specifying @code{none}
7791 as an algorithm disables partitioning and streaming completely. The
7792 default value is @code{balanced}.
7793
7794 @item -flto-compression-level=@var{n}
7795 This option specifies the level of compression used for intermediate
7796 language written to LTO object files, and is only meaningful in
7797 conjunction with LTO mode (@option{-flto}).  Valid
7798 values are 0 (no compression) to 9 (maximum compression).  Values
7799 outside this range are clamped to either 0 or 9.  If the option is not
7800 given, a default balanced compression setting is used.
7801
7802 @item -flto-report
7803 Prints a report with internal details on the workings of the link-time
7804 optimizer.  The contents of this report vary from version to version,
7805 it is meant to be useful to GCC developers when processing object
7806 files in LTO mode (via @option{-flto}).
7807
7808 Disabled by default.
7809
7810 @item -fuse-linker-plugin
7811 Enables the use of a linker plugin during link time optimization.  This
7812 option relies on plugin support in the linker, which is available in gold
7813 or in GNU ld 2.21 or newer.
7814
7815 This option enables the extraction of object files with GIMPLE bytecode out
7816 of library archives. This improves the quality of optimization by exposing
7817 more code to the link time optimizer.  This information specifies what
7818 symbols can be accessed externally (by non-LTO object or during dynamic
7819 linking).  Resulting code quality improvements on binaries (and shared
7820 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
7821 See @option{-flto} for a description of the effect of this flag and how to
7822 use it.
7823
7824 Enabled by default when LTO support in GCC is enabled and GCC was compiled
7825 with a linker supporting plugins (GNU ld 2.21 or newer or gold).
7826
7827 @item -fcompare-elim
7828 @opindex fcompare-elim
7829 After register allocation and post-register allocation instruction splitting,
7830 identify arithmetic instructions that compute processor flags similar to a
7831 comparison operation based on that arithmetic.  If possible, eliminate the
7832 explicit comparison operation.
7833
7834 This pass only applies to certain targets that cannot explicitly represent
7835 the comparison operation before register allocation is complete.
7836
7837 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7838
7839 @item -fcprop-registers
7840 @opindex fcprop-registers
7841 After register allocation and post-register allocation instruction splitting,
7842 we perform a copy-propagation pass to try to reduce scheduling dependencies
7843 and occasionally eliminate the copy.
7844
7845 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7846
7847 @item -fprofile-correction
7848 @opindex fprofile-correction
7849 Profiles collected using an instrumented binary for multi-threaded programs may
7850 be inconsistent due to missed counter updates. When this option is specified,
7851 GCC will use heuristics to correct or smooth out such inconsistencies. By
7852 default, GCC will emit an error message when an inconsistent profile is detected.
7853
7854 @item -fprofile-dir=@var{path}
7855 @opindex fprofile-dir
7856
7857 Set the directory to search for the profile data files in to @var{path}.
7858 This option affects only the profile data generated by
7859 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
7860 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
7861 and its related options.  Both absolute and relative paths can be used.
7862 By default, GCC will use the current directory as @var{path}, thus the
7863 profile data file will appear in the same directory as the object file.
7864
7865 @item -fprofile-generate
7866 @itemx -fprofile-generate=@var{path}
7867 @opindex fprofile-generate
7868
7869 Enable options usually used for instrumenting application to produce
7870 profile useful for later recompilation with profile feedback based
7871 optimization.  You must use @option{-fprofile-generate} both when
7872 compiling and when linking your program.
7873
7874 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
7875
7876 If @var{path} is specified, GCC will look at the @var{path} to find
7877 the profile feedback data files. See @option{-fprofile-dir}.
7878
7879 @item -fprofile-use
7880 @itemx -fprofile-use=@var{path}
7881 @opindex fprofile-use
7882 Enable profile feedback directed optimizations, and optimizations
7883 generally profitable only with profile feedback available.
7884
7885 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
7886 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
7887
7888 By default, GCC emits an error message if the feedback profiles do not
7889 match the source code.  This error can be turned into a warning by using
7890 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
7891 code.
7892
7893 If @var{path} is specified, GCC will look at the @var{path} to find
7894 the profile feedback data files. See @option{-fprofile-dir}.
7895 @end table
7896
7897 The following options control compiler behavior regarding floating
7898 point arithmetic.  These options trade off between speed and
7899 correctness.  All must be specifically enabled.
7900
7901 @table @gcctabopt
7902 @item -ffloat-store
7903 @opindex ffloat-store
7904 Do not store floating point variables in registers, and inhibit other
7905 options that might change whether a floating point value is taken from a
7906 register or memory.
7907
7908 @cindex floating point precision
7909 This option prevents undesirable excess precision on machines such as
7910 the 68000 where the floating registers (of the 68881) keep more
7911 precision than a @code{double} is supposed to have.  Similarly for the
7912 x86 architecture.  For most programs, the excess precision does only
7913 good, but a few programs rely on the precise definition of IEEE floating
7914 point.  Use @option{-ffloat-store} for such programs, after modifying
7915 them to store all pertinent intermediate computations into variables.
7916
7917 @item -fexcess-precision=@var{style}
7918 @opindex fexcess-precision
7919 This option allows further control over excess precision on machines
7920 where floating-point registers have more precision than the IEEE
7921 @code{float} and @code{double} types and the processor does not
7922 support operations rounding to those types.  By default,
7923 @option{-fexcess-precision=fast} is in effect; this means that
7924 operations are carried out in the precision of the registers and that
7925 it is unpredictable when rounding to the types specified in the source
7926 code takes place.  When compiling C, if
7927 @option{-fexcess-precision=standard} is specified then excess
7928 precision will follow the rules specified in ISO C99; in particular,
7929 both casts and assignments cause values to be rounded to their
7930 semantic types (whereas @option{-ffloat-store} only affects
7931 assignments).  This option is enabled by default for C if a strict
7932 conformance option such as @option{-std=c99} is used.
7933
7934 @opindex mfpmath
7935 @option{-fexcess-precision=standard} is not implemented for languages
7936 other than C, and has no effect if
7937 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
7938 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
7939 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
7940 semantics apply without excess precision, and in the latter, rounding
7941 is unpredictable.
7942
7943 @item -ffast-math
7944 @opindex ffast-math
7945 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
7946 @option{-ffinite-math-only}, @option{-fno-rounding-math},
7947 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
7948
7949 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
7950
7951 This option is not turned on by any @option{-O} option besides
7952 @option{-Ofast} since it can result in incorrect output for programs
7953 which depend on an exact implementation of IEEE or ISO rules/specifications
7954 for math functions. It may, however, yield faster code for programs
7955 that do not require the guarantees of these specifications.
7956
7957 @item -fno-math-errno
7958 @opindex fno-math-errno
7959 Do not set ERRNO after calling math functions that are executed
7960 with a single instruction, e.g., sqrt.  A program that relies on
7961 IEEE exceptions for math error handling may want to use this flag
7962 for speed while maintaining IEEE arithmetic compatibility.
7963
7964 This option is not turned on by any @option{-O} option since
7965 it can result in incorrect output for programs which depend on
7966 an exact implementation of IEEE or ISO rules/specifications for
7967 math functions. It may, however, yield faster code for programs
7968 that do not require the guarantees of these specifications.
7969
7970 The default is @option{-fmath-errno}.
7971
7972 On Darwin systems, the math library never sets @code{errno}.  There is
7973 therefore no reason for the compiler to consider the possibility that
7974 it might, and @option{-fno-math-errno} is the default.
7975
7976 @item -funsafe-math-optimizations
7977 @opindex funsafe-math-optimizations
7978
7979 Allow optimizations for floating-point arithmetic that (a) assume
7980 that arguments and results are valid and (b) may violate IEEE or
7981 ANSI standards.  When used at link-time, it may include libraries
7982 or startup files that change the default FPU control word or other
7983 similar optimizations.
7984
7985 This option is not turned on by any @option{-O} option since
7986 it can result in incorrect output for programs which depend on
7987 an exact implementation of IEEE or ISO rules/specifications for
7988 math functions. It may, however, yield faster code for programs
7989 that do not require the guarantees of these specifications.
7990 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
7991 @option{-fassociative-math} and @option{-freciprocal-math}.
7992
7993 The default is @option{-fno-unsafe-math-optimizations}.
7994
7995 @item -fassociative-math
7996 @opindex fassociative-math
7997
7998 Allow re-association of operands in series of floating-point operations.
7999 This violates the ISO C and C++ language standard by possibly changing
8000 computation result.  NOTE: re-ordering may change the sign of zero as
8001 well as ignore NaNs and inhibit or create underflow or overflow (and
8002 thus cannot be used on a code which relies on rounding behavior like
8003 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
8004 and thus may not be used when ordered comparisons are required.
8005 This option requires that both @option{-fno-signed-zeros} and
8006 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8007 much sense with @option{-frounding-math}. For Fortran the option
8008 is automatically enabled when both @option{-fno-signed-zeros} and
8009 @option{-fno-trapping-math} are in effect.
8010
8011 The default is @option{-fno-associative-math}.
8012
8013 @item -freciprocal-math
8014 @opindex freciprocal-math
8015
8016 Allow the reciprocal of a value to be used instead of dividing by
8017 the value if this enables optimizations.  For example @code{x / y}
8018 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
8019 is subject to common subexpression elimination.  Note that this loses
8020 precision and increases the number of flops operating on the value.
8021
8022 The default is @option{-fno-reciprocal-math}.
8023
8024 @item -ffinite-math-only
8025 @opindex ffinite-math-only
8026 Allow optimizations for floating-point arithmetic that assume
8027 that arguments and results are not NaNs or +-Infs.
8028
8029 This option is not turned on by any @option{-O} option since
8030 it can result in incorrect output for programs which depend on
8031 an exact implementation of IEEE or ISO rules/specifications for
8032 math functions. It may, however, yield faster code for programs
8033 that do not require the guarantees of these specifications.
8034
8035 The default is @option{-fno-finite-math-only}.
8036
8037 @item -fno-signed-zeros
8038 @opindex fno-signed-zeros
8039 Allow optimizations for floating point arithmetic that ignore the
8040 signedness of zero.  IEEE arithmetic specifies the behavior of
8041 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8042 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8043 This option implies that the sign of a zero result isn't significant.
8044
8045 The default is @option{-fsigned-zeros}.
8046
8047 @item -fno-trapping-math
8048 @opindex fno-trapping-math
8049 Compile code assuming that floating-point operations cannot generate
8050 user-visible traps.  These traps include division by zero, overflow,
8051 underflow, inexact result and invalid operation.  This option requires
8052 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8053 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8054
8055 This option should never be turned on by any @option{-O} option since
8056 it can result in incorrect output for programs which depend on
8057 an exact implementation of IEEE or ISO rules/specifications for
8058 math functions.
8059
8060 The default is @option{-ftrapping-math}.
8061
8062 @item -frounding-math
8063 @opindex frounding-math
8064 Disable transformations and optimizations that assume default floating
8065 point rounding behavior.  This is round-to-zero for all floating point
8066 to integer conversions, and round-to-nearest for all other arithmetic
8067 truncations.  This option should be specified for programs that change
8068 the FP rounding mode dynamically, or that may be executed with a
8069 non-default rounding mode.  This option disables constant folding of
8070 floating point expressions at compile-time (which may be affected by
8071 rounding mode) and arithmetic transformations that are unsafe in the
8072 presence of sign-dependent rounding modes.
8073
8074 The default is @option{-fno-rounding-math}.
8075
8076 This option is experimental and does not currently guarantee to
8077 disable all GCC optimizations that are affected by rounding mode.
8078 Future versions of GCC may provide finer control of this setting
8079 using C99's @code{FENV_ACCESS} pragma.  This command line option
8080 will be used to specify the default state for @code{FENV_ACCESS}.
8081
8082 @item -fsignaling-nans
8083 @opindex fsignaling-nans
8084 Compile code assuming that IEEE signaling NaNs may generate user-visible
8085 traps during floating-point operations.  Setting this option disables
8086 optimizations that may change the number of exceptions visible with
8087 signaling NaNs.  This option implies @option{-ftrapping-math}.
8088
8089 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8090 be defined.
8091
8092 The default is @option{-fno-signaling-nans}.
8093
8094 This option is experimental and does not currently guarantee to
8095 disable all GCC optimizations that affect signaling NaN behavior.
8096
8097 @item -fsingle-precision-constant
8098 @opindex fsingle-precision-constant
8099 Treat floating point constant as single precision constant instead of
8100 implicitly converting it to double precision constant.
8101
8102 @item -fcx-limited-range
8103 @opindex fcx-limited-range
8104 When enabled, this option states that a range reduction step is not
8105 needed when performing complex division.  Also, there is no checking
8106 whether the result of a complex multiplication or division is @code{NaN
8107 + I*NaN}, with an attempt to rescue the situation in that case.  The
8108 default is @option{-fno-cx-limited-range}, but is enabled by
8109 @option{-ffast-math}.
8110
8111 This option controls the default setting of the ISO C99
8112 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8113 all languages.
8114
8115 @item -fcx-fortran-rules
8116 @opindex fcx-fortran-rules
8117 Complex multiplication and division follow Fortran rules.  Range
8118 reduction is done as part of complex division, but there is no checking
8119 whether the result of a complex multiplication or division is @code{NaN
8120 + I*NaN}, with an attempt to rescue the situation in that case.
8121
8122 The default is @option{-fno-cx-fortran-rules}.
8123
8124 @end table
8125
8126 The following options control optimizations that may improve
8127 performance, but are not enabled by any @option{-O} options.  This
8128 section includes experimental options that may produce broken code.
8129
8130 @table @gcctabopt
8131 @item -fbranch-probabilities
8132 @opindex fbranch-probabilities
8133 After running a program compiled with @option{-fprofile-arcs}
8134 (@pxref{Debugging Options,, Options for Debugging Your Program or
8135 @command{gcc}}), you can compile it a second time using
8136 @option{-fbranch-probabilities}, to improve optimizations based on
8137 the number of times each branch was taken.  When the program
8138 compiled with @option{-fprofile-arcs} exits it saves arc execution
8139 counts to a file called @file{@var{sourcename}.gcda} for each source
8140 file.  The information in this data file is very dependent on the
8141 structure of the generated code, so you must use the same source code
8142 and the same optimization options for both compilations.
8143
8144 With @option{-fbranch-probabilities}, GCC puts a
8145 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8146 These can be used to improve optimization.  Currently, they are only
8147 used in one place: in @file{reorg.c}, instead of guessing which path a
8148 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8149 exactly determine which path is taken more often.
8150
8151 @item -fprofile-values
8152 @opindex fprofile-values
8153 If combined with @option{-fprofile-arcs}, it adds code so that some
8154 data about values of expressions in the program is gathered.
8155
8156 With @option{-fbranch-probabilities}, it reads back the data gathered
8157 from profiling values of expressions for usage in optimizations.
8158
8159 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8160
8161 @item -fvpt
8162 @opindex fvpt
8163 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
8164 a code to gather information about values of expressions.
8165
8166 With @option{-fbranch-probabilities}, it reads back the data gathered
8167 and actually performs the optimizations based on them.
8168 Currently the optimizations include specialization of division operation
8169 using the knowledge about the value of the denominator.
8170
8171 @item -frename-registers
8172 @opindex frename-registers
8173 Attempt to avoid false dependencies in scheduled code by making use
8174 of registers left over after register allocation.  This optimization
8175 will most benefit processors with lots of registers.  Depending on the
8176 debug information format adopted by the target, however, it can
8177 make debugging impossible, since variables will no longer stay in
8178 a ``home register''.
8179
8180 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8181
8182 @item -ftracer
8183 @opindex ftracer
8184 Perform tail duplication to enlarge superblock size.  This transformation
8185 simplifies the control flow of the function allowing other optimizations to do
8186 better job.
8187
8188 Enabled with @option{-fprofile-use}.
8189
8190 @item -funroll-loops
8191 @opindex funroll-loops
8192 Unroll loops whose number of iterations can be determined at compile time or
8193 upon entry to the loop.  @option{-funroll-loops} implies
8194 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8195 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8196 small constant number of iterations).  This option makes code larger, and may
8197 or may not make it run faster.
8198
8199 Enabled with @option{-fprofile-use}.
8200
8201 @item -funroll-all-loops
8202 @opindex funroll-all-loops
8203 Unroll all loops, even if their number of iterations is uncertain when
8204 the loop is entered.  This usually makes programs run more slowly.
8205 @option{-funroll-all-loops} implies the same options as
8206 @option{-funroll-loops}.
8207
8208 @item -fpeel-loops
8209 @opindex fpeel-loops
8210 Peels the loops for that there is enough information that they do not
8211 roll much (from profile feedback).  It also turns on complete loop peeling
8212 (i.e.@: complete removal of loops with small constant number of iterations).
8213
8214 Enabled with @option{-fprofile-use}.
8215
8216 @item -fmove-loop-invariants
8217 @opindex fmove-loop-invariants
8218 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8219 at level @option{-O1}
8220
8221 @item -funswitch-loops
8222 @opindex funswitch-loops
8223 Move branches with loop invariant conditions out of the loop, with duplicates
8224 of the loop on both branches (modified according to result of the condition).
8225
8226 @item -ffunction-sections
8227 @itemx -fdata-sections
8228 @opindex ffunction-sections
8229 @opindex fdata-sections
8230 Place each function or data item into its own section in the output
8231 file if the target supports arbitrary sections.  The name of the
8232 function or the name of the data item determines the section's name
8233 in the output file.
8234
8235 Use these options on systems where the linker can perform optimizations
8236 to improve locality of reference in the instruction space.  Most systems
8237 using the ELF object format and SPARC processors running Solaris 2 have
8238 linkers with such optimizations.  AIX may have these optimizations in
8239 the future.
8240
8241 Only use these options when there are significant benefits from doing
8242 so.  When you specify these options, the assembler and linker will
8243 create larger object and executable files and will also be slower.
8244 You will not be able to use @code{gprof} on all systems if you
8245 specify this option and you may have problems with debugging if
8246 you specify both this option and @option{-g}.
8247
8248 @item -fbranch-target-load-optimize
8249 @opindex fbranch-target-load-optimize
8250 Perform branch target register load optimization before prologue / epilogue
8251 threading.
8252 The use of target registers can typically be exposed only during reload,
8253 thus hoisting loads out of loops and doing inter-block scheduling needs
8254 a separate optimization pass.
8255
8256 @item -fbranch-target-load-optimize2
8257 @opindex fbranch-target-load-optimize2
8258 Perform branch target register load optimization after prologue / epilogue
8259 threading.
8260
8261 @item -fbtr-bb-exclusive
8262 @opindex fbtr-bb-exclusive
8263 When performing branch target register load optimization, don't reuse
8264 branch target registers in within any basic block.
8265
8266 @item -fstack-protector
8267 @opindex fstack-protector
8268 Emit extra code to check for buffer overflows, such as stack smashing
8269 attacks.  This is done by adding a guard variable to functions with
8270 vulnerable objects.  This includes functions that call alloca, and
8271 functions with buffers larger than 8 bytes.  The guards are initialized
8272 when a function is entered and then checked when the function exits.
8273 If a guard check fails, an error message is printed and the program exits.
8274
8275 @item -fstack-protector-all
8276 @opindex fstack-protector-all
8277 Like @option{-fstack-protector} except that all functions are protected.
8278
8279 @item -fsection-anchors
8280 @opindex fsection-anchors
8281 Try to reduce the number of symbolic address calculations by using
8282 shared ``anchor'' symbols to address nearby objects.  This transformation
8283 can help to reduce the number of GOT entries and GOT accesses on some
8284 targets.
8285
8286 For example, the implementation of the following function @code{foo}:
8287
8288 @smallexample
8289 static int a, b, c;
8290 int foo (void) @{ return a + b + c; @}
8291 @end smallexample
8292
8293 would usually calculate the addresses of all three variables, but if you
8294 compile it with @option{-fsection-anchors}, it will access the variables
8295 from a common anchor point instead.  The effect is similar to the
8296 following pseudocode (which isn't valid C):
8297
8298 @smallexample
8299 int foo (void)
8300 @{
8301   register int *xr = &x;
8302   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8303 @}
8304 @end smallexample
8305
8306 Not all targets support this option.
8307
8308 @item --param @var{name}=@var{value}
8309 @opindex param
8310 In some places, GCC uses various constants to control the amount of
8311 optimization that is done.  For example, GCC will not inline functions
8312 that contain more that a certain number of instructions.  You can
8313 control some of these constants on the command-line using the
8314 @option{--param} option.
8315
8316 The names of specific parameters, and the meaning of the values, are
8317 tied to the internals of the compiler, and are subject to change
8318 without notice in future releases.
8319
8320 In each case, the @var{value} is an integer.  The allowable choices for
8321 @var{name} are given in the following table:
8322
8323 @table @gcctabopt
8324 @item predictable-branch-outcome
8325 When branch is predicted to be taken with probability lower than this threshold
8326 (in percent), then it is considered well predictable. The default is 10.
8327
8328 @item max-crossjump-edges
8329 The maximum number of incoming edges to consider for crossjumping.
8330 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8331 the number of edges incoming to each block.  Increasing values mean
8332 more aggressive optimization, making the compile time increase with
8333 probably small improvement in executable size.
8334
8335 @item min-crossjump-insns
8336 The minimum number of instructions which must be matched at the end
8337 of two blocks before crossjumping will be performed on them.  This
8338 value is ignored in the case where all instructions in the block being
8339 crossjumped from are matched.  The default value is 5.
8340
8341 @item max-grow-copy-bb-insns
8342 The maximum code size expansion factor when copying basic blocks
8343 instead of jumping.  The expansion is relative to a jump instruction.
8344 The default value is 8.
8345
8346 @item max-goto-duplication-insns
8347 The maximum number of instructions to duplicate to a block that jumps
8348 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8349 passes, GCC factors computed gotos early in the compilation process,
8350 and unfactors them as late as possible.  Only computed jumps at the
8351 end of a basic blocks with no more than max-goto-duplication-insns are
8352 unfactored.  The default value is 8.
8353
8354 @item max-delay-slot-insn-search
8355 The maximum number of instructions to consider when looking for an
8356 instruction to fill a delay slot.  If more than this arbitrary number of
8357 instructions is searched, the time savings from filling the delay slot
8358 will be minimal so stop searching.  Increasing values mean more
8359 aggressive optimization, making the compile time increase with probably
8360 small improvement in executable run time.
8361
8362 @item max-delay-slot-live-search
8363 When trying to fill delay slots, the maximum number of instructions to
8364 consider when searching for a block with valid live register
8365 information.  Increasing this arbitrarily chosen value means more
8366 aggressive optimization, increasing the compile time.  This parameter
8367 should be removed when the delay slot code is rewritten to maintain the
8368 control-flow graph.
8369
8370 @item max-gcse-memory
8371 The approximate maximum amount of memory that will be allocated in
8372 order to perform the global common subexpression elimination
8373 optimization.  If more memory than specified is required, the
8374 optimization will not be done.
8375
8376 @item max-gcse-insertion-ratio
8377 If the ratio of expression insertions to deletions is larger than this value
8378 for any expression, then RTL PRE will insert or remove the expression and thus
8379 leave partially redundant computations in the instruction stream.  The default value is 20.
8380
8381 @item max-pending-list-length
8382 The maximum number of pending dependencies scheduling will allow
8383 before flushing the current state and starting over.  Large functions
8384 with few branches or calls can create excessively large lists which
8385 needlessly consume memory and resources.
8386
8387 @item max-inline-insns-single
8388 Several parameters control the tree inliner used in gcc.
8389 This number sets the maximum number of instructions (counted in GCC's
8390 internal representation) in a single function that the tree inliner
8391 will consider for inlining.  This only affects functions declared
8392 inline and methods implemented in a class declaration (C++).
8393 The default value is 400.
8394
8395 @item max-inline-insns-auto
8396 When you use @option{-finline-functions} (included in @option{-O3}),
8397 a lot of functions that would otherwise not be considered for inlining
8398 by the compiler will be investigated.  To those functions, a different
8399 (more restrictive) limit compared to functions declared inline can
8400 be applied.
8401 The default value is 40.
8402
8403 @item large-function-insns
8404 The limit specifying really large functions.  For functions larger than this
8405 limit after inlining, inlining is constrained by
8406 @option{--param large-function-growth}.  This parameter is useful primarily
8407 to avoid extreme compilation time caused by non-linear algorithms used by the
8408 backend.
8409 The default value is 2700.
8410
8411 @item large-function-growth
8412 Specifies maximal growth of large function caused by inlining in percents.
8413 The default value is 100 which limits large function growth to 2.0 times
8414 the original size.
8415
8416 @item large-unit-insns
8417 The limit specifying large translation unit.  Growth caused by inlining of
8418 units larger than this limit is limited by @option{--param inline-unit-growth}.
8419 For small units this might be too tight (consider unit consisting of function A
8420 that is inline and B that just calls A three time.  If B is small relative to
8421 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8422 large units consisting of small inlineable functions however the overall unit
8423 growth limit is needed to avoid exponential explosion of code size.  Thus for
8424 smaller units, the size is increased to @option{--param large-unit-insns}
8425 before applying @option{--param inline-unit-growth}.  The default is 10000
8426
8427 @item inline-unit-growth
8428 Specifies maximal overall growth of the compilation unit caused by inlining.
8429 The default value is 30 which limits unit growth to 1.3 times the original
8430 size.
8431
8432 @item ipcp-unit-growth
8433 Specifies maximal overall growth of the compilation unit caused by
8434 interprocedural constant propagation.  The default value is 10 which limits
8435 unit growth to 1.1 times the original size.
8436
8437 @item large-stack-frame
8438 The limit specifying large stack frames.  While inlining the algorithm is trying
8439 to not grow past this limit too much.  Default value is 256 bytes.
8440
8441 @item large-stack-frame-growth
8442 Specifies maximal growth of large stack frames caused by inlining in percents.
8443 The default value is 1000 which limits large stack frame growth to 11 times
8444 the original size.
8445
8446 @item max-inline-insns-recursive
8447 @itemx max-inline-insns-recursive-auto
8448 Specifies maximum number of instructions out-of-line copy of self recursive inline
8449 function can grow into by performing recursive inlining.
8450
8451 For functions declared inline @option{--param max-inline-insns-recursive} is
8452 taken into account.  For function not declared inline, recursive inlining
8453 happens only when @option{-finline-functions} (included in @option{-O3}) is
8454 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8455 default value is 450.
8456
8457 @item max-inline-recursive-depth
8458 @itemx max-inline-recursive-depth-auto
8459 Specifies maximum recursion depth used by the recursive inlining.
8460
8461 For functions declared inline @option{--param max-inline-recursive-depth} is
8462 taken into account.  For function not declared inline, recursive inlining
8463 happens only when @option{-finline-functions} (included in @option{-O3}) is
8464 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8465 default value is 8.
8466
8467 @item min-inline-recursive-probability
8468 Recursive inlining is profitable only for function having deep recursion
8469 in average and can hurt for function having little recursion depth by
8470 increasing the prologue size or complexity of function body to other
8471 optimizers.
8472
8473 When profile feedback is available (see @option{-fprofile-generate}) the actual
8474 recursion depth can be guessed from probability that function will recurse via
8475 given call expression.  This parameter limits inlining only to call expression
8476 whose probability exceeds given threshold (in percents).  The default value is
8477 10.
8478
8479 @item early-inlining-insns
8480 Specify growth that early inliner can make.  In effect it increases amount of
8481 inlining for code having large abstraction penalty.  The default value is 10.
8482
8483 @item max-early-inliner-iterations
8484 @itemx max-early-inliner-iterations
8485 Limit of iterations of early inliner.  This basically bounds number of nested
8486 indirect calls early inliner can resolve.  Deeper chains are still handled by
8487 late inlining.
8488
8489 @item comdat-sharing-probability
8490 @itemx comdat-sharing-probability
8491 Probability (in percent) that C++ inline function with comdat visibility
8492 will be shared across multiple compilation units.  The default value is 20.
8493
8494 @item min-vect-loop-bound
8495 The minimum number of iterations under which a loop will not get vectorized
8496 when @option{-ftree-vectorize} is used.  The number of iterations after
8497 vectorization needs to be greater than the value specified by this option
8498 to allow vectorization.  The default value is 0.
8499
8500 @item gcse-cost-distance-ratio
8501 Scaling factor in calculation of maximum distance an expression
8502 can be moved by GCSE optimizations.  This is currently supported only in the
8503 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
8504 will be with simple expressions, i.e., the expressions which have cost
8505 less than @option{gcse-unrestricted-cost}.  Specifying 0 will disable
8506 hoisting of simple expressions.  The default value is 10.
8507
8508 @item gcse-unrestricted-cost
8509 Cost, roughly measured as the cost of a single typical machine
8510 instruction, at which GCSE optimizations will not constrain
8511 the distance an expression can travel.  This is currently
8512 supported only in the code hoisting pass.  The lesser the cost,
8513 the more aggressive code hoisting will be.  Specifying 0 will
8514 allow all expressions to travel unrestricted distances.
8515 The default value is 3.
8516
8517 @item max-hoist-depth
8518 The depth of search in the dominator tree for expressions to hoist.
8519 This is used to avoid quadratic behavior in hoisting algorithm.
8520 The value of 0 will avoid limiting the search, but may slow down compilation
8521 of huge functions.  The default value is 30.
8522
8523 @item max-unrolled-insns
8524 The maximum number of instructions that a loop should have if that loop
8525 is unrolled, and if the loop is unrolled, it determines how many times
8526 the loop code is unrolled.
8527
8528 @item max-average-unrolled-insns
8529 The maximum number of instructions biased by probabilities of their execution
8530 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8531 it determines how many times the loop code is unrolled.
8532
8533 @item max-unroll-times
8534 The maximum number of unrollings of a single loop.
8535
8536 @item max-peeled-insns
8537 The maximum number of instructions that a loop should have if that loop
8538 is peeled, and if the loop is peeled, it determines how many times
8539 the loop code is peeled.
8540
8541 @item max-peel-times
8542 The maximum number of peelings of a single loop.
8543
8544 @item max-completely-peeled-insns
8545 The maximum number of insns of a completely peeled loop.
8546
8547 @item max-completely-peel-times
8548 The maximum number of iterations of a loop to be suitable for complete peeling.
8549
8550 @item max-completely-peel-loop-nest-depth
8551 The maximum depth of a loop nest suitable for complete peeling.
8552
8553 @item max-unswitch-insns
8554 The maximum number of insns of an unswitched loop.
8555
8556 @item max-unswitch-level
8557 The maximum number of branches unswitched in a single loop.
8558
8559 @item lim-expensive
8560 The minimum cost of an expensive expression in the loop invariant motion.
8561
8562 @item iv-consider-all-candidates-bound
8563 Bound on number of candidates for induction variables below that
8564 all candidates are considered for each use in induction variable
8565 optimizations.  Only the most relevant candidates are considered
8566 if there are more candidates, to avoid quadratic time complexity.
8567
8568 @item iv-max-considered-uses
8569 The induction variable optimizations give up on loops that contain more
8570 induction variable uses.
8571
8572 @item iv-always-prune-cand-set-bound
8573 If number of candidates in the set is smaller than this value,
8574 we always try to remove unnecessary ivs from the set during its
8575 optimization when a new iv is added to the set.
8576
8577 @item scev-max-expr-size
8578 Bound on size of expressions used in the scalar evolutions analyzer.
8579 Large expressions slow the analyzer.
8580
8581 @item scev-max-expr-complexity
8582 Bound on the complexity of the expressions in the scalar evolutions analyzer.
8583 Complex expressions slow the analyzer.
8584
8585 @item omega-max-vars
8586 The maximum number of variables in an Omega constraint system.
8587 The default value is 128.
8588
8589 @item omega-max-geqs
8590 The maximum number of inequalities in an Omega constraint system.
8591 The default value is 256.
8592
8593 @item omega-max-eqs
8594 The maximum number of equalities in an Omega constraint system.
8595 The default value is 128.
8596
8597 @item omega-max-wild-cards
8598 The maximum number of wildcard variables that the Omega solver will
8599 be able to insert.  The default value is 18.
8600
8601 @item omega-hash-table-size
8602 The size of the hash table in the Omega solver.  The default value is
8603 550.
8604
8605 @item omega-max-keys
8606 The maximal number of keys used by the Omega solver.  The default
8607 value is 500.
8608
8609 @item omega-eliminate-redundant-constraints
8610 When set to 1, use expensive methods to eliminate all redundant
8611 constraints.  The default value is 0.
8612
8613 @item vect-max-version-for-alignment-checks
8614 The maximum number of runtime checks that can be performed when
8615 doing loop versioning for alignment in the vectorizer.  See option
8616 ftree-vect-loop-version for more information.
8617
8618 @item vect-max-version-for-alias-checks
8619 The maximum number of runtime checks that can be performed when
8620 doing loop versioning for alias in the vectorizer.  See option
8621 ftree-vect-loop-version for more information.
8622
8623 @item max-iterations-to-track
8624
8625 The maximum number of iterations of a loop the brute force algorithm
8626 for analysis of # of iterations of the loop tries to evaluate.
8627
8628 @item hot-bb-count-fraction
8629 Select fraction of the maximal count of repetitions of basic block in program
8630 given basic block needs to have to be considered hot.
8631
8632 @item hot-bb-frequency-fraction
8633 Select fraction of the entry block frequency of executions of basic block in
8634 function given basic block needs to have to be considered hot.
8635
8636 @item max-predicted-iterations
8637 The maximum number of loop iterations we predict statically.  This is useful
8638 in cases where function contain single loop with known bound and other loop
8639 with unknown.  We predict the known number of iterations correctly, while
8640 the unknown number of iterations average to roughly 10.  This means that the
8641 loop without bounds would appear artificially cold relative to the other one.
8642
8643 @item align-threshold
8644
8645 Select fraction of the maximal frequency of executions of basic block in
8646 function given basic block will get aligned.
8647
8648 @item align-loop-iterations
8649
8650 A loop expected to iterate at lest the selected number of iterations will get
8651 aligned.
8652
8653 @item tracer-dynamic-coverage
8654 @itemx tracer-dynamic-coverage-feedback
8655
8656 This value is used to limit superblock formation once the given percentage of
8657 executed instructions is covered.  This limits unnecessary code size
8658 expansion.
8659
8660 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8661 feedback is available.  The real profiles (as opposed to statically estimated
8662 ones) are much less balanced allowing the threshold to be larger value.
8663
8664 @item tracer-max-code-growth
8665 Stop tail duplication once code growth has reached given percentage.  This is
8666 rather hokey argument, as most of the duplicates will be eliminated later in
8667 cross jumping, so it may be set to much higher values than is the desired code
8668 growth.
8669
8670 @item tracer-min-branch-ratio
8671
8672 Stop reverse growth when the reverse probability of best edge is less than this
8673 threshold (in percent).
8674
8675 @item tracer-min-branch-ratio
8676 @itemx tracer-min-branch-ratio-feedback
8677
8678 Stop forward growth if the best edge do have probability lower than this
8679 threshold.
8680
8681 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8682 compilation for profile feedback and one for compilation without.  The value
8683 for compilation with profile feedback needs to be more conservative (higher) in
8684 order to make tracer effective.
8685
8686 @item max-cse-path-length
8687
8688 Maximum number of basic blocks on path that cse considers.  The default is 10.
8689
8690 @item max-cse-insns
8691 The maximum instructions CSE process before flushing. The default is 1000.
8692
8693 @item ggc-min-expand
8694
8695 GCC uses a garbage collector to manage its own memory allocation.  This
8696 parameter specifies the minimum percentage by which the garbage
8697 collector's heap should be allowed to expand between collections.
8698 Tuning this may improve compilation speed; it has no effect on code
8699 generation.
8700
8701 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8702 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
8703 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8704 GCC is not able to calculate RAM on a particular platform, the lower
8705 bound of 30% is used.  Setting this parameter and
8706 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8707 every opportunity.  This is extremely slow, but can be useful for
8708 debugging.
8709
8710 @item ggc-min-heapsize
8711
8712 Minimum size of the garbage collector's heap before it begins bothering
8713 to collect garbage.  The first collection occurs after the heap expands
8714 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8715 tuning this may improve compilation speed, and has no effect on code
8716 generation.
8717
8718 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
8719 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8720 with a lower bound of 4096 (four megabytes) and an upper bound of
8721 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8722 particular platform, the lower bound is used.  Setting this parameter
8723 very large effectively disables garbage collection.  Setting this
8724 parameter and @option{ggc-min-expand} to zero causes a full collection
8725 to occur at every opportunity.
8726
8727 @item max-reload-search-insns
8728 The maximum number of instruction reload should look backward for equivalent
8729 register.  Increasing values mean more aggressive optimization, making the
8730 compile time increase with probably slightly better performance.  The default
8731 value is 100.
8732
8733 @item max-cselib-memory-locations
8734 The maximum number of memory locations cselib should take into account.
8735 Increasing values mean more aggressive optimization, making the compile time
8736 increase with probably slightly better performance.  The default value is 500.
8737
8738 @item reorder-blocks-duplicate
8739 @itemx reorder-blocks-duplicate-feedback
8740
8741 Used by basic block reordering pass to decide whether to use unconditional
8742 branch or duplicate the code on its destination.  Code is duplicated when its
8743 estimated size is smaller than this value multiplied by the estimated size of
8744 unconditional jump in the hot spots of the program.
8745
8746 The @option{reorder-block-duplicate-feedback} is used only when profile
8747 feedback is available and may be set to higher values than
8748 @option{reorder-block-duplicate} since information about the hot spots is more
8749 accurate.
8750
8751 @item max-sched-ready-insns
8752 The maximum number of instructions ready to be issued the scheduler should
8753 consider at any given time during the first scheduling pass.  Increasing
8754 values mean more thorough searches, making the compilation time increase
8755 with probably little benefit.  The default value is 100.
8756
8757 @item max-sched-region-blocks
8758 The maximum number of blocks in a region to be considered for
8759 interblock scheduling.  The default value is 10.
8760
8761 @item max-pipeline-region-blocks
8762 The maximum number of blocks in a region to be considered for
8763 pipelining in the selective scheduler.  The default value is 15.
8764
8765 @item max-sched-region-insns
8766 The maximum number of insns in a region to be considered for
8767 interblock scheduling.  The default value is 100.
8768
8769 @item max-pipeline-region-insns
8770 The maximum number of insns in a region to be considered for
8771 pipelining in the selective scheduler.  The default value is 200.
8772
8773 @item min-spec-prob
8774 The minimum probability (in percents) of reaching a source block
8775 for interblock speculative scheduling.  The default value is 40.
8776
8777 @item max-sched-extend-regions-iters
8778 The maximum number of iterations through CFG to extend regions.
8779 0 - disable region extension,
8780 N - do at most N iterations.
8781 The default value is 0.
8782
8783 @item max-sched-insn-conflict-delay
8784 The maximum conflict delay for an insn to be considered for speculative motion.
8785 The default value is 3.
8786
8787 @item sched-spec-prob-cutoff
8788 The minimal probability of speculation success (in percents), so that
8789 speculative insn will be scheduled.
8790 The default value is 40.
8791
8792 @item sched-mem-true-dep-cost
8793 Minimal distance (in CPU cycles) between store and load targeting same
8794 memory locations.  The default value is 1.
8795
8796 @item selsched-max-lookahead
8797 The maximum size of the lookahead window of selective scheduling.  It is a
8798 depth of search for available instructions.
8799 The default value is 50.
8800
8801 @item selsched-max-sched-times
8802 The maximum number of times that an instruction will be scheduled during
8803 selective scheduling.  This is the limit on the number of iterations
8804 through which the instruction may be pipelined.  The default value is 2.
8805
8806 @item selsched-max-insns-to-rename
8807 The maximum number of best instructions in the ready list that are considered
8808 for renaming in the selective scheduler.  The default value is 2.
8809
8810 @item sms-min-sc
8811 The minimum value of stage count that swing modulo scheduler will
8812 generate.  The default value is 2.
8813
8814 @item max-last-value-rtl
8815 The maximum size measured as number of RTLs that can be recorded in an expression
8816 in combiner for a pseudo register as last known value of that register.  The default
8817 is 10000.
8818
8819 @item integer-share-limit
8820 Small integer constants can use a shared data structure, reducing the
8821 compiler's memory usage and increasing its speed.  This sets the maximum
8822 value of a shared integer constant.  The default value is 256.
8823
8824 @item min-virtual-mappings
8825 Specifies the minimum number of virtual mappings in the incremental
8826 SSA updater that should be registered to trigger the virtual mappings
8827 heuristic defined by virtual-mappings-ratio.  The default value is
8828 100.
8829
8830 @item virtual-mappings-ratio
8831 If the number of virtual mappings is virtual-mappings-ratio bigger
8832 than the number of virtual symbols to be updated, then the incremental
8833 SSA updater switches to a full update for those symbols.  The default
8834 ratio is 3.
8835
8836 @item ssp-buffer-size
8837 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
8838 protection when @option{-fstack-protection} is used.
8839
8840 @item max-jump-thread-duplication-stmts
8841 Maximum number of statements allowed in a block that needs to be
8842 duplicated when threading jumps.
8843
8844 @item max-fields-for-field-sensitive
8845 Maximum number of fields in a structure we will treat in
8846 a field sensitive manner during pointer analysis.  The default is zero
8847 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
8848
8849 @item prefetch-latency
8850 Estimate on average number of instructions that are executed before
8851 prefetch finishes.  The distance we prefetch ahead is proportional
8852 to this constant.  Increasing this number may also lead to less
8853 streams being prefetched (see @option{simultaneous-prefetches}).
8854
8855 @item simultaneous-prefetches
8856 Maximum number of prefetches that can run at the same time.
8857
8858 @item l1-cache-line-size
8859 The size of cache line in L1 cache, in bytes.
8860
8861 @item l1-cache-size
8862 The size of L1 cache, in kilobytes.
8863
8864 @item l2-cache-size
8865 The size of L2 cache, in kilobytes.
8866
8867 @item min-insn-to-prefetch-ratio
8868 The minimum ratio between the number of instructions and the
8869 number of prefetches to enable prefetching in a loop.
8870
8871 @item prefetch-min-insn-to-mem-ratio
8872 The minimum ratio between the number of instructions and the
8873 number of memory references to enable prefetching in a loop.
8874
8875 @item use-canonical-types
8876 Whether the compiler should use the ``canonical'' type system.  By
8877 default, this should always be 1, which uses a more efficient internal
8878 mechanism for comparing types in C++ and Objective-C++.  However, if
8879 bugs in the canonical type system are causing compilation failures,
8880 set this value to 0 to disable canonical types.
8881
8882 @item switch-conversion-max-branch-ratio
8883 Switch initialization conversion will refuse to create arrays that are
8884 bigger than @option{switch-conversion-max-branch-ratio} times the number of
8885 branches in the switch.
8886
8887 @item max-partial-antic-length
8888 Maximum length of the partial antic set computed during the tree
8889 partial redundancy elimination optimization (@option{-ftree-pre}) when
8890 optimizing at @option{-O3} and above.  For some sorts of source code
8891 the enhanced partial redundancy elimination optimization can run away,
8892 consuming all of the memory available on the host machine.  This
8893 parameter sets a limit on the length of the sets that are computed,
8894 which prevents the runaway behavior.  Setting a value of 0 for
8895 this parameter will allow an unlimited set length.
8896
8897 @item sccvn-max-scc-size
8898 Maximum size of a strongly connected component (SCC) during SCCVN
8899 processing.  If this limit is hit, SCCVN processing for the whole
8900 function will not be done and optimizations depending on it will
8901 be disabled.  The default maximum SCC size is 10000.
8902
8903 @item ira-max-loops-num
8904 IRA uses a regional register allocation by default.  If a function
8905 contains loops more than number given by the parameter, only at most
8906 given number of the most frequently executed loops will form regions
8907 for the regional register allocation.  The default value of the
8908 parameter is 100.
8909
8910 @item ira-max-conflict-table-size
8911 Although IRA uses a sophisticated algorithm of compression conflict
8912 table, the table can be still big for huge functions.  If the conflict
8913 table for a function could be more than size in MB given by the
8914 parameter, the conflict table is not built and faster, simpler, and
8915 lower quality register allocation algorithm will be used.  The
8916 algorithm do not use pseudo-register conflicts.  The default value of
8917 the parameter is 2000.
8918
8919 @item ira-loop-reserved-regs
8920 IRA can be used to evaluate more accurate register pressure in loops
8921 for decision to move loop invariants (see @option{-O3}).  The number
8922 of available registers reserved for some other purposes is described
8923 by this parameter.  The default value of the parameter is 2 which is
8924 minimal number of registers needed for execution of typical
8925 instruction.  This value is the best found from numerous experiments.
8926
8927 @item loop-invariant-max-bbs-in-loop
8928 Loop invariant motion can be very expensive, both in compile time and
8929 in amount of needed compile time memory, with very large loops.  Loops
8930 with more basic blocks than this parameter won't have loop invariant
8931 motion optimization performed on them.  The default value of the
8932 parameter is 1000 for -O1 and 10000 for -O2 and above.
8933
8934 @item max-vartrack-size
8935 Sets a maximum number of hash table slots to use during variable
8936 tracking dataflow analysis of any function.  If this limit is exceeded
8937 with variable tracking at assignments enabled, analysis for that
8938 function is retried without it, after removing all debug insns from
8939 the function.  If the limit is exceeded even without debug insns, var
8940 tracking analysis is completely disabled for the function.  Setting
8941 the parameter to zero makes it unlimited.
8942
8943 @item max-vartrack-expr-depth
8944 Sets a maximum number of recursion levels when attempting to map
8945 variable names or debug temporaries to value expressions.  This trades
8946 compile time for more complete debug information.  If this is set too
8947 low, value expressions that are available and could be represented in
8948 debug information may end up not being used; setting this higher may
8949 enable the compiler to find more complex debug expressions, but compile
8950 time may grow exponentially, and even then, it may fail to find more
8951 usable expressions.  The default is 10.
8952
8953 @item min-nondebug-insn-uid
8954 Use uids starting at this parameter for nondebug insns.  The range below
8955 the parameter is reserved exclusively for debug insns created by
8956 @option{-fvar-tracking-assignments}, but debug insns may get
8957 (non-overlapping) uids above it if the reserved range is exhausted.
8958
8959 @item ipa-sra-ptr-growth-factor
8960 IPA-SRA will replace a pointer to an aggregate with one or more new
8961 parameters only when their cumulative size is less or equal to
8962 @option{ipa-sra-ptr-growth-factor} times the size of the original
8963 pointer parameter.
8964
8965 @item graphite-max-nb-scop-params
8966 To avoid exponential effects in the Graphite loop transforms, the
8967 number of parameters in a Static Control Part (SCoP) is bounded.  The
8968 default value is 10 parameters.  A variable whose value is unknown at
8969 compile time and defined outside a SCoP is a parameter of the SCoP.
8970
8971 @item graphite-max-bbs-per-function
8972 To avoid exponential effects in the detection of SCoPs, the size of
8973 the functions analyzed by Graphite is bounded.  The default value is
8974 100 basic blocks.
8975
8976 @item loop-block-tile-size
8977 Loop blocking or strip mining transforms, enabled with
8978 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
8979 loop in the loop nest by a given number of iterations.  The strip
8980 length can be changed using the @option{loop-block-tile-size}
8981 parameter.  The default value is 51 iterations.
8982
8983 @item devirt-type-list-size
8984 IPA-CP attempts to track all possible types passed to a function's
8985 parameter in order to perform devirtualization.
8986 @option{devirt-type-list-size} is the maximum number of types it
8987 stores per a single formal parameter of a function.
8988
8989 @item lto-partitions
8990 Specify desired number of partitions produced during WHOPR compilation.
8991 The number of partitions should exceed the number of CPUs used for compilation.
8992 The default value is 32.
8993
8994 @item lto-minpartition
8995 Size of minimal partition for WHOPR (in estimated instructions).
8996 This prevents expenses of splitting very small programs into too many
8997 partitions.
8998
8999 @item cxx-max-namespaces-for-diagnostic-help
9000 The maximum number of namespaces to consult for suggestions when C++
9001 name lookup fails for an identifier.  The default is 1000.
9002
9003 @item max-stores-to-sink
9004 The maximum number of conditional stores paires that can be sunk.  Set to 0
9005 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9006 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9007
9008 @end table
9009 @end table
9010
9011 @node Preprocessor Options
9012 @section Options Controlling the Preprocessor
9013 @cindex preprocessor options
9014 @cindex options, preprocessor
9015
9016 These options control the C preprocessor, which is run on each C source
9017 file before actual compilation.
9018
9019 If you use the @option{-E} option, nothing is done except preprocessing.
9020 Some of these options make sense only together with @option{-E} because
9021 they cause the preprocessor output to be unsuitable for actual
9022 compilation.
9023
9024 @table @gcctabopt
9025 @item -Wp,@var{option}
9026 @opindex Wp
9027 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9028 and pass @var{option} directly through to the preprocessor.  If
9029 @var{option} contains commas, it is split into multiple options at the
9030 commas.  However, many options are modified, translated or interpreted
9031 by the compiler driver before being passed to the preprocessor, and
9032 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9033 interface is undocumented and subject to change, so whenever possible
9034 you should avoid using @option{-Wp} and let the driver handle the
9035 options instead.
9036
9037 @item -Xpreprocessor @var{option}
9038 @opindex Xpreprocessor
9039 Pass @var{option} as an option to the preprocessor.  You can use this to
9040 supply system-specific preprocessor options which GCC does not know how to
9041 recognize.
9042
9043 If you want to pass an option that takes an argument, you must use
9044 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9045 @end table
9046
9047 @include cppopts.texi
9048
9049 @node Assembler Options
9050 @section Passing Options to the Assembler
9051
9052 @c prevent bad page break with this line
9053 You can pass options to the assembler.
9054
9055 @table @gcctabopt
9056 @item -Wa,@var{option}
9057 @opindex Wa
9058 Pass @var{option} as an option to the assembler.  If @var{option}
9059 contains commas, it is split into multiple options at the commas.
9060
9061 @item -Xassembler @var{option}
9062 @opindex Xassembler
9063 Pass @var{option} as an option to the assembler.  You can use this to
9064 supply system-specific assembler options which GCC does not know how to
9065 recognize.
9066
9067 If you want to pass an option that takes an argument, you must use
9068 @option{-Xassembler} twice, once for the option and once for the argument.
9069
9070 @end table
9071
9072 @node Link Options
9073 @section Options for Linking
9074 @cindex link options
9075 @cindex options, linking
9076
9077 These options come into play when the compiler links object files into
9078 an executable output file.  They are meaningless if the compiler is
9079 not doing a link step.
9080
9081 @table @gcctabopt
9082 @cindex file names
9083 @item @var{object-file-name}
9084 A file name that does not end in a special recognized suffix is
9085 considered to name an object file or library.  (Object files are
9086 distinguished from libraries by the linker according to the file
9087 contents.)  If linking is done, these object files are used as input
9088 to the linker.
9089
9090 @item -c
9091 @itemx -S
9092 @itemx -E
9093 @opindex c
9094 @opindex S
9095 @opindex E
9096 If any of these options is used, then the linker is not run, and
9097 object file names should not be used as arguments.  @xref{Overall
9098 Options}.
9099
9100 @cindex Libraries
9101 @item -l@var{library}
9102 @itemx -l @var{library}
9103 @opindex l
9104 Search the library named @var{library} when linking.  (The second
9105 alternative with the library as a separate argument is only for
9106 POSIX compliance and is not recommended.)
9107
9108 It makes a difference where in the command you write this option; the
9109 linker searches and processes libraries and object files in the order they
9110 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9111 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9112 to functions in @samp{z}, those functions may not be loaded.
9113
9114 The linker searches a standard list of directories for the library,
9115 which is actually a file named @file{lib@var{library}.a}.  The linker
9116 then uses this file as if it had been specified precisely by name.
9117
9118 The directories searched include several standard system directories
9119 plus any that you specify with @option{-L}.
9120
9121 Normally the files found this way are library files---archive files
9122 whose members are object files.  The linker handles an archive file by
9123 scanning through it for members which define symbols that have so far
9124 been referenced but not defined.  But if the file that is found is an
9125 ordinary object file, it is linked in the usual fashion.  The only
9126 difference between using an @option{-l} option and specifying a file name
9127 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9128 and searches several directories.
9129
9130 @item -lobjc
9131 @opindex lobjc
9132 You need this special case of the @option{-l} option in order to
9133 link an Objective-C or Objective-C++ program.
9134
9135 @item -nostartfiles
9136 @opindex nostartfiles
9137 Do not use the standard system startup files when linking.
9138 The standard system libraries are used normally, unless @option{-nostdlib}
9139 or @option{-nodefaultlibs} is used.
9140
9141 @item -nodefaultlibs
9142 @opindex nodefaultlibs
9143 Do not use the standard system libraries when linking.
9144 Only the libraries you specify will be passed to the linker, options
9145 specifying linkage of the system libraries, such as @code{-static-libgcc}
9146 or @code{-shared-libgcc}, will be ignored.
9147 The standard startup files are used normally, unless @option{-nostartfiles}
9148 is used.  The compiler may generate calls to @code{memcmp},
9149 @code{memset}, @code{memcpy} and @code{memmove}.
9150 These entries are usually resolved by entries in
9151 libc.  These entry points should be supplied through some other
9152 mechanism when this option is specified.
9153
9154 @item -nostdlib
9155 @opindex nostdlib
9156 Do not use the standard system startup files or libraries when linking.
9157 No startup files and only the libraries you specify will be passed to
9158 the linker, options specifying linkage of the system libraries, such as
9159 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
9160 The compiler may generate calls to @code{memcmp}, @code{memset},
9161 @code{memcpy} and @code{memmove}.
9162 These entries are usually resolved by entries in
9163 libc.  These entry points should be supplied through some other
9164 mechanism when this option is specified.
9165
9166 @cindex @option{-lgcc}, use with @option{-nostdlib}
9167 @cindex @option{-nostdlib} and unresolved references
9168 @cindex unresolved references and @option{-nostdlib}
9169 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9170 @cindex @option{-nodefaultlibs} and unresolved references
9171 @cindex unresolved references and @option{-nodefaultlibs}
9172 One of the standard libraries bypassed by @option{-nostdlib} and
9173 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9174 that GCC uses to overcome shortcomings of particular machines, or special
9175 needs for some languages.
9176 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9177 Collection (GCC) Internals},
9178 for more discussion of @file{libgcc.a}.)
9179 In most cases, you need @file{libgcc.a} even when you want to avoid
9180 other standard libraries.  In other words, when you specify @option{-nostdlib}
9181 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9182 This ensures that you have no unresolved references to internal GCC
9183 library subroutines.  (For example, @samp{__main}, used to ensure C++
9184 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
9185 GNU Compiler Collection (GCC) Internals}.)
9186
9187 @item -pie
9188 @opindex pie
9189 Produce a position independent executable on targets which support it.
9190 For predictable results, you must also specify the same set of options
9191 that were used to generate code (@option{-fpie}, @option{-fPIE},
9192 or model suboptions) when you specify this option.
9193
9194 @item -rdynamic
9195 @opindex rdynamic
9196 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9197 that support it. This instructs the linker to add all symbols, not
9198 only used ones, to the dynamic symbol table. This option is needed
9199 for some uses of @code{dlopen} or to allow obtaining backtraces
9200 from within a program.
9201
9202 @item -s
9203 @opindex s
9204 Remove all symbol table and relocation information from the executable.
9205
9206 @item -static
9207 @opindex static
9208 On systems that support dynamic linking, this prevents linking with the shared
9209 libraries.  On other systems, this option has no effect.
9210
9211 @item -shared
9212 @opindex shared
9213 Produce a shared object which can then be linked with other objects to
9214 form an executable.  Not all systems support this option.  For predictable
9215 results, you must also specify the same set of options that were used to
9216 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
9217 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
9218 needs to build supplementary stub code for constructors to work.  On
9219 multi-libbed systems, @samp{gcc -shared} must select the correct support
9220 libraries to link against.  Failing to supply the correct flags may lead
9221 to subtle defects.  Supplying them in cases where they are not necessary
9222 is innocuous.}
9223
9224 @item -shared-libgcc
9225 @itemx -static-libgcc
9226 @opindex shared-libgcc
9227 @opindex static-libgcc
9228 On systems that provide @file{libgcc} as a shared library, these options
9229 force the use of either the shared or static version respectively.
9230 If no shared version of @file{libgcc} was built when the compiler was
9231 configured, these options have no effect.
9232
9233 There are several situations in which an application should use the
9234 shared @file{libgcc} instead of the static version.  The most common
9235 of these is when the application wishes to throw and catch exceptions
9236 across different shared libraries.  In that case, each of the libraries
9237 as well as the application itself should use the shared @file{libgcc}.
9238
9239 Therefore, the G++ and GCJ drivers automatically add
9240 @option{-shared-libgcc} whenever you build a shared library or a main
9241 executable, because C++ and Java programs typically use exceptions, so
9242 this is the right thing to do.
9243
9244 If, instead, you use the GCC driver to create shared libraries, you may
9245 find that they will not always be linked with the shared @file{libgcc}.
9246 If GCC finds, at its configuration time, that you have a non-GNU linker
9247 or a GNU linker that does not support option @option{--eh-frame-hdr},
9248 it will link the shared version of @file{libgcc} into shared libraries
9249 by default.  Otherwise, it will take advantage of the linker and optimize
9250 away the linking with the shared version of @file{libgcc}, linking with
9251 the static version of libgcc by default.  This allows exceptions to
9252 propagate through such shared libraries, without incurring relocation
9253 costs at library load time.
9254
9255 However, if a library or main executable is supposed to throw or catch
9256 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9257 for the languages used in the program, or using the option
9258 @option{-shared-libgcc}, such that it is linked with the shared
9259 @file{libgcc}.
9260
9261 @item -static-libstdc++
9262 When the @command{g++} program is used to link a C++ program, it will
9263 normally automatically link against @option{libstdc++}.  If
9264 @file{libstdc++} is available as a shared library, and the
9265 @option{-static} option is not used, then this will link against the
9266 shared version of @file{libstdc++}.  That is normally fine.  However, it
9267 is sometimes useful to freeze the version of @file{libstdc++} used by
9268 the program without going all the way to a fully static link.  The
9269 @option{-static-libstdc++} option directs the @command{g++} driver to
9270 link @file{libstdc++} statically, without necessarily linking other
9271 libraries statically.
9272
9273 @item -symbolic
9274 @opindex symbolic
9275 Bind references to global symbols when building a shared object.  Warn
9276 about any unresolved references (unless overridden by the link editor
9277 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
9278 this option.
9279
9280 @item -T @var{script}
9281 @opindex T
9282 @cindex linker script
9283 Use @var{script} as the linker script.  This option is supported by most
9284 systems using the GNU linker.  On some targets, such as bare-board
9285 targets without an operating system, the @option{-T} option may be required
9286 when linking to avoid references to undefined symbols.
9287
9288 @item -Xlinker @var{option}
9289 @opindex Xlinker
9290 Pass @var{option} as an option to the linker.  You can use this to
9291 supply system-specific linker options which GCC does not know how to
9292 recognize.
9293
9294 If you want to pass an option that takes a separate argument, you must use
9295 @option{-Xlinker} twice, once for the option and once for the argument.
9296 For example, to pass @option{-assert definitions}, you must write
9297 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9298 @option{-Xlinker "-assert definitions"}, because this passes the entire
9299 string as a single argument, which is not what the linker expects.
9300
9301 When using the GNU linker, it is usually more convenient to pass
9302 arguments to linker options using the @option{@var{option}=@var{value}}
9303 syntax than as separate arguments.  For example, you can specify
9304 @samp{-Xlinker -Map=output.map} rather than
9305 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9306 this syntax for command-line options.
9307
9308 @item -Wl,@var{option}
9309 @opindex Wl
9310 Pass @var{option} as an option to the linker.  If @var{option} contains
9311 commas, it is split into multiple options at the commas.  You can use this
9312 syntax to pass an argument to the option.
9313 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
9314 linker.  When using the GNU linker, you can also get the same effect with
9315 @samp{-Wl,-Map=output.map}.
9316
9317 @item -u @var{symbol}
9318 @opindex u
9319 Pretend the symbol @var{symbol} is undefined, to force linking of
9320 library modules to define it.  You can use @option{-u} multiple times with
9321 different symbols to force loading of additional library modules.
9322 @end table
9323
9324 @node Directory Options
9325 @section Options for Directory Search
9326 @cindex directory options
9327 @cindex options, directory search
9328 @cindex search path
9329
9330 These options specify directories to search for header files, for
9331 libraries and for parts of the compiler:
9332
9333 @table @gcctabopt
9334 @item -I@var{dir}
9335 @opindex I
9336 Add the directory @var{dir} to the head of the list of directories to be
9337 searched for header files.  This can be used to override a system header
9338 file, substituting your own version, since these directories are
9339 searched before the system header file directories.  However, you should
9340 not use this option to add directories that contain vendor-supplied
9341 system header files (use @option{-isystem} for that).  If you use more than
9342 one @option{-I} option, the directories are scanned in left-to-right
9343 order; the standard system directories come after.
9344
9345 If a standard system include directory, or a directory specified with
9346 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9347 option will be ignored.  The directory will still be searched but as a
9348 system directory at its normal position in the system include chain.
9349 This is to ensure that GCC's procedure to fix buggy system headers and
9350 the ordering for the include_next directive are not inadvertently changed.
9351 If you really need to change the search order for system directories,
9352 use the @option{-nostdinc} and/or @option{-isystem} options.
9353
9354 @item -iplugindir=@var{dir}
9355 Set the directory to search for plugins which are passed
9356 by @option{-fplugin=@var{name}} instead of
9357 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9358 to be used by the user, but only passed by the driver.
9359
9360 @item -iquote@var{dir}
9361 @opindex iquote
9362 Add the directory @var{dir} to the head of the list of directories to
9363 be searched for header files only for the case of @samp{#include
9364 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9365 otherwise just like @option{-I}.
9366
9367 @item -L@var{dir}
9368 @opindex L
9369 Add directory @var{dir} to the list of directories to be searched
9370 for @option{-l}.
9371
9372 @item -B@var{prefix}
9373 @opindex B
9374 This option specifies where to find the executables, libraries,
9375 include files, and data files of the compiler itself.
9376
9377 The compiler driver program runs one or more of the subprograms
9378 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
9379 @var{prefix} as a prefix for each program it tries to run, both with and
9380 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9381
9382 For each subprogram to be run, the compiler driver first tries the
9383 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9384 was not specified, the driver tries two standard prefixes, which are
9385 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9386 those results in a file name that is found, the unmodified program
9387 name is searched for using the directories specified in your
9388 @env{PATH} environment variable.
9389
9390 The compiler will check to see if the path provided by the @option{-B}
9391 refers to a directory, and if necessary it will add a directory
9392 separator character at the end of the path.
9393
9394 @option{-B} prefixes that effectively specify directory names also apply
9395 to libraries in the linker, because the compiler translates these
9396 options into @option{-L} options for the linker.  They also apply to
9397 includes files in the preprocessor, because the compiler translates these
9398 options into @option{-isystem} options for the preprocessor.  In this case,
9399 the compiler appends @samp{include} to the prefix.
9400
9401 The run-time support file @file{libgcc.a} can also be searched for using
9402 the @option{-B} prefix, if needed.  If it is not found there, the two
9403 standard prefixes above are tried, and that is all.  The file is left
9404 out of the link if it is not found by those means.
9405
9406 Another way to specify a prefix much like the @option{-B} prefix is to use
9407 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9408 Variables}.
9409
9410 As a special kludge, if the path provided by @option{-B} is
9411 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9412 9, then it will be replaced by @file{[dir/]include}.  This is to help
9413 with boot-strapping the compiler.
9414
9415 @item -specs=@var{file}
9416 @opindex specs
9417 Process @var{file} after the compiler reads in the standard @file{specs}
9418 file, in order to override the defaults that the @file{gcc} driver
9419 program uses when determining what switches to pass to @file{cc1},
9420 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
9421 @option{-specs=@var{file}} can be specified on the command line, and they
9422 are processed in order, from left to right.
9423
9424 @item --sysroot=@var{dir}
9425 @opindex sysroot
9426 Use @var{dir} as the logical root directory for headers and libraries.
9427 For example, if the compiler would normally search for headers in
9428 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
9429 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9430
9431 If you use both this option and the @option{-isysroot} option, then
9432 the @option{--sysroot} option will apply to libraries, but the
9433 @option{-isysroot} option will apply to header files.
9434
9435 The GNU linker (beginning with version 2.16) has the necessary support
9436 for this option.  If your linker does not support this option, the
9437 header file aspect of @option{--sysroot} will still work, but the
9438 library aspect will not.
9439
9440 @item -I-
9441 @opindex I-
9442 This option has been deprecated.  Please use @option{-iquote} instead for
9443 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9444 Any directories you specify with @option{-I} options before the @option{-I-}
9445 option are searched only for the case of @samp{#include "@var{file}"};
9446 they are not searched for @samp{#include <@var{file}>}.
9447
9448 If additional directories are specified with @option{-I} options after
9449 the @option{-I-}, these directories are searched for all @samp{#include}
9450 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9451 this way.)
9452
9453 In addition, the @option{-I-} option inhibits the use of the current
9454 directory (where the current input file came from) as the first search
9455 directory for @samp{#include "@var{file}"}.  There is no way to
9456 override this effect of @option{-I-}.  With @option{-I.} you can specify
9457 searching the directory which was current when the compiler was
9458 invoked.  That is not exactly the same as what the preprocessor does
9459 by default, but it is often satisfactory.
9460
9461 @option{-I-} does not inhibit the use of the standard system directories
9462 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9463 independent.
9464 @end table
9465
9466 @c man end
9467
9468 @node Spec Files
9469 @section Specifying subprocesses and the switches to pass to them
9470 @cindex Spec Files
9471
9472 @command{gcc} is a driver program.  It performs its job by invoking a
9473 sequence of other programs to do the work of compiling, assembling and
9474 linking.  GCC interprets its command-line parameters and uses these to
9475 deduce which programs it should invoke, and which command-line options
9476 it ought to place on their command lines.  This behavior is controlled
9477 by @dfn{spec strings}.  In most cases there is one spec string for each
9478 program that GCC can invoke, but a few programs have multiple spec
9479 strings to control their behavior.  The spec strings built into GCC can
9480 be overridden by using the @option{-specs=} command-line switch to specify
9481 a spec file.
9482
9483 @dfn{Spec files} are plaintext files that are used to construct spec
9484 strings.  They consist of a sequence of directives separated by blank
9485 lines.  The type of directive is determined by the first non-whitespace
9486 character on the line and it can be one of the following:
9487
9488 @table @code
9489 @item %@var{command}
9490 Issues a @var{command} to the spec file processor.  The commands that can
9491 appear here are:
9492
9493 @table @code
9494 @item %include <@var{file}>
9495 @cindex @code{%include}
9496 Search for @var{file} and insert its text at the current point in the
9497 specs file.
9498
9499 @item %include_noerr <@var{file}>
9500 @cindex @code{%include_noerr}
9501 Just like @samp{%include}, but do not generate an error message if the include
9502 file cannot be found.
9503
9504 @item %rename @var{old_name} @var{new_name}
9505 @cindex @code{%rename}
9506 Rename the spec string @var{old_name} to @var{new_name}.
9507
9508 @end table
9509
9510 @item *[@var{spec_name}]:
9511 This tells the compiler to create, override or delete the named spec
9512 string.  All lines after this directive up to the next directive or
9513 blank line are considered to be the text for the spec string.  If this
9514 results in an empty string then the spec will be deleted.  (Or, if the
9515 spec did not exist, then nothing will happen.)  Otherwise, if the spec
9516 does not currently exist a new spec will be created.  If the spec does
9517 exist then its contents will be overridden by the text of this
9518 directive, unless the first character of that text is the @samp{+}
9519 character, in which case the text will be appended to the spec.
9520
9521 @item [@var{suffix}]:
9522 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9523 and up to the next directive or blank line are considered to make up the
9524 spec string for the indicated suffix.  When the compiler encounters an
9525 input file with the named suffix, it will processes the spec string in
9526 order to work out how to compile that file.  For example:
9527
9528 @smallexample
9529 .ZZ:
9530 z-compile -input %i
9531 @end smallexample
9532
9533 This says that any input file whose name ends in @samp{.ZZ} should be
9534 passed to the program @samp{z-compile}, which should be invoked with the
9535 command-line switch @option{-input} and with the result of performing the
9536 @samp{%i} substitution.  (See below.)
9537
9538 As an alternative to providing a spec string, the text that follows a
9539 suffix directive can be one of the following:
9540
9541 @table @code
9542 @item @@@var{language}
9543 This says that the suffix is an alias for a known @var{language}.  This is
9544 similar to using the @option{-x} command-line switch to GCC to specify a
9545 language explicitly.  For example:
9546
9547 @smallexample
9548 .ZZ:
9549 @@c++
9550 @end smallexample
9551
9552 Says that .ZZ files are, in fact, C++ source files.
9553
9554 @item #@var{name}
9555 This causes an error messages saying:
9556
9557 @smallexample
9558 @var{name} compiler not installed on this system.
9559 @end smallexample
9560 @end table
9561
9562 GCC already has an extensive list of suffixes built into it.
9563 This directive will add an entry to the end of the list of suffixes, but
9564 since the list is searched from the end backwards, it is effectively
9565 possible to override earlier entries using this technique.
9566
9567 @end table
9568
9569 GCC has the following spec strings built into it.  Spec files can
9570 override these strings or create their own.  Note that individual
9571 targets can also add their own spec strings to this list.
9572
9573 @smallexample
9574 asm          Options to pass to the assembler
9575 asm_final    Options to pass to the assembler post-processor
9576 cpp          Options to pass to the C preprocessor
9577 cc1          Options to pass to the C compiler
9578 cc1plus      Options to pass to the C++ compiler
9579 endfile      Object files to include at the end of the link
9580 link         Options to pass to the linker
9581 lib          Libraries to include on the command line to the linker
9582 libgcc       Decides which GCC support library to pass to the linker
9583 linker       Sets the name of the linker
9584 predefines   Defines to be passed to the C preprocessor
9585 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9586              by default
9587 startfile    Object files to include at the start of the link
9588 @end smallexample
9589
9590 Here is a small example of a spec file:
9591
9592 @smallexample
9593 %rename lib                 old_lib
9594
9595 *lib:
9596 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9597 @end smallexample
9598
9599 This example renames the spec called @samp{lib} to @samp{old_lib} and
9600 then overrides the previous definition of @samp{lib} with a new one.
9601 The new definition adds in some extra command-line options before
9602 including the text of the old definition.
9603
9604 @dfn{Spec strings} are a list of command-line options to be passed to their
9605 corresponding program.  In addition, the spec strings can contain
9606 @samp{%}-prefixed sequences to substitute variable text or to
9607 conditionally insert text into the command line.  Using these constructs
9608 it is possible to generate quite complex command lines.
9609
9610 Here is a table of all defined @samp{%}-sequences for spec
9611 strings.  Note that spaces are not generated automatically around the
9612 results of expanding these sequences.  Therefore you can concatenate them
9613 together or combine them with constant text in a single argument.
9614
9615 @table @code
9616 @item %%
9617 Substitute one @samp{%} into the program name or argument.
9618
9619 @item %i
9620 Substitute the name of the input file being processed.
9621
9622 @item %b
9623 Substitute the basename of the input file being processed.
9624 This is the substring up to (and not including) the last period
9625 and not including the directory.
9626
9627 @item %B
9628 This is the same as @samp{%b}, but include the file suffix (text after
9629 the last period).
9630
9631 @item %d
9632 Marks the argument containing or following the @samp{%d} as a
9633 temporary file name, so that that file will be deleted if GCC exits
9634 successfully.  Unlike @samp{%g}, this contributes no text to the
9635 argument.
9636
9637 @item %g@var{suffix}
9638 Substitute a file name that has suffix @var{suffix} and is chosen
9639 once per compilation, and mark the argument in the same way as
9640 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9641 name is now chosen in a way that is hard to predict even when previously
9642 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9643 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9644 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9645 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9646 was simply substituted with a file name chosen once per compilation,
9647 without regard to any appended suffix (which was therefore treated
9648 just like ordinary text), making such attacks more likely to succeed.
9649
9650 @item %u@var{suffix}
9651 Like @samp{%g}, but generates a new temporary file name even if
9652 @samp{%u@var{suffix}} was already seen.
9653
9654 @item %U@var{suffix}
9655 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9656 new one if there is no such last file name.  In the absence of any
9657 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9658 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9659 would involve the generation of two distinct file names, one
9660 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9661 simply substituted with a file name chosen for the previous @samp{%u},
9662 without regard to any appended suffix.
9663
9664 @item %j@var{suffix}
9665 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9666 writable, and if save-temps is off; otherwise, substitute the name
9667 of a temporary file, just like @samp{%u}.  This temporary file is not
9668 meant for communication between processes, but rather as a junk
9669 disposal mechanism.
9670
9671 @item %|@var{suffix}
9672 @itemx %m@var{suffix}
9673 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9674 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9675 all.  These are the two most common ways to instruct a program that it
9676 should read from standard input or write to standard output.  If you
9677 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9678 construct: see for example @file{f/lang-specs.h}.
9679
9680 @item %.@var{SUFFIX}
9681 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9682 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9683 terminated by the next space or %.
9684
9685 @item %w
9686 Marks the argument containing or following the @samp{%w} as the
9687 designated output file of this compilation.  This puts the argument
9688 into the sequence of arguments that @samp{%o} will substitute later.
9689
9690 @item %o
9691 Substitutes the names of all the output files, with spaces
9692 automatically placed around them.  You should write spaces
9693 around the @samp{%o} as well or the results are undefined.
9694 @samp{%o} is for use in the specs for running the linker.
9695 Input files whose names have no recognized suffix are not compiled
9696 at all, but they are included among the output files, so they will
9697 be linked.
9698
9699 @item %O
9700 Substitutes the suffix for object files.  Note that this is
9701 handled specially when it immediately follows @samp{%g, %u, or %U},
9702 because of the need for those to form complete file names.  The
9703 handling is such that @samp{%O} is treated exactly as if it had already
9704 been substituted, except that @samp{%g, %u, and %U} do not currently
9705 support additional @var{suffix} characters following @samp{%O} as they would
9706 following, for example, @samp{.o}.
9707
9708 @item %p
9709 Substitutes the standard macro predefinitions for the
9710 current target machine.  Use this when running @code{cpp}.
9711
9712 @item %P
9713 Like @samp{%p}, but puts @samp{__} before and after the name of each
9714 predefined macro, except for macros that start with @samp{__} or with
9715 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
9716 C@.
9717
9718 @item %I
9719 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
9720 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
9721 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
9722 and @option{-imultilib} as necessary.
9723
9724 @item %s
9725 Current argument is the name of a library or startup file of some sort.
9726 Search for that file in a standard list of directories and substitute
9727 the full name found.  The current working directory is included in the
9728 list of directories scanned.
9729
9730 @item %T
9731 Current argument is the name of a linker script.  Search for that file
9732 in the current list of directories to scan for libraries. If the file
9733 is located insert a @option{--script} option into the command line
9734 followed by the full path name found.  If the file is not found then
9735 generate an error message.  Note: the current working directory is not
9736 searched.
9737
9738 @item %e@var{str}
9739 Print @var{str} as an error message.  @var{str} is terminated by a newline.
9740 Use this when inconsistent options are detected.
9741
9742 @item %(@var{name})
9743 Substitute the contents of spec string @var{name} at this point.
9744
9745 @item %[@var{name}]
9746 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
9747
9748 @item %x@{@var{option}@}
9749 Accumulate an option for @samp{%X}.
9750
9751 @item %X
9752 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
9753 spec string.
9754
9755 @item %Y
9756 Output the accumulated assembler options specified by @option{-Wa}.
9757
9758 @item %Z
9759 Output the accumulated preprocessor options specified by @option{-Wp}.
9760
9761 @item %a
9762 Process the @code{asm} spec.  This is used to compute the
9763 switches to be passed to the assembler.
9764
9765 @item %A
9766 Process the @code{asm_final} spec.  This is a spec string for
9767 passing switches to an assembler post-processor, if such a program is
9768 needed.
9769
9770 @item %l
9771 Process the @code{link} spec.  This is the spec for computing the
9772 command line passed to the linker.  Typically it will make use of the
9773 @samp{%L %G %S %D and %E} sequences.
9774
9775 @item %D
9776 Dump out a @option{-L} option for each directory that GCC believes might
9777 contain startup files.  If the target supports multilibs then the
9778 current multilib directory will be prepended to each of these paths.
9779
9780 @item %L
9781 Process the @code{lib} spec.  This is a spec string for deciding which
9782 libraries should be included on the command line to the linker.
9783
9784 @item %G
9785 Process the @code{libgcc} spec.  This is a spec string for deciding
9786 which GCC support library should be included on the command line to the linker.
9787
9788 @item %S
9789 Process the @code{startfile} spec.  This is a spec for deciding which
9790 object files should be the first ones passed to the linker.  Typically
9791 this might be a file named @file{crt0.o}.
9792
9793 @item %E
9794 Process the @code{endfile} spec.  This is a spec string that specifies
9795 the last object files that will be passed to the linker.
9796
9797 @item %C
9798 Process the @code{cpp} spec.  This is used to construct the arguments
9799 to be passed to the C preprocessor.
9800
9801 @item %1
9802 Process the @code{cc1} spec.  This is used to construct the options to be
9803 passed to the actual C compiler (@samp{cc1}).
9804
9805 @item %2
9806 Process the @code{cc1plus} spec.  This is used to construct the options to be
9807 passed to the actual C++ compiler (@samp{cc1plus}).
9808
9809 @item %*
9810 Substitute the variable part of a matched option.  See below.
9811 Note that each comma in the substituted string is replaced by
9812 a single space.
9813
9814 @item %<@code{S}
9815 Remove all occurrences of @code{-S} from the command line.  Note---this
9816 command is position dependent.  @samp{%} commands in the spec string
9817 before this one will see @code{-S}, @samp{%} commands in the spec string
9818 after this one will not.
9819
9820 @item %:@var{function}(@var{args})
9821 Call the named function @var{function}, passing it @var{args}.
9822 @var{args} is first processed as a nested spec string, then split
9823 into an argument vector in the usual fashion.  The function returns
9824 a string which is processed as if it had appeared literally as part
9825 of the current spec.
9826
9827 The following built-in spec functions are provided:
9828
9829 @table @code
9830 @item @code{getenv}
9831 The @code{getenv} spec function takes two arguments: an environment
9832 variable name and a string.  If the environment variable is not
9833 defined, a fatal error is issued.  Otherwise, the return value is the
9834 value of the environment variable concatenated with the string.  For
9835 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
9836
9837 @smallexample
9838 %:getenv(TOPDIR /include)
9839 @end smallexample
9840
9841 expands to @file{/path/to/top/include}.
9842
9843 @item @code{if-exists}
9844 The @code{if-exists} spec function takes one argument, an absolute
9845 pathname to a file.  If the file exists, @code{if-exists} returns the
9846 pathname.  Here is a small example of its usage:
9847
9848 @smallexample
9849 *startfile:
9850 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
9851 @end smallexample
9852
9853 @item @code{if-exists-else}
9854 The @code{if-exists-else} spec function is similar to the @code{if-exists}
9855 spec function, except that it takes two arguments.  The first argument is
9856 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
9857 returns the pathname.  If it does not exist, it returns the second argument.
9858 This way, @code{if-exists-else} can be used to select one file or another,
9859 based on the existence of the first.  Here is a small example of its usage:
9860
9861 @smallexample
9862 *startfile:
9863 crt0%O%s %:if-exists(crti%O%s) \
9864 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
9865 @end smallexample
9866
9867 @item @code{replace-outfile}
9868 The @code{replace-outfile} spec function takes two arguments.  It looks for the
9869 first argument in the outfiles array and replaces it with the second argument.  Here
9870 is a small example of its usage:
9871
9872 @smallexample
9873 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
9874 @end smallexample
9875
9876 @item @code{remove-outfile}
9877 The @code{remove-outfile} spec function takes one argument.  It looks for the
9878 first argument in the outfiles array and removes it.  Here is a small example
9879 its usage:
9880
9881 @smallexample
9882 %:remove-outfile(-lm)
9883 @end smallexample
9884
9885 @item @code{pass-through-libs}
9886 The @code{pass-through-libs} spec function takes any number of arguments.  It
9887 finds any @option{-l} options and any non-options ending in ".a" (which it
9888 assumes are the names of linker input library archive files) and returns a
9889 result containing all the found arguments each prepended by
9890 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
9891 intended to be passed to the LTO linker plugin.
9892
9893 @smallexample
9894 %:pass-through-libs(%G %L %G)
9895 @end smallexample
9896
9897 @item @code{print-asm-header}
9898 The @code{print-asm-header} function takes no arguments and simply
9899 prints a banner like:
9900
9901 @smallexample
9902 Assembler options
9903 =================
9904
9905 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
9906 @end smallexample
9907
9908 It is used to separate compiler options from assembler options
9909 in the @option{--target-help} output.
9910 @end table
9911
9912 @item %@{@code{S}@}
9913 Substitutes the @code{-S} switch, if that switch was given to GCC@.
9914 If that switch was not specified, this substitutes nothing.  Note that
9915 the leading dash is omitted when specifying this option, and it is
9916 automatically inserted if the substitution is performed.  Thus the spec
9917 string @samp{%@{foo@}} would match the command-line option @option{-foo}
9918 and would output the command line option @option{-foo}.
9919
9920 @item %W@{@code{S}@}
9921 Like %@{@code{S}@} but mark last argument supplied within as a file to be
9922 deleted on failure.
9923
9924 @item %@{@code{S}*@}
9925 Substitutes all the switches specified to GCC whose names start
9926 with @code{-S}, but which also take an argument.  This is used for
9927 switches like @option{-o}, @option{-D}, @option{-I}, etc.
9928 GCC considers @option{-o foo} as being
9929 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
9930 text, including the space.  Thus two arguments would be generated.
9931
9932 @item %@{@code{S}*&@code{T}*@}
9933 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
9934 (the order of @code{S} and @code{T} in the spec is not significant).
9935 There can be any number of ampersand-separated variables; for each the
9936 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
9937
9938 @item %@{@code{S}:@code{X}@}
9939 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
9940
9941 @item %@{!@code{S}:@code{X}@}
9942 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
9943
9944 @item %@{@code{S}*:@code{X}@}
9945 Substitutes @code{X} if one or more switches whose names start with
9946 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
9947 once, no matter how many such switches appeared.  However, if @code{%*}
9948 appears somewhere in @code{X}, then @code{X} will be substituted once
9949 for each matching switch, with the @code{%*} replaced by the part of
9950 that switch that matched the @code{*}.
9951
9952 @item %@{.@code{S}:@code{X}@}
9953 Substitutes @code{X}, if processing a file with suffix @code{S}.
9954
9955 @item %@{!.@code{S}:@code{X}@}
9956 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
9957
9958 @item %@{,@code{S}:@code{X}@}
9959 Substitutes @code{X}, if processing a file for language @code{S}.
9960
9961 @item %@{!,@code{S}:@code{X}@}
9962 Substitutes @code{X}, if not processing a file for language @code{S}.
9963
9964 @item %@{@code{S}|@code{P}:@code{X}@}
9965 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
9966 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
9967 @code{*} sequences as well, although they have a stronger binding than
9968 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
9969 alternatives must be starred, and only the first matching alternative
9970 is substituted.
9971
9972 For example, a spec string like this:
9973
9974 @smallexample
9975 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
9976 @end smallexample
9977
9978 will output the following command-line options from the following input
9979 command-line options:
9980
9981 @smallexample
9982 fred.c        -foo -baz
9983 jim.d         -bar -boggle
9984 -d fred.c     -foo -baz -boggle
9985 -d jim.d      -bar -baz -boggle
9986 @end smallexample
9987
9988 @item %@{S:X; T:Y; :D@}
9989
9990 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
9991 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
9992 be as many clauses as you need.  This may be combined with @code{.},
9993 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
9994
9995
9996 @end table
9997
9998 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
9999 construct may contain other nested @samp{%} constructs or spaces, or
10000 even newlines.  They are processed as usual, as described above.
10001 Trailing white space in @code{X} is ignored.  White space may also
10002 appear anywhere on the left side of the colon in these constructs,
10003 except between @code{.} or @code{*} and the corresponding word.
10004
10005 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10006 handled specifically in these constructs.  If another value of
10007 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10008 @option{-W} switch is found later in the command line, the earlier
10009 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10010 just one letter, which passes all matching options.
10011
10012 The character @samp{|} at the beginning of the predicate text is used to
10013 indicate that a command should be piped to the following command, but
10014 only if @option{-pipe} is specified.
10015
10016 It is built into GCC which switches take arguments and which do not.
10017 (You might think it would be useful to generalize this to allow each
10018 compiler's spec to say which switches take arguments.  But this cannot
10019 be done in a consistent fashion.  GCC cannot even decide which input
10020 files have been specified without knowing which switches take arguments,
10021 and it must know which input files to compile in order to tell which
10022 compilers to run).
10023
10024 GCC also knows implicitly that arguments starting in @option{-l} are to be
10025 treated as compiler output files, and passed to the linker in their
10026 proper position among the other output files.
10027
10028 @c man begin OPTIONS
10029
10030 @node Target Options
10031 @section Specifying Target Machine and Compiler Version
10032 @cindex target options
10033 @cindex cross compiling
10034 @cindex specifying machine version
10035 @cindex specifying compiler version and target machine
10036 @cindex compiler version, specifying
10037 @cindex target machine, specifying
10038
10039 The usual way to run GCC is to run the executable called @command{gcc}, or
10040 @command{@var{machine}-gcc} when cross-compiling, or
10041 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10042 one that was installed last.
10043
10044 @node Submodel Options
10045 @section Hardware Models and Configurations
10046 @cindex submodel options
10047 @cindex specifying hardware config
10048 @cindex hardware models and configurations, specifying
10049 @cindex machine dependent options
10050
10051 Each target machine types can have its own
10052 special options, starting with @samp{-m}, to choose among various
10053 hardware models or configurations---for example, 68010 vs 68020,
10054 floating coprocessor or none.  A single installed version of the
10055 compiler can compile for any model or configuration, according to the
10056 options specified.
10057
10058 Some configurations of the compiler also support additional special
10059 options, usually for compatibility with other compilers on the same
10060 platform.
10061
10062 @c This list is ordered alphanumerically by subsection name.
10063 @c It should be the same order and spelling as these options are listed
10064 @c in Machine Dependent Options
10065
10066 @menu
10067 * ARM Options::
10068 * AVR Options::
10069 * Blackfin Options::
10070 * CRIS Options::
10071 * Darwin Options::
10072 * DEC Alpha Options::
10073 * DEC Alpha/VMS Options::
10074 * FR30 Options::
10075 * FRV Options::
10076 * GNU/Linux Options::
10077 * H8/300 Options::
10078 * HPPA Options::
10079 * i386 and x86-64 Options::
10080 * i386 and x86-64 Windows Options::
10081 * IA-64 Options::
10082 * IA-64/VMS Options::
10083 * LM32 Options::
10084 * M32C Options::
10085 * M32R/D Options::
10086 * M680x0 Options::
10087 * MCore Options::
10088 * MeP Options::
10089 * MicroBlaze Options::
10090 * MIPS Options::
10091 * MMIX Options::
10092 * MN10300 Options::
10093 * PDP-11 Options::
10094 * picoChip Options::
10095 * PowerPC Options::
10096 * RS/6000 and PowerPC Options::
10097 * RX Options::
10098 * S/390 and zSeries Options::
10099 * Score Options::
10100 * SH Options::
10101 * Solaris 2 Options::
10102 * SPARC Options::
10103 * SPU Options::
10104 * System V Options::
10105 * V850 Options::
10106 * VAX Options::
10107 * VxWorks Options::
10108 * x86-64 Options::
10109 * Xstormy16 Options::
10110 * Xtensa Options::
10111 * zSeries Options::
10112 @end menu
10113
10114 @node ARM Options
10115 @subsection ARM Options
10116 @cindex ARM options
10117
10118 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
10119 architectures:
10120
10121 @table @gcctabopt
10122 @item -mabi=@var{name}
10123 @opindex mabi
10124 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
10125 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
10126
10127 @item -mapcs-frame
10128 @opindex mapcs-frame
10129 Generate a stack frame that is compliant with the ARM Procedure Call
10130 Standard for all functions, even if this is not strictly necessary for
10131 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
10132 with this option will cause the stack frames not to be generated for
10133 leaf functions.  The default is @option{-mno-apcs-frame}.
10134
10135 @item -mapcs
10136 @opindex mapcs
10137 This is a synonym for @option{-mapcs-frame}.
10138
10139 @ignore
10140 @c not currently implemented
10141 @item -mapcs-stack-check
10142 @opindex mapcs-stack-check
10143 Generate code to check the amount of stack space available upon entry to
10144 every function (that actually uses some stack space).  If there is
10145 insufficient space available then either the function
10146 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
10147 called, depending upon the amount of stack space required.  The run time
10148 system is required to provide these functions.  The default is
10149 @option{-mno-apcs-stack-check}, since this produces smaller code.
10150
10151 @c not currently implemented
10152 @item -mapcs-float
10153 @opindex mapcs-float
10154 Pass floating point arguments using the float point registers.  This is
10155 one of the variants of the APCS@.  This option is recommended if the
10156 target hardware has a floating point unit or if a lot of floating point
10157 arithmetic is going to be performed by the code.  The default is
10158 @option{-mno-apcs-float}, since integer only code is slightly increased in
10159 size if @option{-mapcs-float} is used.
10160
10161 @c not currently implemented
10162 @item -mapcs-reentrant
10163 @opindex mapcs-reentrant
10164 Generate reentrant, position independent code.  The default is
10165 @option{-mno-apcs-reentrant}.
10166 @end ignore
10167
10168 @item -mthumb-interwork
10169 @opindex mthumb-interwork
10170 Generate code which supports calling between the ARM and Thumb
10171 instruction sets.  Without this option the two instruction sets cannot
10172 be reliably used inside one program.  The default is
10173 @option{-mno-thumb-interwork}, since slightly larger code is generated
10174 when @option{-mthumb-interwork} is specified.
10175
10176 @item -mno-sched-prolog
10177 @opindex mno-sched-prolog
10178 Prevent the reordering of instructions in the function prolog, or the
10179 merging of those instruction with the instructions in the function's
10180 body.  This means that all functions will start with a recognizable set
10181 of instructions (or in fact one of a choice from a small set of
10182 different function prologues), and this information can be used to
10183 locate the start if functions inside an executable piece of code.  The
10184 default is @option{-msched-prolog}.
10185
10186 @item -mfloat-abi=@var{name}
10187 @opindex mfloat-abi
10188 Specifies which floating-point ABI to use.  Permissible values
10189 are: @samp{soft}, @samp{softfp} and @samp{hard}.
10190
10191 Specifying @samp{soft} causes GCC to generate output containing
10192 library calls for floating-point operations.
10193 @samp{softfp} allows the generation of code using hardware floating-point
10194 instructions, but still uses the soft-float calling conventions.
10195 @samp{hard} allows generation of floating-point instructions
10196 and uses FPU-specific calling conventions.
10197
10198 The default depends on the specific target configuration.  Note that
10199 the hard-float and soft-float ABIs are not link-compatible; you must
10200 compile your entire program with the same ABI, and link with a
10201 compatible set of libraries.
10202
10203 @item -mlittle-endian
10204 @opindex mlittle-endian
10205 Generate code for a processor running in little-endian mode.  This is
10206 the default for all standard configurations.
10207
10208 @item -mbig-endian
10209 @opindex mbig-endian
10210 Generate code for a processor running in big-endian mode; the default is
10211 to compile code for a little-endian processor.
10212
10213 @item -mwords-little-endian
10214 @opindex mwords-little-endian
10215 This option only applies when generating code for big-endian processors.
10216 Generate code for a little-endian word order but a big-endian byte
10217 order.  That is, a byte order of the form @samp{32107654}.  Note: this
10218 option should only be used if you require compatibility with code for
10219 big-endian ARM processors generated by versions of the compiler prior to
10220 2.8.
10221
10222 @item -mcpu=@var{name}
10223 @opindex mcpu
10224 This specifies the name of the target ARM processor.  GCC uses this name
10225 to determine what kind of instructions it can emit when generating
10226 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
10227 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
10228 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
10229 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
10230 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
10231 @samp{arm720},
10232 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
10233 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
10234 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
10235 @samp{strongarm1110},
10236 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
10237 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
10238 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
10239 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
10240 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
10241 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
10242 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
10243 @samp{cortex-a5}, @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a15},
10244 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
10245 @samp{cortex-m4}, @samp{cortex-m3},
10246 @samp{cortex-m1},
10247 @samp{cortex-m0},
10248 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10249
10250 @item -mtune=@var{name}
10251 @opindex mtune
10252 This option is very similar to the @option{-mcpu=} option, except that
10253 instead of specifying the actual target processor type, and hence
10254 restricting which instructions can be used, it specifies that GCC should
10255 tune the performance of the code as if the target were of the type
10256 specified in this option, but still choosing the instructions that it
10257 will generate based on the CPU specified by a @option{-mcpu=} option.
10258 For some ARM implementations better performance can be obtained by using
10259 this option.
10260
10261 @item -march=@var{name}
10262 @opindex march
10263 This specifies the name of the target ARM architecture.  GCC uses this
10264 name to determine what kind of instructions it can emit when generating
10265 assembly code.  This option can be used in conjunction with or instead
10266 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
10267 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
10268 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
10269 @samp{armv6}, @samp{armv6j},
10270 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
10271 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
10272 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10273
10274 @item -mfpu=@var{name}
10275 @itemx -mfpe=@var{number}
10276 @itemx -mfp=@var{number}
10277 @opindex mfpu
10278 @opindex mfpe
10279 @opindex mfp
10280 This specifies what floating point hardware (or hardware emulation) is
10281 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
10282 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
10283 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
10284 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
10285 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
10286 @option{-mfp} and @option{-mfpe} are synonyms for
10287 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
10288 of GCC@.
10289
10290 If @option{-msoft-float} is specified this specifies the format of
10291 floating point values.
10292
10293 If the selected floating-point hardware includes the NEON extension
10294 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
10295 operations will not be used by GCC's auto-vectorization pass unless
10296 @option{-funsafe-math-optimizations} is also specified.  This is
10297 because NEON hardware does not fully implement the IEEE 754 standard for
10298 floating-point arithmetic (in particular denormal values are treated as
10299 zero), so the use of NEON instructions may lead to a loss of precision.
10300
10301 @item -mfp16-format=@var{name}
10302 @opindex mfp16-format
10303 Specify the format of the @code{__fp16} half-precision floating-point type.
10304 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
10305 the default is @samp{none}, in which case the @code{__fp16} type is not
10306 defined.  @xref{Half-Precision}, for more information.
10307
10308 @item -mstructure-size-boundary=@var{n}
10309 @opindex mstructure-size-boundary
10310 The size of all structures and unions will be rounded up to a multiple
10311 of the number of bits set by this option.  Permissible values are 8, 32
10312 and 64.  The default value varies for different toolchains.  For the COFF
10313 targeted toolchain the default value is 8.  A value of 64 is only allowed
10314 if the underlying ABI supports it.
10315
10316 Specifying the larger number can produce faster, more efficient code, but
10317 can also increase the size of the program.  Different values are potentially
10318 incompatible.  Code compiled with one value cannot necessarily expect to
10319 work with code or libraries compiled with another value, if they exchange
10320 information using structures or unions.
10321
10322 @item -mabort-on-noreturn
10323 @opindex mabort-on-noreturn
10324 Generate a call to the function @code{abort} at the end of a
10325 @code{noreturn} function.  It will be executed if the function tries to
10326 return.
10327
10328 @item -mlong-calls
10329 @itemx -mno-long-calls
10330 @opindex mlong-calls
10331 @opindex mno-long-calls
10332 Tells the compiler to perform function calls by first loading the
10333 address of the function into a register and then performing a subroutine
10334 call on this register.  This switch is needed if the target function
10335 will lie outside of the 64 megabyte addressing range of the offset based
10336 version of subroutine call instruction.
10337
10338 Even if this switch is enabled, not all function calls will be turned
10339 into long calls.  The heuristic is that static functions, functions
10340 which have the @samp{short-call} attribute, functions that are inside
10341 the scope of a @samp{#pragma no_long_calls} directive and functions whose
10342 definitions have already been compiled within the current compilation
10343 unit, will not be turned into long calls.  The exception to this rule is
10344 that weak function definitions, functions with the @samp{long-call}
10345 attribute or the @samp{section} attribute, and functions that are within
10346 the scope of a @samp{#pragma long_calls} directive, will always be
10347 turned into long calls.
10348
10349 This feature is not enabled by default.  Specifying
10350 @option{-mno-long-calls} will restore the default behavior, as will
10351 placing the function calls within the scope of a @samp{#pragma
10352 long_calls_off} directive.  Note these switches have no effect on how
10353 the compiler generates code to handle function calls via function
10354 pointers.
10355
10356 @item -msingle-pic-base
10357 @opindex msingle-pic-base
10358 Treat the register used for PIC addressing as read-only, rather than
10359 loading it in the prologue for each function.  The run-time system is
10360 responsible for initializing this register with an appropriate value
10361 before execution begins.
10362
10363 @item -mpic-register=@var{reg}
10364 @opindex mpic-register
10365 Specify the register to be used for PIC addressing.  The default is R10
10366 unless stack-checking is enabled, when R9 is used.
10367
10368 @item -mcirrus-fix-invalid-insns
10369 @opindex mcirrus-fix-invalid-insns
10370 @opindex mno-cirrus-fix-invalid-insns
10371 Insert NOPs into the instruction stream to in order to work around
10372 problems with invalid Maverick instruction combinations.  This option
10373 is only valid if the @option{-mcpu=ep9312} option has been used to
10374 enable generation of instructions for the Cirrus Maverick floating
10375 point co-processor.  This option is not enabled by default, since the
10376 problem is only present in older Maverick implementations.  The default
10377 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10378 switch.
10379
10380 @item -mpoke-function-name
10381 @opindex mpoke-function-name
10382 Write the name of each function into the text section, directly
10383 preceding the function prologue.  The generated code is similar to this:
10384
10385 @smallexample
10386      t0
10387          .ascii "arm_poke_function_name", 0
10388          .align
10389      t1
10390          .word 0xff000000 + (t1 - t0)
10391      arm_poke_function_name
10392          mov     ip, sp
10393          stmfd   sp!, @{fp, ip, lr, pc@}
10394          sub     fp, ip, #4
10395 @end smallexample
10396
10397 When performing a stack backtrace, code can inspect the value of
10398 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10399 location @code{pc - 12} and the top 8 bits are set, then we know that
10400 there is a function name embedded immediately preceding this location
10401 and has length @code{((pc[-3]) & 0xff000000)}.
10402
10403 @item -mthumb
10404 @itemx -marm
10405 @opindex marm
10406 @opindex mthumb
10407
10408 Select between generating code that executes in ARM and Thumb
10409 states.  The default for most configurations is to generate code
10410 that executes in ARM state, but the default can be changed by
10411 configuring GCC with the @option{--with-mode=}@var{state}
10412 configure option.
10413
10414 @item -mtpcs-frame
10415 @opindex mtpcs-frame
10416 Generate a stack frame that is compliant with the Thumb Procedure Call
10417 Standard for all non-leaf functions.  (A leaf function is one that does
10418 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10419
10420 @item -mtpcs-leaf-frame
10421 @opindex mtpcs-leaf-frame
10422 Generate a stack frame that is compliant with the Thumb Procedure Call
10423 Standard for all leaf functions.  (A leaf function is one that does
10424 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10425
10426 @item -mcallee-super-interworking
10427 @opindex mcallee-super-interworking
10428 Gives all externally visible functions in the file being compiled an ARM
10429 instruction set header which switches to Thumb mode before executing the
10430 rest of the function.  This allows these functions to be called from
10431 non-interworking code.  This option is not valid in AAPCS configurations
10432 because interworking is enabled by default.
10433
10434 @item -mcaller-super-interworking
10435 @opindex mcaller-super-interworking
10436 Allows calls via function pointers (including virtual functions) to
10437 execute correctly regardless of whether the target code has been
10438 compiled for interworking or not.  There is a small overhead in the cost
10439 of executing a function pointer if this option is enabled.  This option
10440 is not valid in AAPCS configurations because interworking is enabled
10441 by default.
10442
10443 @item -mtp=@var{name}
10444 @opindex mtp
10445 Specify the access model for the thread local storage pointer.  The valid
10446 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10447 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10448 (supported in the arm6k architecture), and @option{auto}, which uses the
10449 best available method for the selected processor.  The default setting is
10450 @option{auto}.
10451
10452 @item -mword-relocations
10453 @opindex mword-relocations
10454 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
10455 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10456 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10457 is specified.
10458
10459 @item -mfix-cortex-m3-ldrd
10460 @opindex mfix-cortex-m3-ldrd
10461 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10462 with overlapping destination and base registers are used.  This option avoids
10463 generating these instructions.  This option is enabled by default when
10464 @option{-mcpu=cortex-m3} is specified.
10465
10466 @end table
10467
10468 @node AVR Options
10469 @subsection AVR Options
10470 @cindex AVR Options
10471
10472 These options are defined for AVR implementations:
10473
10474 @table @gcctabopt
10475 @item -mmcu=@var{mcu}
10476 @opindex mmcu
10477 Specify ATMEL AVR instruction set or MCU type.
10478
10479 Instruction set avr1 is for the minimal AVR core, not supported by the C
10480 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
10481 attiny11, attiny12, attiny15, attiny28).
10482
10483 Instruction set avr2 (default) is for the classic AVR core with up to
10484 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
10485 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
10486 at90c8534, at90s8535).
10487
10488 Instruction set avr3 is for the classic AVR core with up to 128K program
10489 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
10490
10491 Instruction set avr4 is for the enhanced AVR core with up to 8K program
10492 memory space (MCU types: atmega8, atmega83, atmega85).
10493
10494 Instruction set avr5 is for the enhanced AVR core with up to 128K program
10495 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
10496 atmega64, atmega128, at43usb355, at94k).
10497
10498 @item -mno-interrupts
10499 @opindex mno-interrupts
10500 Generated code is not compatible with hardware interrupts.
10501 Code size will be smaller.
10502
10503 @item -mcall-prologues
10504 @opindex mcall-prologues
10505 Functions prologues/epilogues expanded as call to appropriate
10506 subroutines.  Code size will be smaller.
10507
10508 @item -mtiny-stack
10509 @opindex mtiny-stack
10510 Change only the low 8 bits of the stack pointer.
10511
10512 @item -mint8
10513 @opindex mint8
10514 Assume int to be 8 bit integer.  This affects the sizes of all types: A
10515 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
10516 and long long will be 4 bytes.  Please note that this option does not
10517 comply to the C standards, but it will provide you with smaller code
10518 size.
10519 @end table
10520
10521 @node Blackfin Options
10522 @subsection Blackfin Options
10523 @cindex Blackfin Options
10524
10525 @table @gcctabopt
10526 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
10527 @opindex mcpu=
10528 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
10529 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
10530 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
10531 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
10532 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
10533 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
10534 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
10535 @samp{bf561}, @samp{bf592}.
10536 The optional @var{sirevision} specifies the silicon revision of the target
10537 Blackfin processor.  Any workarounds available for the targeted silicon revision
10538 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
10539 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
10540 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
10541 hexadecimal digits representing the major and minor numbers in the silicon
10542 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
10543 is not defined.  If @var{sirevision} is @samp{any}, the
10544 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
10545 If this optional @var{sirevision} is not used, GCC assumes the latest known
10546 silicon revision of the targeted Blackfin processor.
10547
10548 Support for @samp{bf561} is incomplete.  For @samp{bf561},
10549 Only the processor macro is defined.
10550 Without this option, @samp{bf532} is used as the processor by default.
10551 The corresponding predefined processor macros for @var{cpu} is to
10552 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
10553 provided by libgloss to be linked in if @option{-msim} is not given.
10554
10555 @item -msim
10556 @opindex msim
10557 Specifies that the program will be run on the simulator.  This causes
10558 the simulator BSP provided by libgloss to be linked in.  This option
10559 has effect only for @samp{bfin-elf} toolchain.
10560 Certain other options, such as @option{-mid-shared-library} and
10561 @option{-mfdpic}, imply @option{-msim}.
10562
10563 @item -momit-leaf-frame-pointer
10564 @opindex momit-leaf-frame-pointer
10565 Don't keep the frame pointer in a register for leaf functions.  This
10566 avoids the instructions to save, set up and restore frame pointers and
10567 makes an extra register available in leaf functions.  The option
10568 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10569 which might make debugging harder.
10570
10571 @item -mspecld-anomaly
10572 @opindex mspecld-anomaly
10573 When enabled, the compiler will ensure that the generated code does not
10574 contain speculative loads after jump instructions. If this option is used,
10575 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
10576
10577 @item -mno-specld-anomaly
10578 @opindex mno-specld-anomaly
10579 Don't generate extra code to prevent speculative loads from occurring.
10580
10581 @item -mcsync-anomaly
10582 @opindex mcsync-anomaly
10583 When enabled, the compiler will ensure that the generated code does not
10584 contain CSYNC or SSYNC instructions too soon after conditional branches.
10585 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
10586
10587 @item -mno-csync-anomaly
10588 @opindex mno-csync-anomaly
10589 Don't generate extra code to prevent CSYNC or SSYNC instructions from
10590 occurring too soon after a conditional branch.
10591
10592 @item -mlow-64k
10593 @opindex mlow-64k
10594 When enabled, the compiler is free to take advantage of the knowledge that
10595 the entire program fits into the low 64k of memory.
10596
10597 @item -mno-low-64k
10598 @opindex mno-low-64k
10599 Assume that the program is arbitrarily large.  This is the default.
10600
10601 @item -mstack-check-l1
10602 @opindex mstack-check-l1
10603 Do stack checking using information placed into L1 scratchpad memory by the
10604 uClinux kernel.
10605
10606 @item -mid-shared-library
10607 @opindex mid-shared-library
10608 Generate code that supports shared libraries via the library ID method.
10609 This allows for execute in place and shared libraries in an environment
10610 without virtual memory management.  This option implies @option{-fPIC}.
10611 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10612
10613 @item -mno-id-shared-library
10614 @opindex mno-id-shared-library
10615 Generate code that doesn't assume ID based shared libraries are being used.
10616 This is the default.
10617
10618 @item -mleaf-id-shared-library
10619 @opindex mleaf-id-shared-library
10620 Generate code that supports shared libraries via the library ID method,
10621 but assumes that this library or executable won't link against any other
10622 ID shared libraries.  That allows the compiler to use faster code for jumps
10623 and calls.
10624
10625 @item -mno-leaf-id-shared-library
10626 @opindex mno-leaf-id-shared-library
10627 Do not assume that the code being compiled won't link against any ID shared
10628 libraries.  Slower code will be generated for jump and call insns.
10629
10630 @item -mshared-library-id=n
10631 @opindex mshared-library-id
10632 Specified the identification number of the ID based shared library being
10633 compiled.  Specifying a value of 0 will generate more compact code, specifying
10634 other values will force the allocation of that number to the current
10635 library but is no more space or time efficient than omitting this option.
10636
10637 @item -msep-data
10638 @opindex msep-data
10639 Generate code that allows the data segment to be located in a different
10640 area of memory from the text segment.  This allows for execute in place in
10641 an environment without virtual memory management by eliminating relocations
10642 against the text section.
10643
10644 @item -mno-sep-data
10645 @opindex mno-sep-data
10646 Generate code that assumes that the data segment follows the text segment.
10647 This is the default.
10648
10649 @item -mlong-calls
10650 @itemx -mno-long-calls
10651 @opindex mlong-calls
10652 @opindex mno-long-calls
10653 Tells the compiler to perform function calls by first loading the
10654 address of the function into a register and then performing a subroutine
10655 call on this register.  This switch is needed if the target function
10656 will lie outside of the 24 bit addressing range of the offset based
10657 version of subroutine call instruction.
10658
10659 This feature is not enabled by default.  Specifying
10660 @option{-mno-long-calls} will restore the default behavior.  Note these
10661 switches have no effect on how the compiler generates code to handle
10662 function calls via function pointers.
10663
10664 @item -mfast-fp
10665 @opindex mfast-fp
10666 Link with the fast floating-point library. This library relaxes some of
10667 the IEEE floating-point standard's rules for checking inputs against
10668 Not-a-Number (NAN), in the interest of performance.
10669
10670 @item -minline-plt
10671 @opindex minline-plt
10672 Enable inlining of PLT entries in function calls to functions that are
10673 not known to bind locally.  It has no effect without @option{-mfdpic}.
10674
10675 @item -mmulticore
10676 @opindex mmulticore
10677 Build standalone application for multicore Blackfin processor. Proper
10678 start files and link scripts will be used to support multicore.
10679 This option defines @code{__BFIN_MULTICORE}. It can only be used with
10680 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
10681 @option{-mcorea} or @option{-mcoreb}. If it's used without
10682 @option{-mcorea} or @option{-mcoreb}, single application/dual core
10683 programming model is used. In this model, the main function of Core B
10684 should be named as coreb_main. If it's used with @option{-mcorea} or
10685 @option{-mcoreb}, one application per core programming model is used.
10686 If this option is not used, single core application programming
10687 model is used.
10688
10689 @item -mcorea
10690 @opindex mcorea
10691 Build standalone application for Core A of BF561 when using
10692 one application per core programming model. Proper start files
10693 and link scripts will be used to support Core A. This option
10694 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
10695
10696 @item -mcoreb
10697 @opindex mcoreb
10698 Build standalone application for Core B of BF561 when using
10699 one application per core programming model. Proper start files
10700 and link scripts will be used to support Core B. This option
10701 defines @code{__BFIN_COREB}. When this option is used, coreb_main
10702 should be used instead of main. It must be used with
10703 @option{-mmulticore}.
10704
10705 @item -msdram
10706 @opindex msdram
10707 Build standalone application for SDRAM. Proper start files and
10708 link scripts will be used to put the application into SDRAM.
10709 Loader should initialize SDRAM before loading the application
10710 into SDRAM. This option defines @code{__BFIN_SDRAM}.
10711
10712 @item -micplb
10713 @opindex micplb
10714 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
10715 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
10716 are enabled; for standalone applications the default is off.
10717 @end table
10718
10719 @node CRIS Options
10720 @subsection CRIS Options
10721 @cindex CRIS Options
10722
10723 These options are defined specifically for the CRIS ports.
10724
10725 @table @gcctabopt
10726 @item -march=@var{architecture-type}
10727 @itemx -mcpu=@var{architecture-type}
10728 @opindex march
10729 @opindex mcpu
10730 Generate code for the specified architecture.  The choices for
10731 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
10732 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
10733 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
10734 @samp{v10}.
10735
10736 @item -mtune=@var{architecture-type}
10737 @opindex mtune
10738 Tune to @var{architecture-type} everything applicable about the generated
10739 code, except for the ABI and the set of available instructions.  The
10740 choices for @var{architecture-type} are the same as for
10741 @option{-march=@var{architecture-type}}.
10742
10743 @item -mmax-stack-frame=@var{n}
10744 @opindex mmax-stack-frame
10745 Warn when the stack frame of a function exceeds @var{n} bytes.
10746
10747 @item -metrax4
10748 @itemx -metrax100
10749 @opindex metrax4
10750 @opindex metrax100
10751 The options @option{-metrax4} and @option{-metrax100} are synonyms for
10752 @option{-march=v3} and @option{-march=v8} respectively.
10753
10754 @item -mmul-bug-workaround
10755 @itemx -mno-mul-bug-workaround
10756 @opindex mmul-bug-workaround
10757 @opindex mno-mul-bug-workaround
10758 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
10759 models where it applies.  This option is active by default.
10760
10761 @item -mpdebug
10762 @opindex mpdebug
10763 Enable CRIS-specific verbose debug-related information in the assembly
10764 code.  This option also has the effect to turn off the @samp{#NO_APP}
10765 formatted-code indicator to the assembler at the beginning of the
10766 assembly file.
10767
10768 @item -mcc-init
10769 @opindex mcc-init
10770 Do not use condition-code results from previous instruction; always emit
10771 compare and test instructions before use of condition codes.
10772
10773 @item -mno-side-effects
10774 @opindex mno-side-effects
10775 Do not emit instructions with side-effects in addressing modes other than
10776 post-increment.
10777
10778 @item -mstack-align
10779 @itemx -mno-stack-align
10780 @itemx -mdata-align
10781 @itemx -mno-data-align
10782 @itemx -mconst-align
10783 @itemx -mno-const-align
10784 @opindex mstack-align
10785 @opindex mno-stack-align
10786 @opindex mdata-align
10787 @opindex mno-data-align
10788 @opindex mconst-align
10789 @opindex mno-const-align
10790 These options (no-options) arranges (eliminate arrangements) for the
10791 stack-frame, individual data and constants to be aligned for the maximum
10792 single data access size for the chosen CPU model.  The default is to
10793 arrange for 32-bit alignment.  ABI details such as structure layout are
10794 not affected by these options.
10795
10796 @item -m32-bit
10797 @itemx -m16-bit
10798 @itemx -m8-bit
10799 @opindex m32-bit
10800 @opindex m16-bit
10801 @opindex m8-bit
10802 Similar to the stack- data- and const-align options above, these options
10803 arrange for stack-frame, writable data and constants to all be 32-bit,
10804 16-bit or 8-bit aligned.  The default is 32-bit alignment.
10805
10806 @item -mno-prologue-epilogue
10807 @itemx -mprologue-epilogue
10808 @opindex mno-prologue-epilogue
10809 @opindex mprologue-epilogue
10810 With @option{-mno-prologue-epilogue}, the normal function prologue and
10811 epilogue that sets up the stack-frame are omitted and no return
10812 instructions or return sequences are generated in the code.  Use this
10813 option only together with visual inspection of the compiled code: no
10814 warnings or errors are generated when call-saved registers must be saved,
10815 or storage for local variable needs to be allocated.
10816
10817 @item -mno-gotplt
10818 @itemx -mgotplt
10819 @opindex mno-gotplt
10820 @opindex mgotplt
10821 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
10822 instruction sequences that load addresses for functions from the PLT part
10823 of the GOT rather than (traditional on other architectures) calls to the
10824 PLT@.  The default is @option{-mgotplt}.
10825
10826 @item -melf
10827 @opindex melf
10828 Legacy no-op option only recognized with the cris-axis-elf and
10829 cris-axis-linux-gnu targets.
10830
10831 @item -mlinux
10832 @opindex mlinux
10833 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
10834
10835 @item -sim
10836 @opindex sim
10837 This option, recognized for the cris-axis-elf arranges
10838 to link with input-output functions from a simulator library.  Code,
10839 initialized data and zero-initialized data are allocated consecutively.
10840
10841 @item -sim2
10842 @opindex sim2
10843 Like @option{-sim}, but pass linker options to locate initialized data at
10844 0x40000000 and zero-initialized data at 0x80000000.
10845 @end table
10846
10847 @node Darwin Options
10848 @subsection Darwin Options
10849 @cindex Darwin options
10850
10851 These options are defined for all architectures running the Darwin operating
10852 system.
10853
10854 FSF GCC on Darwin does not create ``fat'' object files; it will create
10855 an object file for the single architecture that it was built to
10856 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
10857 @option{-arch} options are used; it does so by running the compiler or
10858 linker multiple times and joining the results together with
10859 @file{lipo}.
10860
10861 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
10862 @samp{i686}) is determined by the flags that specify the ISA
10863 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
10864 @option{-force_cpusubtype_ALL} option can be used to override this.
10865
10866 The Darwin tools vary in their behavior when presented with an ISA
10867 mismatch.  The assembler, @file{as}, will only permit instructions to
10868 be used that are valid for the subtype of the file it is generating,
10869 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
10870 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
10871 and print an error if asked to create a shared library with a less
10872 restrictive subtype than its input files (for instance, trying to put
10873 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
10874 for executables, @file{ld}, will quietly give the executable the most
10875 restrictive subtype of any of its input files.
10876
10877 @table @gcctabopt
10878 @item -F@var{dir}
10879 @opindex F
10880 Add the framework directory @var{dir} to the head of the list of
10881 directories to be searched for header files.  These directories are
10882 interleaved with those specified by @option{-I} options and are
10883 scanned in a left-to-right order.
10884
10885 A framework directory is a directory with frameworks in it.  A
10886 framework is a directory with a @samp{"Headers"} and/or
10887 @samp{"PrivateHeaders"} directory contained directly in it that ends
10888 in @samp{".framework"}.  The name of a framework is the name of this
10889 directory excluding the @samp{".framework"}.  Headers associated with
10890 the framework are found in one of those two directories, with
10891 @samp{"Headers"} being searched first.  A subframework is a framework
10892 directory that is in a framework's @samp{"Frameworks"} directory.
10893 Includes of subframework headers can only appear in a header of a
10894 framework that contains the subframework, or in a sibling subframework
10895 header.  Two subframeworks are siblings if they occur in the same
10896 framework.  A subframework should not have the same name as a
10897 framework, a warning will be issued if this is violated.  Currently a
10898 subframework cannot have subframeworks, in the future, the mechanism
10899 may be extended to support this.  The standard frameworks can be found
10900 in @samp{"/System/Library/Frameworks"} and
10901 @samp{"/Library/Frameworks"}.  An example include looks like
10902 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
10903 the name of the framework and header.h is found in the
10904 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
10905
10906 @item -iframework@var{dir}
10907 @opindex iframework
10908 Like @option{-F} except the directory is a treated as a system
10909 directory.  The main difference between this @option{-iframework} and
10910 @option{-F} is that with @option{-iframework} the compiler does not
10911 warn about constructs contained within header files found via
10912 @var{dir}.  This option is valid only for the C family of languages.
10913
10914 @item -gused
10915 @opindex gused
10916 Emit debugging information for symbols that are used.  For STABS
10917 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
10918 This is by default ON@.
10919
10920 @item -gfull
10921 @opindex gfull
10922 Emit debugging information for all symbols and types.
10923
10924 @item -mmacosx-version-min=@var{version}
10925 The earliest version of MacOS X that this executable will run on
10926 is @var{version}.  Typical values of @var{version} include @code{10.1},
10927 @code{10.2}, and @code{10.3.9}.
10928
10929 If the compiler was built to use the system's headers by default,
10930 then the default for this option is the system version on which the
10931 compiler is running, otherwise the default is to make choices which
10932 are compatible with as many systems and code bases as possible.
10933
10934 @item -mkernel
10935 @opindex mkernel
10936 Enable kernel development mode.  The @option{-mkernel} option sets
10937 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
10938 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
10939 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
10940 applicable.  This mode also sets @option{-mno-altivec},
10941 @option{-msoft-float}, @option{-fno-builtin} and
10942 @option{-mlong-branch} for PowerPC targets.
10943
10944 @item -mone-byte-bool
10945 @opindex mone-byte-bool
10946 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
10947 By default @samp{sizeof(bool)} is @samp{4} when compiling for
10948 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
10949 option has no effect on x86.
10950
10951 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
10952 to generate code that is not binary compatible with code generated
10953 without that switch.  Using this switch may require recompiling all
10954 other modules in a program, including system libraries.  Use this
10955 switch to conform to a non-default data model.
10956
10957 @item -mfix-and-continue
10958 @itemx -ffix-and-continue
10959 @itemx -findirect-data
10960 @opindex mfix-and-continue
10961 @opindex ffix-and-continue
10962 @opindex findirect-data
10963 Generate code suitable for fast turn around development.  Needed to
10964 enable gdb to dynamically load @code{.o} files into already running
10965 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
10966 are provided for backwards compatibility.
10967
10968 @item -all_load
10969 @opindex all_load
10970 Loads all members of static archive libraries.
10971 See man ld(1) for more information.
10972
10973 @item -arch_errors_fatal
10974 @opindex arch_errors_fatal
10975 Cause the errors having to do with files that have the wrong architecture
10976 to be fatal.
10977
10978 @item -bind_at_load
10979 @opindex bind_at_load
10980 Causes the output file to be marked such that the dynamic linker will
10981 bind all undefined references when the file is loaded or launched.
10982
10983 @item -bundle
10984 @opindex bundle
10985 Produce a Mach-o bundle format file.
10986 See man ld(1) for more information.
10987
10988 @item -bundle_loader @var{executable}
10989 @opindex bundle_loader
10990 This option specifies the @var{executable} that will be loading the build
10991 output file being linked.  See man ld(1) for more information.
10992
10993 @item -dynamiclib
10994 @opindex dynamiclib
10995 When passed this option, GCC will produce a dynamic library instead of
10996 an executable when linking, using the Darwin @file{libtool} command.
10997
10998 @item -force_cpusubtype_ALL
10999 @opindex force_cpusubtype_ALL
11000 This causes GCC's output file to have the @var{ALL} subtype, instead of
11001 one controlled by the @option{-mcpu} or @option{-march} option.
11002
11003 @item -allowable_client  @var{client_name}
11004 @itemx -client_name
11005 @itemx -compatibility_version
11006 @itemx -current_version
11007 @itemx -dead_strip
11008 @itemx -dependency-file
11009 @itemx -dylib_file
11010 @itemx -dylinker_install_name
11011 @itemx -dynamic
11012 @itemx -exported_symbols_list
11013 @itemx -filelist
11014 @need 800
11015 @itemx -flat_namespace
11016 @itemx -force_flat_namespace
11017 @itemx -headerpad_max_install_names
11018 @itemx -image_base
11019 @itemx -init
11020 @itemx -install_name
11021 @itemx -keep_private_externs
11022 @itemx -multi_module
11023 @itemx -multiply_defined
11024 @itemx -multiply_defined_unused
11025 @need 800
11026 @itemx -noall_load
11027 @itemx -no_dead_strip_inits_and_terms
11028 @itemx -nofixprebinding
11029 @itemx -nomultidefs
11030 @itemx -noprebind
11031 @itemx -noseglinkedit
11032 @itemx -pagezero_size
11033 @itemx -prebind
11034 @itemx -prebind_all_twolevel_modules
11035 @itemx -private_bundle
11036 @need 800
11037 @itemx -read_only_relocs
11038 @itemx -sectalign
11039 @itemx -sectobjectsymbols
11040 @itemx -whyload
11041 @itemx -seg1addr
11042 @itemx -sectcreate
11043 @itemx -sectobjectsymbols
11044 @itemx -sectorder
11045 @itemx -segaddr
11046 @itemx -segs_read_only_addr
11047 @need 800
11048 @itemx -segs_read_write_addr
11049 @itemx -seg_addr_table
11050 @itemx -seg_addr_table_filename
11051 @itemx -seglinkedit
11052 @itemx -segprot
11053 @itemx -segs_read_only_addr
11054 @itemx -segs_read_write_addr
11055 @itemx -single_module
11056 @itemx -static
11057 @itemx -sub_library
11058 @need 800
11059 @itemx -sub_umbrella
11060 @itemx -twolevel_namespace
11061 @itemx -umbrella
11062 @itemx -undefined
11063 @itemx -unexported_symbols_list
11064 @itemx -weak_reference_mismatches
11065 @itemx -whatsloaded
11066 @opindex allowable_client
11067 @opindex client_name
11068 @opindex compatibility_version
11069 @opindex current_version
11070 @opindex dead_strip
11071 @opindex dependency-file
11072 @opindex dylib_file
11073 @opindex dylinker_install_name
11074 @opindex dynamic
11075 @opindex exported_symbols_list
11076 @opindex filelist
11077 @opindex flat_namespace
11078 @opindex force_flat_namespace
11079 @opindex headerpad_max_install_names
11080 @opindex image_base
11081 @opindex init
11082 @opindex install_name
11083 @opindex keep_private_externs
11084 @opindex multi_module
11085 @opindex multiply_defined
11086 @opindex multiply_defined_unused
11087 @opindex noall_load
11088 @opindex no_dead_strip_inits_and_terms
11089 @opindex nofixprebinding
11090 @opindex nomultidefs
11091 @opindex noprebind
11092 @opindex noseglinkedit
11093 @opindex pagezero_size
11094 @opindex prebind
11095 @opindex prebind_all_twolevel_modules
11096 @opindex private_bundle
11097 @opindex read_only_relocs
11098 @opindex sectalign
11099 @opindex sectobjectsymbols
11100 @opindex whyload
11101 @opindex seg1addr
11102 @opindex sectcreate
11103 @opindex sectobjectsymbols
11104 @opindex sectorder
11105 @opindex segaddr
11106 @opindex segs_read_only_addr
11107 @opindex segs_read_write_addr
11108 @opindex seg_addr_table
11109 @opindex seg_addr_table_filename
11110 @opindex seglinkedit
11111 @opindex segprot
11112 @opindex segs_read_only_addr
11113 @opindex segs_read_write_addr
11114 @opindex single_module
11115 @opindex static
11116 @opindex sub_library
11117 @opindex sub_umbrella
11118 @opindex twolevel_namespace
11119 @opindex umbrella
11120 @opindex undefined
11121 @opindex unexported_symbols_list
11122 @opindex weak_reference_mismatches
11123 @opindex whatsloaded
11124 These options are passed to the Darwin linker.  The Darwin linker man page
11125 describes them in detail.
11126 @end table
11127
11128 @node DEC Alpha Options
11129 @subsection DEC Alpha Options
11130
11131 These @samp{-m} options are defined for the DEC Alpha implementations:
11132
11133 @table @gcctabopt
11134 @item -mno-soft-float
11135 @itemx -msoft-float
11136 @opindex mno-soft-float
11137 @opindex msoft-float
11138 Use (do not use) the hardware floating-point instructions for
11139 floating-point operations.  When @option{-msoft-float} is specified,
11140 functions in @file{libgcc.a} will be used to perform floating-point
11141 operations.  Unless they are replaced by routines that emulate the
11142 floating-point operations, or compiled in such a way as to call such
11143 emulations routines, these routines will issue floating-point
11144 operations.   If you are compiling for an Alpha without floating-point
11145 operations, you must ensure that the library is built so as not to call
11146 them.
11147
11148 Note that Alpha implementations without floating-point operations are
11149 required to have floating-point registers.
11150
11151 @item -mfp-reg
11152 @itemx -mno-fp-regs
11153 @opindex mfp-reg
11154 @opindex mno-fp-regs
11155 Generate code that uses (does not use) the floating-point register set.
11156 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
11157 register set is not used, floating point operands are passed in integer
11158 registers as if they were integers and floating-point results are passed
11159 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
11160 so any function with a floating-point argument or return value called by code
11161 compiled with @option{-mno-fp-regs} must also be compiled with that
11162 option.
11163
11164 A typical use of this option is building a kernel that does not use,
11165 and hence need not save and restore, any floating-point registers.
11166
11167 @item -mieee
11168 @opindex mieee
11169 The Alpha architecture implements floating-point hardware optimized for
11170 maximum performance.  It is mostly compliant with the IEEE floating
11171 point standard.  However, for full compliance, software assistance is
11172 required.  This option generates code fully IEEE compliant code
11173 @emph{except} that the @var{inexact-flag} is not maintained (see below).
11174 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
11175 defined during compilation.  The resulting code is less efficient but is
11176 able to correctly support denormalized numbers and exceptional IEEE
11177 values such as not-a-number and plus/minus infinity.  Other Alpha
11178 compilers call this option @option{-ieee_with_no_inexact}.
11179
11180 @item -mieee-with-inexact
11181 @opindex mieee-with-inexact
11182 This is like @option{-mieee} except the generated code also maintains
11183 the IEEE @var{inexact-flag}.  Turning on this option causes the
11184 generated code to implement fully-compliant IEEE math.  In addition to
11185 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
11186 macro.  On some Alpha implementations the resulting code may execute
11187 significantly slower than the code generated by default.  Since there is
11188 very little code that depends on the @var{inexact-flag}, you should
11189 normally not specify this option.  Other Alpha compilers call this
11190 option @option{-ieee_with_inexact}.
11191
11192 @item -mfp-trap-mode=@var{trap-mode}
11193 @opindex mfp-trap-mode
11194 This option controls what floating-point related traps are enabled.
11195 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
11196 The trap mode can be set to one of four values:
11197
11198 @table @samp
11199 @item n
11200 This is the default (normal) setting.  The only traps that are enabled
11201 are the ones that cannot be disabled in software (e.g., division by zero
11202 trap).
11203
11204 @item u
11205 In addition to the traps enabled by @samp{n}, underflow traps are enabled
11206 as well.
11207
11208 @item su
11209 Like @samp{u}, but the instructions are marked to be safe for software
11210 completion (see Alpha architecture manual for details).
11211
11212 @item sui
11213 Like @samp{su}, but inexact traps are enabled as well.
11214 @end table
11215
11216 @item -mfp-rounding-mode=@var{rounding-mode}
11217 @opindex mfp-rounding-mode
11218 Selects the IEEE rounding mode.  Other Alpha compilers call this option
11219 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
11220 of:
11221
11222 @table @samp
11223 @item n
11224 Normal IEEE rounding mode.  Floating point numbers are rounded towards
11225 the nearest machine number or towards the even machine number in case
11226 of a tie.
11227
11228 @item m
11229 Round towards minus infinity.
11230
11231 @item c
11232 Chopped rounding mode.  Floating point numbers are rounded towards zero.
11233
11234 @item d
11235 Dynamic rounding mode.  A field in the floating point control register
11236 (@var{fpcr}, see Alpha architecture reference manual) controls the
11237 rounding mode in effect.  The C library initializes this register for
11238 rounding towards plus infinity.  Thus, unless your program modifies the
11239 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
11240 @end table
11241
11242 @item -mtrap-precision=@var{trap-precision}
11243 @opindex mtrap-precision
11244 In the Alpha architecture, floating point traps are imprecise.  This
11245 means without software assistance it is impossible to recover from a
11246 floating trap and program execution normally needs to be terminated.
11247 GCC can generate code that can assist operating system trap handlers
11248 in determining the exact location that caused a floating point trap.
11249 Depending on the requirements of an application, different levels of
11250 precisions can be selected:
11251
11252 @table @samp
11253 @item p
11254 Program precision.  This option is the default and means a trap handler
11255 can only identify which program caused a floating point exception.
11256
11257 @item f
11258 Function precision.  The trap handler can determine the function that
11259 caused a floating point exception.
11260
11261 @item i
11262 Instruction precision.  The trap handler can determine the exact
11263 instruction that caused a floating point exception.
11264 @end table
11265
11266 Other Alpha compilers provide the equivalent options called
11267 @option{-scope_safe} and @option{-resumption_safe}.
11268
11269 @item -mieee-conformant
11270 @opindex mieee-conformant
11271 This option marks the generated code as IEEE conformant.  You must not
11272 use this option unless you also specify @option{-mtrap-precision=i} and either
11273 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
11274 is to emit the line @samp{.eflag 48} in the function prologue of the
11275 generated assembly file.  Under DEC Unix, this has the effect that
11276 IEEE-conformant math library routines will be linked in.
11277
11278 @item -mbuild-constants
11279 @opindex mbuild-constants
11280 Normally GCC examines a 32- or 64-bit integer constant to
11281 see if it can construct it from smaller constants in two or three
11282 instructions.  If it cannot, it will output the constant as a literal and
11283 generate code to load it from the data segment at runtime.
11284
11285 Use this option to require GCC to construct @emph{all} integer constants
11286 using code, even if it takes more instructions (the maximum is six).
11287
11288 You would typically use this option to build a shared library dynamic
11289 loader.  Itself a shared library, it must relocate itself in memory
11290 before it can find the variables and constants in its own data segment.
11291
11292 @item -malpha-as
11293 @itemx -mgas
11294 @opindex malpha-as
11295 @opindex mgas
11296 Select whether to generate code to be assembled by the vendor-supplied
11297 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
11298
11299 @item -mbwx
11300 @itemx -mno-bwx
11301 @itemx -mcix
11302 @itemx -mno-cix
11303 @itemx -mfix
11304 @itemx -mno-fix
11305 @itemx -mmax
11306 @itemx -mno-max
11307 @opindex mbwx
11308 @opindex mno-bwx
11309 @opindex mcix
11310 @opindex mno-cix
11311 @opindex mfix
11312 @opindex mno-fix
11313 @opindex mmax
11314 @opindex mno-max
11315 Indicate whether GCC should generate code to use the optional BWX,
11316 CIX, FIX and MAX instruction sets.  The default is to use the instruction
11317 sets supported by the CPU type specified via @option{-mcpu=} option or that
11318 of the CPU on which GCC was built if none was specified.
11319
11320 @item -mfloat-vax
11321 @itemx -mfloat-ieee
11322 @opindex mfloat-vax
11323 @opindex mfloat-ieee
11324 Generate code that uses (does not use) VAX F and G floating point
11325 arithmetic instead of IEEE single and double precision.
11326
11327 @item -mexplicit-relocs
11328 @itemx -mno-explicit-relocs
11329 @opindex mexplicit-relocs
11330 @opindex mno-explicit-relocs
11331 Older Alpha assemblers provided no way to generate symbol relocations
11332 except via assembler macros.  Use of these macros does not allow
11333 optimal instruction scheduling.  GNU binutils as of version 2.12
11334 supports a new syntax that allows the compiler to explicitly mark
11335 which relocations should apply to which instructions.  This option
11336 is mostly useful for debugging, as GCC detects the capabilities of
11337 the assembler when it is built and sets the default accordingly.
11338
11339 @item -msmall-data
11340 @itemx -mlarge-data
11341 @opindex msmall-data
11342 @opindex mlarge-data
11343 When @option{-mexplicit-relocs} is in effect, static data is
11344 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
11345 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
11346 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
11347 16-bit relocations off of the @code{$gp} register.  This limits the
11348 size of the small data area to 64KB, but allows the variables to be
11349 directly accessed via a single instruction.
11350
11351 The default is @option{-mlarge-data}.  With this option the data area
11352 is limited to just below 2GB@.  Programs that require more than 2GB of
11353 data must use @code{malloc} or @code{mmap} to allocate the data in the
11354 heap instead of in the program's data segment.
11355
11356 When generating code for shared libraries, @option{-fpic} implies
11357 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
11358
11359 @item -msmall-text
11360 @itemx -mlarge-text
11361 @opindex msmall-text
11362 @opindex mlarge-text
11363 When @option{-msmall-text} is used, the compiler assumes that the
11364 code of the entire program (or shared library) fits in 4MB, and is
11365 thus reachable with a branch instruction.  When @option{-msmall-data}
11366 is used, the compiler can assume that all local symbols share the
11367 same @code{$gp} value, and thus reduce the number of instructions
11368 required for a function call from 4 to 1.
11369
11370 The default is @option{-mlarge-text}.
11371
11372 @item -mcpu=@var{cpu_type}
11373 @opindex mcpu
11374 Set the instruction set and instruction scheduling parameters for
11375 machine type @var{cpu_type}.  You can specify either the @samp{EV}
11376 style name or the corresponding chip number.  GCC supports scheduling
11377 parameters for the EV4, EV5 and EV6 family of processors and will
11378 choose the default values for the instruction set from the processor
11379 you specify.  If you do not specify a processor type, GCC will default
11380 to the processor on which the compiler was built.
11381
11382 Supported values for @var{cpu_type} are
11383
11384 @table @samp
11385 @item ev4
11386 @itemx ev45
11387 @itemx 21064
11388 Schedules as an EV4 and has no instruction set extensions.
11389
11390 @item ev5
11391 @itemx 21164
11392 Schedules as an EV5 and has no instruction set extensions.
11393
11394 @item ev56
11395 @itemx 21164a
11396 Schedules as an EV5 and supports the BWX extension.
11397
11398 @item pca56
11399 @itemx 21164pc
11400 @itemx 21164PC
11401 Schedules as an EV5 and supports the BWX and MAX extensions.
11402
11403 @item ev6
11404 @itemx 21264
11405 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
11406
11407 @item ev67
11408 @itemx 21264a
11409 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
11410 @end table
11411
11412 Native Linux/GNU toolchains also support the value @samp{native},
11413 which selects the best architecture option for the host processor.
11414 @option{-mcpu=native} has no effect if GCC does not recognize
11415 the processor.
11416
11417 @item -mtune=@var{cpu_type}
11418 @opindex mtune
11419 Set only the instruction scheduling parameters for machine type
11420 @var{cpu_type}.  The instruction set is not changed.
11421
11422 Native Linux/GNU toolchains also support the value @samp{native},
11423 which selects the best architecture option for the host processor.
11424 @option{-mtune=native} has no effect if GCC does not recognize
11425 the processor.
11426
11427 @item -mmemory-latency=@var{time}
11428 @opindex mmemory-latency
11429 Sets the latency the scheduler should assume for typical memory
11430 references as seen by the application.  This number is highly
11431 dependent on the memory access patterns used by the application
11432 and the size of the external cache on the machine.
11433
11434 Valid options for @var{time} are
11435
11436 @table @samp
11437 @item @var{number}
11438 A decimal number representing clock cycles.
11439
11440 @item L1
11441 @itemx L2
11442 @itemx L3
11443 @itemx main
11444 The compiler contains estimates of the number of clock cycles for
11445 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
11446 (also called Dcache, Scache, and Bcache), as well as to main memory.
11447 Note that L3 is only valid for EV5.
11448
11449 @end table
11450 @end table
11451
11452 @node DEC Alpha/VMS Options
11453 @subsection DEC Alpha/VMS Options
11454
11455 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
11456
11457 @table @gcctabopt
11458 @item -mvms-return-codes
11459 @opindex mvms-return-codes
11460 Return VMS condition codes from main.  The default is to return POSIX
11461 style condition (e.g.@: error) codes.
11462
11463 @item -mdebug-main=@var{prefix}
11464 @opindex mdebug-main=@var{prefix}
11465 Flag the first routine whose name starts with @var{prefix} as the main
11466 routine for the debugger.
11467
11468 @item -mmalloc64
11469 @opindex mmalloc64
11470 Default to 64bit memory allocation routines.
11471 @end table
11472
11473 @node FR30 Options
11474 @subsection FR30 Options
11475 @cindex FR30 Options
11476
11477 These options are defined specifically for the FR30 port.
11478
11479 @table @gcctabopt
11480
11481 @item -msmall-model
11482 @opindex msmall-model
11483 Use the small address space model.  This can produce smaller code, but
11484 it does assume that all symbolic values and addresses will fit into a
11485 20-bit range.
11486
11487 @item -mno-lsim
11488 @opindex mno-lsim
11489 Assume that run-time support has been provided and so there is no need
11490 to include the simulator library (@file{libsim.a}) on the linker
11491 command line.
11492
11493 @end table
11494
11495 @node FRV Options
11496 @subsection FRV Options
11497 @cindex FRV Options
11498
11499 @table @gcctabopt
11500 @item -mgpr-32
11501 @opindex mgpr-32
11502
11503 Only use the first 32 general purpose registers.
11504
11505 @item -mgpr-64
11506 @opindex mgpr-64
11507
11508 Use all 64 general purpose registers.
11509
11510 @item -mfpr-32
11511 @opindex mfpr-32
11512
11513 Use only the first 32 floating point registers.
11514
11515 @item -mfpr-64
11516 @opindex mfpr-64
11517
11518 Use all 64 floating point registers
11519
11520 @item -mhard-float
11521 @opindex mhard-float
11522
11523 Use hardware instructions for floating point operations.
11524
11525 @item -msoft-float
11526 @opindex msoft-float
11527
11528 Use library routines for floating point operations.
11529
11530 @item -malloc-cc
11531 @opindex malloc-cc
11532
11533 Dynamically allocate condition code registers.
11534
11535 @item -mfixed-cc
11536 @opindex mfixed-cc
11537
11538 Do not try to dynamically allocate condition code registers, only
11539 use @code{icc0} and @code{fcc0}.
11540
11541 @item -mdword
11542 @opindex mdword
11543
11544 Change ABI to use double word insns.
11545
11546 @item -mno-dword
11547 @opindex mno-dword
11548
11549 Do not use double word instructions.
11550
11551 @item -mdouble
11552 @opindex mdouble
11553
11554 Use floating point double instructions.
11555
11556 @item -mno-double
11557 @opindex mno-double
11558
11559 Do not use floating point double instructions.
11560
11561 @item -mmedia
11562 @opindex mmedia
11563
11564 Use media instructions.
11565
11566 @item -mno-media
11567 @opindex mno-media
11568
11569 Do not use media instructions.
11570
11571 @item -mmuladd
11572 @opindex mmuladd
11573
11574 Use multiply and add/subtract instructions.
11575
11576 @item -mno-muladd
11577 @opindex mno-muladd
11578
11579 Do not use multiply and add/subtract instructions.
11580
11581 @item -mfdpic
11582 @opindex mfdpic
11583
11584 Select the FDPIC ABI, that uses function descriptors to represent
11585 pointers to functions.  Without any PIC/PIE-related options, it
11586 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
11587 assumes GOT entries and small data are within a 12-bit range from the
11588 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
11589 are computed with 32 bits.
11590 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11591
11592 @item -minline-plt
11593 @opindex minline-plt
11594
11595 Enable inlining of PLT entries in function calls to functions that are
11596 not known to bind locally.  It has no effect without @option{-mfdpic}.
11597 It's enabled by default if optimizing for speed and compiling for
11598 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
11599 optimization option such as @option{-O3} or above is present in the
11600 command line.
11601
11602 @item -mTLS
11603 @opindex mTLS
11604
11605 Assume a large TLS segment when generating thread-local code.
11606
11607 @item -mtls
11608 @opindex mtls
11609
11610 Do not assume a large TLS segment when generating thread-local code.
11611
11612 @item -mgprel-ro
11613 @opindex mgprel-ro
11614
11615 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
11616 that is known to be in read-only sections.  It's enabled by default,
11617 except for @option{-fpic} or @option{-fpie}: even though it may help
11618 make the global offset table smaller, it trades 1 instruction for 4.
11619 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
11620 one of which may be shared by multiple symbols, and it avoids the need
11621 for a GOT entry for the referenced symbol, so it's more likely to be a
11622 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
11623
11624 @item -multilib-library-pic
11625 @opindex multilib-library-pic
11626
11627 Link with the (library, not FD) pic libraries.  It's implied by
11628 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
11629 @option{-fpic} without @option{-mfdpic}.  You should never have to use
11630 it explicitly.
11631
11632 @item -mlinked-fp
11633 @opindex mlinked-fp
11634
11635 Follow the EABI requirement of always creating a frame pointer whenever
11636 a stack frame is allocated.  This option is enabled by default and can
11637 be disabled with @option{-mno-linked-fp}.
11638
11639 @item -mlong-calls
11640 @opindex mlong-calls
11641
11642 Use indirect addressing to call functions outside the current
11643 compilation unit.  This allows the functions to be placed anywhere
11644 within the 32-bit address space.
11645
11646 @item -malign-labels
11647 @opindex malign-labels
11648
11649 Try to align labels to an 8-byte boundary by inserting nops into the
11650 previous packet.  This option only has an effect when VLIW packing
11651 is enabled.  It doesn't create new packets; it merely adds nops to
11652 existing ones.
11653
11654 @item -mlibrary-pic
11655 @opindex mlibrary-pic
11656
11657 Generate position-independent EABI code.
11658
11659 @item -macc-4
11660 @opindex macc-4
11661
11662 Use only the first four media accumulator registers.
11663
11664 @item -macc-8
11665 @opindex macc-8
11666
11667 Use all eight media accumulator registers.
11668
11669 @item -mpack
11670 @opindex mpack
11671
11672 Pack VLIW instructions.
11673
11674 @item -mno-pack
11675 @opindex mno-pack
11676
11677 Do not pack VLIW instructions.
11678
11679 @item -mno-eflags
11680 @opindex mno-eflags
11681
11682 Do not mark ABI switches in e_flags.
11683
11684 @item -mcond-move
11685 @opindex mcond-move
11686
11687 Enable the use of conditional-move instructions (default).
11688
11689 This switch is mainly for debugging the compiler and will likely be removed
11690 in a future version.
11691
11692 @item -mno-cond-move
11693 @opindex mno-cond-move
11694
11695 Disable the use of conditional-move instructions.
11696
11697 This switch is mainly for debugging the compiler and will likely be removed
11698 in a future version.
11699
11700 @item -mscc
11701 @opindex mscc
11702
11703 Enable the use of conditional set instructions (default).
11704
11705 This switch is mainly for debugging the compiler and will likely be removed
11706 in a future version.
11707
11708 @item -mno-scc
11709 @opindex mno-scc
11710
11711 Disable the use of conditional set instructions.
11712
11713 This switch is mainly for debugging the compiler and will likely be removed
11714 in a future version.
11715
11716 @item -mcond-exec
11717 @opindex mcond-exec
11718
11719 Enable the use of conditional execution (default).
11720
11721 This switch is mainly for debugging the compiler and will likely be removed
11722 in a future version.
11723
11724 @item -mno-cond-exec
11725 @opindex mno-cond-exec
11726
11727 Disable the use of conditional execution.
11728
11729 This switch is mainly for debugging the compiler and will likely be removed
11730 in a future version.
11731
11732 @item -mvliw-branch
11733 @opindex mvliw-branch
11734
11735 Run a pass to pack branches into VLIW instructions (default).
11736
11737 This switch is mainly for debugging the compiler and will likely be removed
11738 in a future version.
11739
11740 @item -mno-vliw-branch
11741 @opindex mno-vliw-branch
11742
11743 Do not run a pass to pack branches into VLIW instructions.
11744
11745 This switch is mainly for debugging the compiler and will likely be removed
11746 in a future version.
11747
11748 @item -mmulti-cond-exec
11749 @opindex mmulti-cond-exec
11750
11751 Enable optimization of @code{&&} and @code{||} in conditional execution
11752 (default).
11753
11754 This switch is mainly for debugging the compiler and will likely be removed
11755 in a future version.
11756
11757 @item -mno-multi-cond-exec
11758 @opindex mno-multi-cond-exec
11759
11760 Disable optimization of @code{&&} and @code{||} in conditional execution.
11761
11762 This switch is mainly for debugging the compiler and will likely be removed
11763 in a future version.
11764
11765 @item -mnested-cond-exec
11766 @opindex mnested-cond-exec
11767
11768 Enable nested conditional execution optimizations (default).
11769
11770 This switch is mainly for debugging the compiler and will likely be removed
11771 in a future version.
11772
11773 @item -mno-nested-cond-exec
11774 @opindex mno-nested-cond-exec
11775
11776 Disable nested conditional execution optimizations.
11777
11778 This switch is mainly for debugging the compiler and will likely be removed
11779 in a future version.
11780
11781 @item -moptimize-membar
11782 @opindex moptimize-membar
11783
11784 This switch removes redundant @code{membar} instructions from the
11785 compiler generated code.  It is enabled by default.
11786
11787 @item -mno-optimize-membar
11788 @opindex mno-optimize-membar
11789
11790 This switch disables the automatic removal of redundant @code{membar}
11791 instructions from the generated code.
11792
11793 @item -mtomcat-stats
11794 @opindex mtomcat-stats
11795
11796 Cause gas to print out tomcat statistics.
11797
11798 @item -mcpu=@var{cpu}
11799 @opindex mcpu
11800
11801 Select the processor type for which to generate code.  Possible values are
11802 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
11803 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
11804
11805 @end table
11806
11807 @node GNU/Linux Options
11808 @subsection GNU/Linux Options
11809
11810 These @samp{-m} options are defined for GNU/Linux targets:
11811
11812 @table @gcctabopt
11813 @item -mglibc
11814 @opindex mglibc
11815 Use the GNU C library.  This is the default except
11816 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
11817
11818 @item -muclibc
11819 @opindex muclibc
11820 Use uClibc C library.  This is the default on
11821 @samp{*-*-linux-*uclibc*} targets.
11822
11823 @item -mbionic
11824 @opindex mbionic
11825 Use Bionic C library.  This is the default on
11826 @samp{*-*-linux-*android*} targets.
11827
11828 @item -mandroid
11829 @opindex mandroid
11830 Compile code compatible with Android platform.  This is the default on
11831 @samp{*-*-linux-*android*} targets.
11832
11833 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
11834 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
11835 this option makes the GCC driver pass Android-specific options to the linker.
11836 Finally, this option causes the preprocessor macro @code{__ANDROID__}
11837 to be defined.
11838
11839 @item -tno-android-cc
11840 @opindex tno-android-cc
11841 Disable compilation effects of @option{-mandroid}, i.e., do not enable
11842 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
11843 @option{-fno-rtti} by default.
11844
11845 @item -tno-android-ld
11846 @opindex tno-android-ld
11847 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
11848 linking options to the linker.
11849
11850 @end table
11851
11852 @node H8/300 Options
11853 @subsection H8/300 Options
11854
11855 These @samp{-m} options are defined for the H8/300 implementations:
11856
11857 @table @gcctabopt
11858 @item -mrelax
11859 @opindex mrelax
11860 Shorten some address references at link time, when possible; uses the
11861 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
11862 ld, Using ld}, for a fuller description.
11863
11864 @item -mh
11865 @opindex mh
11866 Generate code for the H8/300H@.
11867
11868 @item -ms
11869 @opindex ms
11870 Generate code for the H8S@.
11871
11872 @item -mn
11873 @opindex mn
11874 Generate code for the H8S and H8/300H in the normal mode.  This switch
11875 must be used either with @option{-mh} or @option{-ms}.
11876
11877 @item -ms2600
11878 @opindex ms2600
11879 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
11880
11881 @item -mint32
11882 @opindex mint32
11883 Make @code{int} data 32 bits by default.
11884
11885 @item -malign-300
11886 @opindex malign-300
11887 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
11888 The default for the H8/300H and H8S is to align longs and floats on 4
11889 byte boundaries.
11890 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
11891 This option has no effect on the H8/300.
11892 @end table
11893
11894 @node HPPA Options
11895 @subsection HPPA Options
11896 @cindex HPPA Options
11897
11898 These @samp{-m} options are defined for the HPPA family of computers:
11899
11900 @table @gcctabopt
11901 @item -march=@var{architecture-type}
11902 @opindex march
11903 Generate code for the specified architecture.  The choices for
11904 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
11905 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
11906 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
11907 architecture option for your machine.  Code compiled for lower numbered
11908 architectures will run on higher numbered architectures, but not the
11909 other way around.
11910
11911 @item -mpa-risc-1-0
11912 @itemx -mpa-risc-1-1
11913 @itemx -mpa-risc-2-0
11914 @opindex mpa-risc-1-0
11915 @opindex mpa-risc-1-1
11916 @opindex mpa-risc-2-0
11917 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
11918
11919 @item -mbig-switch
11920 @opindex mbig-switch
11921 Generate code suitable for big switch tables.  Use this option only if
11922 the assembler/linker complain about out of range branches within a switch
11923 table.
11924
11925 @item -mjump-in-delay
11926 @opindex mjump-in-delay
11927 Fill delay slots of function calls with unconditional jump instructions
11928 by modifying the return pointer for the function call to be the target
11929 of the conditional jump.
11930
11931 @item -mdisable-fpregs
11932 @opindex mdisable-fpregs
11933 Prevent floating point registers from being used in any manner.  This is
11934 necessary for compiling kernels which perform lazy context switching of
11935 floating point registers.  If you use this option and attempt to perform
11936 floating point operations, the compiler will abort.
11937
11938 @item -mdisable-indexing
11939 @opindex mdisable-indexing
11940 Prevent the compiler from using indexing address modes.  This avoids some
11941 rather obscure problems when compiling MIG generated code under MACH@.
11942
11943 @item -mno-space-regs
11944 @opindex mno-space-regs
11945 Generate code that assumes the target has no space registers.  This allows
11946 GCC to generate faster indirect calls and use unscaled index address modes.
11947
11948 Such code is suitable for level 0 PA systems and kernels.
11949
11950 @item -mfast-indirect-calls
11951 @opindex mfast-indirect-calls
11952 Generate code that assumes calls never cross space boundaries.  This
11953 allows GCC to emit code which performs faster indirect calls.
11954
11955 This option will not work in the presence of shared libraries or nested
11956 functions.
11957
11958 @item -mfixed-range=@var{register-range}
11959 @opindex mfixed-range
11960 Generate code treating the given register range as fixed registers.
11961 A fixed register is one that the register allocator can not use.  This is
11962 useful when compiling kernel code.  A register range is specified as
11963 two registers separated by a dash.  Multiple register ranges can be
11964 specified separated by a comma.
11965
11966 @item -mlong-load-store
11967 @opindex mlong-load-store
11968 Generate 3-instruction load and store sequences as sometimes required by
11969 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
11970 the HP compilers.
11971
11972 @item -mportable-runtime
11973 @opindex mportable-runtime
11974 Use the portable calling conventions proposed by HP for ELF systems.
11975
11976 @item -mgas
11977 @opindex mgas
11978 Enable the use of assembler directives only GAS understands.
11979
11980 @item -mschedule=@var{cpu-type}
11981 @opindex mschedule
11982 Schedule code according to the constraints for the machine type
11983 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
11984 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
11985 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
11986 proper scheduling option for your machine.  The default scheduling is
11987 @samp{8000}.
11988
11989 @item -mlinker-opt
11990 @opindex mlinker-opt
11991 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
11992 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
11993 linkers in which they give bogus error messages when linking some programs.
11994
11995 @item -msoft-float
11996 @opindex msoft-float
11997 Generate output containing library calls for floating point.
11998 @strong{Warning:} the requisite libraries are not available for all HPPA
11999 targets.  Normally the facilities of the machine's usual C compiler are
12000 used, but this cannot be done directly in cross-compilation.  You must make
12001 your own arrangements to provide suitable library functions for
12002 cross-compilation.
12003
12004 @option{-msoft-float} changes the calling convention in the output file;
12005 therefore, it is only useful if you compile @emph{all} of a program with
12006 this option.  In particular, you need to compile @file{libgcc.a}, the
12007 library that comes with GCC, with @option{-msoft-float} in order for
12008 this to work.
12009
12010 @item -msio
12011 @opindex msio
12012 Generate the predefine, @code{_SIO}, for server IO@.  The default is
12013 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
12014 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
12015 options are available under HP-UX and HI-UX@.
12016
12017 @item -mgnu-ld
12018 @opindex mgnu-ld
12019 Use GNU ld specific options.  This passes @option{-shared} to ld when
12020 building a shared library.  It is the default when GCC is configured,
12021 explicitly or implicitly, with the GNU linker.  This option does not
12022 have any affect on which ld is called, it only changes what parameters
12023 are passed to that ld.  The ld that is called is determined by the
12024 @option{--with-ld} configure option, GCC's program search path, and
12025 finally by the user's @env{PATH}.  The linker used by GCC can be printed
12026 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
12027 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12028
12029 @item -mhp-ld
12030 @opindex mhp-ld
12031 Use HP ld specific options.  This passes @option{-b} to ld when building
12032 a shared library and passes @option{+Accept TypeMismatch} to ld on all
12033 links.  It is the default when GCC is configured, explicitly or
12034 implicitly, with the HP linker.  This option does not have any affect on
12035 which ld is called, it only changes what parameters are passed to that
12036 ld.  The ld that is called is determined by the @option{--with-ld}
12037 configure option, GCC's program search path, and finally by the user's
12038 @env{PATH}.  The linker used by GCC can be printed using @samp{which
12039 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
12040 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12041
12042 @item -mlong-calls
12043 @opindex mno-long-calls
12044 Generate code that uses long call sequences.  This ensures that a call
12045 is always able to reach linker generated stubs.  The default is to generate
12046 long calls only when the distance from the call site to the beginning
12047 of the function or translation unit, as the case may be, exceeds a
12048 predefined limit set by the branch type being used.  The limits for
12049 normal calls are 7,600,000 and 240,000 bytes, respectively for the
12050 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
12051 240,000 bytes.
12052
12053 Distances are measured from the beginning of functions when using the
12054 @option{-ffunction-sections} option, or when using the @option{-mgas}
12055 and @option{-mno-portable-runtime} options together under HP-UX with
12056 the SOM linker.
12057
12058 It is normally not desirable to use this option as it will degrade
12059 performance.  However, it may be useful in large applications,
12060 particularly when partial linking is used to build the application.
12061
12062 The types of long calls used depends on the capabilities of the
12063 assembler and linker, and the type of code being generated.  The
12064 impact on systems that support long absolute calls, and long pic
12065 symbol-difference or pc-relative calls should be relatively small.
12066 However, an indirect call is used on 32-bit ELF systems in pic code
12067 and it is quite long.
12068
12069 @item -munix=@var{unix-std}
12070 @opindex march
12071 Generate compiler predefines and select a startfile for the specified
12072 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
12073 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
12074 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
12075 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
12076 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
12077 and later.
12078
12079 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
12080 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
12081 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
12082 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
12083 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
12084 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
12085
12086 It is @emph{important} to note that this option changes the interfaces
12087 for various library routines.  It also affects the operational behavior
12088 of the C library.  Thus, @emph{extreme} care is needed in using this
12089 option.
12090
12091 Library code that is intended to operate with more than one UNIX
12092 standard must test, set and restore the variable @var{__xpg4_extended_mask}
12093 as appropriate.  Most GNU software doesn't provide this capability.
12094
12095 @item -nolibdld
12096 @opindex nolibdld
12097 Suppress the generation of link options to search libdld.sl when the
12098 @option{-static} option is specified on HP-UX 10 and later.
12099
12100 @item -static
12101 @opindex static
12102 The HP-UX implementation of setlocale in libc has a dependency on
12103 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
12104 when the @option{-static} option is specified, special link options
12105 are needed to resolve this dependency.
12106
12107 On HP-UX 10 and later, the GCC driver adds the necessary options to
12108 link with libdld.sl when the @option{-static} option is specified.
12109 This causes the resulting binary to be dynamic.  On the 64-bit port,
12110 the linkers generate dynamic binaries by default in any case.  The
12111 @option{-nolibdld} option can be used to prevent the GCC driver from
12112 adding these link options.
12113
12114 @item -threads
12115 @opindex threads
12116 Add support for multithreading with the @dfn{dce thread} library
12117 under HP-UX@.  This option sets flags for both the preprocessor and
12118 linker.
12119 @end table
12120
12121 @node i386 and x86-64 Options
12122 @subsection Intel 386 and AMD x86-64 Options
12123 @cindex i386 Options
12124 @cindex x86-64 Options
12125 @cindex Intel 386 Options
12126 @cindex AMD x86-64 Options
12127
12128 These @samp{-m} options are defined for the i386 and x86-64 family of
12129 computers:
12130
12131 @table @gcctabopt
12132 @item -mtune=@var{cpu-type}
12133 @opindex mtune
12134 Tune to @var{cpu-type} everything applicable about the generated code, except
12135 for the ABI and the set of available instructions.  The choices for
12136 @var{cpu-type} are:
12137 @table @emph
12138 @item generic
12139 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
12140 If you know the CPU on which your code will run, then you should use
12141 the corresponding @option{-mtune} option instead of
12142 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
12143 of your application will have, then you should use this option.
12144
12145 As new processors are deployed in the marketplace, the behavior of this
12146 option will change.  Therefore, if you upgrade to a newer version of
12147 GCC, the code generated option will change to reflect the processors
12148 that were most common when that version of GCC was released.
12149
12150 There is no @option{-march=generic} option because @option{-march}
12151 indicates the instruction set the compiler can use, and there is no
12152 generic instruction set applicable to all processors.  In contrast,
12153 @option{-mtune} indicates the processor (or, in this case, collection of
12154 processors) for which the code is optimized.
12155 @item native
12156 This selects the CPU to tune for at compilation time by determining
12157 the processor type of the compiling machine.  Using @option{-mtune=native}
12158 will produce code optimized for the local machine under the constraints
12159 of the selected instruction set.  Using @option{-march=native} will
12160 enable all instruction subsets supported by the local machine (hence
12161 the result might not run on different machines).
12162 @item i386
12163 Original Intel's i386 CPU@.
12164 @item i486
12165 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
12166 @item i586, pentium
12167 Intel Pentium CPU with no MMX support.
12168 @item pentium-mmx
12169 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
12170 @item pentiumpro
12171 Intel PentiumPro CPU@.
12172 @item i686
12173 Same as @code{generic}, but when used as @code{march} option, PentiumPro
12174 instruction set will be used, so the code will run on all i686 family chips.
12175 @item pentium2
12176 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
12177 @item pentium3, pentium3m
12178 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
12179 support.
12180 @item pentium-m
12181 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
12182 support.  Used by Centrino notebooks.
12183 @item pentium4, pentium4m
12184 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
12185 @item prescott
12186 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
12187 set support.
12188 @item nocona
12189 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
12190 SSE2 and SSE3 instruction set support.
12191 @item core2
12192 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12193 instruction set support.
12194 @item corei7
12195 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
12196 and SSE4.2 instruction set support.
12197 @item corei7-avx
12198 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
12199 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
12200 @item atom
12201 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12202 instruction set support.
12203 @item k6
12204 AMD K6 CPU with MMX instruction set support.
12205 @item k6-2, k6-3
12206 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
12207 @item athlon, athlon-tbird
12208 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
12209 support.
12210 @item athlon-4, athlon-xp, athlon-mp
12211 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
12212 instruction set support.
12213 @item k8, opteron, athlon64, athlon-fx
12214 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
12215 MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit instruction set extensions.)
12216 @item k8-sse3, opteron-sse3, athlon64-sse3
12217 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
12218 @item amdfam10, barcelona
12219 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
12220 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
12221 instruction set extensions.)
12222 @item winchip-c6
12223 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
12224 set support.
12225 @item winchip2
12226 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
12227 instruction set support.
12228 @item c3
12229 Via C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
12230 implemented for this chip.)
12231 @item c3-2
12232 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
12233 implemented for this chip.)
12234 @item geode
12235 Embedded AMD CPU with MMX and 3DNow!@: instruction set support.
12236 @end table
12237
12238 While picking a specific @var{cpu-type} will schedule things appropriately
12239 for that particular chip, the compiler will not generate any code that
12240 does not run on the i386 without the @option{-march=@var{cpu-type}} option
12241 being used.
12242
12243 @item -march=@var{cpu-type}
12244 @opindex march
12245 Generate instructions for the machine type @var{cpu-type}.  The choices
12246 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
12247 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
12248
12249 @item -mcpu=@var{cpu-type}
12250 @opindex mcpu
12251 A deprecated synonym for @option{-mtune}.
12252
12253 @item -mfpmath=@var{unit}
12254 @opindex mfpmath
12255 Generate floating point arithmetics for selected unit @var{unit}.  The choices
12256 for @var{unit} are:
12257
12258 @table @samp
12259 @item 387
12260 Use the standard 387 floating point coprocessor present majority of chips and
12261 emulated otherwise.  Code compiled with this option will run almost everywhere.
12262 The temporary results are computed in 80bit precision instead of precision
12263 specified by the type resulting in slightly different results compared to most
12264 of other chips.  See @option{-ffloat-store} for more detailed description.
12265
12266 This is the default choice for i386 compiler.
12267
12268 @item sse
12269 Use scalar floating point instructions present in the SSE instruction set.
12270 This instruction set is supported by Pentium3 and newer chips, in the AMD line
12271 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
12272 instruction set supports only single precision arithmetics, thus the double and
12273 extended precision arithmetics is still done using 387.  Later version, present
12274 only in Pentium4 and the future AMD x86-64 chips supports double precision
12275 arithmetics too.
12276
12277 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
12278 or @option{-msse2} switches to enable SSE extensions and make this option
12279 effective.  For the x86-64 compiler, these extensions are enabled by default.
12280
12281 The resulting code should be considerably faster in the majority of cases and avoid
12282 the numerical instability problems of 387 code, but may break some existing
12283 code that expects temporaries to be 80bit.
12284
12285 This is the default choice for the x86-64 compiler.
12286
12287 @item sse,387
12288 @itemx sse+387
12289 @itemx both
12290 Attempt to utilize both instruction sets at once.  This effectively double the
12291 amount of available registers and on chips with separate execution units for
12292 387 and SSE the execution resources too.  Use this option with care, as it is
12293 still experimental, because the GCC register allocator does not model separate
12294 functional units well resulting in instable performance.
12295 @end table
12296
12297 @item -masm=@var{dialect}
12298 @opindex masm=@var{dialect}
12299 Output asm instructions using selected @var{dialect}.  Supported
12300 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
12301 not support @samp{intel}.
12302
12303 @item -mieee-fp
12304 @itemx -mno-ieee-fp
12305 @opindex mieee-fp
12306 @opindex mno-ieee-fp
12307 Control whether or not the compiler uses IEEE floating point
12308 comparisons.  These handle correctly the case where the result of a
12309 comparison is unordered.
12310
12311 @item -msoft-float
12312 @opindex msoft-float
12313 Generate output containing library calls for floating point.
12314 @strong{Warning:} the requisite libraries are not part of GCC@.
12315 Normally the facilities of the machine's usual C compiler are used, but
12316 this can't be done directly in cross-compilation.  You must make your
12317 own arrangements to provide suitable library functions for
12318 cross-compilation.
12319
12320 On machines where a function returns floating point results in the 80387
12321 register stack, some floating point opcodes may be emitted even if
12322 @option{-msoft-float} is used.
12323
12324 @item -mno-fp-ret-in-387
12325 @opindex mno-fp-ret-in-387
12326 Do not use the FPU registers for return values of functions.
12327
12328 The usual calling convention has functions return values of types
12329 @code{float} and @code{double} in an FPU register, even if there
12330 is no FPU@.  The idea is that the operating system should emulate
12331 an FPU@.
12332
12333 The option @option{-mno-fp-ret-in-387} causes such values to be returned
12334 in ordinary CPU registers instead.
12335
12336 @item -mno-fancy-math-387
12337 @opindex mno-fancy-math-387
12338 Some 387 emulators do not support the @code{sin}, @code{cos} and
12339 @code{sqrt} instructions for the 387.  Specify this option to avoid
12340 generating those instructions.  This option is the default on FreeBSD,
12341 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
12342 indicates that the target CPU will always have an FPU and so the
12343 instruction will not need emulation.  As of revision 2.6.1, these
12344 instructions are not generated unless you also use the
12345 @option{-funsafe-math-optimizations} switch.
12346
12347 @item -malign-double
12348 @itemx -mno-align-double
12349 @opindex malign-double
12350 @opindex mno-align-double
12351 Control whether GCC aligns @code{double}, @code{long double}, and
12352 @code{long long} variables on a two word boundary or a one word
12353 boundary.  Aligning @code{double} variables on a two word boundary will
12354 produce code that runs somewhat faster on a @samp{Pentium} at the
12355 expense of more memory.
12356
12357 On x86-64, @option{-malign-double} is enabled by default.
12358
12359 @strong{Warning:} if you use the @option{-malign-double} switch,
12360 structures containing the above types will be aligned differently than
12361 the published application binary interface specifications for the 386
12362 and will not be binary compatible with structures in code compiled
12363 without that switch.
12364
12365 @item -m96bit-long-double
12366 @itemx -m128bit-long-double
12367 @opindex m96bit-long-double
12368 @opindex m128bit-long-double
12369 These switches control the size of @code{long double} type.  The i386
12370 application binary interface specifies the size to be 96 bits,
12371 so @option{-m96bit-long-double} is the default in 32 bit mode.
12372
12373 Modern architectures (Pentium and newer) would prefer @code{long double}
12374 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
12375 conforming to the ABI, this would not be possible.  So specifying a
12376 @option{-m128bit-long-double} will align @code{long double}
12377 to a 16 byte boundary by padding the @code{long double} with an additional
12378 32 bit zero.
12379
12380 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
12381 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
12382
12383 Notice that neither of these options enable any extra precision over the x87
12384 standard of 80 bits for a @code{long double}.
12385
12386 @strong{Warning:} if you override the default value for your target ABI, the
12387 structures and arrays containing @code{long double} variables will change
12388 their size as well as function calling convention for function taking
12389 @code{long double} will be modified.  Hence they will not be binary
12390 compatible with arrays or structures in code compiled without that switch.
12391
12392 @item -mlarge-data-threshold=@var{number}
12393 @opindex mlarge-data-threshold=@var{number}
12394 When @option{-mcmodel=medium} is specified, the data greater than
12395 @var{threshold} are placed in large data section.  This value must be the
12396 same across all object linked into the binary and defaults to 65535.
12397
12398 @item -mrtd
12399 @opindex mrtd
12400 Use a different function-calling convention, in which functions that
12401 take a fixed number of arguments return with the @code{ret} @var{num}
12402 instruction, which pops their arguments while returning.  This saves one
12403 instruction in the caller since there is no need to pop the arguments
12404 there.
12405
12406 You can specify that an individual function is called with this calling
12407 sequence with the function attribute @samp{stdcall}.  You can also
12408 override the @option{-mrtd} option by using the function attribute
12409 @samp{cdecl}.  @xref{Function Attributes}.
12410
12411 @strong{Warning:} this calling convention is incompatible with the one
12412 normally used on Unix, so you cannot use it if you need to call
12413 libraries compiled with the Unix compiler.
12414
12415 Also, you must provide function prototypes for all functions that
12416 take variable numbers of arguments (including @code{printf});
12417 otherwise incorrect code will be generated for calls to those
12418 functions.
12419
12420 In addition, seriously incorrect code will result if you call a
12421 function with too many arguments.  (Normally, extra arguments are
12422 harmlessly ignored.)
12423
12424 @item -mregparm=@var{num}
12425 @opindex mregparm
12426 Control how many registers are used to pass integer arguments.  By
12427 default, no registers are used to pass arguments, and at most 3
12428 registers can be used.  You can control this behavior for a specific
12429 function by using the function attribute @samp{regparm}.
12430 @xref{Function Attributes}.
12431
12432 @strong{Warning:} if you use this switch, and
12433 @var{num} is nonzero, then you must build all modules with the same
12434 value, including any libraries.  This includes the system libraries and
12435 startup modules.
12436
12437 @item -msseregparm
12438 @opindex msseregparm
12439 Use SSE register passing conventions for float and double arguments
12440 and return values.  You can control this behavior for a specific
12441 function by using the function attribute @samp{sseregparm}.
12442 @xref{Function Attributes}.
12443
12444 @strong{Warning:} if you use this switch then you must build all
12445 modules with the same value, including any libraries.  This includes
12446 the system libraries and startup modules.
12447
12448 @item -mvect8-ret-in-mem
12449 @opindex mvect8-ret-in-mem
12450 Return 8-byte vectors in memory instead of MMX registers.  This is the
12451 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
12452 Studio compilers until version 12.  Later compiler versions (starting
12453 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
12454 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
12455 you need to remain compatible with existing code produced by those
12456 previous compiler versions or older versions of GCC.
12457
12458 @item -mpc32
12459 @itemx -mpc64
12460 @itemx -mpc80
12461 @opindex mpc32
12462 @opindex mpc64
12463 @opindex mpc80
12464
12465 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
12466 is specified, the significands of results of floating-point operations are
12467 rounded to 24 bits (single precision); @option{-mpc64} rounds the
12468 significands of results of floating-point operations to 53 bits (double
12469 precision) and @option{-mpc80} rounds the significands of results of
12470 floating-point operations to 64 bits (extended double precision), which is
12471 the default.  When this option is used, floating-point operations in higher
12472 precisions are not available to the programmer without setting the FPU
12473 control word explicitly.
12474
12475 Setting the rounding of floating-point operations to less than the default
12476 80 bits can speed some programs by 2% or more.  Note that some mathematical
12477 libraries assume that extended precision (80 bit) floating-point operations
12478 are enabled by default; routines in such libraries could suffer significant
12479 loss of accuracy, typically through so-called "catastrophic cancellation",
12480 when this option is used to set the precision to less than extended precision.
12481
12482 @item -mstackrealign
12483 @opindex mstackrealign
12484 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
12485 option will generate an alternate prologue and epilogue that realigns the
12486 runtime stack if necessary.  This supports mixing legacy codes that keep
12487 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
12488 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
12489 applicable to individual functions.
12490
12491 @item -mpreferred-stack-boundary=@var{num}
12492 @opindex mpreferred-stack-boundary
12493 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
12494 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
12495 the default is 4 (16 bytes or 128 bits).
12496
12497 @item -mincoming-stack-boundary=@var{num}
12498 @opindex mincoming-stack-boundary
12499 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
12500 boundary.  If @option{-mincoming-stack-boundary} is not specified,
12501 the one specified by @option{-mpreferred-stack-boundary} will be used.
12502
12503 On Pentium and PentiumPro, @code{double} and @code{long double} values
12504 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
12505 suffer significant run time performance penalties.  On Pentium III, the
12506 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
12507 properly if it is not 16 byte aligned.
12508
12509 To ensure proper alignment of this values on the stack, the stack boundary
12510 must be as aligned as that required by any value stored on the stack.
12511 Further, every function must be generated such that it keeps the stack
12512 aligned.  Thus calling a function compiled with a higher preferred
12513 stack boundary from a function compiled with a lower preferred stack
12514 boundary will most likely misalign the stack.  It is recommended that
12515 libraries that use callbacks always use the default setting.
12516
12517 This extra alignment does consume extra stack space, and generally
12518 increases code size.  Code that is sensitive to stack space usage, such
12519 as embedded systems and operating system kernels, may want to reduce the
12520 preferred alignment to @option{-mpreferred-stack-boundary=2}.
12521
12522 @item -mmmx
12523 @itemx -mno-mmx
12524 @itemx -msse
12525 @itemx -mno-sse
12526 @itemx -msse2
12527 @itemx -mno-sse2
12528 @itemx -msse3
12529 @itemx -mno-sse3
12530 @itemx -mssse3
12531 @itemx -mno-ssse3
12532 @itemx -msse4.1
12533 @need 800
12534 @itemx -mno-sse4.1
12535 @itemx -msse4.2
12536 @itemx -mno-sse4.2
12537 @itemx -msse4
12538 @itemx -mno-sse4
12539 @itemx -mavx
12540 @itemx -mno-avx
12541 @itemx -maes
12542 @itemx -mno-aes
12543 @itemx -mpclmul
12544 @need 800
12545 @itemx -mno-pclmul
12546 @itemx -mfsgsbase
12547 @itemx -mno-fsgsbase
12548 @itemx -mrdrnd
12549 @itemx -mno-rdrnd
12550 @itemx -mf16c
12551 @itemx -mno-f16c
12552 @itemx -msse4a
12553 @itemx -mno-sse4a
12554 @itemx -mfma4
12555 @need 800
12556 @itemx -mno-fma4
12557 @itemx -mxop
12558 @itemx -mno-xop
12559 @itemx -mlwp
12560 @itemx -mno-lwp
12561 @itemx -m3dnow
12562 @itemx -mno-3dnow
12563 @itemx -mpopcnt
12564 @itemx -mno-popcnt
12565 @itemx -mabm
12566 @itemx -mno-abm
12567 @itemx -mbmi
12568 @itemx -mno-bmi
12569 @itemx -mtbm
12570 @itemx -mno-tbm
12571 @opindex mmmx
12572 @opindex mno-mmx
12573 @opindex msse
12574 @opindex mno-sse
12575 @opindex m3dnow
12576 @opindex mno-3dnow
12577 These switches enable or disable the use of instructions in the MMX,
12578 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, FSGSBASE, RDRND,
12579 F16C, SSE4A, FMA4, XOP, LWP, ABM, BMI, or 3DNow!@: extended instruction sets.
12580 These extensions are also available as built-in functions: see
12581 @ref{X86 Built-in Functions}, for details of the functions enabled and
12582 disabled by these switches.
12583
12584 To have SSE/SSE2 instructions generated automatically from floating-point
12585 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
12586
12587 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
12588 generates new AVX instructions or AVX equivalence for all SSEx instructions
12589 when needed.
12590
12591 These options will enable GCC to use these extended instructions in
12592 generated code, even without @option{-mfpmath=sse}.  Applications which
12593 perform runtime CPU detection must compile separate files for each
12594 supported architecture, using the appropriate flags.  In particular,
12595 the file containing the CPU detection code should be compiled without
12596 these options.
12597
12598 @item -mfused-madd
12599 @itemx -mno-fused-madd
12600 @opindex mfused-madd
12601 @opindex mno-fused-madd
12602 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12603 instructions.  The default is to use these instructions.
12604
12605 @item -mcld
12606 @opindex mcld
12607 This option instructs GCC to emit a @code{cld} instruction in the prologue
12608 of functions that use string instructions.  String instructions depend on
12609 the DF flag to select between autoincrement or autodecrement mode.  While the
12610 ABI specifies the DF flag to be cleared on function entry, some operating
12611 systems violate this specification by not clearing the DF flag in their
12612 exception dispatchers.  The exception handler can be invoked with the DF flag
12613 set which leads to wrong direction mode, when string instructions are used.
12614 This option can be enabled by default on 32-bit x86 targets by configuring
12615 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
12616 instructions can be suppressed with the @option{-mno-cld} compiler option
12617 in this case.
12618
12619 @item -mvzeroupper
12620 @opindex mvzeroupper
12621 This option instructs GCC to emit a @code{vzeroupper} instruction
12622 before a transfer of control flow out of the function to minimize
12623 AVX to SSE transition penalty as well as remove unnecessary zeroupper
12624 intrinsics.
12625
12626 @item -mcx16
12627 @opindex mcx16
12628 This option will enable GCC to use CMPXCHG16B instruction in generated code.
12629 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
12630 data types.  This is useful for high resolution counters that could be updated
12631 by multiple processors (or cores).  This instruction is generated as part of
12632 atomic built-in functions: see @ref{Atomic Builtins} for details.
12633
12634 @item -msahf
12635 @opindex msahf
12636 This option will enable GCC to use SAHF instruction in generated 64-bit code.
12637 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
12638 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
12639 SAHF are load and store instructions, respectively, for certain status flags.
12640 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
12641 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
12642
12643 @item -mmovbe
12644 @opindex mmovbe
12645 This option will enable GCC to use movbe instruction to implement
12646 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
12647
12648 @item -mcrc32
12649 @opindex mcrc32
12650 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
12651 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
12652 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
12653
12654 @item -mrecip
12655 @opindex mrecip
12656 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
12657 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
12658 to increase precision instead of DIVSS and SQRTSS (and their vectorized
12659 variants) for single precision floating point arguments.  These instructions
12660 are generated only when @option{-funsafe-math-optimizations} is enabled
12661 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
12662 Note that while the throughput of the sequence is higher than the throughput
12663 of the non-reciprocal instruction, the precision of the sequence can be
12664 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
12665
12666 Note that GCC implements 1.0f/sqrtf(x) in terms of RSQRTSS (or RSQRTPS)
12667 already with @option{-ffast-math} (or the above option combination), and
12668 doesn't need @option{-mrecip}.
12669
12670 @item -mveclibabi=@var{type}
12671 @opindex mveclibabi
12672 Specifies the ABI type to use for vectorizing intrinsics using an
12673 external library.  Supported types are @code{svml} for the Intel short
12674 vector math library and @code{acml} for the AMD math core library style
12675 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
12676 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
12677 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
12678 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
12679 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
12680 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
12681 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
12682 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
12683 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
12684 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
12685 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
12686 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
12687 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
12688 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
12689 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
12690 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
12691 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
12692 compatible library will have to be specified at link time.
12693
12694 @item -mabi=@var{name}
12695 @opindex mabi
12696 Generate code for the specified calling convention.  Permissible values
12697 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
12698 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
12699 ABI when targeting Windows.  On all other systems, the default is the
12700 SYSV ABI.  You can control this behavior for a specific function by
12701 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
12702 @xref{Function Attributes}.
12703
12704 @item -mtls-dialect=@var{type}
12705 @opindex mtls-dialect
12706 Generate code to access thread-local storage using the @samp{gnu} or
12707 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
12708 @samp{gnu2} is more efficient, but it may add compile- and run-time
12709 requirements that cannot be satisfied on all systems.
12710
12711 @item -mpush-args
12712 @itemx -mno-push-args
12713 @opindex mpush-args
12714 @opindex mno-push-args
12715 Use PUSH operations to store outgoing parameters.  This method is shorter
12716 and usually equally fast as method using SUB/MOV operations and is enabled
12717 by default.  In some cases disabling it may improve performance because of
12718 improved scheduling and reduced dependencies.
12719
12720 @item -maccumulate-outgoing-args
12721 @opindex maccumulate-outgoing-args
12722 If enabled, the maximum amount of space required for outgoing arguments will be
12723 computed in the function prologue.  This is faster on most modern CPUs
12724 because of reduced dependencies, improved scheduling and reduced stack usage
12725 when preferred stack boundary is not equal to 2.  The drawback is a notable
12726 increase in code size.  This switch implies @option{-mno-push-args}.
12727
12728 @item -mthreads
12729 @opindex mthreads
12730 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
12731 on thread-safe exception handling must compile and link all code with the
12732 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
12733 @option{-D_MT}; when linking, it links in a special thread helper library
12734 @option{-lmingwthrd} which cleans up per thread exception handling data.
12735
12736 @item -mno-align-stringops
12737 @opindex mno-align-stringops
12738 Do not align destination of inlined string operations.  This switch reduces
12739 code size and improves performance in case the destination is already aligned,
12740 but GCC doesn't know about it.
12741
12742 @item -minline-all-stringops
12743 @opindex minline-all-stringops
12744 By default GCC inlines string operations only when destination is known to be
12745 aligned at least to 4 byte boundary.  This enables more inlining, increase code
12746 size, but may improve performance of code that depends on fast memcpy, strlen
12747 and memset for short lengths.
12748
12749 @item -minline-stringops-dynamically
12750 @opindex minline-stringops-dynamically
12751 For string operation of unknown size, inline runtime checks so for small
12752 blocks inline code is used, while for large blocks library call is used.
12753
12754 @item -mstringop-strategy=@var{alg}
12755 @opindex mstringop-strategy=@var{alg}
12756 Overwrite internal decision heuristic about particular algorithm to inline
12757 string operation with.  The allowed values are @code{rep_byte},
12758 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
12759 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
12760 expanding inline loop, @code{libcall} for always expanding library call.
12761
12762 @item -momit-leaf-frame-pointer
12763 @opindex momit-leaf-frame-pointer
12764 Don't keep the frame pointer in a register for leaf functions.  This
12765 avoids the instructions to save, set up and restore frame pointers and
12766 makes an extra register available in leaf functions.  The option
12767 @option{-fomit-frame-pointer} removes the frame pointer for all functions
12768 which might make debugging harder.
12769
12770 @item -mtls-direct-seg-refs
12771 @itemx -mno-tls-direct-seg-refs
12772 @opindex mtls-direct-seg-refs
12773 Controls whether TLS variables may be accessed with offsets from the
12774 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
12775 or whether the thread base pointer must be added.  Whether or not this
12776 is legal depends on the operating system, and whether it maps the
12777 segment to cover the entire TLS area.
12778
12779 For systems that use GNU libc, the default is on.
12780
12781 @item -msse2avx
12782 @itemx -mno-sse2avx
12783 @opindex msse2avx
12784 Specify that the assembler should encode SSE instructions with VEX
12785 prefix.  The option @option{-mavx} turns this on by default.
12786
12787 @item -mfentry
12788 @itemx -mno-fentry
12789 @opindex mfentry
12790 If profiling is active @option{-pg} put the profiling
12791 counter call before prologue.
12792 Note: On x86 architectures the attribute @code{ms_hook_prologue}
12793 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
12794
12795 @item -m8bit-idiv
12796 @itemx -mno-8bit-idiv
12797 @opindex 8bit-idiv
12798 On some processors, like Intel Atom, 8bit unsigned integer divide is
12799 much faster than 32bit/64bit integer divide.  This option will generate a
12800 runt-time check.  If both dividend and divisor are within range of 0
12801 to 255, 8bit unsigned integer divide will be used instead of
12802 32bit/64bit integer divide.
12803
12804 @item -mavx256-split-unaligned-load
12805 @item -mavx256-split-unaligned-store
12806 @opindex avx256-split-unaligned-load
12807 @opindex avx256-split-unaligned-store
12808 Split 32-byte AVX unaligned load and store.
12809
12810 @end table
12811
12812 These @samp{-m} switches are supported in addition to the above
12813 on AMD x86-64 processors in 64-bit environments.
12814
12815 @table @gcctabopt
12816 @item -m32
12817 @itemx -m64
12818 @opindex m32
12819 @opindex m64
12820 Generate code for a 32-bit or 64-bit environment.
12821 The 32-bit environment sets int, long and pointer to 32 bits and
12822 generates code that runs on any i386 system.
12823 The 64-bit environment sets int to 32 bits and long and pointer
12824 to 64 bits and generates code for AMD's x86-64 architecture. For
12825 darwin only the -m64 option turns off the @option{-fno-pic} and
12826 @option{-mdynamic-no-pic} options.
12827
12828 @item -mno-red-zone
12829 @opindex mno-red-zone
12830 Do not use a so called red zone for x86-64 code.  The red zone is mandated
12831 by the x86-64 ABI, it is a 128-byte area beyond the location of the
12832 stack pointer that will not be modified by signal or interrupt handlers
12833 and therefore can be used for temporary data without adjusting the stack
12834 pointer.  The flag @option{-mno-red-zone} disables this red zone.
12835
12836 @item -mcmodel=small
12837 @opindex mcmodel=small
12838 Generate code for the small code model: the program and its symbols must
12839 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
12840 Programs can be statically or dynamically linked.  This is the default
12841 code model.
12842
12843 @item -mcmodel=kernel
12844 @opindex mcmodel=kernel
12845 Generate code for the kernel code model.  The kernel runs in the
12846 negative 2 GB of the address space.
12847 This model has to be used for Linux kernel code.
12848
12849 @item -mcmodel=medium
12850 @opindex mcmodel=medium
12851 Generate code for the medium model: The program is linked in the lower 2
12852 GB of the address space.  Small symbols are also placed there.  Symbols
12853 with sizes larger than @option{-mlarge-data-threshold} are put into
12854 large data or bss sections and can be located above 2GB.  Programs can
12855 be statically or dynamically linked.
12856
12857 @item -mcmodel=large
12858 @opindex mcmodel=large
12859 Generate code for the large model: This model makes no assumptions
12860 about addresses and sizes of sections.
12861 @end table
12862
12863 @node i386 and x86-64 Windows Options
12864 @subsection i386 and x86-64 Windows Options
12865 @cindex i386 and x86-64 Windows Options
12866
12867 These additional options are available for Windows targets:
12868
12869 @table @gcctabopt
12870 @item -mconsole
12871 @opindex mconsole
12872 This option is available for Cygwin and MinGW targets.  It
12873 specifies that a console application is to be generated, by
12874 instructing the linker to set the PE header subsystem type
12875 required for console applications.
12876 This is the default behavior for Cygwin and MinGW targets.
12877
12878 @item -mdll
12879 @opindex mdll
12880 This option is available for Cygwin and MinGW targets.  It
12881 specifies that a DLL - a dynamic link library - is to be
12882 generated, enabling the selection of the required runtime
12883 startup object and entry point.
12884
12885 @item -mnop-fun-dllimport
12886 @opindex mnop-fun-dllimport
12887 This option is available for Cygwin and MinGW targets.  It
12888 specifies that the dllimport attribute should be ignored.
12889
12890 @item -mthread
12891 @opindex mthread
12892 This option is available for MinGW targets. It specifies
12893 that MinGW-specific thread support is to be used.
12894
12895 @item -municode
12896 @opindex municode
12897 This option is available for mingw-w64 targets.  It specifies
12898 that the UNICODE macro is getting pre-defined and that the
12899 unicode capable runtime startup code is chosen.
12900
12901 @item -mwin32
12902 @opindex mwin32
12903 This option is available for Cygwin and MinGW targets.  It
12904 specifies that the typical Windows pre-defined macros are to
12905 be set in the pre-processor, but does not influence the choice
12906 of runtime library/startup code.
12907
12908 @item -mwindows
12909 @opindex mwindows
12910 This option is available for Cygwin and MinGW targets.  It
12911 specifies that a GUI application is to be generated by
12912 instructing the linker to set the PE header subsystem type
12913 appropriately.
12914
12915 @item -fno-set-stack-executable
12916 @opindex fno-set-stack-executable
12917 This option is available for MinGW targets. It specifies that
12918 the executable flag for stack used by nested functions isn't
12919 set. This is necessary for binaries running in kernel mode of
12920 Windows, as there the user32 API, which is used to set executable
12921 privileges, isn't available.
12922
12923 @item -mpe-aligned-commons
12924 @opindex mpe-aligned-commons
12925 This option is available for Cygwin and MinGW targets.  It
12926 specifies that the GNU extension to the PE file format that
12927 permits the correct alignment of COMMON variables should be
12928 used when generating code.  It will be enabled by default if
12929 GCC detects that the target assembler found during configuration
12930 supports the feature.
12931 @end table
12932
12933 See also under @ref{i386 and x86-64 Options} for standard options.
12934
12935 @node IA-64 Options
12936 @subsection IA-64 Options
12937 @cindex IA-64 Options
12938
12939 These are the @samp{-m} options defined for the Intel IA-64 architecture.
12940
12941 @table @gcctabopt
12942 @item -mbig-endian
12943 @opindex mbig-endian
12944 Generate code for a big endian target.  This is the default for HP-UX@.
12945
12946 @item -mlittle-endian
12947 @opindex mlittle-endian
12948 Generate code for a little endian target.  This is the default for AIX5
12949 and GNU/Linux.
12950
12951 @item -mgnu-as
12952 @itemx -mno-gnu-as
12953 @opindex mgnu-as
12954 @opindex mno-gnu-as
12955 Generate (or don't) code for the GNU assembler.  This is the default.
12956 @c Also, this is the default if the configure option @option{--with-gnu-as}
12957 @c is used.
12958
12959 @item -mgnu-ld
12960 @itemx -mno-gnu-ld
12961 @opindex mgnu-ld
12962 @opindex mno-gnu-ld
12963 Generate (or don't) code for the GNU linker.  This is the default.
12964 @c Also, this is the default if the configure option @option{--with-gnu-ld}
12965 @c is used.
12966
12967 @item -mno-pic
12968 @opindex mno-pic
12969 Generate code that does not use a global pointer register.  The result
12970 is not position independent code, and violates the IA-64 ABI@.
12971
12972 @item -mvolatile-asm-stop
12973 @itemx -mno-volatile-asm-stop
12974 @opindex mvolatile-asm-stop
12975 @opindex mno-volatile-asm-stop
12976 Generate (or don't) a stop bit immediately before and after volatile asm
12977 statements.
12978
12979 @item -mregister-names
12980 @itemx -mno-register-names
12981 @opindex mregister-names
12982 @opindex mno-register-names
12983 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
12984 the stacked registers.  This may make assembler output more readable.
12985
12986 @item -mno-sdata
12987 @itemx -msdata
12988 @opindex mno-sdata
12989 @opindex msdata
12990 Disable (or enable) optimizations that use the small data section.  This may
12991 be useful for working around optimizer bugs.
12992
12993 @item -mconstant-gp
12994 @opindex mconstant-gp
12995 Generate code that uses a single constant global pointer value.  This is
12996 useful when compiling kernel code.
12997
12998 @item -mauto-pic
12999 @opindex mauto-pic
13000 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
13001 This is useful when compiling firmware code.
13002
13003 @item -minline-float-divide-min-latency
13004 @opindex minline-float-divide-min-latency
13005 Generate code for inline divides of floating point values
13006 using the minimum latency algorithm.
13007
13008 @item -minline-float-divide-max-throughput
13009 @opindex minline-float-divide-max-throughput
13010 Generate code for inline divides of floating point values
13011 using the maximum throughput algorithm.
13012
13013 @item -mno-inline-float-divide
13014 @opindex mno-inline-float-divide
13015 Do not generate inline code for divides of floating point values.
13016
13017 @item -minline-int-divide-min-latency
13018 @opindex minline-int-divide-min-latency
13019 Generate code for inline divides of integer values
13020 using the minimum latency algorithm.
13021
13022 @item -minline-int-divide-max-throughput
13023 @opindex minline-int-divide-max-throughput
13024 Generate code for inline divides of integer values
13025 using the maximum throughput algorithm.
13026
13027 @item -mno-inline-int-divide
13028 @opindex mno-inline-int-divide
13029 Do not generate inline code for divides of integer values.
13030
13031 @item -minline-sqrt-min-latency
13032 @opindex minline-sqrt-min-latency
13033 Generate code for inline square roots
13034 using the minimum latency algorithm.
13035
13036 @item -minline-sqrt-max-throughput
13037 @opindex minline-sqrt-max-throughput
13038 Generate code for inline square roots
13039 using the maximum throughput algorithm.
13040
13041 @item -mno-inline-sqrt
13042 @opindex mno-inline-sqrt
13043 Do not generate inline code for sqrt.
13044
13045 @item -mfused-madd
13046 @itemx -mno-fused-madd
13047 @opindex mfused-madd
13048 @opindex mno-fused-madd
13049 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
13050 instructions.  The default is to use these instructions.
13051
13052 @item -mno-dwarf2-asm
13053 @itemx -mdwarf2-asm
13054 @opindex mno-dwarf2-asm
13055 @opindex mdwarf2-asm
13056 Don't (or do) generate assembler code for the DWARF2 line number debugging
13057 info.  This may be useful when not using the GNU assembler.
13058
13059 @item -mearly-stop-bits
13060 @itemx -mno-early-stop-bits
13061 @opindex mearly-stop-bits
13062 @opindex mno-early-stop-bits
13063 Allow stop bits to be placed earlier than immediately preceding the
13064 instruction that triggered the stop bit.  This can improve instruction
13065 scheduling, but does not always do so.
13066
13067 @item -mfixed-range=@var{register-range}
13068 @opindex mfixed-range
13069 Generate code treating the given register range as fixed registers.
13070 A fixed register is one that the register allocator can not use.  This is
13071 useful when compiling kernel code.  A register range is specified as
13072 two registers separated by a dash.  Multiple register ranges can be
13073 specified separated by a comma.
13074
13075 @item -mtls-size=@var{tls-size}
13076 @opindex mtls-size
13077 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
13078 64.
13079
13080 @item -mtune=@var{cpu-type}
13081 @opindex mtune
13082 Tune the instruction scheduling for a particular CPU, Valid values are
13083 itanium, itanium1, merced, itanium2, and mckinley.
13084
13085 @item -milp32
13086 @itemx -mlp64
13087 @opindex milp32
13088 @opindex mlp64
13089 Generate code for a 32-bit or 64-bit environment.
13090 The 32-bit environment sets int, long and pointer to 32 bits.
13091 The 64-bit environment sets int to 32 bits and long and pointer
13092 to 64 bits.  These are HP-UX specific flags.
13093
13094 @item -mno-sched-br-data-spec
13095 @itemx -msched-br-data-spec
13096 @opindex mno-sched-br-data-spec
13097 @opindex msched-br-data-spec
13098 (Dis/En)able data speculative scheduling before reload.
13099 This will result in generation of the ld.a instructions and
13100 the corresponding check instructions (ld.c / chk.a).
13101 The default is 'disable'.
13102
13103 @item -msched-ar-data-spec
13104 @itemx -mno-sched-ar-data-spec
13105 @opindex msched-ar-data-spec
13106 @opindex mno-sched-ar-data-spec
13107 (En/Dis)able data speculative scheduling after reload.
13108 This will result in generation of the ld.a instructions and
13109 the corresponding check instructions (ld.c / chk.a).
13110 The default is 'enable'.
13111
13112 @item -mno-sched-control-spec
13113 @itemx -msched-control-spec
13114 @opindex mno-sched-control-spec
13115 @opindex msched-control-spec
13116 (Dis/En)able control speculative scheduling.  This feature is
13117 available only during region scheduling (i.e.@: before reload).
13118 This will result in generation of the ld.s instructions and
13119 the corresponding check instructions chk.s .
13120 The default is 'disable'.
13121
13122 @item -msched-br-in-data-spec
13123 @itemx -mno-sched-br-in-data-spec
13124 @opindex msched-br-in-data-spec
13125 @opindex mno-sched-br-in-data-spec
13126 (En/Dis)able speculative scheduling of the instructions that
13127 are dependent on the data speculative loads before reload.
13128 This is effective only with @option{-msched-br-data-spec} enabled.
13129 The default is 'enable'.
13130
13131 @item -msched-ar-in-data-spec
13132 @itemx -mno-sched-ar-in-data-spec
13133 @opindex msched-ar-in-data-spec
13134 @opindex mno-sched-ar-in-data-spec
13135 (En/Dis)able speculative scheduling of the instructions that
13136 are dependent on the data speculative loads after reload.
13137 This is effective only with @option{-msched-ar-data-spec} enabled.
13138 The default is 'enable'.
13139
13140 @item -msched-in-control-spec
13141 @itemx -mno-sched-in-control-spec
13142 @opindex msched-in-control-spec
13143 @opindex mno-sched-in-control-spec
13144 (En/Dis)able speculative scheduling of the instructions that
13145 are dependent on the control speculative loads.
13146 This is effective only with @option{-msched-control-spec} enabled.
13147 The default is 'enable'.
13148
13149 @item -mno-sched-prefer-non-data-spec-insns
13150 @itemx -msched-prefer-non-data-spec-insns
13151 @opindex mno-sched-prefer-non-data-spec-insns
13152 @opindex msched-prefer-non-data-spec-insns
13153 If enabled, data speculative instructions will be chosen for schedule
13154 only if there are no other choices at the moment.  This will make
13155 the use of the data speculation much more conservative.
13156 The default is 'disable'.
13157
13158 @item -mno-sched-prefer-non-control-spec-insns
13159 @itemx -msched-prefer-non-control-spec-insns
13160 @opindex mno-sched-prefer-non-control-spec-insns
13161 @opindex msched-prefer-non-control-spec-insns
13162 If enabled, control speculative instructions will be chosen for schedule
13163 only if there are no other choices at the moment.  This will make
13164 the use of the control speculation much more conservative.
13165 The default is 'disable'.
13166
13167 @item -mno-sched-count-spec-in-critical-path
13168 @itemx -msched-count-spec-in-critical-path
13169 @opindex mno-sched-count-spec-in-critical-path
13170 @opindex msched-count-spec-in-critical-path
13171 If enabled, speculative dependencies will be considered during
13172 computation of the instructions priorities.  This will make the use of the
13173 speculation a bit more conservative.
13174 The default is 'disable'.
13175
13176 @item -msched-spec-ldc
13177 @opindex msched-spec-ldc
13178 Use a simple data speculation check.  This option is on by default.
13179
13180 @item -msched-control-spec-ldc
13181 @opindex msched-spec-ldc
13182 Use a simple check for control speculation.  This option is on by default.
13183
13184 @item -msched-stop-bits-after-every-cycle
13185 @opindex msched-stop-bits-after-every-cycle
13186 Place a stop bit after every cycle when scheduling.  This option is on
13187 by default.
13188
13189 @item -msched-fp-mem-deps-zero-cost
13190 @opindex msched-fp-mem-deps-zero-cost
13191 Assume that floating-point stores and loads are not likely to cause a conflict
13192 when placed into the same instruction group.  This option is disabled by
13193 default.
13194
13195 @item -msel-sched-dont-check-control-spec
13196 @opindex msel-sched-dont-check-control-spec
13197 Generate checks for control speculation in selective scheduling.
13198 This flag is disabled by default.
13199
13200 @item -msched-max-memory-insns=@var{max-insns}
13201 @opindex msched-max-memory-insns
13202 Limit on the number of memory insns per instruction group, giving lower
13203 priority to subsequent memory insns attempting to schedule in the same
13204 instruction group. Frequently useful to prevent cache bank conflicts.
13205 The default value is 1.
13206
13207 @item -msched-max-memory-insns-hard-limit
13208 @opindex msched-max-memory-insns-hard-limit
13209 Disallow more than `msched-max-memory-insns' in instruction group.
13210 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
13211 when limit is reached but may still schedule memory operations.
13212
13213 @end table
13214
13215 @node IA-64/VMS Options
13216 @subsection IA-64/VMS Options
13217
13218 These @samp{-m} options are defined for the IA-64/VMS implementations:
13219
13220 @table @gcctabopt
13221 @item -mvms-return-codes
13222 @opindex mvms-return-codes
13223 Return VMS condition codes from main. The default is to return POSIX
13224 style condition (e.g.@ error) codes.
13225
13226 @item -mdebug-main=@var{prefix}
13227 @opindex mdebug-main=@var{prefix}
13228 Flag the first routine whose name starts with @var{prefix} as the main
13229 routine for the debugger.
13230
13231 @item -mmalloc64
13232 @opindex mmalloc64
13233 Default to 64bit memory allocation routines.
13234 @end table
13235
13236 @node LM32 Options
13237 @subsection LM32 Options
13238 @cindex LM32 options
13239
13240 These @option{-m} options are defined for the Lattice Mico32 architecture:
13241
13242 @table @gcctabopt
13243 @item -mbarrel-shift-enabled
13244 @opindex mbarrel-shift-enabled
13245 Enable barrel-shift instructions.
13246
13247 @item -mdivide-enabled
13248 @opindex mdivide-enabled
13249 Enable divide and modulus instructions.
13250
13251 @item -mmultiply-enabled
13252 @opindex multiply-enabled
13253 Enable multiply instructions.
13254
13255 @item -msign-extend-enabled
13256 @opindex msign-extend-enabled
13257 Enable sign extend instructions.
13258
13259 @item -muser-enabled
13260 @opindex muser-enabled
13261 Enable user-defined instructions.
13262
13263 @end table
13264
13265 @node M32C Options
13266 @subsection M32C Options
13267 @cindex M32C options
13268
13269 @table @gcctabopt
13270 @item -mcpu=@var{name}
13271 @opindex mcpu=
13272 Select the CPU for which code is generated.  @var{name} may be one of
13273 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
13274 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
13275 the M32C/80 series.
13276
13277 @item -msim
13278 @opindex msim
13279 Specifies that the program will be run on the simulator.  This causes
13280 an alternate runtime library to be linked in which supports, for
13281 example, file I/O@.  You must not use this option when generating
13282 programs that will run on real hardware; you must provide your own
13283 runtime library for whatever I/O functions are needed.
13284
13285 @item -memregs=@var{number}
13286 @opindex memregs=
13287 Specifies the number of memory-based pseudo-registers GCC will use
13288 during code generation.  These pseudo-registers will be used like real
13289 registers, so there is a tradeoff between GCC's ability to fit the
13290 code into available registers, and the performance penalty of using
13291 memory instead of registers.  Note that all modules in a program must
13292 be compiled with the same value for this option.  Because of that, you
13293 must not use this option with the default runtime libraries gcc
13294 builds.
13295
13296 @end table
13297
13298 @node M32R/D Options
13299 @subsection M32R/D Options
13300 @cindex M32R/D options
13301
13302 These @option{-m} options are defined for Renesas M32R/D architectures:
13303
13304 @table @gcctabopt
13305 @item -m32r2
13306 @opindex m32r2
13307 Generate code for the M32R/2@.
13308
13309 @item -m32rx
13310 @opindex m32rx
13311 Generate code for the M32R/X@.
13312
13313 @item -m32r
13314 @opindex m32r
13315 Generate code for the M32R@.  This is the default.
13316
13317 @item -mmodel=small
13318 @opindex mmodel=small
13319 Assume all objects live in the lower 16MB of memory (so that their addresses
13320 can be loaded with the @code{ld24} instruction), and assume all subroutines
13321 are reachable with the @code{bl} instruction.
13322 This is the default.
13323
13324 The addressability of a particular object can be set with the
13325 @code{model} attribute.
13326
13327 @item -mmodel=medium
13328 @opindex mmodel=medium
13329 Assume objects may be anywhere in the 32-bit address space (the compiler
13330 will generate @code{seth/add3} instructions to load their addresses), and
13331 assume all subroutines are reachable with the @code{bl} instruction.
13332
13333 @item -mmodel=large
13334 @opindex mmodel=large
13335 Assume objects may be anywhere in the 32-bit address space (the compiler
13336 will generate @code{seth/add3} instructions to load their addresses), and
13337 assume subroutines may not be reachable with the @code{bl} instruction
13338 (the compiler will generate the much slower @code{seth/add3/jl}
13339 instruction sequence).
13340
13341 @item -msdata=none
13342 @opindex msdata=none
13343 Disable use of the small data area.  Variables will be put into
13344 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
13345 @code{section} attribute has been specified).
13346 This is the default.
13347
13348 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
13349 Objects may be explicitly put in the small data area with the
13350 @code{section} attribute using one of these sections.
13351
13352 @item -msdata=sdata
13353 @opindex msdata=sdata
13354 Put small global and static data in the small data area, but do not
13355 generate special code to reference them.
13356
13357 @item -msdata=use
13358 @opindex msdata=use
13359 Put small global and static data in the small data area, and generate
13360 special instructions to reference them.
13361
13362 @item -G @var{num}
13363 @opindex G
13364 @cindex smaller data references
13365 Put global and static objects less than or equal to @var{num} bytes
13366 into the small data or bss sections instead of the normal data or bss
13367 sections.  The default value of @var{num} is 8.
13368 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
13369 for this option to have any effect.
13370
13371 All modules should be compiled with the same @option{-G @var{num}} value.
13372 Compiling with different values of @var{num} may or may not work; if it
13373 doesn't the linker will give an error message---incorrect code will not be
13374 generated.
13375
13376 @item -mdebug
13377 @opindex mdebug
13378 Makes the M32R specific code in the compiler display some statistics
13379 that might help in debugging programs.
13380
13381 @item -malign-loops
13382 @opindex malign-loops
13383 Align all loops to a 32-byte boundary.
13384
13385 @item -mno-align-loops
13386 @opindex mno-align-loops
13387 Do not enforce a 32-byte alignment for loops.  This is the default.
13388
13389 @item -missue-rate=@var{number}
13390 @opindex missue-rate=@var{number}
13391 Issue @var{number} instructions per cycle.  @var{number} can only be 1
13392 or 2.
13393
13394 @item -mbranch-cost=@var{number}
13395 @opindex mbranch-cost=@var{number}
13396 @var{number} can only be 1 or 2.  If it is 1 then branches will be
13397 preferred over conditional code, if it is 2, then the opposite will
13398 apply.
13399
13400 @item -mflush-trap=@var{number}
13401 @opindex mflush-trap=@var{number}
13402 Specifies the trap number to use to flush the cache.  The default is
13403 12.  Valid numbers are between 0 and 15 inclusive.
13404
13405 @item -mno-flush-trap
13406 @opindex mno-flush-trap
13407 Specifies that the cache cannot be flushed by using a trap.
13408
13409 @item -mflush-func=@var{name}
13410 @opindex mflush-func=@var{name}
13411 Specifies the name of the operating system function to call to flush
13412 the cache.  The default is @emph{_flush_cache}, but a function call
13413 will only be used if a trap is not available.
13414
13415 @item -mno-flush-func
13416 @opindex mno-flush-func
13417 Indicates that there is no OS function for flushing the cache.
13418
13419 @end table
13420
13421 @node M680x0 Options
13422 @subsection M680x0 Options
13423 @cindex M680x0 options
13424
13425 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
13426 The default settings depend on which architecture was selected when
13427 the compiler was configured; the defaults for the most common choices
13428 are given below.
13429
13430 @table @gcctabopt
13431 @item -march=@var{arch}
13432 @opindex march
13433 Generate code for a specific M680x0 or ColdFire instruction set
13434 architecture.  Permissible values of @var{arch} for M680x0
13435 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
13436 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
13437 architectures are selected according to Freescale's ISA classification
13438 and the permissible values are: @samp{isaa}, @samp{isaaplus},
13439 @samp{isab} and @samp{isac}.
13440
13441 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
13442 code for a ColdFire target.  The @var{arch} in this macro is one of the
13443 @option{-march} arguments given above.
13444
13445 When used together, @option{-march} and @option{-mtune} select code
13446 that runs on a family of similar processors but that is optimized
13447 for a particular microarchitecture.
13448
13449 @item -mcpu=@var{cpu}
13450 @opindex mcpu
13451 Generate code for a specific M680x0 or ColdFire processor.
13452 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
13453 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
13454 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
13455 below, which also classifies the CPUs into families:
13456
13457 @multitable @columnfractions 0.20 0.80
13458 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
13459 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
13460 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
13461 @item @samp{5206e} @tab @samp{5206e}
13462 @item @samp{5208} @tab @samp{5207} @samp{5208}
13463 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
13464 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
13465 @item @samp{5216} @tab @samp{5214} @samp{5216}
13466 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
13467 @item @samp{5225} @tab @samp{5224} @samp{5225}
13468 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
13469 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
13470 @item @samp{5249} @tab @samp{5249}
13471 @item @samp{5250} @tab @samp{5250}
13472 @item @samp{5271} @tab @samp{5270} @samp{5271}
13473 @item @samp{5272} @tab @samp{5272}
13474 @item @samp{5275} @tab @samp{5274} @samp{5275}
13475 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
13476 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
13477 @item @samp{5307} @tab @samp{5307}
13478 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
13479 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
13480 @item @samp{5407} @tab @samp{5407}
13481 @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}
13482 @end multitable
13483
13484 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
13485 @var{arch} is compatible with @var{cpu}.  Other combinations of
13486 @option{-mcpu} and @option{-march} are rejected.
13487
13488 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
13489 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
13490 where the value of @var{family} is given by the table above.
13491
13492 @item -mtune=@var{tune}
13493 @opindex mtune
13494 Tune the code for a particular microarchitecture, within the
13495 constraints set by @option{-march} and @option{-mcpu}.
13496 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
13497 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
13498 and @samp{cpu32}.  The ColdFire microarchitectures
13499 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
13500
13501 You can also use @option{-mtune=68020-40} for code that needs
13502 to run relatively well on 68020, 68030 and 68040 targets.
13503 @option{-mtune=68020-60} is similar but includes 68060 targets
13504 as well.  These two options select the same tuning decisions as
13505 @option{-m68020-40} and @option{-m68020-60} respectively.
13506
13507 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
13508 when tuning for 680x0 architecture @var{arch}.  It also defines
13509 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
13510 option is used.  If gcc is tuning for a range of architectures,
13511 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
13512 it defines the macros for every architecture in the range.
13513
13514 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
13515 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
13516 of the arguments given above.
13517
13518 @item -m68000
13519 @itemx -mc68000
13520 @opindex m68000
13521 @opindex mc68000
13522 Generate output for a 68000.  This is the default
13523 when the compiler is configured for 68000-based systems.
13524 It is equivalent to @option{-march=68000}.
13525
13526 Use this option for microcontrollers with a 68000 or EC000 core,
13527 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
13528
13529 @item -m68010
13530 @opindex m68010
13531 Generate output for a 68010.  This is the default
13532 when the compiler is configured for 68010-based systems.
13533 It is equivalent to @option{-march=68010}.
13534
13535 @item -m68020
13536 @itemx -mc68020
13537 @opindex m68020
13538 @opindex mc68020
13539 Generate output for a 68020.  This is the default
13540 when the compiler is configured for 68020-based systems.
13541 It is equivalent to @option{-march=68020}.
13542
13543 @item -m68030
13544 @opindex m68030
13545 Generate output for a 68030.  This is the default when the compiler is
13546 configured for 68030-based systems.  It is equivalent to
13547 @option{-march=68030}.
13548
13549 @item -m68040
13550 @opindex m68040
13551 Generate output for a 68040.  This is the default when the compiler is
13552 configured for 68040-based systems.  It is equivalent to
13553 @option{-march=68040}.
13554
13555 This option inhibits the use of 68881/68882 instructions that have to be
13556 emulated by software on the 68040.  Use this option if your 68040 does not
13557 have code to emulate those instructions.
13558
13559 @item -m68060
13560 @opindex m68060
13561 Generate output for a 68060.  This is the default when the compiler is
13562 configured for 68060-based systems.  It is equivalent to
13563 @option{-march=68060}.
13564
13565 This option inhibits the use of 68020 and 68881/68882 instructions that
13566 have to be emulated by software on the 68060.  Use this option if your 68060
13567 does not have code to emulate those instructions.
13568
13569 @item -mcpu32
13570 @opindex mcpu32
13571 Generate output for a CPU32.  This is the default
13572 when the compiler is configured for CPU32-based systems.
13573 It is equivalent to @option{-march=cpu32}.
13574
13575 Use this option for microcontrollers with a
13576 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
13577 68336, 68340, 68341, 68349 and 68360.
13578
13579 @item -m5200
13580 @opindex m5200
13581 Generate output for a 520X ColdFire CPU@.  This is the default
13582 when the compiler is configured for 520X-based systems.
13583 It is equivalent to @option{-mcpu=5206}, and is now deprecated
13584 in favor of that option.
13585
13586 Use this option for microcontroller with a 5200 core, including
13587 the MCF5202, MCF5203, MCF5204 and MCF5206.
13588
13589 @item -m5206e
13590 @opindex m5206e
13591 Generate output for a 5206e ColdFire CPU@.  The option is now
13592 deprecated in favor of the equivalent @option{-mcpu=5206e}.
13593
13594 @item -m528x
13595 @opindex m528x
13596 Generate output for a member of the ColdFire 528X family.
13597 The option is now deprecated in favor of the equivalent
13598 @option{-mcpu=528x}.
13599
13600 @item -m5307
13601 @opindex m5307
13602 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
13603 in favor of the equivalent @option{-mcpu=5307}.
13604
13605 @item -m5407
13606 @opindex m5407
13607 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
13608 in favor of the equivalent @option{-mcpu=5407}.
13609
13610 @item -mcfv4e
13611 @opindex mcfv4e
13612 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
13613 This includes use of hardware floating point instructions.
13614 The option is equivalent to @option{-mcpu=547x}, and is now
13615 deprecated in favor of that option.
13616
13617 @item -m68020-40
13618 @opindex m68020-40
13619 Generate output for a 68040, without using any of the new instructions.
13620 This results in code which can run relatively efficiently on either a
13621 68020/68881 or a 68030 or a 68040.  The generated code does use the
13622 68881 instructions that are emulated on the 68040.
13623
13624 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
13625
13626 @item -m68020-60
13627 @opindex m68020-60
13628 Generate output for a 68060, without using any of the new instructions.
13629 This results in code which can run relatively efficiently on either a
13630 68020/68881 or a 68030 or a 68040.  The generated code does use the
13631 68881 instructions that are emulated on the 68060.
13632
13633 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
13634
13635 @item -mhard-float
13636 @itemx -m68881
13637 @opindex mhard-float
13638 @opindex m68881
13639 Generate floating-point instructions.  This is the default for 68020
13640 and above, and for ColdFire devices that have an FPU@.  It defines the
13641 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
13642 on ColdFire targets.
13643
13644 @item -msoft-float
13645 @opindex msoft-float
13646 Do not generate floating-point instructions; use library calls instead.
13647 This is the default for 68000, 68010, and 68832 targets.  It is also
13648 the default for ColdFire devices that have no FPU.
13649
13650 @item -mdiv
13651 @itemx -mno-div
13652 @opindex mdiv
13653 @opindex mno-div
13654 Generate (do not generate) ColdFire hardware divide and remainder
13655 instructions.  If @option{-march} is used without @option{-mcpu},
13656 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
13657 architectures.  Otherwise, the default is taken from the target CPU
13658 (either the default CPU, or the one specified by @option{-mcpu}).  For
13659 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
13660 @option{-mcpu=5206e}.
13661
13662 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
13663
13664 @item -mshort
13665 @opindex mshort
13666 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13667 Additionally, parameters passed on the stack are also aligned to a
13668 16-bit boundary even on targets whose API mandates promotion to 32-bit.
13669
13670 @item -mno-short
13671 @opindex mno-short
13672 Do not consider type @code{int} to be 16 bits wide.  This is the default.
13673
13674 @item -mnobitfield
13675 @itemx -mno-bitfield
13676 @opindex mnobitfield
13677 @opindex mno-bitfield
13678 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
13679 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
13680
13681 @item -mbitfield
13682 @opindex mbitfield
13683 Do use the bit-field instructions.  The @option{-m68020} option implies
13684 @option{-mbitfield}.  This is the default if you use a configuration
13685 designed for a 68020.
13686
13687 @item -mrtd
13688 @opindex mrtd
13689 Use a different function-calling convention, in which functions
13690 that take a fixed number of arguments return with the @code{rtd}
13691 instruction, which pops their arguments while returning.  This
13692 saves one instruction in the caller since there is no need to pop
13693 the arguments there.
13694
13695 This calling convention is incompatible with the one normally
13696 used on Unix, so you cannot use it if you need to call libraries
13697 compiled with the Unix compiler.
13698
13699 Also, you must provide function prototypes for all functions that
13700 take variable numbers of arguments (including @code{printf});
13701 otherwise incorrect code will be generated for calls to those
13702 functions.
13703
13704 In addition, seriously incorrect code will result if you call a
13705 function with too many arguments.  (Normally, extra arguments are
13706 harmlessly ignored.)
13707
13708 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
13709 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
13710
13711 @item -mno-rtd
13712 @opindex mno-rtd
13713 Do not use the calling conventions selected by @option{-mrtd}.
13714 This is the default.
13715
13716 @item -malign-int
13717 @itemx -mno-align-int
13718 @opindex malign-int
13719 @opindex mno-align-int
13720 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
13721 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
13722 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
13723 Aligning variables on 32-bit boundaries produces code that runs somewhat
13724 faster on processors with 32-bit busses at the expense of more memory.
13725
13726 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
13727 align structures containing the above types  differently than
13728 most published application binary interface specifications for the m68k.
13729
13730 @item -mpcrel
13731 @opindex mpcrel
13732 Use the pc-relative addressing mode of the 68000 directly, instead of
13733 using a global offset table.  At present, this option implies @option{-fpic},
13734 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
13735 not presently supported with @option{-mpcrel}, though this could be supported for
13736 68020 and higher processors.
13737
13738 @item -mno-strict-align
13739 @itemx -mstrict-align
13740 @opindex mno-strict-align
13741 @opindex mstrict-align
13742 Do not (do) assume that unaligned memory references will be handled by
13743 the system.
13744
13745 @item -msep-data
13746 Generate code that allows the data segment to be located in a different
13747 area of memory from the text segment.  This allows for execute in place in
13748 an environment without virtual memory management.  This option implies
13749 @option{-fPIC}.
13750
13751 @item -mno-sep-data
13752 Generate code that assumes that the data segment follows the text segment.
13753 This is the default.
13754
13755 @item -mid-shared-library
13756 Generate code that supports shared libraries via the library ID method.
13757 This allows for execute in place and shared libraries in an environment
13758 without virtual memory management.  This option implies @option{-fPIC}.
13759
13760 @item -mno-id-shared-library
13761 Generate code that doesn't assume ID based shared libraries are being used.
13762 This is the default.
13763
13764 @item -mshared-library-id=n
13765 Specified the identification number of the ID based shared library being
13766 compiled.  Specifying a value of 0 will generate more compact code, specifying
13767 other values will force the allocation of that number to the current
13768 library but is no more space or time efficient than omitting this option.
13769
13770 @item -mxgot
13771 @itemx -mno-xgot
13772 @opindex mxgot
13773 @opindex mno-xgot
13774 When generating position-independent code for ColdFire, generate code
13775 that works if the GOT has more than 8192 entries.  This code is
13776 larger and slower than code generated without this option.  On M680x0
13777 processors, this option is not needed; @option{-fPIC} suffices.
13778
13779 GCC normally uses a single instruction to load values from the GOT@.
13780 While this is relatively efficient, it only works if the GOT
13781 is smaller than about 64k.  Anything larger causes the linker
13782 to report an error such as:
13783
13784 @cindex relocation truncated to fit (ColdFire)
13785 @smallexample
13786 relocation truncated to fit: R_68K_GOT16O foobar
13787 @end smallexample
13788
13789 If this happens, you should recompile your code with @option{-mxgot}.
13790 It should then work with very large GOTs.  However, code generated with
13791 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
13792 the value of a global symbol.
13793
13794 Note that some linkers, including newer versions of the GNU linker,
13795 can create multiple GOTs and sort GOT entries.  If you have such a linker,
13796 you should only need to use @option{-mxgot} when compiling a single
13797 object file that accesses more than 8192 GOT entries.  Very few do.
13798
13799 These options have no effect unless GCC is generating
13800 position-independent code.
13801
13802 @end table
13803
13804 @node MCore Options
13805 @subsection MCore Options
13806 @cindex MCore options
13807
13808 These are the @samp{-m} options defined for the Motorola M*Core
13809 processors.
13810
13811 @table @gcctabopt
13812
13813 @item -mhardlit
13814 @itemx -mno-hardlit
13815 @opindex mhardlit
13816 @opindex mno-hardlit
13817 Inline constants into the code stream if it can be done in two
13818 instructions or less.
13819
13820 @item -mdiv
13821 @itemx -mno-div
13822 @opindex mdiv
13823 @opindex mno-div
13824 Use the divide instruction.  (Enabled by default).
13825
13826 @item -mrelax-immediate
13827 @itemx -mno-relax-immediate
13828 @opindex mrelax-immediate
13829 @opindex mno-relax-immediate
13830 Allow arbitrary sized immediates in bit operations.
13831
13832 @item -mwide-bitfields
13833 @itemx -mno-wide-bitfields
13834 @opindex mwide-bitfields
13835 @opindex mno-wide-bitfields
13836 Always treat bit-fields as int-sized.
13837
13838 @item -m4byte-functions
13839 @itemx -mno-4byte-functions
13840 @opindex m4byte-functions
13841 @opindex mno-4byte-functions
13842 Force all functions to be aligned to a four byte boundary.
13843
13844 @item -mcallgraph-data
13845 @itemx -mno-callgraph-data
13846 @opindex mcallgraph-data
13847 @opindex mno-callgraph-data
13848 Emit callgraph information.
13849
13850 @item -mslow-bytes
13851 @itemx -mno-slow-bytes
13852 @opindex mslow-bytes
13853 @opindex mno-slow-bytes
13854 Prefer word access when reading byte quantities.
13855
13856 @item -mlittle-endian
13857 @itemx -mbig-endian
13858 @opindex mlittle-endian
13859 @opindex mbig-endian
13860 Generate code for a little endian target.
13861
13862 @item -m210
13863 @itemx -m340
13864 @opindex m210
13865 @opindex m340
13866 Generate code for the 210 processor.
13867
13868 @item -mno-lsim
13869 @opindex mno-lsim
13870 Assume that run-time support has been provided and so omit the
13871 simulator library (@file{libsim.a)} from the linker command line.
13872
13873 @item -mstack-increment=@var{size}
13874 @opindex mstack-increment
13875 Set the maximum amount for a single stack increment operation.  Large
13876 values can increase the speed of programs which contain functions
13877 that need a large amount of stack space, but they can also trigger a
13878 segmentation fault if the stack is extended too much.  The default
13879 value is 0x1000.
13880
13881 @end table
13882
13883 @node MeP Options
13884 @subsection MeP Options
13885 @cindex MeP options
13886
13887 @table @gcctabopt
13888
13889 @item -mabsdiff
13890 @opindex mabsdiff
13891 Enables the @code{abs} instruction, which is the absolute difference
13892 between two registers.
13893
13894 @item -mall-opts
13895 @opindex mall-opts
13896 Enables all the optional instructions - average, multiply, divide, bit
13897 operations, leading zero, absolute difference, min/max, clip, and
13898 saturation.
13899
13900
13901 @item -maverage
13902 @opindex maverage
13903 Enables the @code{ave} instruction, which computes the average of two
13904 registers.
13905
13906 @item -mbased=@var{n}
13907 @opindex mbased=
13908 Variables of size @var{n} bytes or smaller will be placed in the
13909 @code{.based} section by default.  Based variables use the @code{$tp}
13910 register as a base register, and there is a 128 byte limit to the
13911 @code{.based} section.
13912
13913 @item -mbitops
13914 @opindex mbitops
13915 Enables the bit operation instructions - bit test (@code{btstm}), set
13916 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
13917 test-and-set (@code{tas}).
13918
13919 @item -mc=@var{name}
13920 @opindex mc=
13921 Selects which section constant data will be placed in.  @var{name} may
13922 be @code{tiny}, @code{near}, or @code{far}.
13923
13924 @item -mclip
13925 @opindex mclip
13926 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
13927 useful unless you also provide @code{-mminmax}.
13928
13929 @item -mconfig=@var{name}
13930 @opindex mconfig=
13931 Selects one of the build-in core configurations.  Each MeP chip has
13932 one or more modules in it; each module has a core CPU and a variety of
13933 coprocessors, optional instructions, and peripherals.  The
13934 @code{MeP-Integrator} tool, not part of GCC, provides these
13935 configurations through this option; using this option is the same as
13936 using all the corresponding command line options.  The default
13937 configuration is @code{default}.
13938
13939 @item -mcop
13940 @opindex mcop
13941 Enables the coprocessor instructions.  By default, this is a 32-bit
13942 coprocessor.  Note that the coprocessor is normally enabled via the
13943 @code{-mconfig=} option.
13944
13945 @item -mcop32
13946 @opindex mcop32
13947 Enables the 32-bit coprocessor's instructions.
13948
13949 @item -mcop64
13950 @opindex mcop64
13951 Enables the 64-bit coprocessor's instructions.
13952
13953 @item -mivc2
13954 @opindex mivc2
13955 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
13956
13957 @item -mdc
13958 @opindex mdc
13959 Causes constant variables to be placed in the @code{.near} section.
13960
13961 @item -mdiv
13962 @opindex mdiv
13963 Enables the @code{div} and @code{divu} instructions.
13964
13965 @item -meb
13966 @opindex meb
13967 Generate big-endian code.
13968
13969 @item -mel
13970 @opindex mel
13971 Generate little-endian code.
13972
13973 @item -mio-volatile
13974 @opindex mio-volatile
13975 Tells the compiler that any variable marked with the @code{io}
13976 attribute is to be considered volatile.
13977
13978 @item -ml
13979 @opindex ml
13980 Causes variables to be assigned to the @code{.far} section by default.
13981
13982 @item -mleadz
13983 @opindex mleadz
13984 Enables the @code{leadz} (leading zero) instruction.
13985
13986 @item -mm
13987 @opindex mm
13988 Causes variables to be assigned to the @code{.near} section by default.
13989
13990 @item -mminmax
13991 @opindex mminmax
13992 Enables the @code{min} and @code{max} instructions.
13993
13994 @item -mmult
13995 @opindex mmult
13996 Enables the multiplication and multiply-accumulate instructions.
13997
13998 @item -mno-opts
13999 @opindex mno-opts
14000 Disables all the optional instructions enabled by @code{-mall-opts}.
14001
14002 @item -mrepeat
14003 @opindex mrepeat
14004 Enables the @code{repeat} and @code{erepeat} instructions, used for
14005 low-overhead looping.
14006
14007 @item -ms
14008 @opindex ms
14009 Causes all variables to default to the @code{.tiny} section.  Note
14010 that there is a 65536 byte limit to this section.  Accesses to these
14011 variables use the @code{%gp} base register.
14012
14013 @item -msatur
14014 @opindex msatur
14015 Enables the saturation instructions.  Note that the compiler does not
14016 currently generate these itself, but this option is included for
14017 compatibility with other tools, like @code{as}.
14018
14019 @item -msdram
14020 @opindex msdram
14021 Link the SDRAM-based runtime instead of the default ROM-based runtime.
14022
14023 @item -msim
14024 @opindex msim
14025 Link the simulator runtime libraries.
14026
14027 @item -msimnovec
14028 @opindex msimnovec
14029 Link the simulator runtime libraries, excluding built-in support
14030 for reset and exception vectors and tables.
14031
14032 @item -mtf
14033 @opindex mtf
14034 Causes all functions to default to the @code{.far} section.  Without
14035 this option, functions default to the @code{.near} section.
14036
14037 @item -mtiny=@var{n}
14038 @opindex mtiny=
14039 Variables that are @var{n} bytes or smaller will be allocated to the
14040 @code{.tiny} section.  These variables use the @code{$gp} base
14041 register.  The default for this option is 4, but note that there's a
14042 65536 byte limit to the @code{.tiny} section.
14043
14044 @end table
14045
14046 @node MicroBlaze Options
14047 @subsection MicroBlaze Options
14048 @cindex MicroBlaze Options
14049
14050 @table @gcctabopt
14051
14052 @item -msoft-float
14053 @opindex msoft-float
14054 Use software emulation for floating point (default).
14055
14056 @item -mhard-float
14057 @opindex mhard-float
14058 Use hardware floating point instructions.
14059
14060 @item -mmemcpy
14061 @opindex mmemcpy
14062 Do not optimize block moves, use @code{memcpy}.
14063
14064 @item -mno-clearbss
14065 @opindex mno-clearbss
14066 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
14067
14068 @item -mcpu=@var{cpu-type}
14069 @opindex mcpu=
14070 Use features of and schedule code for given CPU.
14071 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
14072 where @var{X} is a major version, @var{YY} is the minor version, and
14073 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
14074 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
14075
14076 @item -mxl-soft-mul
14077 @opindex mxl-soft-mul
14078 Use software multiply emulation (default).
14079
14080 @item -mxl-soft-div
14081 @opindex mxl-soft-div
14082 Use software emulation for divides (default).
14083
14084 @item -mxl-barrel-shift
14085 @opindex mxl-barrel-shift
14086 Use the hardware barrel shifter.
14087
14088 @item -mxl-pattern-compare
14089 @opindex mxl-pattern-compare
14090 Use pattern compare instructions.
14091
14092 @item -msmall-divides
14093 @opindex msmall-divides
14094 Use table lookup optimization for small signed integer divisions.
14095
14096 @item -mxl-stack-check
14097 @opindex mxl-stack-check
14098 This option is deprecated.  Use -fstack-check instead.
14099
14100 @item -mxl-gp-opt
14101 @opindex mxl-gp-opt
14102 Use GP relative sdata/sbss sections.
14103
14104 @item -mxl-multiply-high
14105 @opindex mxl-multiply-high
14106 Use multiply high instructions for high part of 32x32 multiply.
14107
14108 @item -mxl-float-convert
14109 @opindex mxl-float-convert
14110 Use hardware floating point conversion instructions.
14111
14112 @item -mxl-float-sqrt
14113 @opindex mxl-float-sqrt
14114 Use hardware floating point square root instruction.
14115
14116 @item -mxl-mode-@var{app-model}
14117 Select application model @var{app-model}.  Valid models are
14118 @table @samp
14119 @item executable
14120 normal executable (default), uses startup code @file{crt0.o}.
14121
14122 @item xmdstub
14123 for use with Xilinx Microprocessor Debugger (XMD) based
14124 software intrusive debug agent called xmdstub. This uses startup file
14125 @file{crt1.o} and sets the start address of the program to be 0x800.
14126
14127 @item bootstrap
14128 for applications that are loaded using a bootloader.
14129 This model uses startup file @file{crt2.o} which does not contain a processor
14130 reset vector handler. This is suitable for transferring control on a
14131 processor reset to the bootloader rather than the application.
14132
14133 @item novectors
14134 for applications that do not require any of the
14135 MicroBlaze vectors. This option may be useful for applications running
14136 within a monitoring application. This model uses @file{crt3.o} as a startup file.
14137 @end table
14138
14139 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
14140 @option{-mxl-mode-@var{app-model}}.
14141
14142 @end table
14143
14144 @node MIPS Options
14145 @subsection MIPS Options
14146 @cindex MIPS options
14147
14148 @table @gcctabopt
14149
14150 @item -EB
14151 @opindex EB
14152 Generate big-endian code.
14153
14154 @item -EL
14155 @opindex EL
14156 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
14157 configurations.
14158
14159 @item -march=@var{arch}
14160 @opindex march
14161 Generate code that will run on @var{arch}, which can be the name of a
14162 generic MIPS ISA, or the name of a particular processor.
14163 The ISA names are:
14164 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
14165 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
14166 The processor names are:
14167 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
14168 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
14169 @samp{5kc}, @samp{5kf},
14170 @samp{20kc},
14171 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
14172 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
14173 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
14174 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
14175 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
14176 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
14177 @samp{m4k},
14178 @samp{octeon},
14179 @samp{orion},
14180 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
14181 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
14182 @samp{rm7000}, @samp{rm9000},
14183 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
14184 @samp{sb1},
14185 @samp{sr71000},
14186 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
14187 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
14188 and @samp{xlr}.
14189 The special value @samp{from-abi} selects the
14190 most compatible architecture for the selected ABI (that is,
14191 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
14192
14193 Native Linux/GNU toolchains also support the value @samp{native},
14194 which selects the best architecture option for the host processor.
14195 @option{-march=native} has no effect if GCC does not recognize
14196 the processor.
14197
14198 In processor names, a final @samp{000} can be abbreviated as @samp{k}
14199 (for example, @samp{-march=r2k}).  Prefixes are optional, and
14200 @samp{vr} may be written @samp{r}.
14201
14202 Names of the form @samp{@var{n}f2_1} refer to processors with
14203 FPUs clocked at half the rate of the core, names of the form
14204 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
14205 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
14206 processors with FPUs clocked a ratio of 3:2 with respect to the core.
14207 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
14208 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
14209 accepted as synonyms for @samp{@var{n}f1_1}.
14210
14211 GCC defines two macros based on the value of this option.  The first
14212 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
14213 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
14214 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
14215 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
14216 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
14217
14218 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
14219 above.  In other words, it will have the full prefix and will not
14220 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
14221 the macro names the resolved architecture (either @samp{"mips1"} or
14222 @samp{"mips3"}).  It names the default architecture when no
14223 @option{-march} option is given.
14224
14225 @item -mtune=@var{arch}
14226 @opindex mtune
14227 Optimize for @var{arch}.  Among other things, this option controls
14228 the way instructions are scheduled, and the perceived cost of arithmetic
14229 operations.  The list of @var{arch} values is the same as for
14230 @option{-march}.
14231
14232 When this option is not used, GCC will optimize for the processor
14233 specified by @option{-march}.  By using @option{-march} and
14234 @option{-mtune} together, it is possible to generate code that will
14235 run on a family of processors, but optimize the code for one
14236 particular member of that family.
14237
14238 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
14239 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
14240 @samp{-march} ones described above.
14241
14242 @item -mips1
14243 @opindex mips1
14244 Equivalent to @samp{-march=mips1}.
14245
14246 @item -mips2
14247 @opindex mips2
14248 Equivalent to @samp{-march=mips2}.
14249
14250 @item -mips3
14251 @opindex mips3
14252 Equivalent to @samp{-march=mips3}.
14253
14254 @item -mips4
14255 @opindex mips4
14256 Equivalent to @samp{-march=mips4}.
14257
14258 @item -mips32
14259 @opindex mips32
14260 Equivalent to @samp{-march=mips32}.
14261
14262 @item -mips32r2
14263 @opindex mips32r2
14264 Equivalent to @samp{-march=mips32r2}.
14265
14266 @item -mips64
14267 @opindex mips64
14268 Equivalent to @samp{-march=mips64}.
14269
14270 @item -mips64r2
14271 @opindex mips64r2
14272 Equivalent to @samp{-march=mips64r2}.
14273
14274 @item -mips16
14275 @itemx -mno-mips16
14276 @opindex mips16
14277 @opindex mno-mips16
14278 Generate (do not generate) MIPS16 code.  If GCC is targetting a
14279 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
14280
14281 MIPS16 code generation can also be controlled on a per-function basis
14282 by means of @code{mips16} and @code{nomips16} attributes.
14283 @xref{Function Attributes}, for more information.
14284
14285 @item -mflip-mips16
14286 @opindex mflip-mips16
14287 Generate MIPS16 code on alternating functions.  This option is provided
14288 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
14289 not intended for ordinary use in compiling user code.
14290
14291 @item -minterlink-mips16
14292 @itemx -mno-interlink-mips16
14293 @opindex minterlink-mips16
14294 @opindex mno-interlink-mips16
14295 Require (do not require) that non-MIPS16 code be link-compatible with
14296 MIPS16 code.
14297
14298 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
14299 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
14300 therefore disables direct jumps unless GCC knows that the target of the
14301 jump is not MIPS16.
14302
14303 @item -mabi=32
14304 @itemx -mabi=o64
14305 @itemx -mabi=n32
14306 @itemx -mabi=64
14307 @itemx -mabi=eabi
14308 @opindex mabi=32
14309 @opindex mabi=o64
14310 @opindex mabi=n32
14311 @opindex mabi=64
14312 @opindex mabi=eabi
14313 Generate code for the given ABI@.
14314
14315 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
14316 generates 64-bit code when you select a 64-bit architecture, but you
14317 can use @option{-mgp32} to get 32-bit code instead.
14318
14319 For information about the O64 ABI, see
14320 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
14321
14322 GCC supports a variant of the o32 ABI in which floating-point registers
14323 are 64 rather than 32 bits wide.  You can select this combination with
14324 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
14325 and @samp{mfhc1} instructions and is therefore only supported for
14326 MIPS32R2 processors.
14327
14328 The register assignments for arguments and return values remain the
14329 same, but each scalar value is passed in a single 64-bit register
14330 rather than a pair of 32-bit registers.  For example, scalar
14331 floating-point values are returned in @samp{$f0} only, not a
14332 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
14333 remains the same, but all 64 bits are saved.
14334
14335 @item -mabicalls
14336 @itemx -mno-abicalls
14337 @opindex mabicalls
14338 @opindex mno-abicalls
14339 Generate (do not generate) code that is suitable for SVR4-style
14340 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
14341 systems.
14342
14343 @item -mshared
14344 @itemx -mno-shared
14345 Generate (do not generate) code that is fully position-independent,
14346 and that can therefore be linked into shared libraries.  This option
14347 only affects @option{-mabicalls}.
14348
14349 All @option{-mabicalls} code has traditionally been position-independent,
14350 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
14351 as an extension, the GNU toolchain allows executables to use absolute
14352 accesses for locally-binding symbols.  It can also use shorter GP
14353 initialization sequences and generate direct calls to locally-defined
14354 functions.  This mode is selected by @option{-mno-shared}.
14355
14356 @option{-mno-shared} depends on binutils 2.16 or higher and generates
14357 objects that can only be linked by the GNU linker.  However, the option
14358 does not affect the ABI of the final executable; it only affects the ABI
14359 of relocatable objects.  Using @option{-mno-shared} will generally make
14360 executables both smaller and quicker.
14361
14362 @option{-mshared} is the default.
14363
14364 @item -mplt
14365 @itemx -mno-plt
14366 @opindex mplt
14367 @opindex mno-plt
14368 Assume (do not assume) that the static and dynamic linkers
14369 support PLTs and copy relocations.  This option only affects
14370 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
14371 has no effect without @samp{-msym32}.
14372
14373 You can make @option{-mplt} the default by configuring
14374 GCC with @option{--with-mips-plt}.  The default is
14375 @option{-mno-plt} otherwise.
14376
14377 @item -mxgot
14378 @itemx -mno-xgot
14379 @opindex mxgot
14380 @opindex mno-xgot
14381 Lift (do not lift) the usual restrictions on the size of the global
14382 offset table.
14383
14384 GCC normally uses a single instruction to load values from the GOT@.
14385 While this is relatively efficient, it will only work if the GOT
14386 is smaller than about 64k.  Anything larger will cause the linker
14387 to report an error such as:
14388
14389 @cindex relocation truncated to fit (MIPS)
14390 @smallexample
14391 relocation truncated to fit: R_MIPS_GOT16 foobar
14392 @end smallexample
14393
14394 If this happens, you should recompile your code with @option{-mxgot}.
14395 It should then work with very large GOTs, although it will also be
14396 less efficient, since it will take three instructions to fetch the
14397 value of a global symbol.
14398
14399 Note that some linkers can create multiple GOTs.  If you have such a
14400 linker, you should only need to use @option{-mxgot} when a single object
14401 file accesses more than 64k's worth of GOT entries.  Very few do.
14402
14403 These options have no effect unless GCC is generating position
14404 independent code.
14405
14406 @item -mgp32
14407 @opindex mgp32
14408 Assume that general-purpose registers are 32 bits wide.
14409
14410 @item -mgp64
14411 @opindex mgp64
14412 Assume that general-purpose registers are 64 bits wide.
14413
14414 @item -mfp32
14415 @opindex mfp32
14416 Assume that floating-point registers are 32 bits wide.
14417
14418 @item -mfp64
14419 @opindex mfp64
14420 Assume that floating-point registers are 64 bits wide.
14421
14422 @item -mhard-float
14423 @opindex mhard-float
14424 Use floating-point coprocessor instructions.
14425
14426 @item -msoft-float
14427 @opindex msoft-float
14428 Do not use floating-point coprocessor instructions.  Implement
14429 floating-point calculations using library calls instead.
14430
14431 @item -msingle-float
14432 @opindex msingle-float
14433 Assume that the floating-point coprocessor only supports single-precision
14434 operations.
14435
14436 @item -mdouble-float
14437 @opindex mdouble-float
14438 Assume that the floating-point coprocessor supports double-precision
14439 operations.  This is the default.
14440
14441 @item -mllsc
14442 @itemx -mno-llsc
14443 @opindex mllsc
14444 @opindex mno-llsc
14445 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
14446 implement atomic memory built-in functions.  When neither option is
14447 specified, GCC will use the instructions if the target architecture
14448 supports them.
14449
14450 @option{-mllsc} is useful if the runtime environment can emulate the
14451 instructions and @option{-mno-llsc} can be useful when compiling for
14452 nonstandard ISAs.  You can make either option the default by
14453 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
14454 respectively.  @option{--with-llsc} is the default for some
14455 configurations; see the installation documentation for details.
14456
14457 @item -mdsp
14458 @itemx -mno-dsp
14459 @opindex mdsp
14460 @opindex mno-dsp
14461 Use (do not use) revision 1 of the MIPS DSP ASE@.
14462 @xref{MIPS DSP Built-in Functions}.  This option defines the
14463 preprocessor macro @samp{__mips_dsp}.  It also defines
14464 @samp{__mips_dsp_rev} to 1.
14465
14466 @item -mdspr2
14467 @itemx -mno-dspr2
14468 @opindex mdspr2
14469 @opindex mno-dspr2
14470 Use (do not use) revision 2 of the MIPS DSP ASE@.
14471 @xref{MIPS DSP Built-in Functions}.  This option defines the
14472 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
14473 It also defines @samp{__mips_dsp_rev} to 2.
14474
14475 @item -msmartmips
14476 @itemx -mno-smartmips
14477 @opindex msmartmips
14478 @opindex mno-smartmips
14479 Use (do not use) the MIPS SmartMIPS ASE.
14480
14481 @item -mpaired-single
14482 @itemx -mno-paired-single
14483 @opindex mpaired-single
14484 @opindex mno-paired-single
14485 Use (do not use) paired-single floating-point instructions.
14486 @xref{MIPS Paired-Single Support}.  This option requires
14487 hardware floating-point support to be enabled.
14488
14489 @item -mdmx
14490 @itemx -mno-mdmx
14491 @opindex mdmx
14492 @opindex mno-mdmx
14493 Use (do not use) MIPS Digital Media Extension instructions.
14494 This option can only be used when generating 64-bit code and requires
14495 hardware floating-point support to be enabled.
14496
14497 @item -mips3d
14498 @itemx -mno-mips3d
14499 @opindex mips3d
14500 @opindex mno-mips3d
14501 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
14502 The option @option{-mips3d} implies @option{-mpaired-single}.
14503
14504 @item -mmt
14505 @itemx -mno-mt
14506 @opindex mmt
14507 @opindex mno-mt
14508 Use (do not use) MT Multithreading instructions.
14509
14510 @item -mlong64
14511 @opindex mlong64
14512 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
14513 an explanation of the default and the way that the pointer size is
14514 determined.
14515
14516 @item -mlong32
14517 @opindex mlong32
14518 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
14519
14520 The default size of @code{int}s, @code{long}s and pointers depends on
14521 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
14522 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
14523 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
14524 or the same size as integer registers, whichever is smaller.
14525
14526 @item -msym32
14527 @itemx -mno-sym32
14528 @opindex msym32
14529 @opindex mno-sym32
14530 Assume (do not assume) that all symbols have 32-bit values, regardless
14531 of the selected ABI@.  This option is useful in combination with
14532 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
14533 to generate shorter and faster references to symbolic addresses.
14534
14535 @item -G @var{num}
14536 @opindex G
14537 Put definitions of externally-visible data in a small data section
14538 if that data is no bigger than @var{num} bytes.  GCC can then access
14539 the data more efficiently; see @option{-mgpopt} for details.
14540
14541 The default @option{-G} option depends on the configuration.
14542
14543 @item -mlocal-sdata
14544 @itemx -mno-local-sdata
14545 @opindex mlocal-sdata
14546 @opindex mno-local-sdata
14547 Extend (do not extend) the @option{-G} behavior to local data too,
14548 such as to static variables in C@.  @option{-mlocal-sdata} is the
14549 default for all configurations.
14550
14551 If the linker complains that an application is using too much small data,
14552 you might want to try rebuilding the less performance-critical parts with
14553 @option{-mno-local-sdata}.  You might also want to build large
14554 libraries with @option{-mno-local-sdata}, so that the libraries leave
14555 more room for the main program.
14556
14557 @item -mextern-sdata
14558 @itemx -mno-extern-sdata
14559 @opindex mextern-sdata
14560 @opindex mno-extern-sdata
14561 Assume (do not assume) that externally-defined data will be in
14562 a small data section if that data is within the @option{-G} limit.
14563 @option{-mextern-sdata} is the default for all configurations.
14564
14565 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
14566 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
14567 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
14568 is placed in a small data section.  If @var{Var} is defined by another
14569 module, you must either compile that module with a high-enough
14570 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
14571 definition.  If @var{Var} is common, you must link the application
14572 with a high-enough @option{-G} setting.
14573
14574 The easiest way of satisfying these restrictions is to compile
14575 and link every module with the same @option{-G} option.  However,
14576 you may wish to build a library that supports several different
14577 small data limits.  You can do this by compiling the library with
14578 the highest supported @option{-G} setting and additionally using
14579 @option{-mno-extern-sdata} to stop the library from making assumptions
14580 about externally-defined data.
14581
14582 @item -mgpopt
14583 @itemx -mno-gpopt
14584 @opindex mgpopt
14585 @opindex mno-gpopt
14586 Use (do not use) GP-relative accesses for symbols that are known to be
14587 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
14588 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
14589 configurations.
14590
14591 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
14592 might not hold the value of @code{_gp}.  For example, if the code is
14593 part of a library that might be used in a boot monitor, programs that
14594 call boot monitor routines will pass an unknown value in @code{$gp}.
14595 (In such situations, the boot monitor itself would usually be compiled
14596 with @option{-G0}.)
14597
14598 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
14599 @option{-mno-extern-sdata}.
14600
14601 @item -membedded-data
14602 @itemx -mno-embedded-data
14603 @opindex membedded-data
14604 @opindex mno-embedded-data
14605 Allocate variables to the read-only data section first if possible, then
14606 next in the small data section if possible, otherwise in data.  This gives
14607 slightly slower code than the default, but reduces the amount of RAM required
14608 when executing, and thus may be preferred for some embedded systems.
14609
14610 @item -muninit-const-in-rodata
14611 @itemx -mno-uninit-const-in-rodata
14612 @opindex muninit-const-in-rodata
14613 @opindex mno-uninit-const-in-rodata
14614 Put uninitialized @code{const} variables in the read-only data section.
14615 This option is only meaningful in conjunction with @option{-membedded-data}.
14616
14617 @item -mcode-readable=@var{setting}
14618 @opindex mcode-readable
14619 Specify whether GCC may generate code that reads from executable sections.
14620 There are three possible settings:
14621
14622 @table @gcctabopt
14623 @item -mcode-readable=yes
14624 Instructions may freely access executable sections.  This is the
14625 default setting.
14626
14627 @item -mcode-readable=pcrel
14628 MIPS16 PC-relative load instructions can access executable sections,
14629 but other instructions must not do so.  This option is useful on 4KSc
14630 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
14631 It is also useful on processors that can be configured to have a dual
14632 instruction/data SRAM interface and that, like the M4K, automatically
14633 redirect PC-relative loads to the instruction RAM.
14634
14635 @item -mcode-readable=no
14636 Instructions must not access executable sections.  This option can be
14637 useful on targets that are configured to have a dual instruction/data
14638 SRAM interface but that (unlike the M4K) do not automatically redirect
14639 PC-relative loads to the instruction RAM.
14640 @end table
14641
14642 @item -msplit-addresses
14643 @itemx -mno-split-addresses
14644 @opindex msplit-addresses
14645 @opindex mno-split-addresses
14646 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
14647 relocation operators.  This option has been superseded by
14648 @option{-mexplicit-relocs} but is retained for backwards compatibility.
14649
14650 @item -mexplicit-relocs
14651 @itemx -mno-explicit-relocs
14652 @opindex mexplicit-relocs
14653 @opindex mno-explicit-relocs
14654 Use (do not use) assembler relocation operators when dealing with symbolic
14655 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
14656 is to use assembler macros instead.
14657
14658 @option{-mexplicit-relocs} is the default if GCC was configured
14659 to use an assembler that supports relocation operators.
14660
14661 @item -mcheck-zero-division
14662 @itemx -mno-check-zero-division
14663 @opindex mcheck-zero-division
14664 @opindex mno-check-zero-division
14665 Trap (do not trap) on integer division by zero.
14666
14667 The default is @option{-mcheck-zero-division}.
14668
14669 @item -mdivide-traps
14670 @itemx -mdivide-breaks
14671 @opindex mdivide-traps
14672 @opindex mdivide-breaks
14673 MIPS systems check for division by zero by generating either a
14674 conditional trap or a break instruction.  Using traps results in
14675 smaller code, but is only supported on MIPS II and later.  Also, some
14676 versions of the Linux kernel have a bug that prevents trap from
14677 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
14678 allow conditional traps on architectures that support them and
14679 @option{-mdivide-breaks} to force the use of breaks.
14680
14681 The default is usually @option{-mdivide-traps}, but this can be
14682 overridden at configure time using @option{--with-divide=breaks}.
14683 Divide-by-zero checks can be completely disabled using
14684 @option{-mno-check-zero-division}.
14685
14686 @item -mmemcpy
14687 @itemx -mno-memcpy
14688 @opindex mmemcpy
14689 @opindex mno-memcpy
14690 Force (do not force) the use of @code{memcpy()} for non-trivial block
14691 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
14692 most constant-sized copies.
14693
14694 @item -mlong-calls
14695 @itemx -mno-long-calls
14696 @opindex mlong-calls
14697 @opindex mno-long-calls
14698 Disable (do not disable) use of the @code{jal} instruction.  Calling
14699 functions using @code{jal} is more efficient but requires the caller
14700 and callee to be in the same 256 megabyte segment.
14701
14702 This option has no effect on abicalls code.  The default is
14703 @option{-mno-long-calls}.
14704
14705 @item -mmad
14706 @itemx -mno-mad
14707 @opindex mmad
14708 @opindex mno-mad
14709 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
14710 instructions, as provided by the R4650 ISA@.
14711
14712 @item -mfused-madd
14713 @itemx -mno-fused-madd
14714 @opindex mfused-madd
14715 @opindex mno-fused-madd
14716 Enable (disable) use of the floating point multiply-accumulate
14717 instructions, when they are available.  The default is
14718 @option{-mfused-madd}.
14719
14720 When multiply-accumulate instructions are used, the intermediate
14721 product is calculated to infinite precision and is not subject to
14722 the FCSR Flush to Zero bit.  This may be undesirable in some
14723 circumstances.
14724
14725 @item -nocpp
14726 @opindex nocpp
14727 Tell the MIPS assembler to not run its preprocessor over user
14728 assembler files (with a @samp{.s} suffix) when assembling them.
14729
14730 @item -mfix-24k
14731 @item -mno-fix-24k
14732 @opindex mfix-24k
14733 @opindex mno-fix-24k
14734 Work around the 24K E48 (lost data on stores during refill) errata.
14735 The workarounds are implemented by the assembler rather than by GCC.
14736
14737 @item -mfix-r4000
14738 @itemx -mno-fix-r4000
14739 @opindex mfix-r4000
14740 @opindex mno-fix-r4000
14741 Work around certain R4000 CPU errata:
14742 @itemize @minus
14743 @item
14744 A double-word or a variable shift may give an incorrect result if executed
14745 immediately after starting an integer division.
14746 @item
14747 A double-word or a variable shift may give an incorrect result if executed
14748 while an integer multiplication is in progress.
14749 @item
14750 An integer division may give an incorrect result if started in a delay slot
14751 of a taken branch or a jump.
14752 @end itemize
14753
14754 @item -mfix-r4400
14755 @itemx -mno-fix-r4400
14756 @opindex mfix-r4400
14757 @opindex mno-fix-r4400
14758 Work around certain R4400 CPU errata:
14759 @itemize @minus
14760 @item
14761 A double-word or a variable shift may give an incorrect result if executed
14762 immediately after starting an integer division.
14763 @end itemize
14764
14765 @item -mfix-r10000
14766 @itemx -mno-fix-r10000
14767 @opindex mfix-r10000
14768 @opindex mno-fix-r10000
14769 Work around certain R10000 errata:
14770 @itemize @minus
14771 @item
14772 @code{ll}/@code{sc} sequences may not behave atomically on revisions
14773 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
14774 @end itemize
14775
14776 This option can only be used if the target architecture supports
14777 branch-likely instructions.  @option{-mfix-r10000} is the default when
14778 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
14779 otherwise.
14780
14781 @item -mfix-vr4120
14782 @itemx -mno-fix-vr4120
14783 @opindex mfix-vr4120
14784 Work around certain VR4120 errata:
14785 @itemize @minus
14786 @item
14787 @code{dmultu} does not always produce the correct result.
14788 @item
14789 @code{div} and @code{ddiv} do not always produce the correct result if one
14790 of the operands is negative.
14791 @end itemize
14792 The workarounds for the division errata rely on special functions in
14793 @file{libgcc.a}.  At present, these functions are only provided by
14794 the @code{mips64vr*-elf} configurations.
14795
14796 Other VR4120 errata require a nop to be inserted between certain pairs of
14797 instructions.  These errata are handled by the assembler, not by GCC itself.
14798
14799 @item -mfix-vr4130
14800 @opindex mfix-vr4130
14801 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
14802 workarounds are implemented by the assembler rather than by GCC,
14803 although GCC will avoid using @code{mflo} and @code{mfhi} if the
14804 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
14805 instructions are available instead.
14806
14807 @item -mfix-sb1
14808 @itemx -mno-fix-sb1
14809 @opindex mfix-sb1
14810 Work around certain SB-1 CPU core errata.
14811 (This flag currently works around the SB-1 revision 2
14812 ``F1'' and ``F2'' floating point errata.)
14813
14814 @item -mr10k-cache-barrier=@var{setting}
14815 @opindex mr10k-cache-barrier
14816 Specify whether GCC should insert cache barriers to avoid the
14817 side-effects of speculation on R10K processors.
14818
14819 In common with many processors, the R10K tries to predict the outcome
14820 of a conditional branch and speculatively executes instructions from
14821 the ``taken'' branch.  It later aborts these instructions if the
14822 predicted outcome was wrong.  However, on the R10K, even aborted
14823 instructions can have side effects.
14824
14825 This problem only affects kernel stores and, depending on the system,
14826 kernel loads.  As an example, a speculatively-executed store may load
14827 the target memory into cache and mark the cache line as dirty, even if
14828 the store itself is later aborted.  If a DMA operation writes to the
14829 same area of memory before the ``dirty'' line is flushed, the cached
14830 data will overwrite the DMA-ed data.  See the R10K processor manual
14831 for a full description, including other potential problems.
14832
14833 One workaround is to insert cache barrier instructions before every memory
14834 access that might be speculatively executed and that might have side
14835 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
14836 controls GCC's implementation of this workaround.  It assumes that
14837 aborted accesses to any byte in the following regions will not have
14838 side effects:
14839
14840 @enumerate
14841 @item
14842 the memory occupied by the current function's stack frame;
14843
14844 @item
14845 the memory occupied by an incoming stack argument;
14846
14847 @item
14848 the memory occupied by an object with a link-time-constant address.
14849 @end enumerate
14850
14851 It is the kernel's responsibility to ensure that speculative
14852 accesses to these regions are indeed safe.
14853
14854 If the input program contains a function declaration such as:
14855
14856 @smallexample
14857 void foo (void);
14858 @end smallexample
14859
14860 then the implementation of @code{foo} must allow @code{j foo} and
14861 @code{jal foo} to be executed speculatively.  GCC honors this
14862 restriction for functions it compiles itself.  It expects non-GCC
14863 functions (such as hand-written assembly code) to do the same.
14864
14865 The option has three forms:
14866
14867 @table @gcctabopt
14868 @item -mr10k-cache-barrier=load-store
14869 Insert a cache barrier before a load or store that might be
14870 speculatively executed and that might have side effects even
14871 if aborted.
14872
14873 @item -mr10k-cache-barrier=store
14874 Insert a cache barrier before a store that might be speculatively
14875 executed and that might have side effects even if aborted.
14876
14877 @item -mr10k-cache-barrier=none
14878 Disable the insertion of cache barriers.  This is the default setting.
14879 @end table
14880
14881 @item -mflush-func=@var{func}
14882 @itemx -mno-flush-func
14883 @opindex mflush-func
14884 Specifies the function to call to flush the I and D caches, or to not
14885 call any such function.  If called, the function must take the same
14886 arguments as the common @code{_flush_func()}, that is, the address of the
14887 memory range for which the cache is being flushed, the size of the
14888 memory range, and the number 3 (to flush both caches).  The default
14889 depends on the target GCC was configured for, but commonly is either
14890 @samp{_flush_func} or @samp{__cpu_flush}.
14891
14892 @item mbranch-cost=@var{num}
14893 @opindex mbranch-cost
14894 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14895 This cost is only a heuristic and is not guaranteed to produce
14896 consistent results across releases.  A zero cost redundantly selects
14897 the default, which is based on the @option{-mtune} setting.
14898
14899 @item -mbranch-likely
14900 @itemx -mno-branch-likely
14901 @opindex mbranch-likely
14902 @opindex mno-branch-likely
14903 Enable or disable use of Branch Likely instructions, regardless of the
14904 default for the selected architecture.  By default, Branch Likely
14905 instructions may be generated if they are supported by the selected
14906 architecture.  An exception is for the MIPS32 and MIPS64 architectures
14907 and processors which implement those architectures; for those, Branch
14908 Likely instructions will not be generated by default because the MIPS32
14909 and MIPS64 architectures specifically deprecate their use.
14910
14911 @item -mfp-exceptions
14912 @itemx -mno-fp-exceptions
14913 @opindex mfp-exceptions
14914 Specifies whether FP exceptions are enabled.  This affects how we schedule
14915 FP instructions for some processors.  The default is that FP exceptions are
14916 enabled.
14917
14918 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
14919 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
14920 FP pipe.
14921
14922 @item -mvr4130-align
14923 @itemx -mno-vr4130-align
14924 @opindex mvr4130-align
14925 The VR4130 pipeline is two-way superscalar, but can only issue two
14926 instructions together if the first one is 8-byte aligned.  When this
14927 option is enabled, GCC will align pairs of instructions that it
14928 thinks should execute in parallel.
14929
14930 This option only has an effect when optimizing for the VR4130.
14931 It normally makes code faster, but at the expense of making it bigger.
14932 It is enabled by default at optimization level @option{-O3}.
14933
14934 @item -msynci
14935 @itemx -mno-synci
14936 @opindex msynci
14937 Enable (disable) generation of @code{synci} instructions on
14938 architectures that support it.  The @code{synci} instructions (if
14939 enabled) will be generated when @code{__builtin___clear_cache()} is
14940 compiled.
14941
14942 This option defaults to @code{-mno-synci}, but the default can be
14943 overridden by configuring with @code{--with-synci}.
14944
14945 When compiling code for single processor systems, it is generally safe
14946 to use @code{synci}.  However, on many multi-core (SMP) systems, it
14947 will not invalidate the instruction caches on all cores and may lead
14948 to undefined behavior.
14949
14950 @item -mrelax-pic-calls
14951 @itemx -mno-relax-pic-calls
14952 @opindex mrelax-pic-calls
14953 Try to turn PIC calls that are normally dispatched via register
14954 @code{$25} into direct calls.  This is only possible if the linker can
14955 resolve the destination at link-time and if the destination is within
14956 range for a direct call.
14957
14958 @option{-mrelax-pic-calls} is the default if GCC was configured to use
14959 an assembler and a linker that supports the @code{.reloc} assembly
14960 directive and @code{-mexplicit-relocs} is in effect.  With
14961 @code{-mno-explicit-relocs}, this optimization can be performed by the
14962 assembler and the linker alone without help from the compiler.
14963
14964 @item -mmcount-ra-address
14965 @itemx -mno-mcount-ra-address
14966 @opindex mmcount-ra-address
14967 @opindex mno-mcount-ra-address
14968 Emit (do not emit) code that allows @code{_mcount} to modify the
14969 calling function's return address.  When enabled, this option extends
14970 the usual @code{_mcount} interface with a new @var{ra-address}
14971 parameter, which has type @code{intptr_t *} and is passed in register
14972 @code{$12}.  @code{_mcount} can then modify the return address by
14973 doing both of the following:
14974 @itemize
14975 @item
14976 Returning the new address in register @code{$31}.
14977 @item
14978 Storing the new address in @code{*@var{ra-address}},
14979 if @var{ra-address} is nonnull.
14980 @end itemize
14981
14982 The default is @option{-mno-mcount-ra-address}.
14983
14984 @end table
14985
14986 @node MMIX Options
14987 @subsection MMIX Options
14988 @cindex MMIX Options
14989
14990 These options are defined for the MMIX:
14991
14992 @table @gcctabopt
14993 @item -mlibfuncs
14994 @itemx -mno-libfuncs
14995 @opindex mlibfuncs
14996 @opindex mno-libfuncs
14997 Specify that intrinsic library functions are being compiled, passing all
14998 values in registers, no matter the size.
14999
15000 @item -mepsilon
15001 @itemx -mno-epsilon
15002 @opindex mepsilon
15003 @opindex mno-epsilon
15004 Generate floating-point comparison instructions that compare with respect
15005 to the @code{rE} epsilon register.
15006
15007 @item -mabi=mmixware
15008 @itemx -mabi=gnu
15009 @opindex mabi=mmixware
15010 @opindex mabi=gnu
15011 Generate code that passes function parameters and return values that (in
15012 the called function) are seen as registers @code{$0} and up, as opposed to
15013 the GNU ABI which uses global registers @code{$231} and up.
15014
15015 @item -mzero-extend
15016 @itemx -mno-zero-extend
15017 @opindex mzero-extend
15018 @opindex mno-zero-extend
15019 When reading data from memory in sizes shorter than 64 bits, use (do not
15020 use) zero-extending load instructions by default, rather than
15021 sign-extending ones.
15022
15023 @item -mknuthdiv
15024 @itemx -mno-knuthdiv
15025 @opindex mknuthdiv
15026 @opindex mno-knuthdiv
15027 Make the result of a division yielding a remainder have the same sign as
15028 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
15029 remainder follows the sign of the dividend.  Both methods are
15030 arithmetically valid, the latter being almost exclusively used.
15031
15032 @item -mtoplevel-symbols
15033 @itemx -mno-toplevel-symbols
15034 @opindex mtoplevel-symbols
15035 @opindex mno-toplevel-symbols
15036 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
15037 code can be used with the @code{PREFIX} assembly directive.
15038
15039 @item -melf
15040 @opindex melf
15041 Generate an executable in the ELF format, rather than the default
15042 @samp{mmo} format used by the @command{mmix} simulator.
15043
15044 @item -mbranch-predict
15045 @itemx -mno-branch-predict
15046 @opindex mbranch-predict
15047 @opindex mno-branch-predict
15048 Use (do not use) the probable-branch instructions, when static branch
15049 prediction indicates a probable branch.
15050
15051 @item -mbase-addresses
15052 @itemx -mno-base-addresses
15053 @opindex mbase-addresses
15054 @opindex mno-base-addresses
15055 Generate (do not generate) code that uses @emph{base addresses}.  Using a
15056 base address automatically generates a request (handled by the assembler
15057 and the linker) for a constant to be set up in a global register.  The
15058 register is used for one or more base address requests within the range 0
15059 to 255 from the value held in the register.  The generally leads to short
15060 and fast code, but the number of different data items that can be
15061 addressed is limited.  This means that a program that uses lots of static
15062 data may require @option{-mno-base-addresses}.
15063
15064 @item -msingle-exit
15065 @itemx -mno-single-exit
15066 @opindex msingle-exit
15067 @opindex mno-single-exit
15068 Force (do not force) generated code to have a single exit point in each
15069 function.
15070 @end table
15071
15072 @node MN10300 Options
15073 @subsection MN10300 Options
15074 @cindex MN10300 options
15075
15076 These @option{-m} options are defined for Matsushita MN10300 architectures:
15077
15078 @table @gcctabopt
15079 @item -mmult-bug
15080 @opindex mmult-bug
15081 Generate code to avoid bugs in the multiply instructions for the MN10300
15082 processors.  This is the default.
15083
15084 @item -mno-mult-bug
15085 @opindex mno-mult-bug
15086 Do not generate code to avoid bugs in the multiply instructions for the
15087 MN10300 processors.
15088
15089 @item -mam33
15090 @opindex mam33
15091 Generate code which uses features specific to the AM33 processor.
15092
15093 @item -mno-am33
15094 @opindex mno-am33
15095 Do not generate code which uses features specific to the AM33 processor.  This
15096 is the default.
15097
15098 @item -mam33-2
15099 @opindex mam33-2
15100 Generate code which uses features specific to the AM33/2.0 processor.
15101
15102 @item -mam34
15103 @opindex mam34
15104 Generate code which uses features specific to the AM34 processor.
15105
15106 @item -mtune=@var{cpu-type}
15107 @opindex mtune
15108 Use the timing characteristics of the indicated CPU type when
15109 scheduling instructions.  This does not change the targeted processor
15110 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
15111 @samp{am33-2} or @samp{am34}.
15112
15113 @item -mreturn-pointer-on-d0
15114 @opindex mreturn-pointer-on-d0
15115 When generating a function which returns a pointer, return the pointer
15116 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
15117 only in a0, and attempts to call such functions without a prototype
15118 would result in errors.  Note that this option is on by default; use
15119 @option{-mno-return-pointer-on-d0} to disable it.
15120
15121 @item -mno-crt0
15122 @opindex mno-crt0
15123 Do not link in the C run-time initialization object file.
15124
15125 @item -mrelax
15126 @opindex mrelax
15127 Indicate to the linker that it should perform a relaxation optimization pass
15128 to shorten branches, calls and absolute memory addresses.  This option only
15129 has an effect when used on the command line for the final link step.
15130
15131 This option makes symbolic debugging impossible.
15132
15133 @item -mliw
15134 @opindex mliw
15135 Allow the compiler to generate @emph{Long Instruction Word}
15136 instructions if the target is the @samp{AM33} or later.  This is the
15137 default.  This option defines the preprocessor macro @samp{__LIW__}.
15138
15139 @item -mnoliw
15140 @opindex mnoliw
15141 Do not allow the compiler to generate @emph{Long Instruction Word}
15142 instructions.  This option defines the preprocessor macro
15143 @samp{__NO_LIW__}.
15144
15145 @item -msetlb
15146 @opindex msetlb
15147 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
15148 instructions if the target is the @samp{AM33} or later.  This is the
15149 default.  This option defines the preprocessor macro @samp{__SETLB__}.
15150
15151 @item -mnosetlb
15152 @opindex mnosetlb
15153 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
15154 instructions.  This option defines the preprocessor macro
15155 @samp{__NO_SETLB__}.
15156
15157 @end table
15158
15159 @node PDP-11 Options
15160 @subsection PDP-11 Options
15161 @cindex PDP-11 Options
15162
15163 These options are defined for the PDP-11:
15164
15165 @table @gcctabopt
15166 @item -mfpu
15167 @opindex mfpu
15168 Use hardware FPP floating point.  This is the default.  (FIS floating
15169 point on the PDP-11/40 is not supported.)
15170
15171 @item -msoft-float
15172 @opindex msoft-float
15173 Do not use hardware floating point.
15174
15175 @item -mac0
15176 @opindex mac0
15177 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
15178
15179 @item -mno-ac0
15180 @opindex mno-ac0
15181 Return floating-point results in memory.  This is the default.
15182
15183 @item -m40
15184 @opindex m40
15185 Generate code for a PDP-11/40.
15186
15187 @item -m45
15188 @opindex m45
15189 Generate code for a PDP-11/45.  This is the default.
15190
15191 @item -m10
15192 @opindex m10
15193 Generate code for a PDP-11/10.
15194
15195 @item -mbcopy-builtin
15196 @opindex mbcopy-builtin
15197 Use inline @code{movmemhi} patterns for copying memory.  This is the
15198 default.
15199
15200 @item -mbcopy
15201 @opindex mbcopy
15202 Do not use inline @code{movmemhi} patterns for copying memory.
15203
15204 @item -mint16
15205 @itemx -mno-int32
15206 @opindex mint16
15207 @opindex mno-int32
15208 Use 16-bit @code{int}.  This is the default.
15209
15210 @item -mint32
15211 @itemx -mno-int16
15212 @opindex mint32
15213 @opindex mno-int16
15214 Use 32-bit @code{int}.
15215
15216 @item -mfloat64
15217 @itemx -mno-float32
15218 @opindex mfloat64
15219 @opindex mno-float32
15220 Use 64-bit @code{float}.  This is the default.
15221
15222 @item -mfloat32
15223 @itemx -mno-float64
15224 @opindex mfloat32
15225 @opindex mno-float64
15226 Use 32-bit @code{float}.
15227
15228 @item -mabshi
15229 @opindex mabshi
15230 Use @code{abshi2} pattern.  This is the default.
15231
15232 @item -mno-abshi
15233 @opindex mno-abshi
15234 Do not use @code{abshi2} pattern.
15235
15236 @item -mbranch-expensive
15237 @opindex mbranch-expensive
15238 Pretend that branches are expensive.  This is for experimenting with
15239 code generation only.
15240
15241 @item -mbranch-cheap
15242 @opindex mbranch-cheap
15243 Do not pretend that branches are expensive.  This is the default.
15244
15245 @item -munix-asm
15246 @opindex munix-asm
15247 Use Unix assembler syntax.  This is the default when configured for
15248 @samp{pdp11-*-bsd}.
15249
15250 @item -mdec-asm
15251 @opindex mdec-asm
15252 Use DEC assembler syntax.  This is the default when configured for any
15253 PDP-11 target other than @samp{pdp11-*-bsd}.
15254 @end table
15255
15256 @node picoChip Options
15257 @subsection picoChip Options
15258 @cindex picoChip options
15259
15260 These @samp{-m} options are defined for picoChip implementations:
15261
15262 @table @gcctabopt
15263
15264 @item -mae=@var{ae_type}
15265 @opindex mcpu
15266 Set the instruction set, register set, and instruction scheduling
15267 parameters for array element type @var{ae_type}.  Supported values
15268 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
15269
15270 @option{-mae=ANY} selects a completely generic AE type.  Code
15271 generated with this option will run on any of the other AE types.  The
15272 code will not be as efficient as it would be if compiled for a specific
15273 AE type, and some types of operation (e.g., multiplication) will not
15274 work properly on all types of AE.
15275
15276 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
15277 for compiled code, and is the default.
15278
15279 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
15280 option may suffer from poor performance of byte (char) manipulation,
15281 since the DSP AE does not provide hardware support for byte load/stores.
15282
15283 @item -msymbol-as-address
15284 Enable the compiler to directly use a symbol name as an address in a
15285 load/store instruction, without first loading it into a
15286 register.  Typically, the use of this option will generate larger
15287 programs, which run faster than when the option isn't used.  However, the
15288 results vary from program to program, so it is left as a user option,
15289 rather than being permanently enabled.
15290
15291 @item -mno-inefficient-warnings
15292 Disables warnings about the generation of inefficient code.  These
15293 warnings can be generated, for example, when compiling code which
15294 performs byte-level memory operations on the MAC AE type.  The MAC AE has
15295 no hardware support for byte-level memory operations, so all byte
15296 load/stores must be synthesized from word load/store operations.  This is
15297 inefficient and a warning will be generated indicating to the programmer
15298 that they should rewrite the code to avoid byte operations, or to target
15299 an AE type which has the necessary hardware support.  This option enables
15300 the warning to be turned off.
15301
15302 @end table
15303
15304 @node PowerPC Options
15305 @subsection PowerPC Options
15306 @cindex PowerPC options
15307
15308 These are listed under @xref{RS/6000 and PowerPC Options}.
15309
15310 @node RS/6000 and PowerPC Options
15311 @subsection IBM RS/6000 and PowerPC Options
15312 @cindex RS/6000 and PowerPC Options
15313 @cindex IBM RS/6000 and PowerPC Options
15314
15315 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
15316 @table @gcctabopt
15317 @item -mpower
15318 @itemx -mno-power
15319 @itemx -mpower2
15320 @itemx -mno-power2
15321 @itemx -mpowerpc
15322 @itemx -mno-powerpc
15323 @itemx -mpowerpc-gpopt
15324 @itemx -mno-powerpc-gpopt
15325 @itemx -mpowerpc-gfxopt
15326 @itemx -mno-powerpc-gfxopt
15327 @need 800
15328 @itemx -mpowerpc64
15329 @itemx -mno-powerpc64
15330 @itemx -mmfcrf
15331 @itemx -mno-mfcrf
15332 @itemx -mpopcntb
15333 @itemx -mno-popcntb
15334 @itemx -mpopcntd
15335 @itemx -mno-popcntd
15336 @itemx -mfprnd
15337 @itemx -mno-fprnd
15338 @need 800
15339 @itemx -mcmpb
15340 @itemx -mno-cmpb
15341 @itemx -mmfpgpr
15342 @itemx -mno-mfpgpr
15343 @itemx -mhard-dfp
15344 @itemx -mno-hard-dfp
15345 @opindex mpower
15346 @opindex mno-power
15347 @opindex mpower2
15348 @opindex mno-power2
15349 @opindex mpowerpc
15350 @opindex mno-powerpc
15351 @opindex mpowerpc-gpopt
15352 @opindex mno-powerpc-gpopt
15353 @opindex mpowerpc-gfxopt
15354 @opindex mno-powerpc-gfxopt
15355 @opindex mpowerpc64
15356 @opindex mno-powerpc64
15357 @opindex mmfcrf
15358 @opindex mno-mfcrf
15359 @opindex mpopcntb
15360 @opindex mno-popcntb
15361 @opindex mpopcntd
15362 @opindex mno-popcntd
15363 @opindex mfprnd
15364 @opindex mno-fprnd
15365 @opindex mcmpb
15366 @opindex mno-cmpb
15367 @opindex mmfpgpr
15368 @opindex mno-mfpgpr
15369 @opindex mhard-dfp
15370 @opindex mno-hard-dfp
15371 GCC supports two related instruction set architectures for the
15372 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
15373 instructions supported by the @samp{rios} chip set used in the original
15374 RS/6000 systems and the @dfn{PowerPC} instruction set is the
15375 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
15376 the IBM 4xx, 6xx, and follow-on microprocessors.
15377
15378 Neither architecture is a subset of the other.  However there is a
15379 large common subset of instructions supported by both.  An MQ
15380 register is included in processors supporting the POWER architecture.
15381
15382 You use these options to specify which instructions are available on the
15383 processor you are using.  The default value of these options is
15384 determined when configuring GCC@.  Specifying the
15385 @option{-mcpu=@var{cpu_type}} overrides the specification of these
15386 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
15387 rather than the options listed above.
15388
15389 The @option{-mpower} option allows GCC to generate instructions that
15390 are found only in the POWER architecture and to use the MQ register.
15391 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
15392 to generate instructions that are present in the POWER2 architecture but
15393 not the original POWER architecture.
15394
15395 The @option{-mpowerpc} option allows GCC to generate instructions that
15396 are found only in the 32-bit subset of the PowerPC architecture.
15397 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
15398 GCC to use the optional PowerPC architecture instructions in the
15399 General Purpose group, including floating-point square root.  Specifying
15400 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
15401 use the optional PowerPC architecture instructions in the Graphics
15402 group, including floating-point select.
15403
15404 The @option{-mmfcrf} option allows GCC to generate the move from
15405 condition register field instruction implemented on the POWER4
15406 processor and other processors that support the PowerPC V2.01
15407 architecture.
15408 The @option{-mpopcntb} option allows GCC to generate the popcount and
15409 double precision FP reciprocal estimate instruction implemented on the
15410 POWER5 processor and other processors that support the PowerPC V2.02
15411 architecture.
15412 The @option{-mpopcntd} option allows GCC to generate the popcount
15413 instruction implemented on the POWER7 processor and other processors
15414 that support the PowerPC V2.06 architecture.
15415 The @option{-mfprnd} option allows GCC to generate the FP round to
15416 integer instructions implemented on the POWER5+ processor and other
15417 processors that support the PowerPC V2.03 architecture.
15418 The @option{-mcmpb} option allows GCC to generate the compare bytes
15419 instruction implemented on the POWER6 processor and other processors
15420 that support the PowerPC V2.05 architecture.
15421 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
15422 general purpose register instructions implemented on the POWER6X
15423 processor and other processors that support the extended PowerPC V2.05
15424 architecture.
15425 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
15426 point instructions implemented on some POWER processors.
15427
15428 The @option{-mpowerpc64} option allows GCC to generate the additional
15429 64-bit instructions that are found in the full PowerPC64 architecture
15430 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
15431 @option{-mno-powerpc64}.
15432
15433 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
15434 will use only the instructions in the common subset of both
15435 architectures plus some special AIX common-mode calls, and will not use
15436 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
15437 permits GCC to use any instruction from either architecture and to
15438 allow use of the MQ register; specify this for the Motorola MPC601.
15439
15440 @item -mnew-mnemonics
15441 @itemx -mold-mnemonics
15442 @opindex mnew-mnemonics
15443 @opindex mold-mnemonics
15444 Select which mnemonics to use in the generated assembler code.  With
15445 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
15446 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
15447 assembler mnemonics defined for the POWER architecture.  Instructions
15448 defined in only one architecture have only one mnemonic; GCC uses that
15449 mnemonic irrespective of which of these options is specified.
15450
15451 GCC defaults to the mnemonics appropriate for the architecture in
15452 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
15453 value of these option.  Unless you are building a cross-compiler, you
15454 should normally not specify either @option{-mnew-mnemonics} or
15455 @option{-mold-mnemonics}, but should instead accept the default.
15456
15457 @item -mcpu=@var{cpu_type}
15458 @opindex mcpu
15459 Set architecture type, register usage, choice of mnemonics, and
15460 instruction scheduling parameters for machine type @var{cpu_type}.
15461 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
15462 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
15463 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
15464 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
15465 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
15466 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
15467 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
15468 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
15469 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
15470 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
15471 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
15472
15473 @option{-mcpu=common} selects a completely generic processor.  Code
15474 generated under this option will run on any POWER or PowerPC processor.
15475 GCC will use only the instructions in the common subset of both
15476 architectures, and will not use the MQ register.  GCC assumes a generic
15477 processor model for scheduling purposes.
15478
15479 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
15480 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
15481 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
15482 types, with an appropriate, generic processor model assumed for
15483 scheduling purposes.
15484
15485 The other options specify a specific processor.  Code generated under
15486 those options will run best on that processor, and may not run at all on
15487 others.
15488
15489 The @option{-mcpu} options automatically enable or disable the
15490 following options:
15491
15492 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
15493 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
15494 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
15495 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
15496
15497 The particular options set for any particular CPU will vary between
15498 compiler versions, depending on what setting seems to produce optimal
15499 code for that CPU; it doesn't necessarily reflect the actual hardware's
15500 capabilities.  If you wish to set an individual option to a particular
15501 value, you may specify it after the @option{-mcpu} option, like
15502 @samp{-mcpu=970 -mno-altivec}.
15503
15504 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
15505 not enabled or disabled by the @option{-mcpu} option at present because
15506 AIX does not have full support for these options.  You may still
15507 enable or disable them individually if you're sure it'll work in your
15508 environment.
15509
15510 @item -mtune=@var{cpu_type}
15511 @opindex mtune
15512 Set the instruction scheduling parameters for machine type
15513 @var{cpu_type}, but do not set the architecture type, register usage, or
15514 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
15515 values for @var{cpu_type} are used for @option{-mtune} as for
15516 @option{-mcpu}.  If both are specified, the code generated will use the
15517 architecture, registers, and mnemonics set by @option{-mcpu}, but the
15518 scheduling parameters set by @option{-mtune}.
15519
15520 @item -mcmodel=small
15521 @opindex mcmodel=small
15522 Generate PowerPC64 code for the small model: The TOC is limited to
15523 64k.
15524
15525 @item -mcmodel=medium
15526 @opindex mcmodel=medium
15527 Generate PowerPC64 code for the medium model: The TOC and other static
15528 data may be up to a total of 4G in size.
15529
15530 @item -mcmodel=large
15531 @opindex mcmodel=large
15532 Generate PowerPC64 code for the large model: The TOC may be up to 4G
15533 in size.  Other data and code is only limited by the 64-bit address
15534 space.
15535
15536 @item -maltivec
15537 @itemx -mno-altivec
15538 @opindex maltivec
15539 @opindex mno-altivec
15540 Generate code that uses (does not use) AltiVec instructions, and also
15541 enable the use of built-in functions that allow more direct access to
15542 the AltiVec instruction set.  You may also need to set
15543 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
15544 enhancements.
15545
15546 @item -mvrsave
15547 @itemx -mno-vrsave
15548 @opindex mvrsave
15549 @opindex mno-vrsave
15550 Generate VRSAVE instructions when generating AltiVec code.
15551
15552 @item -mgen-cell-microcode
15553 @opindex mgen-cell-microcode
15554 Generate Cell microcode instructions
15555
15556 @item -mwarn-cell-microcode
15557 @opindex mwarn-cell-microcode
15558 Warning when a Cell microcode instruction is going to emitted.  An example
15559 of a Cell microcode instruction is a variable shift.
15560
15561 @item -msecure-plt
15562 @opindex msecure-plt
15563 Generate code that allows ld and ld.so to build executables and shared
15564 libraries with non-exec .plt and .got sections.  This is a PowerPC
15565 32-bit SYSV ABI option.
15566
15567 @item -mbss-plt
15568 @opindex mbss-plt
15569 Generate code that uses a BSS .plt section that ld.so fills in, and
15570 requires .plt and .got sections that are both writable and executable.
15571 This is a PowerPC 32-bit SYSV ABI option.
15572
15573 @item -misel
15574 @itemx -mno-isel
15575 @opindex misel
15576 @opindex mno-isel
15577 This switch enables or disables the generation of ISEL instructions.
15578
15579 @item -misel=@var{yes/no}
15580 This switch has been deprecated.  Use @option{-misel} and
15581 @option{-mno-isel} instead.
15582
15583 @item -mspe
15584 @itemx -mno-spe
15585 @opindex mspe
15586 @opindex mno-spe
15587 This switch enables or disables the generation of SPE simd
15588 instructions.
15589
15590 @item -mpaired
15591 @itemx -mno-paired
15592 @opindex mpaired
15593 @opindex mno-paired
15594 This switch enables or disables the generation of PAIRED simd
15595 instructions.
15596
15597 @item -mspe=@var{yes/no}
15598 This option has been deprecated.  Use @option{-mspe} and
15599 @option{-mno-spe} instead.
15600
15601 @item -mvsx
15602 @itemx -mno-vsx
15603 @opindex mvsx
15604 @opindex mno-vsx
15605 Generate code that uses (does not use) vector/scalar (VSX)
15606 instructions, and also enable the use of built-in functions that allow
15607 more direct access to the VSX instruction set.
15608
15609 @item -mfloat-gprs=@var{yes/single/double/no}
15610 @itemx -mfloat-gprs
15611 @opindex mfloat-gprs
15612 This switch enables or disables the generation of floating point
15613 operations on the general purpose registers for architectures that
15614 support it.
15615
15616 The argument @var{yes} or @var{single} enables the use of
15617 single-precision floating point operations.
15618
15619 The argument @var{double} enables the use of single and
15620 double-precision floating point operations.
15621
15622 The argument @var{no} disables floating point operations on the
15623 general purpose registers.
15624
15625 This option is currently only available on the MPC854x.
15626
15627 @item -m32
15628 @itemx -m64
15629 @opindex m32
15630 @opindex m64
15631 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
15632 targets (including GNU/Linux).  The 32-bit environment sets int, long
15633 and pointer to 32 bits and generates code that runs on any PowerPC
15634 variant.  The 64-bit environment sets int to 32 bits and long and
15635 pointer to 64 bits, and generates code for PowerPC64, as for
15636 @option{-mpowerpc64}.
15637
15638 @item -mfull-toc
15639 @itemx -mno-fp-in-toc
15640 @itemx -mno-sum-in-toc
15641 @itemx -mminimal-toc
15642 @opindex mfull-toc
15643 @opindex mno-fp-in-toc
15644 @opindex mno-sum-in-toc
15645 @opindex mminimal-toc
15646 Modify generation of the TOC (Table Of Contents), which is created for
15647 every executable file.  The @option{-mfull-toc} option is selected by
15648 default.  In that case, GCC will allocate at least one TOC entry for
15649 each unique non-automatic variable reference in your program.  GCC
15650 will also place floating-point constants in the TOC@.  However, only
15651 16,384 entries are available in the TOC@.
15652
15653 If you receive a linker error message that saying you have overflowed
15654 the available TOC space, you can reduce the amount of TOC space used
15655 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
15656 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
15657 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
15658 generate code to calculate the sum of an address and a constant at
15659 run-time instead of putting that sum into the TOC@.  You may specify one
15660 or both of these options.  Each causes GCC to produce very slightly
15661 slower and larger code at the expense of conserving TOC space.
15662
15663 If you still run out of space in the TOC even when you specify both of
15664 these options, specify @option{-mminimal-toc} instead.  This option causes
15665 GCC to make only one TOC entry for every file.  When you specify this
15666 option, GCC will produce code that is slower and larger but which
15667 uses extremely little TOC space.  You may wish to use this option
15668 only on files that contain less frequently executed code.
15669
15670 @item -maix64
15671 @itemx -maix32
15672 @opindex maix64
15673 @opindex maix32
15674 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
15675 @code{long} type, and the infrastructure needed to support them.
15676 Specifying @option{-maix64} implies @option{-mpowerpc64} and
15677 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
15678 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
15679
15680 @item -mxl-compat
15681 @itemx -mno-xl-compat
15682 @opindex mxl-compat
15683 @opindex mno-xl-compat
15684 Produce code that conforms more closely to IBM XL compiler semantics
15685 when using AIX-compatible ABI@.  Pass floating-point arguments to
15686 prototyped functions beyond the register save area (RSA) on the stack
15687 in addition to argument FPRs.  Do not assume that most significant
15688 double in 128-bit long double value is properly rounded when comparing
15689 values and converting to double.  Use XL symbol names for long double
15690 support routines.
15691
15692 The AIX calling convention was extended but not initially documented to
15693 handle an obscure K&R C case of calling a function that takes the
15694 address of its arguments with fewer arguments than declared.  IBM XL
15695 compilers access floating point arguments which do not fit in the
15696 RSA from the stack when a subroutine is compiled without
15697 optimization.  Because always storing floating-point arguments on the
15698 stack is inefficient and rarely needed, this option is not enabled by
15699 default and only is necessary when calling subroutines compiled by IBM
15700 XL compilers without optimization.
15701
15702 @item -mpe
15703 @opindex mpe
15704 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
15705 application written to use message passing with special startup code to
15706 enable the application to run.  The system must have PE installed in the
15707 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
15708 must be overridden with the @option{-specs=} option to specify the
15709 appropriate directory location.  The Parallel Environment does not
15710 support threads, so the @option{-mpe} option and the @option{-pthread}
15711 option are incompatible.
15712
15713 @item -malign-natural
15714 @itemx -malign-power
15715 @opindex malign-natural
15716 @opindex malign-power
15717 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
15718 @option{-malign-natural} overrides the ABI-defined alignment of larger
15719 types, such as floating-point doubles, on their natural size-based boundary.
15720 The option @option{-malign-power} instructs GCC to follow the ABI-specified
15721 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
15722
15723 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
15724 is not supported.
15725
15726 @item -msoft-float
15727 @itemx -mhard-float
15728 @opindex msoft-float
15729 @opindex mhard-float
15730 Generate code that does not use (uses) the floating-point register set.
15731 Software floating point emulation is provided if you use the
15732 @option{-msoft-float} option, and pass the option to GCC when linking.
15733
15734 @item -msingle-float
15735 @itemx -mdouble-float
15736 @opindex msingle-float
15737 @opindex mdouble-float
15738 Generate code for single or double-precision floating point operations.
15739 @option{-mdouble-float} implies @option{-msingle-float}.
15740
15741 @item -msimple-fpu
15742 @opindex msimple-fpu
15743 Do not generate sqrt and div instructions for hardware floating point unit.
15744
15745 @item -mfpu
15746 @opindex mfpu
15747 Specify type of floating point unit.  Valid values are @var{sp_lite}
15748 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
15749 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
15750 and @var{dp_full} (equivalent to -mdouble-float).
15751
15752 @item -mxilinx-fpu
15753 @opindex mxilinx-fpu
15754 Perform optimizations for floating point unit on Xilinx PPC 405/440.
15755
15756 @item -mmultiple
15757 @itemx -mno-multiple
15758 @opindex mmultiple
15759 @opindex mno-multiple
15760 Generate code that uses (does not use) the load multiple word
15761 instructions and the store multiple word instructions.  These
15762 instructions are generated by default on POWER systems, and not
15763 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
15764 endian PowerPC systems, since those instructions do not work when the
15765 processor is in little endian mode.  The exceptions are PPC740 and
15766 PPC750 which permit the instructions usage in little endian mode.
15767
15768 @item -mstring
15769 @itemx -mno-string
15770 @opindex mstring
15771 @opindex mno-string
15772 Generate code that uses (does not use) the load string instructions
15773 and the store string word instructions to save multiple registers and
15774 do small block moves.  These instructions are generated by default on
15775 POWER systems, and not generated on PowerPC systems.  Do not use
15776 @option{-mstring} on little endian PowerPC systems, since those
15777 instructions do not work when the processor is in little endian mode.
15778 The exceptions are PPC740 and PPC750 which permit the instructions
15779 usage in little endian mode.
15780
15781 @item -mupdate
15782 @itemx -mno-update
15783 @opindex mupdate
15784 @opindex mno-update
15785 Generate code that uses (does not use) the load or store instructions
15786 that update the base register to the address of the calculated memory
15787 location.  These instructions are generated by default.  If you use
15788 @option{-mno-update}, there is a small window between the time that the
15789 stack pointer is updated and the address of the previous frame is
15790 stored, which means code that walks the stack frame across interrupts or
15791 signals may get corrupted data.
15792
15793 @item -mavoid-indexed-addresses
15794 @itemx -mno-avoid-indexed-addresses
15795 @opindex mavoid-indexed-addresses
15796 @opindex mno-avoid-indexed-addresses
15797 Generate code that tries to avoid (not avoid) the use of indexed load
15798 or store instructions. These instructions can incur a performance
15799 penalty on Power6 processors in certain situations, such as when
15800 stepping through large arrays that cross a 16M boundary.  This option
15801 is enabled by default when targetting Power6 and disabled otherwise.
15802
15803 @item -mfused-madd
15804 @itemx -mno-fused-madd
15805 @opindex mfused-madd
15806 @opindex mno-fused-madd
15807 Generate code that uses (does not use) the floating point multiply and
15808 accumulate instructions.  These instructions are generated by default
15809 if hardware floating point is used.  The machine dependent
15810 @option{-mfused-madd} option is now mapped to the machine independent
15811 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
15812 mapped to @option{-ffp-contract=off}.
15813
15814 @item -mmulhw
15815 @itemx -mno-mulhw
15816 @opindex mmulhw
15817 @opindex mno-mulhw
15818 Generate code that uses (does not use) the half-word multiply and
15819 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
15820 These instructions are generated by default when targetting those
15821 processors.
15822
15823 @item -mdlmzb
15824 @itemx -mno-dlmzb
15825 @opindex mdlmzb
15826 @opindex mno-dlmzb
15827 Generate code that uses (does not use) the string-search @samp{dlmzb}
15828 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
15829 generated by default when targetting those processors.
15830
15831 @item -mno-bit-align
15832 @itemx -mbit-align
15833 @opindex mno-bit-align
15834 @opindex mbit-align
15835 On System V.4 and embedded PowerPC systems do not (do) force structures
15836 and unions that contain bit-fields to be aligned to the base type of the
15837 bit-field.
15838
15839 For example, by default a structure containing nothing but 8
15840 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
15841 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
15842 the structure would be aligned to a 1 byte boundary and be one byte in
15843 size.
15844
15845 @item -mno-strict-align
15846 @itemx -mstrict-align
15847 @opindex mno-strict-align
15848 @opindex mstrict-align
15849 On System V.4 and embedded PowerPC systems do not (do) assume that
15850 unaligned memory references will be handled by the system.
15851
15852 @item -mrelocatable
15853 @itemx -mno-relocatable
15854 @opindex mrelocatable
15855 @opindex mno-relocatable
15856 Generate code that allows (does not allow) a static executable to be
15857 relocated to a different address at runtime.  A simple embedded
15858 PowerPC system loader should relocate the entire contents of
15859 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
15860 a table of 32-bit addresses generated by this option.  For this to
15861 work, all objects linked together must be compiled with
15862 @option{-mrelocatable} or @option{-mrelocatable-lib}.
15863 @option{-mrelocatable} code aligns the stack to an 8 byte boundary.
15864
15865 @item -mrelocatable-lib
15866 @itemx -mno-relocatable-lib
15867 @opindex mrelocatable-lib
15868 @opindex mno-relocatable-lib
15869 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
15870 @code{.fixup} section to allow static executables to be relocated at
15871 runtime, but @option{-mrelocatable-lib} does not use the smaller stack
15872 alignment of @option{-mrelocatable}.  Objects compiled with
15873 @option{-mrelocatable-lib} may be linked with objects compiled with
15874 any combination of the @option{-mrelocatable} options.
15875
15876 @item -mno-toc
15877 @itemx -mtoc
15878 @opindex mno-toc
15879 @opindex mtoc
15880 On System V.4 and embedded PowerPC systems do not (do) assume that
15881 register 2 contains a pointer to a global area pointing to the addresses
15882 used in the program.
15883
15884 @item -mlittle
15885 @itemx -mlittle-endian
15886 @opindex mlittle
15887 @opindex mlittle-endian
15888 On System V.4 and embedded PowerPC systems compile code for the
15889 processor in little endian mode.  The @option{-mlittle-endian} option is
15890 the same as @option{-mlittle}.
15891
15892 @item -mbig
15893 @itemx -mbig-endian
15894 @opindex mbig
15895 @opindex mbig-endian
15896 On System V.4 and embedded PowerPC systems compile code for the
15897 processor in big endian mode.  The @option{-mbig-endian} option is
15898 the same as @option{-mbig}.
15899
15900 @item -mdynamic-no-pic
15901 @opindex mdynamic-no-pic
15902 On Darwin and Mac OS X systems, compile code so that it is not
15903 relocatable, but that its external references are relocatable.  The
15904 resulting code is suitable for applications, but not shared
15905 libraries.
15906
15907 @item -msingle-pic-base
15908 @opindex msingle-pic-base
15909 Treat the register used for PIC addressing as read-only, rather than
15910 loading it in the prologue for each function.  The run-time system is
15911 responsible for initializing this register with an appropriate value
15912 before execution begins.
15913
15914 @item -mprioritize-restricted-insns=@var{priority}
15915 @opindex mprioritize-restricted-insns
15916 This option controls the priority that is assigned to
15917 dispatch-slot restricted instructions during the second scheduling
15918 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
15919 @var{no/highest/second-highest} priority to dispatch slot restricted
15920 instructions.
15921
15922 @item -msched-costly-dep=@var{dependence_type}
15923 @opindex msched-costly-dep
15924 This option controls which dependences are considered costly
15925 by the target during instruction scheduling.  The argument
15926 @var{dependence_type} takes one of the following values:
15927 @var{no}: no dependence is costly,
15928 @var{all}: all dependences are costly,
15929 @var{true_store_to_load}: a true dependence from store to load is costly,
15930 @var{store_to_load}: any dependence from store to load is costly,
15931 @var{number}: any dependence which latency >= @var{number} is costly.
15932
15933 @item -minsert-sched-nops=@var{scheme}
15934 @opindex minsert-sched-nops
15935 This option controls which nop insertion scheme will be used during
15936 the second scheduling pass.  The argument @var{scheme} takes one of the
15937 following values:
15938 @var{no}: Don't insert nops.
15939 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
15940 according to the scheduler's grouping.
15941 @var{regroup_exact}: Insert nops to force costly dependent insns into
15942 separate groups.  Insert exactly as many nops as needed to force an insn
15943 to a new group, according to the estimated processor grouping.
15944 @var{number}: Insert nops to force costly dependent insns into
15945 separate groups.  Insert @var{number} nops to force an insn to a new group.
15946
15947 @item -mcall-sysv
15948 @opindex mcall-sysv
15949 On System V.4 and embedded PowerPC systems compile code using calling
15950 conventions that adheres to the March 1995 draft of the System V
15951 Application Binary Interface, PowerPC processor supplement.  This is the
15952 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
15953
15954 @item -mcall-sysv-eabi
15955 @itemx -mcall-eabi
15956 @opindex mcall-sysv-eabi
15957 @opindex mcall-eabi
15958 Specify both @option{-mcall-sysv} and @option{-meabi} options.
15959
15960 @item -mcall-sysv-noeabi
15961 @opindex mcall-sysv-noeabi
15962 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
15963
15964 @item -mcall-aixdesc
15965 @opindex m
15966 On System V.4 and embedded PowerPC systems compile code for the AIX
15967 operating system.
15968
15969 @item -mcall-linux
15970 @opindex mcall-linux
15971 On System V.4 and embedded PowerPC systems compile code for the
15972 Linux-based GNU system.
15973
15974 @item -mcall-freebsd
15975 @opindex mcall-freebsd
15976 On System V.4 and embedded PowerPC systems compile code for the
15977 FreeBSD operating system.
15978
15979 @item -mcall-netbsd
15980 @opindex mcall-netbsd
15981 On System V.4 and embedded PowerPC systems compile code for the
15982 NetBSD operating system.
15983
15984 @item -mcall-openbsd
15985 @opindex mcall-netbsd
15986 On System V.4 and embedded PowerPC systems compile code for the
15987 OpenBSD operating system.
15988
15989 @item -maix-struct-return
15990 @opindex maix-struct-return
15991 Return all structures in memory (as specified by the AIX ABI)@.
15992
15993 @item -msvr4-struct-return
15994 @opindex msvr4-struct-return
15995 Return structures smaller than 8 bytes in registers (as specified by the
15996 SVR4 ABI)@.
15997
15998 @item -mabi=@var{abi-type}
15999 @opindex mabi
16000 Extend the current ABI with a particular extension, or remove such extension.
16001 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
16002 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
16003
16004 @item -mabi=spe
16005 @opindex mabi=spe
16006 Extend the current ABI with SPE ABI extensions.  This does not change
16007 the default ABI, instead it adds the SPE ABI extensions to the current
16008 ABI@.
16009
16010 @item -mabi=no-spe
16011 @opindex mabi=no-spe
16012 Disable Booke SPE ABI extensions for the current ABI@.
16013
16014 @item -mabi=ibmlongdouble
16015 @opindex mabi=ibmlongdouble
16016 Change the current ABI to use IBM extended precision long double.
16017 This is a PowerPC 32-bit SYSV ABI option.
16018
16019 @item -mabi=ieeelongdouble
16020 @opindex mabi=ieeelongdouble
16021 Change the current ABI to use IEEE extended precision long double.
16022 This is a PowerPC 32-bit Linux ABI option.
16023
16024 @item -mprototype
16025 @itemx -mno-prototype
16026 @opindex mprototype
16027 @opindex mno-prototype
16028 On System V.4 and embedded PowerPC systems assume that all calls to
16029 variable argument functions are properly prototyped.  Otherwise, the
16030 compiler must insert an instruction before every non prototyped call to
16031 set or clear bit 6 of the condition code register (@var{CR}) to
16032 indicate whether floating point values were passed in the floating point
16033 registers in case the function takes a variable arguments.  With
16034 @option{-mprototype}, only calls to prototyped variable argument functions
16035 will set or clear the bit.
16036
16037 @item -msim
16038 @opindex msim
16039 On embedded PowerPC systems, assume that the startup module is called
16040 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
16041 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
16042 configurations.
16043
16044 @item -mmvme
16045 @opindex mmvme
16046 On embedded PowerPC systems, assume that the startup module is called
16047 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
16048 @file{libc.a}.
16049
16050 @item -mads
16051 @opindex mads
16052 On embedded PowerPC systems, assume that the startup module is called
16053 @file{crt0.o} and the standard C libraries are @file{libads.a} and
16054 @file{libc.a}.
16055
16056 @item -myellowknife
16057 @opindex myellowknife
16058 On embedded PowerPC systems, assume that the startup module is called
16059 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
16060 @file{libc.a}.
16061
16062 @item -mvxworks
16063 @opindex mvxworks
16064 On System V.4 and embedded PowerPC systems, specify that you are
16065 compiling for a VxWorks system.
16066
16067 @item -memb
16068 @opindex memb
16069 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
16070 header to indicate that @samp{eabi} extended relocations are used.
16071
16072 @item -meabi
16073 @itemx -mno-eabi
16074 @opindex meabi
16075 @opindex mno-eabi
16076 On System V.4 and embedded PowerPC systems do (do not) adhere to the
16077 Embedded Applications Binary Interface (eabi) which is a set of
16078 modifications to the System V.4 specifications.  Selecting @option{-meabi}
16079 means that the stack is aligned to an 8 byte boundary, a function
16080 @code{__eabi} is called to from @code{main} to set up the eabi
16081 environment, and the @option{-msdata} option can use both @code{r2} and
16082 @code{r13} to point to two separate small data areas.  Selecting
16083 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
16084 do not call an initialization function from @code{main}, and the
16085 @option{-msdata} option will only use @code{r13} to point to a single
16086 small data area.  The @option{-meabi} option is on by default if you
16087 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
16088
16089 @item -msdata=eabi
16090 @opindex msdata=eabi
16091 On System V.4 and embedded PowerPC systems, put small initialized
16092 @code{const} global and static data in the @samp{.sdata2} section, which
16093 is pointed to by register @code{r2}.  Put small initialized
16094 non-@code{const} global and static data in the @samp{.sdata} section,
16095 which is pointed to by register @code{r13}.  Put small uninitialized
16096 global and static data in the @samp{.sbss} section, which is adjacent to
16097 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
16098 incompatible with the @option{-mrelocatable} option.  The
16099 @option{-msdata=eabi} option also sets the @option{-memb} option.
16100
16101 @item -msdata=sysv
16102 @opindex msdata=sysv
16103 On System V.4 and embedded PowerPC systems, put small global and static
16104 data in the @samp{.sdata} section, which is pointed to by register
16105 @code{r13}.  Put small uninitialized global and static data in the
16106 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
16107 The @option{-msdata=sysv} option is incompatible with the
16108 @option{-mrelocatable} option.
16109
16110 @item -msdata=default
16111 @itemx -msdata
16112 @opindex msdata=default
16113 @opindex msdata
16114 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
16115 compile code the same as @option{-msdata=eabi}, otherwise compile code the
16116 same as @option{-msdata=sysv}.
16117
16118 @item -msdata=data
16119 @opindex msdata=data
16120 On System V.4 and embedded PowerPC systems, put small global
16121 data in the @samp{.sdata} section.  Put small uninitialized global
16122 data in the @samp{.sbss} section.  Do not use register @code{r13}
16123 to address small data however.  This is the default behavior unless
16124 other @option{-msdata} options are used.
16125
16126 @item -msdata=none
16127 @itemx -mno-sdata
16128 @opindex msdata=none
16129 @opindex mno-sdata
16130 On embedded PowerPC systems, put all initialized global and static data
16131 in the @samp{.data} section, and all uninitialized data in the
16132 @samp{.bss} section.
16133
16134 @item -mblock-move-inline-limit=@var{num}
16135 @opindex mblock-move-inline-limit
16136 Inline all block moves (such as calls to @code{memcpy} or structure
16137 copies) less than or equal to @var{num} bytes.  The minimum value for
16138 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
16139 targets.  The default value is target-specific.
16140
16141 @item -G @var{num}
16142 @opindex G
16143 @cindex smaller data references (PowerPC)
16144 @cindex .sdata/.sdata2 references (PowerPC)
16145 On embedded PowerPC systems, put global and static items less than or
16146 equal to @var{num} bytes into the small data or bss sections instead of
16147 the normal data or bss section.  By default, @var{num} is 8.  The
16148 @option{-G @var{num}} switch is also passed to the linker.
16149 All modules should be compiled with the same @option{-G @var{num}} value.
16150
16151 @item -mregnames
16152 @itemx -mno-regnames
16153 @opindex mregnames
16154 @opindex mno-regnames
16155 On System V.4 and embedded PowerPC systems do (do not) emit register
16156 names in the assembly language output using symbolic forms.
16157
16158 @item -mlongcall
16159 @itemx -mno-longcall
16160 @opindex mlongcall
16161 @opindex mno-longcall
16162 By default assume that all calls are far away so that a longer more
16163 expensive calling sequence is required.  This is required for calls
16164 further than 32 megabytes (33,554,432 bytes) from the current location.
16165 A short call will be generated if the compiler knows
16166 the call cannot be that far away.  This setting can be overridden by
16167 the @code{shortcall} function attribute, or by @code{#pragma
16168 longcall(0)}.
16169
16170 Some linkers are capable of detecting out-of-range calls and generating
16171 glue code on the fly.  On these systems, long calls are unnecessary and
16172 generate slower code.  As of this writing, the AIX linker can do this,
16173 as can the GNU linker for PowerPC/64.  It is planned to add this feature
16174 to the GNU linker for 32-bit PowerPC systems as well.
16175
16176 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
16177 callee, L42'', plus a ``branch island'' (glue code).  The two target
16178 addresses represent the callee and the ``branch island''.  The
16179 Darwin/PPC linker will prefer the first address and generate a ``bl
16180 callee'' if the PPC ``bl'' instruction will reach the callee directly;
16181 otherwise, the linker will generate ``bl L42'' to call the ``branch
16182 island''.  The ``branch island'' is appended to the body of the
16183 calling function; it computes the full 32-bit address of the callee
16184 and jumps to it.
16185
16186 On Mach-O (Darwin) systems, this option directs the compiler emit to
16187 the glue for every direct call, and the Darwin linker decides whether
16188 to use or discard it.
16189
16190 In the future, we may cause GCC to ignore all longcall specifications
16191 when the linker is known to generate glue.
16192
16193 @item -mtls-markers
16194 @itemx -mno-tls-markers
16195 @opindex mtls-markers
16196 @opindex mno-tls-markers
16197 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
16198 specifying the function argument.  The relocation allows ld to
16199 reliably associate function call with argument setup instructions for
16200 TLS optimization, which in turn allows gcc to better schedule the
16201 sequence.
16202
16203 @item -pthread
16204 @opindex pthread
16205 Adds support for multithreading with the @dfn{pthreads} library.
16206 This option sets flags for both the preprocessor and linker.
16207
16208 @item -mrecip
16209 @itemx -mno-recip
16210 @opindex mrecip
16211 This option will enable GCC to use the reciprocal estimate and
16212 reciprocal square root estimate instructions with additional
16213 Newton-Raphson steps to increase precision instead of doing a divide or
16214 square root and divide for floating point arguments.  You should use
16215 the @option{-ffast-math} option when using @option{-mrecip} (or at
16216 least @option{-funsafe-math-optimizations},
16217 @option{-finite-math-only}, @option{-freciprocal-math} and
16218 @option{-fno-trapping-math}).  Note that while the throughput of the
16219 sequence is generally higher than the throughput of the non-reciprocal
16220 instruction, the precision of the sequence can be decreased by up to 2
16221 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
16222 roots.
16223
16224 @item -mrecip=@var{opt}
16225 @opindex mrecip=opt
16226 This option allows to control which reciprocal estimate instructions
16227 may be used.  @var{opt} is a comma separated list of options, that may
16228 be preceded by a @code{!} to invert the option:
16229 @code{all}: enable all estimate instructions,
16230 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
16231 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
16232 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
16233 @code{divf}: enable the single precision reciprocal approximation instructions;
16234 @code{divd}: enable the double precision reciprocal approximation instructions;
16235 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
16236 @code{rsqrtf}: enable the single precision reciprocal square root approximation instructions;
16237 @code{rsqrtd}: enable the double precision reciprocal square root approximation instructions;
16238
16239 So for example, @option{-mrecip=all,!rsqrtd} would enable the
16240 all of the reciprocal estimate instructions, except for the
16241 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
16242 which handle the double precision reciprocal square root calculations.
16243
16244 @item -mrecip-precision
16245 @itemx -mno-recip-precision
16246 @opindex mrecip-precision
16247 Assume (do not assume) that the reciprocal estimate instructions
16248 provide higher precision estimates than is mandated by the powerpc
16249 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
16250 automatically selects @option{-mrecip-precision}.  The double
16251 precision square root estimate instructions are not generated by
16252 default on low precision machines, since they do not provide an
16253 estimate that converges after three steps.
16254
16255 @item -mveclibabi=@var{type}
16256 @opindex mveclibabi
16257 Specifies the ABI type to use for vectorizing intrinsics using an
16258 external library.  The only type supported at present is @code{mass},
16259 which specifies to use IBM's Mathematical Acceleration Subsystem
16260 (MASS) libraries for vectorizing intrinsics using external libraries.
16261 GCC will currently emit calls to @code{acosd2}, @code{acosf4},
16262 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
16263 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
16264 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
16265 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
16266 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
16267 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
16268 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
16269 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
16270 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
16271 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
16272 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
16273 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
16274 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
16275 for power7.  Both @option{-ftree-vectorize} and
16276 @option{-funsafe-math-optimizations} have to be enabled.  The MASS
16277 libraries will have to be specified at link time.
16278
16279 @item -mfriz
16280 @itemx -mno-friz
16281 @opindex mfriz
16282 Generate (do not generate) the @code{friz} instruction when the
16283 @option{-funsafe-math-optimizations} option is used to optimize
16284 rounding a floating point value to 64-bit integer and back to floating
16285 point.  The @code{friz} instruction does not return the same value if
16286 the floating point number is too large to fit in an integer.
16287 @end table
16288
16289 @node RX Options
16290 @subsection RX Options
16291 @cindex RX Options
16292
16293 These command line options are defined for RX targets:
16294
16295 @table @gcctabopt
16296 @item -m64bit-doubles
16297 @itemx -m32bit-doubles
16298 @opindex m64bit-doubles
16299 @opindex m32bit-doubles
16300 Make the @code{double} data type be 64-bits (@option{-m64bit-doubles})
16301 or 32-bits (@option{-m32bit-doubles}) in size.  The default is
16302 @option{-m32bit-doubles}.  @emph{Note} RX floating point hardware only
16303 works on 32-bit values, which is why the default is
16304 @option{-m32bit-doubles}.
16305
16306 @item -fpu
16307 @itemx -nofpu
16308 @opindex fpu
16309 @opindex nofpu
16310 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
16311 floating point hardware.  The default is enabled for the @var{RX600}
16312 series and disabled for the @var{RX200} series.
16313
16314 Floating point instructions will only be generated for 32-bit floating
16315 point values however, so if the @option{-m64bit-doubles} option is in
16316 use then the FPU hardware will not be used for doubles.
16317
16318 @emph{Note} If the @option{-fpu} option is enabled then
16319 @option{-funsafe-math-optimizations} is also enabled automatically.
16320 This is because the RX FPU instructions are themselves unsafe.
16321
16322 @item -mcpu=@var{name}
16323 @opindex -mcpu
16324 Selects the type of RX CPU to be targeted.  Currently three types are
16325 supported, the generic @var{RX600} and @var{RX200} series hardware and
16326 the specific @var{RX610} CPU.  The default is @var{RX600}.
16327
16328 The only difference between @var{RX600} and @var{RX610} is that the
16329 @var{RX610} does not support the @code{MVTIPL} instruction.
16330
16331 The @var{RX200} series does not have a hardware floating point unit
16332 and so @option{-nofpu} is enabled by default when this type is
16333 selected.
16334
16335 @item -mbig-endian-data
16336 @itemx -mlittle-endian-data
16337 @opindex mbig-endian-data
16338 @opindex mlittle-endian-data
16339 Store data (but not code) in the big-endian format.  The default is
16340 @option{-mlittle-endian-data}, i.e.@: to store data in the little endian
16341 format.
16342
16343 @item -msmall-data-limit=@var{N}
16344 @opindex msmall-data-limit
16345 Specifies the maximum size in bytes of global and static variables
16346 which can be placed into the small data area.  Using the small data
16347 area can lead to smaller and faster code, but the size of area is
16348 limited and it is up to the programmer to ensure that the area does
16349 not overflow.  Also when the small data area is used one of the RX's
16350 registers (@code{r13}) is reserved for use pointing to this area, so
16351 it is no longer available for use by the compiler.  This could result
16352 in slower and/or larger code if variables which once could have been
16353 held in @code{r13} are now pushed onto the stack.
16354
16355 Note, common variables (variables which have not been initialised) and
16356 constants are not placed into the small data area as they are assigned
16357 to other sections in the output executable.
16358
16359 The default value is zero, which disables this feature.  Note, this
16360 feature is not enabled by default with higher optimization levels
16361 (@option{-O2} etc) because of the potentially detrimental effects of
16362 reserving register @code{r13}.  It is up to the programmer to
16363 experiment and discover whether this feature is of benefit to their
16364 program.
16365
16366 @item -msim
16367 @itemx -mno-sim
16368 @opindex msim
16369 @opindex mno-sim
16370 Use the simulator runtime.  The default is to use the libgloss board
16371 specific runtime.
16372
16373 @item -mas100-syntax
16374 @itemx -mno-as100-syntax
16375 @opindex mas100-syntax
16376 @opindex mno-as100-syntax
16377 When generating assembler output use a syntax that is compatible with
16378 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
16379 assembler but it has some restrictions so generating it is not the
16380 default option.
16381
16382 @item -mmax-constant-size=@var{N}
16383 @opindex mmax-constant-size
16384 Specifies the maximum size, in bytes, of a constant that can be used as
16385 an operand in a RX instruction.  Although the RX instruction set does
16386 allow constants of up to 4 bytes in length to be used in instructions,
16387 a longer value equates to a longer instruction.  Thus in some
16388 circumstances it can be beneficial to restrict the size of constants
16389 that are used in instructions.  Constants that are too big are instead
16390 placed into a constant pool and referenced via register indirection.
16391
16392 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
16393 or 4 means that constants of any size are allowed.
16394
16395 @item -mrelax
16396 @opindex mrelax
16397 Enable linker relaxation.  Linker relaxation is a process whereby the
16398 linker will attempt to reduce the size of a program by finding shorter
16399 versions of various instructions.  Disabled by default.
16400
16401 @item -mint-register=@var{N}
16402 @opindex mint-register
16403 Specify the number of registers to reserve for fast interrupt handler
16404 functions.  The value @var{N} can be between 0 and 4.  A value of 1
16405 means that register @code{r13} will be reserved for the exclusive use
16406 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
16407 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
16408 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
16409 A value of 0, the default, does not reserve any registers.
16410
16411 @item -msave-acc-in-interrupts
16412 @opindex msave-acc-in-interrupts
16413 Specifies that interrupt handler functions should preserve the
16414 accumulator register.  This is only necessary if normal code might use
16415 the accumulator register, for example because it performs 64-bit
16416 multiplications.  The default is to ignore the accumulator as this
16417 makes the interrupt handlers faster.
16418
16419 @end table
16420
16421 @emph{Note:} The generic GCC command line @option{-ffixed-@var{reg}}
16422 has special significance to the RX port when used with the
16423 @code{interrupt} function attribute.  This attribute indicates a
16424 function intended to process fast interrupts.  GCC will will ensure
16425 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
16426 and/or @code{r13} and only provided that the normal use of the
16427 corresponding registers have been restricted via the
16428 @option{-ffixed-@var{reg}} or @option{-mint-register} command line
16429 options.
16430
16431 @node S/390 and zSeries Options
16432 @subsection S/390 and zSeries Options
16433 @cindex S/390 and zSeries Options
16434
16435 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
16436
16437 @table @gcctabopt
16438 @item -mhard-float
16439 @itemx -msoft-float
16440 @opindex mhard-float
16441 @opindex msoft-float
16442 Use (do not use) the hardware floating-point instructions and registers
16443 for floating-point operations.  When @option{-msoft-float} is specified,
16444 functions in @file{libgcc.a} will be used to perform floating-point
16445 operations.  When @option{-mhard-float} is specified, the compiler
16446 generates IEEE floating-point instructions.  This is the default.
16447
16448 @item -mhard-dfp
16449 @itemx -mno-hard-dfp
16450 @opindex mhard-dfp
16451 @opindex mno-hard-dfp
16452 Use (do not use) the hardware decimal-floating-point instructions for
16453 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
16454 specified, functions in @file{libgcc.a} will be used to perform
16455 decimal-floating-point operations.  When @option{-mhard-dfp} is
16456 specified, the compiler generates decimal-floating-point hardware
16457 instructions.  This is the default for @option{-march=z9-ec} or higher.
16458
16459 @item -mlong-double-64
16460 @itemx -mlong-double-128
16461 @opindex mlong-double-64
16462 @opindex mlong-double-128
16463 These switches control the size of @code{long double} type. A size
16464 of 64bit makes the @code{long double} type equivalent to the @code{double}
16465 type. This is the default.
16466
16467 @item -mbackchain
16468 @itemx -mno-backchain
16469 @opindex mbackchain
16470 @opindex mno-backchain
16471 Store (do not store) the address of the caller's frame as backchain pointer
16472 into the callee's stack frame.
16473 A backchain may be needed to allow debugging using tools that do not understand
16474 DWARF-2 call frame information.
16475 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
16476 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
16477 the backchain is placed into the topmost word of the 96/160 byte register
16478 save area.
16479
16480 In general, code compiled with @option{-mbackchain} is call-compatible with
16481 code compiled with @option{-mmo-backchain}; however, use of the backchain
16482 for debugging purposes usually requires that the whole binary is built with
16483 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
16484 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16485 to build a linux kernel use @option{-msoft-float}.
16486
16487 The default is to not maintain the backchain.
16488
16489 @item -mpacked-stack
16490 @itemx -mno-packed-stack
16491 @opindex mpacked-stack
16492 @opindex mno-packed-stack
16493 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
16494 specified, the compiler uses the all fields of the 96/160 byte register save
16495 area only for their default purpose; unused fields still take up stack space.
16496 When @option{-mpacked-stack} is specified, register save slots are densely
16497 packed at the top of the register save area; unused space is reused for other
16498 purposes, allowing for more efficient use of the available stack space.
16499 However, when @option{-mbackchain} is also in effect, the topmost word of
16500 the save area is always used to store the backchain, and the return address
16501 register is always saved two words below the backchain.
16502
16503 As long as the stack frame backchain is not used, code generated with
16504 @option{-mpacked-stack} is call-compatible with code generated with
16505 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
16506 S/390 or zSeries generated code that uses the stack frame backchain at run
16507 time, not just for debugging purposes.  Such code is not call-compatible
16508 with code compiled with @option{-mpacked-stack}.  Also, note that the
16509 combination of @option{-mbackchain},
16510 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16511 to build a linux kernel use @option{-msoft-float}.
16512
16513 The default is to not use the packed stack layout.
16514
16515 @item -msmall-exec
16516 @itemx -mno-small-exec
16517 @opindex msmall-exec
16518 @opindex mno-small-exec
16519 Generate (or do not generate) code using the @code{bras} instruction
16520 to do subroutine calls.
16521 This only works reliably if the total executable size does not
16522 exceed 64k.  The default is to use the @code{basr} instruction instead,
16523 which does not have this limitation.
16524
16525 @item -m64
16526 @itemx -m31
16527 @opindex m64
16528 @opindex m31
16529 When @option{-m31} is specified, generate code compliant to the
16530 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
16531 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
16532 particular to generate 64-bit instructions.  For the @samp{s390}
16533 targets, the default is @option{-m31}, while the @samp{s390x}
16534 targets default to @option{-m64}.
16535
16536 @item -mzarch
16537 @itemx -mesa
16538 @opindex mzarch
16539 @opindex mesa
16540 When @option{-mzarch} is specified, generate code using the
16541 instructions available on z/Architecture.
16542 When @option{-mesa} is specified, generate code using the
16543 instructions available on ESA/390.  Note that @option{-mesa} is
16544 not possible with @option{-m64}.
16545 When generating code compliant to the GNU/Linux for S/390 ABI,
16546 the default is @option{-mesa}.  When generating code compliant
16547 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
16548
16549 @item -mmvcle
16550 @itemx -mno-mvcle
16551 @opindex mmvcle
16552 @opindex mno-mvcle
16553 Generate (or do not generate) code using the @code{mvcle} instruction
16554 to perform block moves.  When @option{-mno-mvcle} is specified,
16555 use a @code{mvc} loop instead.  This is the default unless optimizing for
16556 size.
16557
16558 @item -mdebug
16559 @itemx -mno-debug
16560 @opindex mdebug
16561 @opindex mno-debug
16562 Print (or do not print) additional debug information when compiling.
16563 The default is to not print debug information.
16564
16565 @item -march=@var{cpu-type}
16566 @opindex march
16567 Generate code that will run on @var{cpu-type}, which is the name of a system
16568 representing a certain processor type.  Possible values for
16569 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
16570 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
16571 When generating code using the instructions available on z/Architecture,
16572 the default is @option{-march=z900}.  Otherwise, the default is
16573 @option{-march=g5}.
16574
16575 @item -mtune=@var{cpu-type}
16576 @opindex mtune
16577 Tune to @var{cpu-type} everything applicable about the generated code,
16578 except for the ABI and the set of available instructions.
16579 The list of @var{cpu-type} values is the same as for @option{-march}.
16580 The default is the value used for @option{-march}.
16581
16582 @item -mtpf-trace
16583 @itemx -mno-tpf-trace
16584 @opindex mtpf-trace
16585 @opindex mno-tpf-trace
16586 Generate code that adds (does not add) in TPF OS specific branches to trace
16587 routines in the operating system.  This option is off by default, even
16588 when compiling for the TPF OS@.
16589
16590 @item -mfused-madd
16591 @itemx -mno-fused-madd
16592 @opindex mfused-madd
16593 @opindex mno-fused-madd
16594 Generate code that uses (does not use) the floating point multiply and
16595 accumulate instructions.  These instructions are generated by default if
16596 hardware floating point is used.
16597
16598 @item -mwarn-framesize=@var{framesize}
16599 @opindex mwarn-framesize
16600 Emit a warning if the current function exceeds the given frame size.  Because
16601 this is a compile time check it doesn't need to be a real problem when the program
16602 runs.  It is intended to identify functions which most probably cause
16603 a stack overflow.  It is useful to be used in an environment with limited stack
16604 size e.g.@: the linux kernel.
16605
16606 @item -mwarn-dynamicstack
16607 @opindex mwarn-dynamicstack
16608 Emit a warning if the function calls alloca or uses dynamically
16609 sized arrays.  This is generally a bad idea with a limited stack size.
16610
16611 @item -mstack-guard=@var{stack-guard}
16612 @itemx -mstack-size=@var{stack-size}
16613 @opindex mstack-guard
16614 @opindex mstack-size
16615 If these options are provided the s390 back end emits additional instructions in
16616 the function prologue which trigger a trap if the stack size is @var{stack-guard}
16617 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
16618 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
16619 the frame size of the compiled function is chosen.
16620 These options are intended to be used to help debugging stack overflow problems.
16621 The additionally emitted code causes only little overhead and hence can also be
16622 used in production like systems without greater performance degradation.  The given
16623 values have to be exact powers of 2 and @var{stack-size} has to be greater than
16624 @var{stack-guard} without exceeding 64k.
16625 In order to be efficient the extra code makes the assumption that the stack starts
16626 at an address aligned to the value given by @var{stack-size}.
16627 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
16628 @end table
16629
16630 @node Score Options
16631 @subsection Score Options
16632 @cindex Score Options
16633
16634 These options are defined for Score implementations:
16635
16636 @table @gcctabopt
16637 @item -meb
16638 @opindex meb
16639 Compile code for big endian mode.  This is the default.
16640
16641 @item -mel
16642 @opindex mel
16643 Compile code for little endian mode.
16644
16645 @item -mnhwloop
16646 @opindex mnhwloop
16647 Disable generate bcnz instruction.
16648
16649 @item -muls
16650 @opindex muls
16651 Enable generate unaligned load and store instruction.
16652
16653 @item -mmac
16654 @opindex mmac
16655 Enable the use of multiply-accumulate instructions. Disabled by default.
16656
16657 @item -mscore5
16658 @opindex mscore5
16659 Specify the SCORE5 as the target architecture.
16660
16661 @item -mscore5u
16662 @opindex mscore5u
16663 Specify the SCORE5U of the target architecture.
16664
16665 @item -mscore7
16666 @opindex mscore7
16667 Specify the SCORE7 as the target architecture. This is the default.
16668
16669 @item -mscore7d
16670 @opindex mscore7d
16671 Specify the SCORE7D as the target architecture.
16672 @end table
16673
16674 @node SH Options
16675 @subsection SH Options
16676
16677 These @samp{-m} options are defined for the SH implementations:
16678
16679 @table @gcctabopt
16680 @item -m1
16681 @opindex m1
16682 Generate code for the SH1.
16683
16684 @item -m2
16685 @opindex m2
16686 Generate code for the SH2.
16687
16688 @item -m2e
16689 Generate code for the SH2e.
16690
16691 @item -m2a-nofpu
16692 @opindex m2a-nofpu
16693 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
16694 that the floating-point unit is not used.
16695
16696 @item -m2a-single-only
16697 @opindex m2a-single-only
16698 Generate code for the SH2a-FPU, in such a way that no double-precision
16699 floating point operations are used.
16700
16701 @item -m2a-single
16702 @opindex m2a-single
16703 Generate code for the SH2a-FPU assuming the floating-point unit is in
16704 single-precision mode by default.
16705
16706 @item -m2a
16707 @opindex m2a
16708 Generate code for the SH2a-FPU assuming the floating-point unit is in
16709 double-precision mode by default.
16710
16711 @item -m3
16712 @opindex m3
16713 Generate code for the SH3.
16714
16715 @item -m3e
16716 @opindex m3e
16717 Generate code for the SH3e.
16718
16719 @item -m4-nofpu
16720 @opindex m4-nofpu
16721 Generate code for the SH4 without a floating-point unit.
16722
16723 @item -m4-single-only
16724 @opindex m4-single-only
16725 Generate code for the SH4 with a floating-point unit that only
16726 supports single-precision arithmetic.
16727
16728 @item -m4-single
16729 @opindex m4-single
16730 Generate code for the SH4 assuming the floating-point unit is in
16731 single-precision mode by default.
16732
16733 @item -m4
16734 @opindex m4
16735 Generate code for the SH4.
16736
16737 @item -m4a-nofpu
16738 @opindex m4a-nofpu
16739 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
16740 floating-point unit is not used.
16741
16742 @item -m4a-single-only
16743 @opindex m4a-single-only
16744 Generate code for the SH4a, in such a way that no double-precision
16745 floating point operations are used.
16746
16747 @item -m4a-single
16748 @opindex m4a-single
16749 Generate code for the SH4a assuming the floating-point unit is in
16750 single-precision mode by default.
16751
16752 @item -m4a
16753 @opindex m4a
16754 Generate code for the SH4a.
16755
16756 @item -m4al
16757 @opindex m4al
16758 Same as @option{-m4a-nofpu}, except that it implicitly passes
16759 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
16760 instructions at the moment.
16761
16762 @item -mb
16763 @opindex mb
16764 Compile code for the processor in big endian mode.
16765
16766 @item -ml
16767 @opindex ml
16768 Compile code for the processor in little endian mode.
16769
16770 @item -mdalign
16771 @opindex mdalign
16772 Align doubles at 64-bit boundaries.  Note that this changes the calling
16773 conventions, and thus some functions from the standard C library will
16774 not work unless you recompile it first with @option{-mdalign}.
16775
16776 @item -mrelax
16777 @opindex mrelax
16778 Shorten some address references at link time, when possible; uses the
16779 linker option @option{-relax}.
16780
16781 @item -mbigtable
16782 @opindex mbigtable
16783 Use 32-bit offsets in @code{switch} tables.  The default is to use
16784 16-bit offsets.
16785
16786 @item -mbitops
16787 @opindex mbitops
16788 Enable the use of bit manipulation instructions on SH2A.
16789
16790 @item -mfmovd
16791 @opindex mfmovd
16792 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
16793 alignment constraints.
16794
16795 @item -mhitachi
16796 @opindex mhitachi
16797 Comply with the calling conventions defined by Renesas.
16798
16799 @item -mrenesas
16800 @opindex mhitachi
16801 Comply with the calling conventions defined by Renesas.
16802
16803 @item -mno-renesas
16804 @opindex mhitachi
16805 Comply with the calling conventions defined for GCC before the Renesas
16806 conventions were available.  This option is the default for all
16807 targets of the SH toolchain.
16808
16809 @item -mnomacsave
16810 @opindex mnomacsave
16811 Mark the @code{MAC} register as call-clobbered, even if
16812 @option{-mhitachi} is given.
16813
16814 @item -mieee
16815 @opindex mieee
16816 Increase IEEE-compliance of floating-point code.
16817 At the moment, this is equivalent to @option{-fno-finite-math-only}.
16818 When generating 16 bit SH opcodes, getting IEEE-conforming results for
16819 comparisons of NANs / infinities incurs extra overhead in every
16820 floating point comparison, therefore the default is set to
16821 @option{-ffinite-math-only}.
16822
16823 @item -minline-ic_invalidate
16824 @opindex minline-ic_invalidate
16825 Inline code to invalidate instruction cache entries after setting up
16826 nested function trampolines.
16827 This option has no effect if -musermode is in effect and the selected
16828 code generation option (e.g. -m4) does not allow the use of the icbi
16829 instruction.
16830 If the selected code generation option does not allow the use of the icbi
16831 instruction, and -musermode is not in effect, the inlined code will
16832 manipulate the instruction cache address array directly with an associative
16833 write.  This not only requires privileged mode, but it will also
16834 fail if the cache line had been mapped via the TLB and has become unmapped.
16835
16836 @item -misize
16837 @opindex misize
16838 Dump instruction size and location in the assembly code.
16839
16840 @item -mpadstruct
16841 @opindex mpadstruct
16842 This option is deprecated.  It pads structures to multiple of 4 bytes,
16843 which is incompatible with the SH ABI@.
16844
16845 @item -mspace
16846 @opindex mspace
16847 Optimize for space instead of speed.  Implied by @option{-Os}.
16848
16849 @item -mprefergot
16850 @opindex mprefergot
16851 When generating position-independent code, emit function calls using
16852 the Global Offset Table instead of the Procedure Linkage Table.
16853
16854 @item -musermode
16855 @opindex musermode
16856 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
16857 if the inlined code would not work in user mode.
16858 This is the default when the target is @code{sh-*-linux*}.
16859
16860 @item -multcost=@var{number}
16861 @opindex multcost=@var{number}
16862 Set the cost to assume for a multiply insn.
16863
16864 @item -mdiv=@var{strategy}
16865 @opindex mdiv=@var{strategy}
16866 Set the division strategy to use for SHmedia code.  @var{strategy} must be
16867 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
16868 inv:call2, inv:fp .
16869 "fp" performs the operation in floating point.  This has a very high latency,
16870 but needs only a few instructions, so it might be a good choice if
16871 your code has enough easily exploitable ILP to allow the compiler to
16872 schedule the floating point instructions together with other instructions.
16873 Division by zero causes a floating point exception.
16874 "inv" uses integer operations to calculate the inverse of the divisor,
16875 and then multiplies the dividend with the inverse.  This strategy allows
16876 cse and hoisting of the inverse calculation.  Division by zero calculates
16877 an unspecified result, but does not trap.
16878 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
16879 have been found, or if the entire operation has been hoisted to the same
16880 place, the last stages of the inverse calculation are intertwined with the
16881 final multiply to reduce the overall latency, at the expense of using a few
16882 more instructions, and thus offering fewer scheduling opportunities with
16883 other code.
16884 "call" calls a library function that usually implements the inv:minlat
16885 strategy.
16886 This gives high code density for m5-*media-nofpu compilations.
16887 "call2" uses a different entry point of the same library function, where it
16888 assumes that a pointer to a lookup table has already been set up, which
16889 exposes the pointer load to cse / code hoisting optimizations.
16890 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
16891 code generation, but if the code stays unoptimized, revert to the "call",
16892 "call2", or "fp" strategies, respectively.  Note that the
16893 potentially-trapping side effect of division by zero is carried by a
16894 separate instruction, so it is possible that all the integer instructions
16895 are hoisted out, but the marker for the side effect stays where it is.
16896 A recombination to fp operations or a call is not possible in that case.
16897 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
16898 that the inverse calculation was nor separated from the multiply, they speed
16899 up division where the dividend fits into 20 bits (plus sign where applicable),
16900 by inserting a test to skip a number of operations in this case; this test
16901 slows down the case of larger dividends.  inv20u assumes the case of a such
16902 a small dividend to be unlikely, and inv20l assumes it to be likely.
16903
16904 @item -maccumulate-outgoing-args
16905 @opindex maccumulate-outgoing-args
16906 Reserve space once for outgoing arguments in the function prologue rather
16907 than around each call.  Generally beneficial for performance and size.  Also
16908 needed for unwinding to avoid changing the stack frame around conditional code.
16909
16910 @item -mdivsi3_libfunc=@var{name}
16911 @opindex mdivsi3_libfunc=@var{name}
16912 Set the name of the library function used for 32 bit signed division to
16913 @var{name}.  This only affect the name used in the call and inv:call
16914 division strategies, and the compiler will still expect the same
16915 sets of input/output/clobbered registers as if this option was not present.
16916
16917 @item -mfixed-range=@var{register-range}
16918 @opindex mfixed-range
16919 Generate code treating the given register range as fixed registers.
16920 A fixed register is one that the register allocator can not use.  This is
16921 useful when compiling kernel code.  A register range is specified as
16922 two registers separated by a dash.  Multiple register ranges can be
16923 specified separated by a comma.
16924
16925 @item -madjust-unroll
16926 @opindex madjust-unroll
16927 Throttle unrolling to avoid thrashing target registers.
16928 This option only has an effect if the gcc code base supports the
16929 TARGET_ADJUST_UNROLL_MAX target hook.
16930
16931 @item -mindexed-addressing
16932 @opindex mindexed-addressing
16933 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
16934 This is only safe if the hardware and/or OS implement 32 bit wrap-around
16935 semantics for the indexed addressing mode.  The architecture allows the
16936 implementation of processors with 64 bit MMU, which the OS could use to
16937 get 32 bit addressing, but since no current hardware implementation supports
16938 this or any other way to make the indexed addressing mode safe to use in
16939 the 32 bit ABI, the default is -mno-indexed-addressing.
16940
16941 @item -mgettrcost=@var{number}
16942 @opindex mgettrcost=@var{number}
16943 Set the cost assumed for the gettr instruction to @var{number}.
16944 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
16945
16946 @item -mpt-fixed
16947 @opindex mpt-fixed
16948 Assume pt* instructions won't trap.  This will generally generate better
16949 scheduled code, but is unsafe on current hardware.  The current architecture
16950 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
16951 This has the unintentional effect of making it unsafe to schedule ptabs /
16952 ptrel before a branch, or hoist it out of a loop.  For example,
16953 __do_global_ctors, a part of libgcc that runs constructors at program
16954 startup, calls functions in a list which is delimited by @minus{}1.  With the
16955 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
16956 That means that all the constructors will be run a bit quicker, but when
16957 the loop comes to the end of the list, the program crashes because ptabs
16958 loads @minus{}1 into a target register.  Since this option is unsafe for any
16959 hardware implementing the current architecture specification, the default
16960 is -mno-pt-fixed.  Unless the user specifies a specific cost with
16961 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
16962 this deters register allocation using target registers for storing
16963 ordinary integers.
16964
16965 @item -minvalid-symbols
16966 @opindex minvalid-symbols
16967 Assume symbols might be invalid.  Ordinary function symbols generated by
16968 the compiler will always be valid to load with movi/shori/ptabs or
16969 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
16970 to generate symbols that will cause ptabs / ptrel to trap.
16971 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
16972 It will then prevent cross-basic-block cse, hoisting and most scheduling
16973 of symbol loads.  The default is @option{-mno-invalid-symbols}.
16974 @end table
16975
16976 @node Solaris 2 Options
16977 @subsection Solaris 2 Options
16978 @cindex Solaris 2 options
16979
16980 These @samp{-m} options are supported on Solaris 2:
16981
16982 @table @gcctabopt
16983 @item -mimpure-text
16984 @opindex mimpure-text
16985 @option{-mimpure-text}, used in addition to @option{-shared}, tells
16986 the compiler to not pass @option{-z text} to the linker when linking a
16987 shared object.  Using this option, you can link position-dependent
16988 code into a shared object.
16989
16990 @option{-mimpure-text} suppresses the ``relocations remain against
16991 allocatable but non-writable sections'' linker error message.
16992 However, the necessary relocations will trigger copy-on-write, and the
16993 shared object is not actually shared across processes.  Instead of
16994 using @option{-mimpure-text}, you should compile all source code with
16995 @option{-fpic} or @option{-fPIC}.
16996
16997 @end table
16998
16999 These switches are supported in addition to the above on Solaris 2:
17000
17001 @table @gcctabopt
17002 @item -pthreads
17003 @opindex pthreads
17004 Add support for multithreading using the POSIX threads library.  This
17005 option sets flags for both the preprocessor and linker.  This option does
17006 not affect the thread safety of object code produced  by the compiler or
17007 that of libraries supplied with it.
17008
17009 @item -pthread
17010 @opindex pthread
17011 This is a synonym for @option{-pthreads}.
17012 @end table
17013
17014 @node SPARC Options
17015 @subsection SPARC Options
17016 @cindex SPARC options
17017
17018 These @samp{-m} options are supported on the SPARC:
17019
17020 @table @gcctabopt
17021 @item -mno-app-regs
17022 @itemx -mapp-regs
17023 @opindex mno-app-regs
17024 @opindex mapp-regs
17025 Specify @option{-mapp-regs} to generate output using the global registers
17026 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
17027 is the default.
17028
17029 To be fully SVR4 ABI compliant at the cost of some performance loss,
17030 specify @option{-mno-app-regs}.  You should compile libraries and system
17031 software with this option.
17032
17033 @item -mfpu
17034 @itemx -mhard-float
17035 @opindex mfpu
17036 @opindex mhard-float
17037 Generate output containing floating point instructions.  This is the
17038 default.
17039
17040 @item -mno-fpu
17041 @itemx -msoft-float
17042 @opindex mno-fpu
17043 @opindex msoft-float
17044 Generate output containing library calls for floating point.
17045 @strong{Warning:} the requisite libraries are not available for all SPARC
17046 targets.  Normally the facilities of the machine's usual C compiler are
17047 used, but this cannot be done directly in cross-compilation.  You must make
17048 your own arrangements to provide suitable library functions for
17049 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
17050 @samp{sparclite-*-*} do provide software floating point support.
17051
17052 @option{-msoft-float} changes the calling convention in the output file;
17053 therefore, it is only useful if you compile @emph{all} of a program with
17054 this option.  In particular, you need to compile @file{libgcc.a}, the
17055 library that comes with GCC, with @option{-msoft-float} in order for
17056 this to work.
17057
17058 @item -mhard-quad-float
17059 @opindex mhard-quad-float
17060 Generate output containing quad-word (long double) floating point
17061 instructions.
17062
17063 @item -msoft-quad-float
17064 @opindex msoft-quad-float
17065 Generate output containing library calls for quad-word (long double)
17066 floating point instructions.  The functions called are those specified
17067 in the SPARC ABI@.  This is the default.
17068
17069 As of this writing, there are no SPARC implementations that have hardware
17070 support for the quad-word floating point instructions.  They all invoke
17071 a trap handler for one of these instructions, and then the trap handler
17072 emulates the effect of the instruction.  Because of the trap handler overhead,
17073 this is much slower than calling the ABI library routines.  Thus the
17074 @option{-msoft-quad-float} option is the default.
17075
17076 @item -mno-unaligned-doubles
17077 @itemx -munaligned-doubles
17078 @opindex mno-unaligned-doubles
17079 @opindex munaligned-doubles
17080 Assume that doubles have 8 byte alignment.  This is the default.
17081
17082 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
17083 alignment only if they are contained in another type, or if they have an
17084 absolute address.  Otherwise, it assumes they have 4 byte alignment.
17085 Specifying this option avoids some rare compatibility problems with code
17086 generated by other compilers.  It is not the default because it results
17087 in a performance loss, especially for floating point code.
17088
17089 @item -mno-faster-structs
17090 @itemx -mfaster-structs
17091 @opindex mno-faster-structs
17092 @opindex mfaster-structs
17093 With @option{-mfaster-structs}, the compiler assumes that structures
17094 should have 8 byte alignment.  This enables the use of pairs of
17095 @code{ldd} and @code{std} instructions for copies in structure
17096 assignment, in place of twice as many @code{ld} and @code{st} pairs.
17097 However, the use of this changed alignment directly violates the SPARC
17098 ABI@.  Thus, it's intended only for use on targets where the developer
17099 acknowledges that their resulting code will not be directly in line with
17100 the rules of the ABI@.
17101
17102 @item -mcpu=@var{cpu_type}
17103 @opindex mcpu
17104 Set the instruction set, register set, and instruction scheduling parameters
17105 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
17106 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
17107 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
17108 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
17109 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
17110
17111 Default instruction scheduling parameters are used for values that select
17112 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
17113 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
17114
17115 Here is a list of each supported architecture and their supported
17116 implementations.
17117
17118 @smallexample
17119     v7:             cypress
17120     v8:             supersparc, hypersparc, leon
17121     sparclite:      f930, f934, sparclite86x
17122     sparclet:       tsc701
17123     v9:             ultrasparc, ultrasparc3, niagara, niagara2
17124 @end smallexample
17125
17126 By default (unless configured otherwise), GCC generates code for the V7
17127 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
17128 additionally optimizes it for the Cypress CY7C602 chip, as used in the
17129 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
17130 SPARCStation 1, 2, IPX etc.
17131
17132 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
17133 architecture.  The only difference from V7 code is that the compiler emits
17134 the integer multiply and integer divide instructions which exist in SPARC-V8
17135 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
17136 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
17137 2000 series.
17138
17139 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
17140 the SPARC architecture.  This adds the integer multiply, integer divide step
17141 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
17142 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
17143 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
17144 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
17145 MB86934 chip, which is the more recent SPARClite with FPU@.
17146
17147 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
17148 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
17149 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
17150 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
17151 optimizes it for the TEMIC SPARClet chip.
17152
17153 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
17154 architecture.  This adds 64-bit integer and floating-point move instructions,
17155 3 additional floating-point condition code registers and conditional move
17156 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
17157 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
17158 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
17159 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
17160 @option{-mcpu=niagara}, the compiler additionally optimizes it for
17161 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
17162 additionally optimizes it for Sun UltraSPARC T2 chips.
17163
17164 @item -mtune=@var{cpu_type}
17165 @opindex mtune
17166 Set the instruction scheduling parameters for machine type
17167 @var{cpu_type}, but do not set the instruction set or register set that the
17168 option @option{-mcpu=@var{cpu_type}} would.
17169
17170 The same values for @option{-mcpu=@var{cpu_type}} can be used for
17171 @option{-mtune=@var{cpu_type}}, but the only useful values are those
17172 that select a particular CPU implementation.  Those are @samp{cypress},
17173 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
17174 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
17175 @samp{niagara}, and @samp{niagara2}.
17176
17177 @item -mv8plus
17178 @itemx -mno-v8plus
17179 @opindex mv8plus
17180 @opindex mno-v8plus
17181 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
17182 difference from the V8 ABI is that the global and out registers are
17183 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
17184 mode for all SPARC-V9 processors.
17185
17186 @item -mvis
17187 @itemx -mno-vis
17188 @opindex mvis
17189 @opindex mno-vis
17190 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
17191 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
17192 @end table
17193
17194 These @samp{-m} options are supported in addition to the above
17195 on SPARC-V9 processors in 64-bit environments:
17196
17197 @table @gcctabopt
17198 @item -mlittle-endian
17199 @opindex mlittle-endian
17200 Generate code for a processor running in little-endian mode.  It is only
17201 available for a few configurations and most notably not on Solaris and Linux.
17202
17203 @item -m32
17204 @itemx -m64
17205 @opindex m32
17206 @opindex m64
17207 Generate code for a 32-bit or 64-bit environment.
17208 The 32-bit environment sets int, long and pointer to 32 bits.
17209 The 64-bit environment sets int to 32 bits and long and pointer
17210 to 64 bits.
17211
17212 @item -mcmodel=medlow
17213 @opindex mcmodel=medlow
17214 Generate code for the Medium/Low code model: 64-bit addresses, programs
17215 must be linked in the low 32 bits of memory.  Programs can be statically
17216 or dynamically linked.
17217
17218 @item -mcmodel=medmid
17219 @opindex mcmodel=medmid
17220 Generate code for the Medium/Middle code model: 64-bit addresses, programs
17221 must be linked in the low 44 bits of memory, the text and data segments must
17222 be less than 2GB in size and the data segment must be located within 2GB of
17223 the text segment.
17224
17225 @item -mcmodel=medany
17226 @opindex mcmodel=medany
17227 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
17228 may be linked anywhere in memory, the text and data segments must be less
17229 than 2GB in size and the data segment must be located within 2GB of the
17230 text segment.
17231
17232 @item -mcmodel=embmedany
17233 @opindex mcmodel=embmedany
17234 Generate code for the Medium/Anywhere code model for embedded systems:
17235 64-bit addresses, the text and data segments must be less than 2GB in
17236 size, both starting anywhere in memory (determined at link time).  The
17237 global register %g4 points to the base of the data segment.  Programs
17238 are statically linked and PIC is not supported.
17239
17240 @item -mstack-bias
17241 @itemx -mno-stack-bias
17242 @opindex mstack-bias
17243 @opindex mno-stack-bias
17244 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
17245 frame pointer if present, are offset by @minus{}2047 which must be added back
17246 when making stack frame references.  This is the default in 64-bit mode.
17247 Otherwise, assume no such offset is present.
17248 @end table
17249
17250 @node SPU Options
17251 @subsection SPU Options
17252 @cindex SPU options
17253
17254 These @samp{-m} options are supported on the SPU:
17255
17256 @table @gcctabopt
17257 @item -mwarn-reloc
17258 @itemx -merror-reloc
17259 @opindex mwarn-reloc
17260 @opindex merror-reloc
17261
17262 The loader for SPU does not handle dynamic relocations.  By default, GCC
17263 will give an error when it generates code that requires a dynamic
17264 relocation.  @option{-mno-error-reloc} disables the error,
17265 @option{-mwarn-reloc} will generate a warning instead.
17266
17267 @item -msafe-dma
17268 @itemx -munsafe-dma
17269 @opindex msafe-dma
17270 @opindex munsafe-dma
17271
17272 Instructions which initiate or test completion of DMA must not be
17273 reordered with respect to loads and stores of the memory which is being
17274 accessed.  Users typically address this problem using the volatile
17275 keyword, but that can lead to inefficient code in places where the
17276 memory is known to not change.  Rather than mark the memory as volatile
17277 we treat the DMA instructions as potentially effecting all memory.  With
17278 @option{-munsafe-dma} users must use the volatile keyword to protect
17279 memory accesses.
17280
17281 @item -mbranch-hints
17282 @opindex mbranch-hints
17283
17284 By default, GCC will generate a branch hint instruction to avoid
17285 pipeline stalls for always taken or probably taken branches.  A hint
17286 will not be generated closer than 8 instructions away from its branch.
17287 There is little reason to disable them, except for debugging purposes,
17288 or to make an object a little bit smaller.
17289
17290 @item -msmall-mem
17291 @itemx -mlarge-mem
17292 @opindex msmall-mem
17293 @opindex mlarge-mem
17294
17295 By default, GCC generates code assuming that addresses are never larger
17296 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
17297 a full 32 bit address.
17298
17299 @item -mstdmain
17300 @opindex mstdmain
17301
17302 By default, GCC links against startup code that assumes the SPU-style
17303 main function interface (which has an unconventional parameter list).
17304 With @option{-mstdmain}, GCC will link your program against startup
17305 code that assumes a C99-style interface to @code{main}, including a
17306 local copy of @code{argv} strings.
17307
17308 @item -mfixed-range=@var{register-range}
17309 @opindex mfixed-range
17310 Generate code treating the given register range as fixed registers.
17311 A fixed register is one that the register allocator can not use.  This is
17312 useful when compiling kernel code.  A register range is specified as
17313 two registers separated by a dash.  Multiple register ranges can be
17314 specified separated by a comma.
17315
17316 @item -mea32
17317 @itemx -mea64
17318 @opindex mea32
17319 @opindex mea64
17320 Compile code assuming that pointers to the PPU address space accessed
17321 via the @code{__ea} named address space qualifier are either 32 or 64
17322 bits wide.  The default is 32 bits.  As this is an ABI changing option,
17323 all object code in an executable must be compiled with the same setting.
17324
17325 @item -maddress-space-conversion
17326 @itemx -mno-address-space-conversion
17327 @opindex maddress-space-conversion
17328 @opindex mno-address-space-conversion
17329 Allow/disallow treating the @code{__ea} address space as superset
17330 of the generic address space.  This enables explicit type casts
17331 between @code{__ea} and generic pointer as well as implicit
17332 conversions of generic pointers to @code{__ea} pointers.  The
17333 default is to allow address space pointer conversions.
17334
17335 @item -mcache-size=@var{cache-size}
17336 @opindex mcache-size
17337 This option controls the version of libgcc that the compiler links to an
17338 executable and selects a software-managed cache for accessing variables
17339 in the @code{__ea} address space with a particular cache size.  Possible
17340 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
17341 and @samp{128}.  The default cache size is 64KB.
17342
17343 @item -matomic-updates
17344 @itemx -mno-atomic-updates
17345 @opindex matomic-updates
17346 @opindex mno-atomic-updates
17347 This option controls the version of libgcc that the compiler links to an
17348 executable and selects whether atomic updates to the software-managed
17349 cache of PPU-side variables are used.  If you use atomic updates, changes
17350 to a PPU variable from SPU code using the @code{__ea} named address space
17351 qualifier will not interfere with changes to other PPU variables residing
17352 in the same cache line from PPU code.  If you do not use atomic updates,
17353 such interference may occur; however, writing back cache lines will be
17354 more efficient.  The default behavior is to use atomic updates.
17355
17356 @item -mdual-nops
17357 @itemx -mdual-nops=@var{n}
17358 @opindex mdual-nops
17359 By default, GCC will insert nops to increase dual issue when it expects
17360 it to increase performance.  @var{n} can be a value from 0 to 10.  A
17361 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
17362 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
17363
17364 @item -mhint-max-nops=@var{n}
17365 @opindex mhint-max-nops
17366 Maximum number of nops to insert for a branch hint.  A branch hint must
17367 be at least 8 instructions away from the branch it is effecting.  GCC
17368 will insert up to @var{n} nops to enforce this, otherwise it will not
17369 generate the branch hint.
17370
17371 @item -mhint-max-distance=@var{n}
17372 @opindex mhint-max-distance
17373 The encoding of the branch hint instruction limits the hint to be within
17374 256 instructions of the branch it is effecting.  By default, GCC makes
17375 sure it is within 125.
17376
17377 @item -msafe-hints
17378 @opindex msafe-hints
17379 Work around a hardware bug which causes the SPU to stall indefinitely.
17380 By default, GCC will insert the @code{hbrp} instruction to make sure
17381 this stall won't happen.
17382
17383 @end table
17384
17385 @node System V Options
17386 @subsection Options for System V
17387
17388 These additional options are available on System V Release 4 for
17389 compatibility with other compilers on those systems:
17390
17391 @table @gcctabopt
17392 @item -G
17393 @opindex G
17394 Create a shared object.
17395 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
17396
17397 @item -Qy
17398 @opindex Qy
17399 Identify the versions of each tool used by the compiler, in a
17400 @code{.ident} assembler directive in the output.
17401
17402 @item -Qn
17403 @opindex Qn
17404 Refrain from adding @code{.ident} directives to the output file (this is
17405 the default).
17406
17407 @item -YP,@var{dirs}
17408 @opindex YP
17409 Search the directories @var{dirs}, and no others, for libraries
17410 specified with @option{-l}.
17411
17412 @item -Ym,@var{dir}
17413 @opindex Ym
17414 Look in the directory @var{dir} to find the M4 preprocessor.
17415 The assembler uses this option.
17416 @c This is supposed to go with a -Yd for predefined M4 macro files, but
17417 @c the generic assembler that comes with Solaris takes just -Ym.
17418 @end table
17419
17420 @node V850 Options
17421 @subsection V850 Options
17422 @cindex V850 Options
17423
17424 These @samp{-m} options are defined for V850 implementations:
17425
17426 @table @gcctabopt
17427 @item -mlong-calls
17428 @itemx -mno-long-calls
17429 @opindex mlong-calls
17430 @opindex mno-long-calls
17431 Treat all calls as being far away (near).  If calls are assumed to be
17432 far away, the compiler will always load the functions address up into a
17433 register, and call indirect through the pointer.
17434
17435 @item -mno-ep
17436 @itemx -mep
17437 @opindex mno-ep
17438 @opindex mep
17439 Do not optimize (do optimize) basic blocks that use the same index
17440 pointer 4 or more times to copy pointer into the @code{ep} register, and
17441 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
17442 option is on by default if you optimize.
17443
17444 @item -mno-prolog-function
17445 @itemx -mprolog-function
17446 @opindex mno-prolog-function
17447 @opindex mprolog-function
17448 Do not use (do use) external functions to save and restore registers
17449 at the prologue and epilogue of a function.  The external functions
17450 are slower, but use less code space if more than one function saves
17451 the same number of registers.  The @option{-mprolog-function} option
17452 is on by default if you optimize.
17453
17454 @item -mspace
17455 @opindex mspace
17456 Try to make the code as small as possible.  At present, this just turns
17457 on the @option{-mep} and @option{-mprolog-function} options.
17458
17459 @item -mtda=@var{n}
17460 @opindex mtda
17461 Put static or global variables whose size is @var{n} bytes or less into
17462 the tiny data area that register @code{ep} points to.  The tiny data
17463 area can hold up to 256 bytes in total (128 bytes for byte references).
17464
17465 @item -msda=@var{n}
17466 @opindex msda
17467 Put static or global variables whose size is @var{n} bytes or less into
17468 the small data area that register @code{gp} points to.  The small data
17469 area can hold up to 64 kilobytes.
17470
17471 @item -mzda=@var{n}
17472 @opindex mzda
17473 Put static or global variables whose size is @var{n} bytes or less into
17474 the first 32 kilobytes of memory.
17475
17476 @item -mv850
17477 @opindex mv850
17478 Specify that the target processor is the V850.
17479
17480 @item -mbig-switch
17481 @opindex mbig-switch
17482 Generate code suitable for big switch tables.  Use this option only if
17483 the assembler/linker complain about out of range branches within a switch
17484 table.
17485
17486 @item -mapp-regs
17487 @opindex mapp-regs
17488 This option will cause r2 and r5 to be used in the code generated by
17489 the compiler.  This setting is the default.
17490
17491 @item -mno-app-regs
17492 @opindex mno-app-regs
17493 This option will cause r2 and r5 to be treated as fixed registers.
17494
17495 @item -mv850e2v3
17496 @opindex mv850e2v3
17497 Specify that the target processor is the V850E2V3.  The preprocessor
17498 constants @samp{__v850e2v3__} will be defined if
17499 this option is used.
17500
17501 @item -mv850e2
17502 @opindex mv850e2
17503 Specify that the target processor is the V850E2.  The preprocessor
17504 constants @samp{__v850e2__} will be defined if this option is used.
17505
17506 @item -mv850e1
17507 @opindex mv850e1
17508 Specify that the target processor is the V850E1.  The preprocessor
17509 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
17510 this option is used.
17511
17512 @item -mv850es
17513 @opindex mv850es
17514 Specify that the target processor is the V850ES.  This is an alias for
17515 the @option{-mv850e1} option.
17516
17517 @item -mv850e
17518 @opindex mv850e
17519 Specify that the target processor is the V850E@.  The preprocessor
17520 constant @samp{__v850e__} will be defined if this option is used.
17521
17522 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
17523 nor @option{-mv850e2} nor @option{-mv850e2v3}
17524 are defined then a default target processor will be chosen and the
17525 relevant @samp{__v850*__} preprocessor constant will be defined.
17526
17527 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
17528 defined, regardless of which processor variant is the target.
17529
17530 @item -mdisable-callt
17531 @opindex mdisable-callt
17532 This option will suppress generation of the CALLT instruction for the
17533 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
17534 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
17535
17536 @end table
17537
17538 @node VAX Options
17539 @subsection VAX Options
17540 @cindex VAX options
17541
17542 These @samp{-m} options are defined for the VAX:
17543
17544 @table @gcctabopt
17545 @item -munix
17546 @opindex munix
17547 Do not output certain jump instructions (@code{aobleq} and so on)
17548 that the Unix assembler for the VAX cannot handle across long
17549 ranges.
17550
17551 @item -mgnu
17552 @opindex mgnu
17553 Do output those jump instructions, on the assumption that you
17554 will assemble with the GNU assembler.
17555
17556 @item -mg
17557 @opindex mg
17558 Output code for g-format floating point numbers instead of d-format.
17559 @end table
17560
17561 @node VxWorks Options
17562 @subsection VxWorks Options
17563 @cindex VxWorks Options
17564
17565 The options in this section are defined for all VxWorks targets.
17566 Options specific to the target hardware are listed with the other
17567 options for that target.
17568
17569 @table @gcctabopt
17570 @item -mrtp
17571 @opindex mrtp
17572 GCC can generate code for both VxWorks kernels and real time processes
17573 (RTPs).  This option switches from the former to the latter.  It also
17574 defines the preprocessor macro @code{__RTP__}.
17575
17576 @item -non-static
17577 @opindex non-static
17578 Link an RTP executable against shared libraries rather than static
17579 libraries.  The options @option{-static} and @option{-shared} can
17580 also be used for RTPs (@pxref{Link Options}); @option{-static}
17581 is the default.
17582
17583 @item -Bstatic
17584 @itemx -Bdynamic
17585 @opindex Bstatic
17586 @opindex Bdynamic
17587 These options are passed down to the linker.  They are defined for
17588 compatibility with Diab.
17589
17590 @item -Xbind-lazy
17591 @opindex Xbind-lazy
17592 Enable lazy binding of function calls.  This option is equivalent to
17593 @option{-Wl,-z,now} and is defined for compatibility with Diab.
17594
17595 @item -Xbind-now
17596 @opindex Xbind-now
17597 Disable lazy binding of function calls.  This option is the default and
17598 is defined for compatibility with Diab.
17599 @end table
17600
17601 @node x86-64 Options
17602 @subsection x86-64 Options
17603 @cindex x86-64 options
17604
17605 These are listed under @xref{i386 and x86-64 Options}.
17606
17607 @node Xstormy16 Options
17608 @subsection Xstormy16 Options
17609 @cindex Xstormy16 Options
17610
17611 These options are defined for Xstormy16:
17612
17613 @table @gcctabopt
17614 @item -msim
17615 @opindex msim
17616 Choose startup files and linker script suitable for the simulator.
17617 @end table
17618
17619 @node Xtensa Options
17620 @subsection Xtensa Options
17621 @cindex Xtensa Options
17622
17623 These options are supported for Xtensa targets:
17624
17625 @table @gcctabopt
17626 @item -mconst16
17627 @itemx -mno-const16
17628 @opindex mconst16
17629 @opindex mno-const16
17630 Enable or disable use of @code{CONST16} instructions for loading
17631 constant values.  The @code{CONST16} instruction is currently not a
17632 standard option from Tensilica.  When enabled, @code{CONST16}
17633 instructions are always used in place of the standard @code{L32R}
17634 instructions.  The use of @code{CONST16} is enabled by default only if
17635 the @code{L32R} instruction is not available.
17636
17637 @item -mfused-madd
17638 @itemx -mno-fused-madd
17639 @opindex mfused-madd
17640 @opindex mno-fused-madd
17641 Enable or disable use of fused multiply/add and multiply/subtract
17642 instructions in the floating-point option.  This has no effect if the
17643 floating-point option is not also enabled.  Disabling fused multiply/add
17644 and multiply/subtract instructions forces the compiler to use separate
17645 instructions for the multiply and add/subtract operations.  This may be
17646 desirable in some cases where strict IEEE 754-compliant results are
17647 required: the fused multiply add/subtract instructions do not round the
17648 intermediate result, thereby producing results with @emph{more} bits of
17649 precision than specified by the IEEE standard.  Disabling fused multiply
17650 add/subtract instructions also ensures that the program output is not
17651 sensitive to the compiler's ability to combine multiply and add/subtract
17652 operations.
17653
17654 @item -mserialize-volatile
17655 @itemx -mno-serialize-volatile
17656 @opindex mserialize-volatile
17657 @opindex mno-serialize-volatile
17658 When this option is enabled, GCC inserts @code{MEMW} instructions before
17659 @code{volatile} memory references to guarantee sequential consistency.
17660 The default is @option{-mserialize-volatile}.  Use
17661 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
17662
17663 @item -mforce-no-pic
17664 @opindex mforce-no-pic
17665 For targets, like GNU/Linux, where all user-mode Xtensa code must be
17666 position-independent code (PIC), this option disables PIC for compiling
17667 kernel code.
17668
17669 @item -mtext-section-literals
17670 @itemx -mno-text-section-literals
17671 @opindex mtext-section-literals
17672 @opindex mno-text-section-literals
17673 Control the treatment of literal pools.  The default is
17674 @option{-mno-text-section-literals}, which places literals in a separate
17675 section in the output file.  This allows the literal pool to be placed
17676 in a data RAM/ROM, and it also allows the linker to combine literal
17677 pools from separate object files to remove redundant literals and
17678 improve code size.  With @option{-mtext-section-literals}, the literals
17679 are interspersed in the text section in order to keep them as close as
17680 possible to their references.  This may be necessary for large assembly
17681 files.
17682
17683 @item -mtarget-align
17684 @itemx -mno-target-align
17685 @opindex mtarget-align
17686 @opindex mno-target-align
17687 When this option is enabled, GCC instructs the assembler to
17688 automatically align instructions to reduce branch penalties at the
17689 expense of some code density.  The assembler attempts to widen density
17690 instructions to align branch targets and the instructions following call
17691 instructions.  If there are not enough preceding safe density
17692 instructions to align a target, no widening will be performed.  The
17693 default is @option{-mtarget-align}.  These options do not affect the
17694 treatment of auto-aligned instructions like @code{LOOP}, which the
17695 assembler will always align, either by widening density instructions or
17696 by inserting no-op instructions.
17697
17698 @item -mlongcalls
17699 @itemx -mno-longcalls
17700 @opindex mlongcalls
17701 @opindex mno-longcalls
17702 When this option is enabled, GCC instructs the assembler to translate
17703 direct calls to indirect calls unless it can determine that the target
17704 of a direct call is in the range allowed by the call instruction.  This
17705 translation typically occurs for calls to functions in other source
17706 files.  Specifically, the assembler translates a direct @code{CALL}
17707 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
17708 The default is @option{-mno-longcalls}.  This option should be used in
17709 programs where the call target can potentially be out of range.  This
17710 option is implemented in the assembler, not the compiler, so the
17711 assembly code generated by GCC will still show direct call
17712 instructions---look at the disassembled object code to see the actual
17713 instructions.  Note that the assembler will use an indirect call for
17714 every cross-file call, not just those that really will be out of range.
17715 @end table
17716
17717 @node zSeries Options
17718 @subsection zSeries Options
17719 @cindex zSeries options
17720
17721 These are listed under @xref{S/390 and zSeries Options}.
17722
17723 @node Code Gen Options
17724 @section Options for Code Generation Conventions
17725 @cindex code generation conventions
17726 @cindex options, code generation
17727 @cindex run-time options
17728
17729 These machine-independent options control the interface conventions
17730 used in code generation.
17731
17732 Most of them have both positive and negative forms; the negative form
17733 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
17734 one of the forms is listed---the one which is not the default.  You
17735 can figure out the other form by either removing @samp{no-} or adding
17736 it.
17737
17738 @table @gcctabopt
17739 @item -fbounds-check
17740 @opindex fbounds-check
17741 For front-ends that support it, generate additional code to check that
17742 indices used to access arrays are within the declared range.  This is
17743 currently only supported by the Java and Fortran front-ends, where
17744 this option defaults to true and false respectively.
17745
17746 @item -ftrapv
17747 @opindex ftrapv
17748 This option generates traps for signed overflow on addition, subtraction,
17749 multiplication operations.
17750
17751 @item -fwrapv
17752 @opindex fwrapv
17753 This option instructs the compiler to assume that signed arithmetic
17754 overflow of addition, subtraction and multiplication wraps around
17755 using twos-complement representation.  This flag enables some optimizations
17756 and disables others.  This option is enabled by default for the Java
17757 front-end, as required by the Java language specification.
17758
17759 @item -fexceptions
17760 @opindex fexceptions
17761 Enable exception handling.  Generates extra code needed to propagate
17762 exceptions.  For some targets, this implies GCC will generate frame
17763 unwind information for all functions, which can produce significant data
17764 size overhead, although it does not affect execution.  If you do not
17765 specify this option, GCC will enable it by default for languages like
17766 C++ which normally require exception handling, and disable it for
17767 languages like C that do not normally require it.  However, you may need
17768 to enable this option when compiling C code that needs to interoperate
17769 properly with exception handlers written in C++.  You may also wish to
17770 disable this option if you are compiling older C++ programs that don't
17771 use exception handling.
17772
17773 @item -fnon-call-exceptions
17774 @opindex fnon-call-exceptions
17775 Generate code that allows trapping instructions to throw exceptions.
17776 Note that this requires platform-specific runtime support that does
17777 not exist everywhere.  Moreover, it only allows @emph{trapping}
17778 instructions to throw exceptions, i.e.@: memory references or floating
17779 point instructions.  It does not allow exceptions to be thrown from
17780 arbitrary signal handlers such as @code{SIGALRM}.
17781
17782 @item -funwind-tables
17783 @opindex funwind-tables
17784 Similar to @option{-fexceptions}, except that it will just generate any needed
17785 static data, but will not affect the generated code in any other way.
17786 You will normally not enable this option; instead, a language processor
17787 that needs this handling would enable it on your behalf.
17788
17789 @item -fasynchronous-unwind-tables
17790 @opindex fasynchronous-unwind-tables
17791 Generate unwind table in dwarf2 format, if supported by target machine.  The
17792 table is exact at each instruction boundary, so it can be used for stack
17793 unwinding from asynchronous events (such as debugger or garbage collector).
17794
17795 @item -fpcc-struct-return
17796 @opindex fpcc-struct-return
17797 Return ``short'' @code{struct} and @code{union} values in memory like
17798 longer ones, rather than in registers.  This convention is less
17799 efficient, but it has the advantage of allowing intercallability between
17800 GCC-compiled files and files compiled with other compilers, particularly
17801 the Portable C Compiler (pcc).
17802
17803 The precise convention for returning structures in memory depends
17804 on the target configuration macros.
17805
17806 Short structures and unions are those whose size and alignment match
17807 that of some integer type.
17808
17809 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
17810 switch is not binary compatible with code compiled with the
17811 @option{-freg-struct-return} switch.
17812 Use it to conform to a non-default application binary interface.
17813
17814 @item -freg-struct-return
17815 @opindex freg-struct-return
17816 Return @code{struct} and @code{union} values in registers when possible.
17817 This is more efficient for small structures than
17818 @option{-fpcc-struct-return}.
17819
17820 If you specify neither @option{-fpcc-struct-return} nor
17821 @option{-freg-struct-return}, GCC defaults to whichever convention is
17822 standard for the target.  If there is no standard convention, GCC
17823 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
17824 the principal compiler.  In those cases, we can choose the standard, and
17825 we chose the more efficient register return alternative.
17826
17827 @strong{Warning:} code compiled with the @option{-freg-struct-return}
17828 switch is not binary compatible with code compiled with the
17829 @option{-fpcc-struct-return} switch.
17830 Use it to conform to a non-default application binary interface.
17831
17832 @item -fshort-enums
17833 @opindex fshort-enums
17834 Allocate to an @code{enum} type only as many bytes as it needs for the
17835 declared range of possible values.  Specifically, the @code{enum} type
17836 will be equivalent to the smallest integer type which has enough room.
17837
17838 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
17839 code that is not binary compatible with code generated without that switch.
17840 Use it to conform to a non-default application binary interface.
17841
17842 @item -fshort-double
17843 @opindex fshort-double
17844 Use the same size for @code{double} as for @code{float}.
17845
17846 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
17847 code that is not binary compatible with code generated without that switch.
17848 Use it to conform to a non-default application binary interface.
17849
17850 @item -fshort-wchar
17851 @opindex fshort-wchar
17852 Override the underlying type for @samp{wchar_t} to be @samp{short
17853 unsigned int} instead of the default for the target.  This option is
17854 useful for building programs to run under WINE@.
17855
17856 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
17857 code that is not binary compatible with code generated without that switch.
17858 Use it to conform to a non-default application binary interface.
17859
17860 @item -fno-common
17861 @opindex fno-common
17862 In C code, controls the placement of uninitialized global variables.
17863 Unix C compilers have traditionally permitted multiple definitions of
17864 such variables in different compilation units by placing the variables
17865 in a common block.
17866 This is the behavior specified by @option{-fcommon}, and is the default
17867 for GCC on most targets.
17868 On the other hand, this behavior is not required by ISO C, and on some
17869 targets may carry a speed or code size penalty on variable references.
17870 The @option{-fno-common} option specifies that the compiler should place
17871 uninitialized global variables in the data section of the object file,
17872 rather than generating them as common blocks.
17873 This has the effect that if the same variable is declared
17874 (without @code{extern}) in two different compilations,
17875 you will get a multiple-definition error when you link them.
17876 In this case, you must compile with @option{-fcommon} instead.
17877 Compiling with @option{-fno-common} is useful on targets for which
17878 it provides better performance, or if you wish to verify that the
17879 program will work on other systems which always treat uninitialized
17880 variable declarations this way.
17881
17882 @item -fno-ident
17883 @opindex fno-ident
17884 Ignore the @samp{#ident} directive.
17885
17886 @item -finhibit-size-directive
17887 @opindex finhibit-size-directive
17888 Don't output a @code{.size} assembler directive, or anything else that
17889 would cause trouble if the function is split in the middle, and the
17890 two halves are placed at locations far apart in memory.  This option is
17891 used when compiling @file{crtstuff.c}; you should not need to use it
17892 for anything else.
17893
17894 @item -fverbose-asm
17895 @opindex fverbose-asm
17896 Put extra commentary information in the generated assembly code to
17897 make it more readable.  This option is generally only of use to those
17898 who actually need to read the generated assembly code (perhaps while
17899 debugging the compiler itself).
17900
17901 @option{-fno-verbose-asm}, the default, causes the
17902 extra information to be omitted and is useful when comparing two assembler
17903 files.
17904
17905 @item -frecord-gcc-switches
17906 @opindex frecord-gcc-switches
17907 This switch causes the command line that was used to invoke the
17908 compiler to be recorded into the object file that is being created.
17909 This switch is only implemented on some targets and the exact format
17910 of the recording is target and binary file format dependent, but it
17911 usually takes the form of a section containing ASCII text.  This
17912 switch is related to the @option{-fverbose-asm} switch, but that
17913 switch only records information in the assembler output file as
17914 comments, so it never reaches the object file.
17915
17916 @item -fpic
17917 @opindex fpic
17918 @cindex global offset table
17919 @cindex PIC
17920 Generate position-independent code (PIC) suitable for use in a shared
17921 library, if supported for the target machine.  Such code accesses all
17922 constant addresses through a global offset table (GOT)@.  The dynamic
17923 loader resolves the GOT entries when the program starts (the dynamic
17924 loader is not part of GCC; it is part of the operating system).  If
17925 the GOT size for the linked executable exceeds a machine-specific
17926 maximum size, you get an error message from the linker indicating that
17927 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
17928 instead.  (These maximums are 8k on the SPARC and 32k
17929 on the m68k and RS/6000.  The 386 has no such limit.)
17930
17931 Position-independent code requires special support, and therefore works
17932 only on certain machines.  For the 386, GCC supports PIC for System V
17933 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
17934 position-independent.
17935
17936 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17937 are defined to 1.
17938
17939 @item -fPIC
17940 @opindex fPIC
17941 If supported for the target machine, emit position-independent code,
17942 suitable for dynamic linking and avoiding any limit on the size of the
17943 global offset table.  This option makes a difference on the m68k,
17944 PowerPC and SPARC@.
17945
17946 Position-independent code requires special support, and therefore works
17947 only on certain machines.
17948
17949 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17950 are defined to 2.
17951
17952 @item -fpie
17953 @itemx -fPIE
17954 @opindex fpie
17955 @opindex fPIE
17956 These options are similar to @option{-fpic} and @option{-fPIC}, but
17957 generated position independent code can be only linked into executables.
17958 Usually these options are used when @option{-pie} GCC option will be
17959 used during linking.
17960
17961 @option{-fpie} and @option{-fPIE} both define the macros
17962 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
17963 for @option{-fpie} and 2 for @option{-fPIE}.
17964
17965 @item -fno-jump-tables
17966 @opindex fno-jump-tables
17967 Do not use jump tables for switch statements even where it would be
17968 more efficient than other code generation strategies.  This option is
17969 of use in conjunction with @option{-fpic} or @option{-fPIC} for
17970 building code which forms part of a dynamic linker and cannot
17971 reference the address of a jump table.  On some targets, jump tables
17972 do not require a GOT and this option is not needed.
17973
17974 @item -ffixed-@var{reg}
17975 @opindex ffixed
17976 Treat the register named @var{reg} as a fixed register; generated code
17977 should never refer to it (except perhaps as a stack pointer, frame
17978 pointer or in some other fixed role).
17979
17980 @var{reg} must be the name of a register.  The register names accepted
17981 are machine-specific and are defined in the @code{REGISTER_NAMES}
17982 macro in the machine description macro file.
17983
17984 This flag does not have a negative form, because it specifies a
17985 three-way choice.
17986
17987 @item -fcall-used-@var{reg}
17988 @opindex fcall-used
17989 Treat the register named @var{reg} as an allocable register that is
17990 clobbered by function calls.  It may be allocated for temporaries or
17991 variables that do not live across a call.  Functions compiled this way
17992 will not save and restore the register @var{reg}.
17993
17994 It is an error to used this flag with the frame pointer or stack pointer.
17995 Use of this flag for other registers that have fixed pervasive roles in
17996 the machine's execution model will produce disastrous results.
17997
17998 This flag does not have a negative form, because it specifies a
17999 three-way choice.
18000
18001 @item -fcall-saved-@var{reg}
18002 @opindex fcall-saved
18003 Treat the register named @var{reg} as an allocable register saved by
18004 functions.  It may be allocated even for temporaries or variables that
18005 live across a call.  Functions compiled this way will save and restore
18006 the register @var{reg} if they use it.
18007
18008 It is an error to used this flag with the frame pointer or stack pointer.
18009 Use of this flag for other registers that have fixed pervasive roles in
18010 the machine's execution model will produce disastrous results.
18011
18012 A different sort of disaster will result from the use of this flag for
18013 a register in which function values may be returned.
18014
18015 This flag does not have a negative form, because it specifies a
18016 three-way choice.
18017
18018 @item -fpack-struct[=@var{n}]
18019 @opindex fpack-struct
18020 Without a value specified, pack all structure members together without
18021 holes.  When a value is specified (which must be a small power of two), pack
18022 structure members according to this value, representing the maximum
18023 alignment (that is, objects with default alignment requirements larger than
18024 this will be output potentially unaligned at the next fitting location.
18025
18026 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
18027 code that is not binary compatible with code generated without that switch.
18028 Additionally, it makes the code suboptimal.
18029 Use it to conform to a non-default application binary interface.
18030
18031 @item -finstrument-functions
18032 @opindex finstrument-functions
18033 Generate instrumentation calls for entry and exit to functions.  Just
18034 after function entry and just before function exit, the following
18035 profiling functions will be called with the address of the current
18036 function and its call site.  (On some platforms,
18037 @code{__builtin_return_address} does not work beyond the current
18038 function, so the call site information may not be available to the
18039 profiling functions otherwise.)
18040
18041 @smallexample
18042 void __cyg_profile_func_enter (void *this_fn,
18043                                void *call_site);
18044 void __cyg_profile_func_exit  (void *this_fn,
18045                                void *call_site);
18046 @end smallexample
18047
18048 The first argument is the address of the start of the current function,
18049 which may be looked up exactly in the symbol table.
18050
18051 This instrumentation is also done for functions expanded inline in other
18052 functions.  The profiling calls will indicate where, conceptually, the
18053 inline function is entered and exited.  This means that addressable
18054 versions of such functions must be available.  If all your uses of a
18055 function are expanded inline, this may mean an additional expansion of
18056 code size.  If you use @samp{extern inline} in your C code, an
18057 addressable version of such functions must be provided.  (This is
18058 normally the case anyways, but if you get lucky and the optimizer always
18059 expands the functions inline, you might have gotten away without
18060 providing static copies.)
18061
18062 A function may be given the attribute @code{no_instrument_function}, in
18063 which case this instrumentation will not be done.  This can be used, for
18064 example, for the profiling functions listed above, high-priority
18065 interrupt routines, and any functions from which the profiling functions
18066 cannot safely be called (perhaps signal handlers, if the profiling
18067 routines generate output or allocate memory).
18068
18069 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
18070 @opindex finstrument-functions-exclude-file-list
18071
18072 Set the list of functions that are excluded from instrumentation (see
18073 the description of @code{-finstrument-functions}).  If the file that
18074 contains a function definition matches with one of @var{file}, then
18075 that function is not instrumented.  The match is done on substrings:
18076 if the @var{file} parameter is a substring of the file name, it is
18077 considered to be a match.
18078
18079 For example:
18080
18081 @smallexample
18082 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
18083 @end smallexample
18084
18085 @noindent
18086 will exclude any inline function defined in files whose pathnames
18087 contain @code{/bits/stl} or @code{include/sys}.
18088
18089 If, for some reason, you want to include letter @code{','} in one of
18090 @var{sym}, write @code{'\,'}. For example,
18091 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
18092 (note the single quote surrounding the option).
18093
18094 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
18095 @opindex finstrument-functions-exclude-function-list
18096
18097 This is similar to @code{-finstrument-functions-exclude-file-list},
18098 but this option sets the list of function names to be excluded from
18099 instrumentation.  The function name to be matched is its user-visible
18100 name, such as @code{vector<int> blah(const vector<int> &)}, not the
18101 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
18102 match is done on substrings: if the @var{sym} parameter is a substring
18103 of the function name, it is considered to be a match.  For C99 and C++
18104 extended identifiers, the function name must be given in UTF-8, not
18105 using universal character names.
18106
18107 @item -fstack-check
18108 @opindex fstack-check
18109 Generate code to verify that you do not go beyond the boundary of the
18110 stack.  You should specify this flag if you are running in an
18111 environment with multiple threads, but only rarely need to specify it in
18112 a single-threaded environment since stack overflow is automatically
18113 detected on nearly all systems if there is only one stack.
18114
18115 Note that this switch does not actually cause checking to be done; the
18116 operating system or the language runtime must do that.  The switch causes
18117 generation of code to ensure that they see the stack being extended.
18118
18119 You can additionally specify a string parameter: @code{no} means no
18120 checking, @code{generic} means force the use of old-style checking,
18121 @code{specific} means use the best checking method and is equivalent
18122 to bare @option{-fstack-check}.
18123
18124 Old-style checking is a generic mechanism that requires no specific
18125 target support in the compiler but comes with the following drawbacks:
18126
18127 @enumerate
18128 @item
18129 Modified allocation strategy for large objects: they will always be
18130 allocated dynamically if their size exceeds a fixed threshold.
18131
18132 @item
18133 Fixed limit on the size of the static frame of functions: when it is
18134 topped by a particular function, stack checking is not reliable and
18135 a warning is issued by the compiler.
18136
18137 @item
18138 Inefficiency: because of both the modified allocation strategy and the
18139 generic implementation, the performances of the code are hampered.
18140 @end enumerate
18141
18142 Note that old-style stack checking is also the fallback method for
18143 @code{specific} if no target support has been added in the compiler.
18144
18145 @item -fstack-limit-register=@var{reg}
18146 @itemx -fstack-limit-symbol=@var{sym}
18147 @itemx -fno-stack-limit
18148 @opindex fstack-limit-register
18149 @opindex fstack-limit-symbol
18150 @opindex fno-stack-limit
18151 Generate code to ensure that the stack does not grow beyond a certain value,
18152 either the value of a register or the address of a symbol.  If the stack
18153 would grow beyond the value, a signal is raised.  For most targets,
18154 the signal is raised before the stack overruns the boundary, so
18155 it is possible to catch the signal without taking special precautions.
18156
18157 For instance, if the stack starts at absolute address @samp{0x80000000}
18158 and grows downwards, you can use the flags
18159 @option{-fstack-limit-symbol=__stack_limit} and
18160 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
18161 of 128KB@.  Note that this may only work with the GNU linker.
18162
18163 @item -fsplit-stack
18164 @opindex fsplit-stack
18165 Generate code to automatically split the stack before it overflows.
18166 The resulting program has a discontiguous stack which can only
18167 overflow if the program is unable to allocate any more memory.  This
18168 is most useful when running threaded programs, as it is no longer
18169 necessary to calculate a good stack size to use for each thread.  This
18170 is currently only implemented for the i386 and x86_64 backends running
18171 GNU/Linux.
18172
18173 When code compiled with @option{-fsplit-stack} calls code compiled
18174 without @option{-fsplit-stack}, there may not be much stack space
18175 available for the latter code to run.  If compiling all code,
18176 including library code, with @option{-fsplit-stack} is not an option,
18177 then the linker can fix up these calls so that the code compiled
18178 without @option{-fsplit-stack} always has a large stack.  Support for
18179 this is implemented in the gold linker in GNU binutils release 2.21
18180 and later.
18181
18182 @item -fleading-underscore
18183 @opindex fleading-underscore
18184 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
18185 change the way C symbols are represented in the object file.  One use
18186 is to help link with legacy assembly code.
18187
18188 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
18189 generate code that is not binary compatible with code generated without that
18190 switch.  Use it to conform to a non-default application binary interface.
18191 Not all targets provide complete support for this switch.
18192
18193 @item -ftls-model=@var{model}
18194 @opindex ftls-model
18195 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
18196 The @var{model} argument should be one of @code{global-dynamic},
18197 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
18198
18199 The default without @option{-fpic} is @code{initial-exec}; with
18200 @option{-fpic} the default is @code{global-dynamic}.
18201
18202 @item -fvisibility=@var{default|internal|hidden|protected}
18203 @opindex fvisibility
18204 Set the default ELF image symbol visibility to the specified option---all
18205 symbols will be marked with this unless overridden within the code.
18206 Using this feature can very substantially improve linking and
18207 load times of shared object libraries, produce more optimized
18208 code, provide near-perfect API export and prevent symbol clashes.
18209 It is @strong{strongly} recommended that you use this in any shared objects
18210 you distribute.
18211
18212 Despite the nomenclature, @code{default} always means public; i.e.,
18213 available to be linked against from outside the shared object.
18214 @code{protected} and @code{internal} are pretty useless in real-world
18215 usage so the only other commonly used option will be @code{hidden}.
18216 The default if @option{-fvisibility} isn't specified is
18217 @code{default}, i.e., make every
18218 symbol public---this causes the same behavior as previous versions of
18219 GCC@.
18220
18221 A good explanation of the benefits offered by ensuring ELF
18222 symbols have the correct visibility is given by ``How To Write
18223 Shared Libraries'' by Ulrich Drepper (which can be found at
18224 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
18225 solution made possible by this option to marking things hidden when
18226 the default is public is to make the default hidden and mark things
18227 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
18228 and @code{__attribute__ ((visibility("default")))} instead of
18229 @code{__declspec(dllexport)} you get almost identical semantics with
18230 identical syntax.  This is a great boon to those working with
18231 cross-platform projects.
18232
18233 For those adding visibility support to existing code, you may find
18234 @samp{#pragma GCC visibility} of use.  This works by you enclosing
18235 the declarations you wish to set visibility for with (for example)
18236 @samp{#pragma GCC visibility push(hidden)} and
18237 @samp{#pragma GCC visibility pop}.
18238 Bear in mind that symbol visibility should be viewed @strong{as
18239 part of the API interface contract} and thus all new code should
18240 always specify visibility when it is not the default; i.e., declarations
18241 only for use within the local DSO should @strong{always} be marked explicitly
18242 as hidden as so to avoid PLT indirection overheads---making this
18243 abundantly clear also aids readability and self-documentation of the code.
18244 Note that due to ISO C++ specification requirements, operator new and
18245 operator delete must always be of default visibility.
18246
18247 Be aware that headers from outside your project, in particular system
18248 headers and headers from any other library you use, may not be
18249 expecting to be compiled with visibility other than the default.  You
18250 may need to explicitly say @samp{#pragma GCC visibility push(default)}
18251 before including any such headers.
18252
18253 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
18254 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
18255 no modifications.  However, this means that calls to @samp{extern}
18256 functions with no explicit visibility will use the PLT, so it is more
18257 effective to use @samp{__attribute ((visibility))} and/or
18258 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
18259 declarations should be treated as hidden.
18260
18261 Note that @samp{-fvisibility} does affect C++ vague linkage
18262 entities. This means that, for instance, an exception class that will
18263 be thrown between DSOs must be explicitly marked with default
18264 visibility so that the @samp{type_info} nodes will be unified between
18265 the DSOs.
18266
18267 An overview of these techniques, their benefits and how to use them
18268 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
18269
18270 @item -fstrict-volatile-bitfields
18271 @opindex fstrict-volatile-bitfields
18272 This option should be used if accesses to volatile bitfields (or other
18273 structure fields, although the compiler usually honors those types
18274 anyway) should use a single access of the width of the
18275 field's type, aligned to a natural alignment if possible.  For
18276 example, targets with memory-mapped peripheral registers might require
18277 all such accesses to be 16 bits wide; with this flag the user could
18278 declare all peripheral bitfields as ``unsigned short'' (assuming short
18279 is 16 bits on these targets) to force GCC to use 16 bit accesses
18280 instead of, perhaps, a more efficient 32 bit access.
18281
18282 If this option is disabled, the compiler will use the most efficient
18283 instruction.  In the previous example, that might be a 32-bit load
18284 instruction, even though that will access bytes that do not contain
18285 any portion of the bitfield, or memory-mapped registers unrelated to
18286 the one being updated.
18287
18288 If the target requires strict alignment, and honoring the field
18289 type would require violating this alignment, a warning is issued.
18290 If the field has @code{packed} attribute, the access is done without
18291 honoring the field type.  If the field doesn't have @code{packed}
18292 attribute, the access is done honoring the field type.  In both cases,
18293 GCC assumes that the user knows something about the target hardware
18294 that it is unaware of.
18295
18296 The default value of this option is determined by the application binary
18297 interface for the target processor.
18298
18299 @end table
18300
18301 @c man end
18302
18303 @node Environment Variables
18304 @section Environment Variables Affecting GCC
18305 @cindex environment variables
18306
18307 @c man begin ENVIRONMENT
18308 This section describes several environment variables that affect how GCC
18309 operates.  Some of them work by specifying directories or prefixes to use
18310 when searching for various kinds of files.  Some are used to specify other
18311 aspects of the compilation environment.
18312
18313 Note that you can also specify places to search using options such as
18314 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
18315 take precedence over places specified using environment variables, which
18316 in turn take precedence over those specified by the configuration of GCC@.
18317 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
18318 GNU Compiler Collection (GCC) Internals}.
18319
18320 @table @env
18321 @item LANG
18322 @itemx LC_CTYPE
18323 @c @itemx LC_COLLATE
18324 @itemx LC_MESSAGES
18325 @c @itemx LC_MONETARY
18326 @c @itemx LC_NUMERIC
18327 @c @itemx LC_TIME
18328 @itemx LC_ALL
18329 @findex LANG
18330 @findex LC_CTYPE
18331 @c @findex LC_COLLATE
18332 @findex LC_MESSAGES
18333 @c @findex LC_MONETARY
18334 @c @findex LC_NUMERIC
18335 @c @findex LC_TIME
18336 @findex LC_ALL
18337 @cindex locale
18338 These environment variables control the way that GCC uses
18339 localization information that allow GCC to work with different
18340 national conventions.  GCC inspects the locale categories
18341 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
18342 so.  These locale categories can be set to any value supported by your
18343 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
18344 Kingdom encoded in UTF-8.
18345
18346 The @env{LC_CTYPE} environment variable specifies character
18347 classification.  GCC uses it to determine the character boundaries in
18348 a string; this is needed for some multibyte encodings that contain quote
18349 and escape characters that would otherwise be interpreted as a string
18350 end or escape.
18351
18352 The @env{LC_MESSAGES} environment variable specifies the language to
18353 use in diagnostic messages.
18354
18355 If the @env{LC_ALL} environment variable is set, it overrides the value
18356 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
18357 and @env{LC_MESSAGES} default to the value of the @env{LANG}
18358 environment variable.  If none of these variables are set, GCC
18359 defaults to traditional C English behavior.
18360
18361 @item TMPDIR
18362 @findex TMPDIR
18363 If @env{TMPDIR} is set, it specifies the directory to use for temporary
18364 files.  GCC uses temporary files to hold the output of one stage of
18365 compilation which is to be used as input to the next stage: for example,
18366 the output of the preprocessor, which is the input to the compiler
18367 proper.
18368
18369 @item GCC_COMPARE_DEBUG
18370 @findex GCC_COMPARE_DEBUG
18371 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
18372 @option{-fcompare-debug} to the compiler driver.  See the documentation
18373 of this option for more details.
18374
18375 @item GCC_EXEC_PREFIX
18376 @findex GCC_EXEC_PREFIX
18377 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
18378 names of the subprograms executed by the compiler.  No slash is added
18379 when this prefix is combined with the name of a subprogram, but you can
18380 specify a prefix that ends with a slash if you wish.
18381
18382 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
18383 an appropriate prefix to use based on the pathname it was invoked with.
18384
18385 If GCC cannot find the subprogram using the specified prefix, it
18386 tries looking in the usual places for the subprogram.
18387
18388 The default value of @env{GCC_EXEC_PREFIX} is
18389 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
18390 the installed compiler. In many cases @var{prefix} is the value
18391 of @code{prefix} when you ran the @file{configure} script.
18392
18393 Other prefixes specified with @option{-B} take precedence over this prefix.
18394
18395 This prefix is also used for finding files such as @file{crt0.o} that are
18396 used for linking.
18397
18398 In addition, the prefix is used in an unusual way in finding the
18399 directories to search for header files.  For each of the standard
18400 directories whose name normally begins with @samp{/usr/local/lib/gcc}
18401 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
18402 replacing that beginning with the specified prefix to produce an
18403 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
18404 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
18405 These alternate directories are searched first; the standard directories
18406 come next. If a standard directory begins with the configured
18407 @var{prefix} then the value of @var{prefix} is replaced by
18408 @env{GCC_EXEC_PREFIX} when looking for header files.
18409
18410 @item COMPILER_PATH
18411 @findex COMPILER_PATH
18412 The value of @env{COMPILER_PATH} is a colon-separated list of
18413 directories, much like @env{PATH}.  GCC tries the directories thus
18414 specified when searching for subprograms, if it can't find the
18415 subprograms using @env{GCC_EXEC_PREFIX}.
18416
18417 @item LIBRARY_PATH
18418 @findex LIBRARY_PATH
18419 The value of @env{LIBRARY_PATH} is a colon-separated list of
18420 directories, much like @env{PATH}.  When configured as a native compiler,
18421 GCC tries the directories thus specified when searching for special
18422 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
18423 using GCC also uses these directories when searching for ordinary
18424 libraries for the @option{-l} option (but directories specified with
18425 @option{-L} come first).
18426
18427 @item LANG
18428 @findex LANG
18429 @cindex locale definition
18430 This variable is used to pass locale information to the compiler.  One way in
18431 which this information is used is to determine the character set to be used
18432 when character literals, string literals and comments are parsed in C and C++.
18433 When the compiler is configured to allow multibyte characters,
18434 the following values for @env{LANG} are recognized:
18435
18436 @table @samp
18437 @item C-JIS
18438 Recognize JIS characters.
18439 @item C-SJIS
18440 Recognize SJIS characters.
18441 @item C-EUCJP
18442 Recognize EUCJP characters.
18443 @end table
18444
18445 If @env{LANG} is not defined, or if it has some other value, then the
18446 compiler will use mblen and mbtowc as defined by the default locale to
18447 recognize and translate multibyte characters.
18448 @end table
18449
18450 @noindent
18451 Some additional environments variables affect the behavior of the
18452 preprocessor.
18453
18454 @include cppenv.texi
18455
18456 @c man end
18457
18458 @node Precompiled Headers
18459 @section Using Precompiled Headers
18460 @cindex precompiled headers
18461 @cindex speed of compilation
18462
18463 Often large projects have many header files that are included in every
18464 source file.  The time the compiler takes to process these header files
18465 over and over again can account for nearly all of the time required to
18466 build the project.  To make builds faster, GCC allows users to
18467 `precompile' a header file; then, if builds can use the precompiled
18468 header file they will be much faster.
18469
18470 To create a precompiled header file, simply compile it as you would any
18471 other file, if necessary using the @option{-x} option to make the driver
18472 treat it as a C or C++ header file.  You will probably want to use a
18473 tool like @command{make} to keep the precompiled header up-to-date when
18474 the headers it contains change.
18475
18476 A precompiled header file will be searched for when @code{#include} is
18477 seen in the compilation.  As it searches for the included file
18478 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
18479 compiler looks for a precompiled header in each directory just before it
18480 looks for the include file in that directory.  The name searched for is
18481 the name specified in the @code{#include} with @samp{.gch} appended.  If
18482 the precompiled header file can't be used, it is ignored.
18483
18484 For instance, if you have @code{#include "all.h"}, and you have
18485 @file{all.h.gch} in the same directory as @file{all.h}, then the
18486 precompiled header file will be used if possible, and the original
18487 header will be used otherwise.
18488
18489 Alternatively, you might decide to put the precompiled header file in a
18490 directory and use @option{-I} to ensure that directory is searched
18491 before (or instead of) the directory containing the original header.
18492 Then, if you want to check that the precompiled header file is always
18493 used, you can put a file of the same name as the original header in this
18494 directory containing an @code{#error} command.
18495
18496 This also works with @option{-include}.  So yet another way to use
18497 precompiled headers, good for projects not designed with precompiled
18498 header files in mind, is to simply take most of the header files used by
18499 a project, include them from another header file, precompile that header
18500 file, and @option{-include} the precompiled header.  If the header files
18501 have guards against multiple inclusion, they will be skipped because
18502 they've already been included (in the precompiled header).
18503
18504 If you need to precompile the same header file for different
18505 languages, targets, or compiler options, you can instead make a
18506 @emph{directory} named like @file{all.h.gch}, and put each precompiled
18507 header in the directory, perhaps using @option{-o}.  It doesn't matter
18508 what you call the files in the directory, every precompiled header in
18509 the directory will be considered.  The first precompiled header
18510 encountered in the directory that is valid for this compilation will
18511 be used; they're searched in no particular order.
18512
18513 There are many other possibilities, limited only by your imagination,
18514 good sense, and the constraints of your build system.
18515
18516 A precompiled header file can be used only when these conditions apply:
18517
18518 @itemize
18519 @item
18520 Only one precompiled header can be used in a particular compilation.
18521
18522 @item
18523 A precompiled header can't be used once the first C token is seen.  You
18524 can have preprocessor directives before a precompiled header; you can
18525 even include a precompiled header from inside another header, so long as
18526 there are no C tokens before the @code{#include}.
18527
18528 @item
18529 The precompiled header file must be produced for the same language as
18530 the current compilation.  You can't use a C precompiled header for a C++
18531 compilation.
18532
18533 @item
18534 The precompiled header file must have been produced by the same compiler
18535 binary as the current compilation is using.
18536
18537 @item
18538 Any macros defined before the precompiled header is included must
18539 either be defined in the same way as when the precompiled header was
18540 generated, or must not affect the precompiled header, which usually
18541 means that they don't appear in the precompiled header at all.
18542
18543 The @option{-D} option is one way to define a macro before a
18544 precompiled header is included; using a @code{#define} can also do it.
18545 There are also some options that define macros implicitly, like
18546 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
18547 defined this way.
18548
18549 @item If debugging information is output when using the precompiled
18550 header, using @option{-g} or similar, the same kind of debugging information
18551 must have been output when building the precompiled header.  However,
18552 a precompiled header built using @option{-g} can be used in a compilation
18553 when no debugging information is being output.
18554
18555 @item The same @option{-m} options must generally be used when building
18556 and using the precompiled header.  @xref{Submodel Options},
18557 for any cases where this rule is relaxed.
18558
18559 @item Each of the following options must be the same when building and using
18560 the precompiled header:
18561
18562 @gccoptlist{-fexceptions}
18563
18564 @item
18565 Some other command-line options starting with @option{-f},
18566 @option{-p}, or @option{-O} must be defined in the same way as when
18567 the precompiled header was generated.  At present, it's not clear
18568 which options are safe to change and which are not; the safest choice
18569 is to use exactly the same options when generating and using the
18570 precompiled header.  The following are known to be safe:
18571
18572 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
18573 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
18574 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
18575 -pedantic-errors}
18576
18577 @end itemize
18578
18579 For all of these except the last, the compiler will automatically
18580 ignore the precompiled header if the conditions aren't met.  If you
18581 find an option combination that doesn't work and doesn't cause the
18582 precompiled header to be ignored, please consider filing a bug report,
18583 see @ref{Bugs}.
18584
18585 If you do use differing options when generating and using the
18586 precompiled header, the actual behavior will be a mixture of the
18587 behavior for the options.  For instance, if you use @option{-g} to
18588 generate the precompiled header but not when using it, you may or may
18589 not get debugging information for routines in the precompiled header.