OSDN Git Service

2011-03-11 Richard Guenther <rguenther@suse.de>
[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  -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 -fdiagnostics-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  -Wcpp  -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 @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  -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 -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 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
286 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
287 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
288 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
289 -fdump-statistics @gol
290 -fdump-tree-all @gol
291 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
292 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
294 -fdump-tree-ch @gol
295 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
296 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
297 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
298 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
299 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
300 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
301 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
302 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
303 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
304 -fdump-tree-nrv -fdump-tree-vect @gol
305 -fdump-tree-sink @gol
306 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
307 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
308 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
310 -ftree-vectorizer-verbose=@var{n} @gol
311 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
312 -fdump-final-insns=@var{file} @gol
313 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
314 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
315 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
316 -fenable-icf-debug @gol
317 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
318 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
319 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
320 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
321 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
322 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
323 -ggdb  -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
324 -gvms  -gxcoff  -gxcoff+ @gol
325 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
326 -fdebug-prefix-map=@var{old}=@var{new} @gol
327 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
328 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
329 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
330 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
331 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
332 -print-sysroot -print-sysroot-headers-suffix @gol
333 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
334
335 @item Optimization Options
336 @xref{Optimize Options,,Options that Control Optimization}.
337 @gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
338 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
339 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
340 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
341 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
342 -fcompare-elim -fcprop-registers -fcrossjumping @gol
343 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
344 -fcx-limited-range @gol
345 -fdata-sections -fdce -fdce -fdelayed-branch @gol
346 -fdelete-null-pointer-checks -fdse -fdevirtualize -fdse @gol
347 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol
348 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
349 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
350 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
351 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
352 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
353 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg @gol
354 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
355 -fipa-struct-reorg -fira-algorithm=@var{algorithm} @gol
356 -fira-region=@var{region} @gol
357 -fira-loop-pressure -fno-ira-share-save-slots @gol
358 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
359 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
360 -floop-block -floop-flatten -floop-interchange -floop-strip-mine @gol
361 -floop-parallelize-all -flto -flto-compression-level
362 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
363 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
364 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
365 -fno-default-inline @gol
366 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
367 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
368 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
369 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
370 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
371 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
372 -fprefetch-loop-arrays @gol
373 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
374 -fprofile-generate=@var{path} @gol
375 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
376 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
377 -freorder-blocks-and-partition -freorder-functions @gol
378 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
379 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
380 -fsched-spec-load -fsched-spec-load-dangerous @gol
381 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
382 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
383 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
384 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
385 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
386 -fselective-scheduling -fselective-scheduling2 @gol
387 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
388 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
389 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
390 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
391 -ftree-bit-ccp @gol
392 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
393 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
394 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
395 -ftree-loop-if-convert-stores -ftree-loop-im @gol
396 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
397 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
398 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
399 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
400 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
401 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
402 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
403 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
404 -fwhole-program -fwpa -fuse-linker-plugin @gol
405 --param @var{name}=@var{value}
406 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
407
408 @item Preprocessor Options
409 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
410 @gccoptlist{-A@var{question}=@var{answer} @gol
411 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
412 -C  -dD  -dI  -dM  -dN @gol
413 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
414 -idirafter @var{dir} @gol
415 -include @var{file}  -imacros @var{file} @gol
416 -iprefix @var{file}  -iwithprefix @var{dir} @gol
417 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
418 -imultilib @var{dir} -isysroot @var{dir} @gol
419 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
420 -P  -fworking-directory  -remap @gol
421 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
422 -Xpreprocessor @var{option}}
423
424 @item Assembler Option
425 @xref{Assembler Options,,Passing Options to the Assembler}.
426 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
427
428 @item Linker Options
429 @xref{Link Options,,Options for Linking}.
430 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
431 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
432 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
433 -shared-libgcc  -symbolic @gol
434 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
435 -u @var{symbol}}
436
437 @item Directory Options
438 @xref{Directory Options,,Options for Directory Search}.
439 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir}}
440 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I-
441 --sysroot=@var{dir}
442
443 @item Machine Dependent Options
444 @xref{Submodel Options,,Hardware Models and Configurations}.
445 @c This list is ordered alphanumerically by subsection name.
446 @c Try and put the significant identifier (CPU or system) first,
447 @c so users have a clue at guessing where the ones they want will be.
448
449 @emph{ARC Options}
450 @gccoptlist{-EB  -EL @gol
451 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
452 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
453
454 @emph{ARM Options}
455 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
456 -mabi=@var{name} @gol
457 -mapcs-stack-check  -mno-apcs-stack-check @gol
458 -mapcs-float  -mno-apcs-float @gol
459 -mapcs-reentrant  -mno-apcs-reentrant @gol
460 -msched-prolog  -mno-sched-prolog @gol
461 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
462 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
463 -mfp16-format=@var{name}
464 -mthumb-interwork  -mno-thumb-interwork @gol
465 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
466 -mstructure-size-boundary=@var{n} @gol
467 -mabort-on-noreturn @gol
468 -mlong-calls  -mno-long-calls @gol
469 -msingle-pic-base  -mno-single-pic-base @gol
470 -mpic-register=@var{reg} @gol
471 -mnop-fun-dllimport @gol
472 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
473 -mpoke-function-name @gol
474 -mthumb  -marm @gol
475 -mtpcs-frame  -mtpcs-leaf-frame @gol
476 -mcaller-super-interworking  -mcallee-super-interworking @gol
477 -mtp=@var{name} @gol
478 -mword-relocations @gol
479 -mfix-cortex-m3-ldrd}
480
481 @emph{AVR Options}
482 @gccoptlist{-mmcu=@var{mcu}  -mno-interrupts @gol
483 -mcall-prologues  -mtiny-stack  -mint8}
484
485 @emph{Blackfin Options}
486 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
487 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
488 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
489 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
490 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
491 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
492 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
493 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
494 -micplb}
495
496 @emph{CRIS Options}
497 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
498 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
499 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
500 -mstack-align  -mdata-align  -mconst-align @gol
501 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
502 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
503 -mmul-bug-workaround  -mno-mul-bug-workaround}
504
505 @emph{CRX Options}
506 @gccoptlist{-mmac -mpush-args}
507
508 @emph{Darwin Options}
509 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
510 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
511 -client_name  -compatibility_version  -current_version @gol
512 -dead_strip @gol
513 -dependency-file  -dylib_file  -dylinker_install_name @gol
514 -dynamic  -dynamiclib  -exported_symbols_list @gol
515 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
516 -force_flat_namespace  -headerpad_max_install_names @gol
517 -iframework @gol
518 -image_base  -init  -install_name  -keep_private_externs @gol
519 -multi_module  -multiply_defined  -multiply_defined_unused @gol
520 -noall_load   -no_dead_strip_inits_and_terms @gol
521 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
522 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
523 -private_bundle  -read_only_relocs  -sectalign @gol
524 -sectobjectsymbols  -whyload  -seg1addr @gol
525 -sectcreate  -sectobjectsymbols  -sectorder @gol
526 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
527 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
528 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
529 -single_module  -static  -sub_library  -sub_umbrella @gol
530 -twolevel_namespace  -umbrella  -undefined @gol
531 -unexported_symbols_list  -weak_reference_mismatches @gol
532 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
533 -mkernel -mone-byte-bool}
534
535 @emph{DEC Alpha Options}
536 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
537 -mieee  -mieee-with-inexact  -mieee-conformant @gol
538 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
539 -mtrap-precision=@var{mode}  -mbuild-constants @gol
540 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
541 -mbwx  -mmax  -mfix  -mcix @gol
542 -mfloat-vax  -mfloat-ieee @gol
543 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
544 -msmall-text  -mlarge-text @gol
545 -mmemory-latency=@var{time}}
546
547 @emph{DEC Alpha/VMS Options}
548 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
549
550 @emph{FR30 Options}
551 @gccoptlist{-msmall-model -mno-lsim}
552
553 @emph{FRV Options}
554 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
555 -mhard-float  -msoft-float @gol
556 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
557 -mdouble  -mno-double @gol
558 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
559 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
560 -mlinked-fp  -mlong-calls  -malign-labels @gol
561 -mlibrary-pic  -macc-4  -macc-8 @gol
562 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
563 -moptimize-membar -mno-optimize-membar @gol
564 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
565 -mvliw-branch  -mno-vliw-branch @gol
566 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
567 -mno-nested-cond-exec  -mtomcat-stats @gol
568 -mTLS -mtls @gol
569 -mcpu=@var{cpu}}
570
571 @emph{GNU/Linux Options}
572 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
573 -tno-android-cc -tno-android-ld}
574
575 @emph{H8/300 Options}
576 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
577
578 @emph{HPPA Options}
579 @gccoptlist{-march=@var{architecture-type} @gol
580 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
581 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
582 -mfixed-range=@var{register-range} @gol
583 -mjump-in-delay -mlinker-opt -mlong-calls @gol
584 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
585 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
586 -mno-jump-in-delay  -mno-long-load-store @gol
587 -mno-portable-runtime  -mno-soft-float @gol
588 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
589 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
590 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
591 -munix=@var{unix-std}  -nolibdld  -static  -threads}
592
593 @emph{i386 and x86-64 Options}
594 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
595 -mfpmath=@var{unit} @gol
596 -masm=@var{dialect}  -mno-fancy-math-387 @gol
597 -mno-fp-ret-in-387  -msoft-float @gol
598 -mno-wide-multiply  -mrtd  -malign-double @gol
599 -mpreferred-stack-boundary=@var{num}
600 -mincoming-stack-boundary=@var{num} @gol
601 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip -mvzeroupper @gol
602 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
603 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfused-madd @gol
604 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlwp @gol
605 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
606 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
607 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
608 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
609 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
610 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
611 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
612 -mcmodel=@var{code-model} -mabi=@var{name} @gol
613 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
614 -msse2avx -mfentry -m8bit-idiv}
615
616 @emph{IA-64 Options}
617 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
618 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
619 -mconstant-gp  -mauto-pic  -mfused-madd @gol
620 -minline-float-divide-min-latency @gol
621 -minline-float-divide-max-throughput @gol
622 -mno-inline-float-divide @gol
623 -minline-int-divide-min-latency @gol
624 -minline-int-divide-max-throughput  @gol
625 -mno-inline-int-divide @gol
626 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
627 -mno-inline-sqrt @gol
628 -mdwarf2-asm -mearly-stop-bits @gol
629 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
630 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
631 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
632 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
633 -msched-spec-ldc -msched-spec-control-ldc @gol
634 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
635 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
636 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
637 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
638
639 @emph{IA-64/VMS Options}
640 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
641
642 @emph{LM32 Options}
643 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
644 -msign-extend-enabled -muser-enabled}
645
646 @emph{M32R/D Options}
647 @gccoptlist{-m32r2 -m32rx -m32r @gol
648 -mdebug @gol
649 -malign-loops -mno-align-loops @gol
650 -missue-rate=@var{number} @gol
651 -mbranch-cost=@var{number} @gol
652 -mmodel=@var{code-size-model-type} @gol
653 -msdata=@var{sdata-type} @gol
654 -mno-flush-func -mflush-func=@var{name} @gol
655 -mno-flush-trap -mflush-trap=@var{number} @gol
656 -G @var{num}}
657
658 @emph{M32C Options}
659 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
660
661 @emph{M680x0 Options}
662 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
663 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
664 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
665 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
666 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
667 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
668 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
669 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
670 -mxgot -mno-xgot}
671
672 @emph{M68hc1x Options}
673 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
674 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
675 -msoft-reg-count=@var{count}}
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-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
725 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
726 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
727 -mflush-func=@var{func}  -mno-flush-func @gol
728 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
729 -mfp-exceptions -mno-fp-exceptions @gol
730 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
731 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
732
733 @emph{MMIX Options}
734 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
735 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
736 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
737 -mno-base-addresses  -msingle-exit  -mno-single-exit}
738
739 @emph{MN10300 Options}
740 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
741 -mno-am33 -mam33 -mam33-2 -mam34 @gol
742 -mtune=@var{cpu-type} @gol
743 -mreturn-pointer-on-d0 @gol
744 -mno-crt0  -mrelax -mliw}
745
746 @emph{PDP-11 Options}
747 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
748 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
749 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
750 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
751 -mbranch-expensive  -mbranch-cheap @gol
752 -munix-asm  -mdec-asm}
753
754 @emph{picoChip Options}
755 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
756 -msymbol-as-address -mno-inefficient-warnings}
757
758 @emph{PowerPC Options}
759 See RS/6000 and PowerPC Options.
760
761 @emph{RS/6000 and PowerPC Options}
762 @gccoptlist{-mcpu=@var{cpu-type} @gol
763 -mtune=@var{cpu-type} @gol
764 -mcmodel=@var{code-model} @gol
765 -mpower  -mno-power  -mpower2  -mno-power2 @gol
766 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
767 -maltivec  -mno-altivec @gol
768 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
769 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
770 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
771 -mfprnd  -mno-fprnd @gol
772 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
773 -mnew-mnemonics  -mold-mnemonics @gol
774 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
775 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
776 -malign-power  -malign-natural @gol
777 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
778 -msingle-float -mdouble-float -msimple-fpu @gol
779 -mstring  -mno-string  -mupdate  -mno-update @gol
780 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
781 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
782 -mstrict-align  -mno-strict-align  -mrelocatable @gol
783 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
784 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
785 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
786 -mprioritize-restricted-insns=@var{priority} @gol
787 -msched-costly-dep=@var{dependence_type} @gol
788 -minsert-sched-nops=@var{scheme} @gol
789 -mcall-sysv  -mcall-netbsd @gol
790 -maix-struct-return  -msvr4-struct-return @gol
791 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
792 -mblock-move-inline-limit=@var{num} @gol
793 -misel -mno-isel @gol
794 -misel=yes  -misel=no @gol
795 -mspe -mno-spe @gol
796 -mspe=yes  -mspe=no @gol
797 -mpaired @gol
798 -mgen-cell-microcode -mwarn-cell-microcode @gol
799 -mvrsave -mno-vrsave @gol
800 -mmulhw -mno-mulhw @gol
801 -mdlmzb -mno-dlmzb @gol
802 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
803 -mprototype  -mno-prototype @gol
804 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
805 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
806 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision
807 -mno-recip-precision @gol
808 -mveclibabi=@var{type} -mfriz -mno-friz}
809
810 @emph{RX Options}
811 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
812 -mcpu=@gol
813 -mbig-endian-data -mlittle-endian-data @gol
814 -msmall-data @gol
815 -msim  -mno-sim@gol
816 -mas100-syntax -mno-as100-syntax@gol
817 -mrelax@gol
818 -mmax-constant-size=@gol
819 -mint-register=@gol
820 -msave-acc-in-interrupts}
821
822 @emph{S/390 and zSeries Options}
823 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
824 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
825 -mlong-double-64 -mlong-double-128 @gol
826 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
827 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
828 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
829 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
830 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
831
832 @emph{Score Options}
833 @gccoptlist{-meb -mel @gol
834 -mnhwloop @gol
835 -muls @gol
836 -mmac @gol
837 -mscore5 -mscore5u -mscore7 -mscore7d}
838
839 @emph{SH Options}
840 @gccoptlist{-m1  -m2  -m2e @gol
841 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
842 -m3  -m3e @gol
843 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
844 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
845 -m5-64media  -m5-64media-nofpu @gol
846 -m5-32media  -m5-32media-nofpu @gol
847 -m5-compact  -m5-compact-nofpu @gol
848 -mb  -ml  -mdalign  -mrelax @gol
849 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
850 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
851 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
852 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
853 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
854 -maccumulate-outgoing-args -minvalid-symbols}
855
856 @emph{Solaris 2 Options}
857 @gccoptlist{-mimpure-text  -mno-impure-text @gol
858 -threads -pthreads -pthread}
859
860 @emph{SPARC Options}
861 @gccoptlist{-mcpu=@var{cpu-type} @gol
862 -mtune=@var{cpu-type} @gol
863 -mcmodel=@var{code-model} @gol
864 -m32  -m64  -mapp-regs  -mno-app-regs @gol
865 -mfaster-structs  -mno-faster-structs @gol
866 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
867 -mhard-quad-float  -msoft-quad-float @gol
868 -mlittle-endian @gol
869 -mstack-bias  -mno-stack-bias @gol
870 -munaligned-doubles  -mno-unaligned-doubles @gol
871 -mv8plus  -mno-v8plus  -mvis  -mno-vis}
872
873 @emph{SPU Options}
874 @gccoptlist{-mwarn-reloc -merror-reloc @gol
875 -msafe-dma -munsafe-dma @gol
876 -mbranch-hints @gol
877 -msmall-mem -mlarge-mem -mstdmain @gol
878 -mfixed-range=@var{register-range} @gol
879 -mea32 -mea64 @gol
880 -maddress-space-conversion -mno-address-space-conversion @gol
881 -mcache-size=@var{cache-size} @gol
882 -matomic-updates -mno-atomic-updates}
883
884 @emph{System V Options}
885 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
886
887 @emph{V850 Options}
888 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
889 -mprolog-function  -mno-prolog-function  -mspace @gol
890 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
891 -mapp-regs  -mno-app-regs @gol
892 -mdisable-callt  -mno-disable-callt @gol
893 -mv850e2v3 @gol
894 -mv850e2 @gol
895 -mv850e1 -mv850es @gol
896 -mv850e @gol
897 -mv850  -mbig-switch}
898
899 @emph{VAX Options}
900 @gccoptlist{-mg  -mgnu  -munix}
901
902 @emph{VxWorks Options}
903 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
904 -Xbind-lazy  -Xbind-now}
905
906 @emph{x86-64 Options}
907 See i386 and x86-64 Options.
908
909 @emph{i386 and x86-64 Windows Options}
910 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
911 -mnop-fun-dllimport -mthread @gol
912 -municode -mwin32 -mwindows -fno-set-stack-executable}
913
914 @emph{Xstormy16 Options}
915 @gccoptlist{-msim}
916
917 @emph{Xtensa Options}
918 @gccoptlist{-mconst16 -mno-const16 @gol
919 -mfused-madd  -mno-fused-madd @gol
920 -mforce-no-pic @gol
921 -mserialize-volatile  -mno-serialize-volatile @gol
922 -mtext-section-literals  -mno-text-section-literals @gol
923 -mtarget-align  -mno-target-align @gol
924 -mlongcalls  -mno-longcalls}
925
926 @emph{zSeries Options}
927 See S/390 and zSeries Options.
928
929 @item Code Generation Options
930 @xref{Code Gen Options,,Options for Code Generation Conventions}.
931 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
932 -ffixed-@var{reg}  -fexceptions @gol
933 -fnon-call-exceptions  -funwind-tables @gol
934 -fasynchronous-unwind-tables @gol
935 -finhibit-size-directive  -finstrument-functions @gol
936 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
937 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
938 -fno-common  -fno-ident @gol
939 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
940 -fno-jump-tables @gol
941 -frecord-gcc-switches @gol
942 -freg-struct-return  -fshort-enums @gol
943 -fshort-double  -fshort-wchar @gol
944 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
945 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
946 -fno-stack-limit -fsplit-stack @gol
947 -fleading-underscore  -ftls-model=@var{model} @gol
948 -ftrapv  -fwrapv  -fbounds-check @gol
949 -fvisibility -fstrict-volatile-bitfields}
950 @end table
951
952 @menu
953 * Overall Options::     Controlling the kind of output:
954                         an executable, object files, assembler files,
955                         or preprocessed source.
956 * C Dialect Options::   Controlling the variant of C language compiled.
957 * C++ Dialect Options:: Variations on C++.
958 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
959                         and Objective-C++.
960 * Language Independent Options:: Controlling how diagnostics should be
961                         formatted.
962 * Warning Options::     How picky should the compiler be?
963 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
964 * Optimize Options::    How much optimization?
965 * Preprocessor Options:: Controlling header files and macro definitions.
966                          Also, getting dependency information for Make.
967 * Assembler Options::   Passing options to the assembler.
968 * Link Options::        Specifying libraries and so on.
969 * Directory Options::   Where to find header files and libraries.
970                         Where to find the compiler executable files.
971 * Spec Files::          How to pass switches to sub-processes.
972 * Target Options::      Running a cross-compiler, or an old version of GCC.
973 @end menu
974
975 @node Overall Options
976 @section Options Controlling the Kind of Output
977
978 Compilation can involve up to four stages: preprocessing, compilation
979 proper, assembly and linking, always in that order.  GCC is capable of
980 preprocessing and compiling several files either into several
981 assembler input files, or into one assembler input file; then each
982 assembler input file produces an object file, and linking combines all
983 the object files (those newly compiled, and those specified as input)
984 into an executable file.
985
986 @cindex file name suffix
987 For any given input file, the file name suffix determines what kind of
988 compilation is done:
989
990 @table @gcctabopt
991 @item @var{file}.c
992 C source code which must be preprocessed.
993
994 @item @var{file}.i
995 C source code which should not be preprocessed.
996
997 @item @var{file}.ii
998 C++ source code which should not be preprocessed.
999
1000 @item @var{file}.m
1001 Objective-C source code.  Note that you must link with the @file{libobjc}
1002 library to make an Objective-C program work.
1003
1004 @item @var{file}.mi
1005 Objective-C source code which should not be preprocessed.
1006
1007 @item @var{file}.mm
1008 @itemx @var{file}.M
1009 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1010 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1011 to a literal capital M@.
1012
1013 @item @var{file}.mii
1014 Objective-C++ source code which should not be preprocessed.
1015
1016 @item @var{file}.h
1017 C, C++, Objective-C or Objective-C++ header file to be turned into a
1018 precompiled header (default), or C, C++ header file to be turned into an
1019 Ada spec (via the @option{-fdump-ada-spec} switch).
1020
1021 @item @var{file}.cc
1022 @itemx @var{file}.cp
1023 @itemx @var{file}.cxx
1024 @itemx @var{file}.cpp
1025 @itemx @var{file}.CPP
1026 @itemx @var{file}.c++
1027 @itemx @var{file}.C
1028 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
1029 the last two letters must both be literally @samp{x}.  Likewise,
1030 @samp{.C} refers to a literal capital C@.
1031
1032 @item @var{file}.mm
1033 @itemx @var{file}.M
1034 Objective-C++ source code which must be preprocessed.
1035
1036 @item @var{file}.mii
1037 Objective-C++ source code which should not be preprocessed.
1038
1039 @item @var{file}.hh
1040 @itemx @var{file}.H
1041 @itemx @var{file}.hp
1042 @itemx @var{file}.hxx
1043 @itemx @var{file}.hpp
1044 @itemx @var{file}.HPP
1045 @itemx @var{file}.h++
1046 @itemx @var{file}.tcc
1047 C++ header file to be turned into a precompiled header or Ada spec.
1048
1049 @item @var{file}.f
1050 @itemx @var{file}.for
1051 @itemx @var{file}.ftn
1052 Fixed form Fortran source code which should not be preprocessed.
1053
1054 @item @var{file}.F
1055 @itemx @var{file}.FOR
1056 @itemx @var{file}.fpp
1057 @itemx @var{file}.FPP
1058 @itemx @var{file}.FTN
1059 Fixed form Fortran source code which must be preprocessed (with the traditional
1060 preprocessor).
1061
1062 @item @var{file}.f90
1063 @itemx @var{file}.f95
1064 @itemx @var{file}.f03
1065 @itemx @var{file}.f08
1066 Free form Fortran source code which should not be preprocessed.
1067
1068 @item @var{file}.F90
1069 @itemx @var{file}.F95
1070 @itemx @var{file}.F03
1071 @itemx @var{file}.F08
1072 Free form Fortran source code which must be preprocessed (with the
1073 traditional preprocessor).
1074
1075 @item @var{file}.go
1076 Go source code.
1077
1078 @c FIXME: Descriptions of Java file types.
1079 @c @var{file}.java
1080 @c @var{file}.class
1081 @c @var{file}.zip
1082 @c @var{file}.jar
1083
1084 @item @var{file}.ads
1085 Ada source code file which contains a library unit declaration (a
1086 declaration of a package, subprogram, or generic, or a generic
1087 instantiation), or a library unit renaming declaration (a package,
1088 generic, or subprogram renaming declaration).  Such files are also
1089 called @dfn{specs}.
1090
1091 @item @var{file}.adb
1092 Ada source code file containing a library unit body (a subprogram or
1093 package body).  Such files are also called @dfn{bodies}.
1094
1095 @c GCC also knows about some suffixes for languages not yet included:
1096 @c Pascal:
1097 @c @var{file}.p
1098 @c @var{file}.pas
1099 @c Ratfor:
1100 @c @var{file}.r
1101
1102 @item @var{file}.s
1103 Assembler code.
1104
1105 @item @var{file}.S
1106 @itemx @var{file}.sx
1107 Assembler code which must be preprocessed.
1108
1109 @item @var{other}
1110 An object file to be fed straight into linking.
1111 Any file name with no recognized suffix is treated this way.
1112 @end table
1113
1114 @opindex x
1115 You can specify the input language explicitly with the @option{-x} option:
1116
1117 @table @gcctabopt
1118 @item -x @var{language}
1119 Specify explicitly the @var{language} for the following input files
1120 (rather than letting the compiler choose a default based on the file
1121 name suffix).  This option applies to all following input files until
1122 the next @option{-x} option.  Possible values for @var{language} are:
1123 @smallexample
1124 c  c-header  cpp-output
1125 c++  c++-header  c++-cpp-output
1126 objective-c  objective-c-header  objective-c-cpp-output
1127 objective-c++ objective-c++-header objective-c++-cpp-output
1128 assembler  assembler-with-cpp
1129 ada
1130 f77  f77-cpp-input f95  f95-cpp-input
1131 go
1132 java
1133 @end smallexample
1134
1135 @item -x none
1136 Turn off any specification of a language, so that subsequent files are
1137 handled according to their file name suffixes (as they are if @option{-x}
1138 has not been used at all).
1139
1140 @item -pass-exit-codes
1141 @opindex pass-exit-codes
1142 Normally the @command{gcc} program will exit with the code of 1 if any
1143 phase of the compiler returns a non-success return code.  If you specify
1144 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1145 numerically highest error produced by any phase that returned an error
1146 indication.  The C, C++, and Fortran frontends return 4, if an internal
1147 compiler error is encountered.
1148 @end table
1149
1150 If you only want some of the stages of compilation, you can use
1151 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1152 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1153 @command{gcc} is to stop.  Note that some combinations (for example,
1154 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1155
1156 @table @gcctabopt
1157 @item -c
1158 @opindex c
1159 Compile or assemble the source files, but do not link.  The linking
1160 stage simply is not done.  The ultimate output is in the form of an
1161 object file for each source file.
1162
1163 By default, the object file name for a source file is made by replacing
1164 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1165
1166 Unrecognized input files, not requiring compilation or assembly, are
1167 ignored.
1168
1169 @item -S
1170 @opindex S
1171 Stop after the stage of compilation proper; do not assemble.  The output
1172 is in the form of an assembler code file for each non-assembler input
1173 file specified.
1174
1175 By default, the assembler file name for a source file is made by
1176 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1177
1178 Input files that don't require compilation are ignored.
1179
1180 @item -E
1181 @opindex E
1182 Stop after the preprocessing stage; do not run the compiler proper.  The
1183 output is in the form of preprocessed source code, which is sent to the
1184 standard output.
1185
1186 Input files which don't require preprocessing are ignored.
1187
1188 @cindex output file option
1189 @item -o @var{file}
1190 @opindex o
1191 Place output in file @var{file}.  This applies regardless to whatever
1192 sort of output is being produced, whether it be an executable file,
1193 an object file, an assembler file or preprocessed C code.
1194
1195 If @option{-o} is not specified, the default is to put an executable
1196 file in @file{a.out}, the object file for
1197 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1198 assembler file in @file{@var{source}.s}, a precompiled header file in
1199 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1200 standard output.
1201
1202 @item -v
1203 @opindex v
1204 Print (on standard error output) the commands executed to run the stages
1205 of compilation.  Also print the version number of the compiler driver
1206 program and of the preprocessor and the compiler proper.
1207
1208 @item -###
1209 @opindex ###
1210 Like @option{-v} except the commands are not executed and arguments
1211 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1212 This is useful for shell scripts to capture the driver-generated command lines.
1213
1214 @item -pipe
1215 @opindex pipe
1216 Use pipes rather than temporary files for communication between the
1217 various stages of compilation.  This fails to work on some systems where
1218 the assembler is unable to read from a pipe; but the GNU assembler has
1219 no trouble.
1220
1221 @item --help
1222 @opindex help
1223 Print (on the standard output) a description of the command line options
1224 understood by @command{gcc}.  If the @option{-v} option is also specified
1225 then @option{--help} will also be passed on to the various processes
1226 invoked by @command{gcc}, so that they can display the command line options
1227 they accept.  If the @option{-Wextra} option has also been specified
1228 (prior to the @option{--help} option), then command line options which
1229 have no documentation associated with them will also be displayed.
1230
1231 @item --target-help
1232 @opindex target-help
1233 Print (on the standard output) a description of target-specific command
1234 line options for each tool.  For some targets extra target-specific
1235 information may also be printed.
1236
1237 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1238 Print (on the standard output) a description of the command line
1239 options understood by the compiler that fit into all specified classes
1240 and qualifiers.  These are the supported classes:
1241
1242 @table @asis
1243 @item @samp{optimizers}
1244 This will display all of the optimization options supported by the
1245 compiler.
1246
1247 @item @samp{warnings}
1248 This will display all of the options controlling warning messages
1249 produced by the compiler.
1250
1251 @item @samp{target}
1252 This will display target-specific options.  Unlike the
1253 @option{--target-help} option however, target-specific options of the
1254 linker and assembler will not be displayed.  This is because those
1255 tools do not currently support the extended @option{--help=} syntax.
1256
1257 @item @samp{params}
1258 This will display the values recognized by the @option{--param}
1259 option.
1260
1261 @item @var{language}
1262 This will display the options supported for @var{language}, where
1263 @var{language} is the name of one of the languages supported in this
1264 version of GCC.
1265
1266 @item @samp{common}
1267 This will display the options that are common to all languages.
1268 @end table
1269
1270 These are the supported qualifiers:
1271
1272 @table @asis
1273 @item @samp{undocumented}
1274 Display only those options which are undocumented.
1275
1276 @item @samp{joined}
1277 Display options which take an argument that appears after an equal
1278 sign in the same continuous piece of text, such as:
1279 @samp{--help=target}.
1280
1281 @item @samp{separate}
1282 Display options which take an argument that appears as a separate word
1283 following the original option, such as: @samp{-o output-file}.
1284 @end table
1285
1286 Thus for example to display all the undocumented target-specific
1287 switches supported by the compiler the following can be used:
1288
1289 @smallexample
1290 --help=target,undocumented
1291 @end smallexample
1292
1293 The sense of a qualifier can be inverted by prefixing it with the
1294 @samp{^} character, so for example to display all binary warning
1295 options (i.e., ones that are either on or off and that do not take an
1296 argument), which have a description the following can be used:
1297
1298 @smallexample
1299 --help=warnings,^joined,^undocumented
1300 @end smallexample
1301
1302 The argument to @option{--help=} should not consist solely of inverted
1303 qualifiers.
1304
1305 Combining several classes is possible, although this usually
1306 restricts the output by so much that there is nothing to display.  One
1307 case where it does work however is when one of the classes is
1308 @var{target}.  So for example to display all the target-specific
1309 optimization options the following can be used:
1310
1311 @smallexample
1312 --help=target,optimizers
1313 @end smallexample
1314
1315 The @option{--help=} option can be repeated on the command line.  Each
1316 successive use will display its requested class of options, skipping
1317 those that have already been displayed.
1318
1319 If the @option{-Q} option appears on the command line before the
1320 @option{--help=} option, then the descriptive text displayed by
1321 @option{--help=} is changed.  Instead of describing the displayed
1322 options, an indication is given as to whether the option is enabled,
1323 disabled or set to a specific value (assuming that the compiler
1324 knows this at the point where the @option{--help=} option is used).
1325
1326 Here is a truncated example from the ARM port of @command{gcc}:
1327
1328 @smallexample
1329   % gcc -Q -mabi=2 --help=target -c
1330   The following options are target specific:
1331   -mabi=                                2
1332   -mabort-on-noreturn                   [disabled]
1333   -mapcs                                [disabled]
1334 @end smallexample
1335
1336 The output is sensitive to the effects of previous command line
1337 options, so for example it is possible to find out which optimizations
1338 are enabled at @option{-O2} by using:
1339
1340 @smallexample
1341 -Q -O2 --help=optimizers
1342 @end smallexample
1343
1344 Alternatively you can discover which binary optimizations are enabled
1345 by @option{-O3} by using:
1346
1347 @smallexample
1348 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1349 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1350 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1351 @end smallexample
1352
1353 @item -no-canonical-prefixes
1354 @opindex no-canonical-prefixes
1355 Do not expand any symbolic links, resolve references to @samp{/../}
1356 or @samp{/./}, or make the path absolute when generating a relative
1357 prefix.
1358
1359 @item --version
1360 @opindex version
1361 Display the version number and copyrights of the invoked GCC@.
1362
1363 @item -wrapper
1364 @opindex wrapper
1365 Invoke all subcommands under a wrapper program.  The name of the
1366 wrapper program and its parameters are passed as a comma separated
1367 list.
1368
1369 @smallexample
1370 gcc -c t.c -wrapper gdb,--args
1371 @end smallexample
1372
1373 This will invoke all subprograms of @command{gcc} under
1374 @samp{gdb --args}, thus the invocation of @command{cc1} will be
1375 @samp{gdb --args cc1 @dots{}}.
1376
1377 @item -fplugin=@var{name}.so
1378 Load the plugin code in file @var{name}.so, assumed to be a
1379 shared object to be dlopen'd by the compiler.  The base name of
1380 the shared object file is used to identify the plugin for the
1381 purposes of argument parsing (See
1382 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1383 Each plugin should define the callback functions specified in the
1384 Plugins API.
1385
1386 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1387 Define an argument called @var{key} with a value of @var{value}
1388 for the plugin called @var{name}.
1389
1390 @item -fdump-ada-spec@r{[}-slim@r{]}
1391 For C and C++ source and include files, generate corresponding Ada
1392 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1393 GNAT User's Guide}, which provides detailed documentation on this feature.
1394
1395 @item -fdump-go-spec=@var{file}
1396 For input files in any language, generate corresponding Go
1397 declarations in @var{file}.  This generates Go @code{const},
1398 @code{type}, @code{var}, and @code{func} declarations which may be a
1399 useful way to start writing a Go interface to code written in some
1400 other language.
1401
1402 @include @value{srcdir}/../libiberty/at-file.texi
1403 @end table
1404
1405 @node Invoking G++
1406 @section Compiling C++ Programs
1407
1408 @cindex suffixes for C++ source
1409 @cindex C++ source file suffixes
1410 C++ source files conventionally use one of the suffixes @samp{.C},
1411 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1412 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1413 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1414 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1415 files with these names and compiles them as C++ programs even if you
1416 call the compiler the same way as for compiling C programs (usually
1417 with the name @command{gcc}).
1418
1419 @findex g++
1420 @findex c++
1421 However, the use of @command{gcc} does not add the C++ library.
1422 @command{g++} is a program that calls GCC and treats @samp{.c},
1423 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1424 files unless @option{-x} is used, and automatically specifies linking
1425 against the C++ library.  This program is also useful when
1426 precompiling a C header file with a @samp{.h} extension for use in C++
1427 compilations.  On many systems, @command{g++} is also installed with
1428 the name @command{c++}.
1429
1430 @cindex invoking @command{g++}
1431 When you compile C++ programs, you may specify many of the same
1432 command-line options that you use for compiling programs in any
1433 language; or command-line options meaningful for C and related
1434 languages; or options that are meaningful only for C++ programs.
1435 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1436 explanations of options for languages related to C@.
1437 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1438 explanations of options that are meaningful only for C++ programs.
1439
1440 @node C Dialect Options
1441 @section Options Controlling C Dialect
1442 @cindex dialect options
1443 @cindex language dialect options
1444 @cindex options, dialect
1445
1446 The following options control the dialect of C (or languages derived
1447 from C, such as C++, Objective-C and Objective-C++) that the compiler
1448 accepts:
1449
1450 @table @gcctabopt
1451 @cindex ANSI support
1452 @cindex ISO support
1453 @item -ansi
1454 @opindex ansi
1455 In C mode, this is equivalent to @samp{-std=c90}. In C++ mode, it is
1456 equivalent to @samp{-std=c++98}.
1457
1458 This turns off certain features of GCC that are incompatible with ISO
1459 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1460 such as the @code{asm} and @code{typeof} keywords, and
1461 predefined macros such as @code{unix} and @code{vax} that identify the
1462 type of system you are using.  It also enables the undesirable and
1463 rarely used ISO trigraph feature.  For the C compiler,
1464 it disables recognition of C++ style @samp{//} comments as well as
1465 the @code{inline} keyword.
1466
1467 The alternate keywords @code{__asm__}, @code{__extension__},
1468 @code{__inline__} and @code{__typeof__} continue to work despite
1469 @option{-ansi}.  You would not want to use them in an ISO C program, of
1470 course, but it is useful to put them in header files that might be included
1471 in compilations done with @option{-ansi}.  Alternate predefined macros
1472 such as @code{__unix__} and @code{__vax__} are also available, with or
1473 without @option{-ansi}.
1474
1475 The @option{-ansi} option does not cause non-ISO programs to be
1476 rejected gratuitously.  For that, @option{-pedantic} is required in
1477 addition to @option{-ansi}.  @xref{Warning Options}.
1478
1479 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1480 option is used.  Some header files may notice this macro and refrain
1481 from declaring certain functions or defining certain macros that the
1482 ISO standard doesn't call for; this is to avoid interfering with any
1483 programs that might use these names for other things.
1484
1485 Functions that would normally be built in but do not have semantics
1486 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1487 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1488 built-in functions provided by GCC}, for details of the functions
1489 affected.
1490
1491 @item -std=
1492 @opindex std
1493 Determine the language standard. @xref{Standards,,Language Standards
1494 Supported by GCC}, for details of these standard versions.  This option
1495 is currently only supported when compiling C or C++.
1496
1497 The compiler can accept several base standards, such as @samp{c90} or
1498 @samp{c++98}, and GNU dialects of those standards, such as
1499 @samp{gnu90} or @samp{gnu++98}.  By specifying a base standard, the
1500 compiler will accept all programs following that standard and those
1501 using GNU extensions that do not contradict it.  For example,
1502 @samp{-std=c90} turns off certain features of GCC that are
1503 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1504 keywords, but not other GNU extensions that do not have a meaning in
1505 ISO C90, such as omitting the middle term of a @code{?:}
1506 expression. On the other hand, by specifying a GNU dialect of a
1507 standard, all features the compiler support are enabled, even when
1508 those features change the meaning of the base standard and some
1509 strict-conforming programs may be rejected.  The particular standard
1510 is used by @option{-pedantic} to identify which features are GNU
1511 extensions given that version of the standard. For example
1512 @samp{-std=gnu90 -pedantic} would warn about C++ style @samp{//}
1513 comments, while @samp{-std=gnu99 -pedantic} would not.
1514
1515 A value for this option must be provided; possible values are
1516
1517 @table @samp
1518 @item c90
1519 @itemx c89
1520 @itemx iso9899:1990
1521 Support all ISO C90 programs (certain GNU extensions that conflict
1522 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1523
1524 @item iso9899:199409
1525 ISO C90 as modified in amendment 1.
1526
1527 @item c99
1528 @itemx c9x
1529 @itemx iso9899:1999
1530 @itemx iso9899:199x
1531 ISO C99.  Note that this standard is not yet fully supported; see
1532 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1533 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1534
1535 @item c1x
1536 ISO C1X, the draft of the next revision of the ISO C standard.
1537 Support is limited and experimental and features enabled by this
1538 option may be changed or removed if changed in or removed from the
1539 standard draft.
1540
1541 @item gnu90
1542 @itemx gnu89
1543 GNU dialect of ISO C90 (including some C99 features). This
1544 is the default for C code.
1545
1546 @item gnu99
1547 @itemx gnu9x
1548 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1549 this will become the default.  The name @samp{gnu9x} is deprecated.
1550
1551 @item gnu1x
1552 GNU dialect of ISO C1X.  Support is limited and experimental and
1553 features enabled by this option may be changed or removed if changed
1554 in or removed from the standard draft.
1555
1556 @item c++98
1557 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1558 C++ code.
1559
1560 @item gnu++98
1561 GNU dialect of @option{-std=c++98}.  This is the default for
1562 C++ code.
1563
1564 @item c++0x
1565 The working draft of the upcoming ISO C++0x standard. This option
1566 enables experimental features that are likely to be included in
1567 C++0x. The working draft is constantly changing, and any feature that is
1568 enabled by this flag may be removed from future versions of GCC if it is
1569 not part of the C++0x standard.
1570
1571 @item gnu++0x
1572 GNU dialect of @option{-std=c++0x}. This option enables
1573 experimental features that may be removed in future versions of GCC.
1574 @end table
1575
1576 @item -fgnu89-inline
1577 @opindex fgnu89-inline
1578 The option @option{-fgnu89-inline} tells GCC to use the traditional
1579 GNU semantics for @code{inline} functions when in C99 mode.
1580 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1581 is accepted and ignored by GCC versions 4.1.3 up to but not including
1582 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1583 C99 mode.  Using this option is roughly equivalent to adding the
1584 @code{gnu_inline} function attribute to all inline functions
1585 (@pxref{Function Attributes}).
1586
1587 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1588 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1589 specifies the default behavior).  This option was first supported in
1590 GCC 4.3.  This option is not supported in @option{-std=c90} or
1591 @option{-std=gnu90} mode.
1592
1593 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1594 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1595 in effect for @code{inline} functions.  @xref{Common Predefined
1596 Macros,,,cpp,The C Preprocessor}.
1597
1598 @item -aux-info @var{filename}
1599 @opindex aux-info
1600 Output to the given filename prototyped declarations for all functions
1601 declared and/or defined in a translation unit, including those in header
1602 files.  This option is silently ignored in any language other than C@.
1603
1604 Besides declarations, the file indicates, in comments, the origin of
1605 each declaration (source file and line), whether the declaration was
1606 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1607 @samp{O} for old, respectively, in the first character after the line
1608 number and the colon), and whether it came from a declaration or a
1609 definition (@samp{C} or @samp{F}, respectively, in the following
1610 character).  In the case of function definitions, a K&R-style list of
1611 arguments followed by their declarations is also provided, inside
1612 comments, after the declaration.
1613
1614 @item -fno-asm
1615 @opindex fno-asm
1616 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1617 keyword, so that code can use these words as identifiers.  You can use
1618 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1619 instead.  @option{-ansi} implies @option{-fno-asm}.
1620
1621 In C++, this switch only affects the @code{typeof} keyword, since
1622 @code{asm} and @code{inline} are standard keywords.  You may want to
1623 use the @option{-fno-gnu-keywords} flag instead, which has the same
1624 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1625 switch only affects the @code{asm} and @code{typeof} keywords, since
1626 @code{inline} is a standard keyword in ISO C99.
1627
1628 @item -fno-builtin
1629 @itemx -fno-builtin-@var{function}
1630 @opindex fno-builtin
1631 @cindex built-in functions
1632 Don't recognize built-in functions that do not begin with
1633 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1634 functions provided by GCC}, for details of the functions affected,
1635 including those which are not built-in functions when @option{-ansi} or
1636 @option{-std} options for strict ISO C conformance are used because they
1637 do not have an ISO standard meaning.
1638
1639 GCC normally generates special code to handle certain built-in functions
1640 more efficiently; for instance, calls to @code{alloca} may become single
1641 instructions that adjust the stack directly, and calls to @code{memcpy}
1642 may become inline copy loops.  The resulting code is often both smaller
1643 and faster, but since the function calls no longer appear as such, you
1644 cannot set a breakpoint on those calls, nor can you change the behavior
1645 of the functions by linking with a different library.  In addition,
1646 when a function is recognized as a built-in function, GCC may use
1647 information about that function to warn about problems with calls to
1648 that function, or to generate more efficient code, even if the
1649 resulting code still contains calls to that function.  For example,
1650 warnings are given with @option{-Wformat} for bad calls to
1651 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1652 known not to modify global memory.
1653
1654 With the @option{-fno-builtin-@var{function}} option
1655 only the built-in function @var{function} is
1656 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1657 function is named that is not built-in in this version of GCC, this
1658 option is ignored.  There is no corresponding
1659 @option{-fbuiltin-@var{function}} option; if you wish to enable
1660 built-in functions selectively when using @option{-fno-builtin} or
1661 @option{-ffreestanding}, you may define macros such as:
1662
1663 @smallexample
1664 #define abs(n)          __builtin_abs ((n))
1665 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1666 @end smallexample
1667
1668 @item -fhosted
1669 @opindex fhosted
1670 @cindex hosted environment
1671
1672 Assert that compilation takes place in a hosted environment.  This implies
1673 @option{-fbuiltin}.  A hosted environment is one in which the
1674 entire standard library is available, and in which @code{main} has a return
1675 type of @code{int}.  Examples are nearly everything except a kernel.
1676 This is equivalent to @option{-fno-freestanding}.
1677
1678 @item -ffreestanding
1679 @opindex ffreestanding
1680 @cindex hosted environment
1681
1682 Assert that compilation takes place in a freestanding environment.  This
1683 implies @option{-fno-builtin}.  A freestanding environment
1684 is one in which the standard library may not exist, and program startup may
1685 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1686 This is equivalent to @option{-fno-hosted}.
1687
1688 @xref{Standards,,Language Standards Supported by GCC}, for details of
1689 freestanding and hosted environments.
1690
1691 @item -fopenmp
1692 @opindex fopenmp
1693 @cindex OpenMP parallel
1694 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1695 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1696 compiler generates parallel code according to the OpenMP Application
1697 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1698 implies @option{-pthread}, and thus is only supported on targets that
1699 have support for @option{-pthread}.
1700
1701 @item -fms-extensions
1702 @opindex fms-extensions
1703 Accept some non-standard constructs used in Microsoft header files.
1704
1705 In C++ code, this allows member names in structures to be similar
1706 to previous types declarations.
1707
1708 @smallexample
1709 typedef int UOW;
1710 struct ABC @{
1711   UOW UOW;
1712 @};
1713 @end smallexample
1714
1715 Some cases of unnamed fields in structures and unions are only
1716 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1717 fields within structs/unions}, for details.
1718
1719 @item -fplan9-extensions
1720 Accept some non-standard constructs used in Plan 9 code.
1721
1722 This enables @option{-fms-extensions}, permits passing pointers to
1723 structures with anonymous fields to functions which expect pointers to
1724 elements of the type of the field, and permits referring to anonymous
1725 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1726 struct/union fields within structs/unions}, for details.  This is only
1727 supported for C, not C++.
1728
1729 @item -trigraphs
1730 @opindex trigraphs
1731 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1732 options for strict ISO C conformance) implies @option{-trigraphs}.
1733
1734 @item -no-integrated-cpp
1735 @opindex no-integrated-cpp
1736 Performs a compilation in two passes: preprocessing and compiling.  This
1737 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1738 @option{-B} option.  The user supplied compilation step can then add in
1739 an additional preprocessing step after normal preprocessing but before
1740 compiling.  The default is to use the integrated cpp (internal cpp)
1741
1742 The semantics of this option will change if "cc1", "cc1plus", and
1743 "cc1obj" are merged.
1744
1745 @cindex traditional C language
1746 @cindex C language, traditional
1747 @item -traditional
1748 @itemx -traditional-cpp
1749 @opindex traditional-cpp
1750 @opindex traditional
1751 Formerly, these options caused GCC to attempt to emulate a pre-standard
1752 C compiler.  They are now only supported with the @option{-E} switch.
1753 The preprocessor continues to support a pre-standard mode.  See the GNU
1754 CPP manual for details.
1755
1756 @item -fcond-mismatch
1757 @opindex fcond-mismatch
1758 Allow conditional expressions with mismatched types in the second and
1759 third arguments.  The value of such an expression is void.  This option
1760 is not supported for C++.
1761
1762 @item -flax-vector-conversions
1763 @opindex flax-vector-conversions
1764 Allow implicit conversions between vectors with differing numbers of
1765 elements and/or incompatible element types.  This option should not be
1766 used for new code.
1767
1768 @item -funsigned-char
1769 @opindex funsigned-char
1770 Let the type @code{char} be unsigned, like @code{unsigned char}.
1771
1772 Each kind of machine has a default for what @code{char} should
1773 be.  It is either like @code{unsigned char} by default or like
1774 @code{signed char} by default.
1775
1776 Ideally, a portable program should always use @code{signed char} or
1777 @code{unsigned char} when it depends on the signedness of an object.
1778 But many programs have been written to use plain @code{char} and
1779 expect it to be signed, or expect it to be unsigned, depending on the
1780 machines they were written for.  This option, and its inverse, let you
1781 make such a program work with the opposite default.
1782
1783 The type @code{char} is always a distinct type from each of
1784 @code{signed char} or @code{unsigned char}, even though its behavior
1785 is always just like one of those two.
1786
1787 @item -fsigned-char
1788 @opindex fsigned-char
1789 Let the type @code{char} be signed, like @code{signed char}.
1790
1791 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1792 the negative form of @option{-funsigned-char}.  Likewise, the option
1793 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1794
1795 @item -fsigned-bitfields
1796 @itemx -funsigned-bitfields
1797 @itemx -fno-signed-bitfields
1798 @itemx -fno-unsigned-bitfields
1799 @opindex fsigned-bitfields
1800 @opindex funsigned-bitfields
1801 @opindex fno-signed-bitfields
1802 @opindex fno-unsigned-bitfields
1803 These options control whether a bit-field is signed or unsigned, when the
1804 declaration does not use either @code{signed} or @code{unsigned}.  By
1805 default, such a bit-field is signed, because this is consistent: the
1806 basic integer types such as @code{int} are signed types.
1807 @end table
1808
1809 @node C++ Dialect Options
1810 @section Options Controlling C++ Dialect
1811
1812 @cindex compiler options, C++
1813 @cindex C++ options, command line
1814 @cindex options, C++
1815 This section describes the command-line options that are only meaningful
1816 for C++ programs; but you can also use most of the GNU compiler options
1817 regardless of what language your program is in.  For example, you
1818 might compile a file @code{firstClass.C} like this:
1819
1820 @smallexample
1821 g++ -g -frepo -O -c firstClass.C
1822 @end smallexample
1823
1824 @noindent
1825 In this example, only @option{-frepo} is an option meant
1826 only for C++ programs; you can use the other options with any
1827 language supported by GCC@.
1828
1829 Here is a list of options that are @emph{only} for compiling C++ programs:
1830
1831 @table @gcctabopt
1832
1833 @item -fabi-version=@var{n}
1834 @opindex fabi-version
1835 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1836 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1837 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1838 the version that conforms most closely to the C++ ABI specification.
1839 Therefore, the ABI obtained using version 0 will change as ABI bugs
1840 are fixed.
1841
1842 The default is version 2.
1843
1844 Version 3 corrects an error in mangling a constant address as a
1845 template argument.
1846
1847 Version 4 implements a standard mangling for vector types.
1848
1849 Version 5 corrects the mangling of attribute const/volatile on
1850 function pointer types, decltype of a plain decl, and use of a
1851 function parameter in the declaration of another parameter.
1852
1853 See also @option{-Wabi}.
1854
1855 @item -fno-access-control
1856 @opindex fno-access-control
1857 Turn off all access checking.  This switch is mainly useful for working
1858 around bugs in the access control code.
1859
1860 @item -fcheck-new
1861 @opindex fcheck-new
1862 Check that the pointer returned by @code{operator new} is non-null
1863 before attempting to modify the storage allocated.  This check is
1864 normally unnecessary because the C++ standard specifies that
1865 @code{operator new} will only return @code{0} if it is declared
1866 @samp{throw()}, in which case the compiler will always check the
1867 return value even without this option.  In all other cases, when
1868 @code{operator new} has a non-empty exception specification, memory
1869 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1870 @samp{new (nothrow)}.
1871
1872 @item -fconserve-space
1873 @opindex fconserve-space
1874 Put uninitialized or runtime-initialized global variables into the
1875 common segment, as C does.  This saves space in the executable at the
1876 cost of not diagnosing duplicate definitions.  If you compile with this
1877 flag and your program mysteriously crashes after @code{main()} has
1878 completed, you may have an object that is being destroyed twice because
1879 two definitions were merged.
1880
1881 This option is no longer useful on most targets, now that support has
1882 been added for putting variables into BSS without making them common.
1883
1884 @item -fno-deduce-init-list
1885 @opindex fno-deduce-init-list
1886 Disable deduction of a template type parameter as
1887 std::initializer_list from a brace-enclosed initializer list, i.e.
1888
1889 @smallexample
1890 template <class T> auto forward(T t) -> decltype (realfn (t))
1891 @{
1892   return realfn (t);
1893 @}
1894
1895 void f()
1896 @{
1897   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1898 @}
1899 @end smallexample
1900
1901 This option is present because this deduction is an extension to the
1902 current specification in the C++0x working draft, and there was
1903 some concern about potential overload resolution problems.
1904
1905 @item -ffriend-injection
1906 @opindex ffriend-injection
1907 Inject friend functions into the enclosing namespace, so that they are
1908 visible outside the scope of the class in which they are declared.
1909 Friend functions were documented to work this way in the old Annotated
1910 C++ Reference Manual, and versions of G++ before 4.1 always worked
1911 that way.  However, in ISO C++ a friend function which is not declared
1912 in an enclosing scope can only be found using argument dependent
1913 lookup.  This option causes friends to be injected as they were in
1914 earlier releases.
1915
1916 This option is for compatibility, and may be removed in a future
1917 release of G++.
1918
1919 @item -fno-elide-constructors
1920 @opindex fno-elide-constructors
1921 The C++ standard allows an implementation to omit creating a temporary
1922 which is only used to initialize another object of the same type.
1923 Specifying this option disables that optimization, and forces G++ to
1924 call the copy constructor in all cases.
1925
1926 @item -fno-enforce-eh-specs
1927 @opindex fno-enforce-eh-specs
1928 Don't generate code to check for violation of exception specifications
1929 at runtime.  This option violates the C++ standard, but may be useful
1930 for reducing code size in production builds, much like defining
1931 @samp{NDEBUG}.  This does not give user code permission to throw
1932 exceptions in violation of the exception specifications; the compiler
1933 will still optimize based on the specifications, so throwing an
1934 unexpected exception will result in undefined behavior.
1935
1936 @item -ffor-scope
1937 @itemx -fno-for-scope
1938 @opindex ffor-scope
1939 @opindex fno-for-scope
1940 If @option{-ffor-scope} is specified, the scope of variables declared in
1941 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1942 as specified by the C++ standard.
1943 If @option{-fno-for-scope} is specified, the scope of variables declared in
1944 a @i{for-init-statement} extends to the end of the enclosing scope,
1945 as was the case in old versions of G++, and other (traditional)
1946 implementations of C++.
1947
1948 The default if neither flag is given to follow the standard,
1949 but to allow and give a warning for old-style code that would
1950 otherwise be invalid, or have different behavior.
1951
1952 @item -fno-gnu-keywords
1953 @opindex fno-gnu-keywords
1954 Do not recognize @code{typeof} as a keyword, so that code can use this
1955 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1956 @option{-ansi} implies @option{-fno-gnu-keywords}.
1957
1958 @item -fno-implicit-templates
1959 @opindex fno-implicit-templates
1960 Never emit code for non-inline templates which are instantiated
1961 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1962 @xref{Template Instantiation}, for more information.
1963
1964 @item -fno-implicit-inline-templates
1965 @opindex fno-implicit-inline-templates
1966 Don't emit code for implicit instantiations of inline templates, either.
1967 The default is to handle inlines differently so that compiles with and
1968 without optimization will need the same set of explicit instantiations.
1969
1970 @item -fno-implement-inlines
1971 @opindex fno-implement-inlines
1972 To save space, do not emit out-of-line copies of inline functions
1973 controlled by @samp{#pragma implementation}.  This will cause linker
1974 errors if these functions are not inlined everywhere they are called.
1975
1976 @item -fms-extensions
1977 @opindex fms-extensions
1978 Disable pedantic warnings about constructs used in MFC, such as implicit
1979 int and getting a pointer to member function via non-standard syntax.
1980
1981 @item -fno-nonansi-builtins
1982 @opindex fno-nonansi-builtins
1983 Disable built-in declarations of functions that are not mandated by
1984 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1985 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1986
1987 @item -fnothrow-opt
1988 @opindex fnothrow-opt
1989 Treat a @code{throw()} exception specification as though it were a
1990 @code{noexcept} specification to reduce or eliminate the text size
1991 overhead relative to a function with no exception specification.  If
1992 the function has local variables of types with non-trivial
1993 destructors, the exception specification will actually make the
1994 function smaller because the EH cleanups for those variables can be
1995 optimized away.  The semantic effect is that an exception thrown out of
1996 a function with such an exception specification will result in a call
1997 to @code{terminate} rather than @code{unexpected}.
1998
1999 @item -fno-operator-names
2000 @opindex fno-operator-names
2001 Do not treat the operator name keywords @code{and}, @code{bitand},
2002 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2003 synonyms as keywords.
2004
2005 @item -fno-optional-diags
2006 @opindex fno-optional-diags
2007 Disable diagnostics that the standard says a compiler does not need to
2008 issue.  Currently, the only such diagnostic issued by G++ is the one for
2009 a name having multiple meanings within a class.
2010
2011 @item -fpermissive
2012 @opindex fpermissive
2013 Downgrade some diagnostics about nonconformant code from errors to
2014 warnings.  Thus, using @option{-fpermissive} will allow some
2015 nonconforming code to compile.
2016
2017 @item -fno-pretty-templates
2018 @opindex fno-pretty-templates
2019 When an error message refers to a specialization of a function
2020 template, the compiler will normally print the signature of the
2021 template followed by the template arguments and any typedefs or
2022 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2023 rather than @code{void f(int)}) so that it's clear which template is
2024 involved.  When an error message refers to a specialization of a class
2025 template, the compiler will omit any template arguments which match
2026 the default template arguments for that template.  If either of these
2027 behaviors make it harder to understand the error message rather than
2028 easier, using @option{-fno-pretty-templates} will disable them.
2029
2030 @item -frepo
2031 @opindex frepo
2032 Enable automatic template instantiation at link time.  This option also
2033 implies @option{-fno-implicit-templates}.  @xref{Template
2034 Instantiation}, for more information.
2035
2036 @item -fno-rtti
2037 @opindex fno-rtti
2038 Disable generation of information about every class with virtual
2039 functions for use by the C++ runtime type identification features
2040 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2041 of the language, you can save some space by using this flag.  Note that
2042 exception handling uses the same information, but it will generate it as
2043 needed. The @samp{dynamic_cast} operator can still be used for casts that
2044 do not require runtime type information, i.e.@: casts to @code{void *} or to
2045 unambiguous base classes.
2046
2047 @item -fstats
2048 @opindex fstats
2049 Emit statistics about front-end processing at the end of the compilation.
2050 This information is generally only useful to the G++ development team.
2051
2052 @item -fstrict-enums
2053 @opindex fstrict-enums
2054 Allow the compiler to optimize using the assumption that a value of
2055 enumeration type can only be one of the values of the enumeration (as
2056 defined in the C++ standard; basically, a value which can be
2057 represented in the minimum number of bits needed to represent all the
2058 enumerators).  This assumption may not be valid if the program uses a
2059 cast to convert an arbitrary integer value to the enumeration type.
2060
2061 @item -ftemplate-depth=@var{n}
2062 @opindex ftemplate-depth
2063 Set the maximum instantiation depth for template classes to @var{n}.
2064 A limit on the template instantiation depth is needed to detect
2065 endless recursions during template class instantiation.  ANSI/ISO C++
2066 conforming programs must not rely on a maximum depth greater than 17
2067 (changed to 1024 in C++0x).
2068
2069 @item -fno-threadsafe-statics
2070 @opindex fno-threadsafe-statics
2071 Do not emit the extra code to use the routines specified in the C++
2072 ABI for thread-safe initialization of local statics.  You can use this
2073 option to reduce code size slightly in code that doesn't need to be
2074 thread-safe.
2075
2076 @item -fuse-cxa-atexit
2077 @opindex fuse-cxa-atexit
2078 Register destructors for objects with static storage duration with the
2079 @code{__cxa_atexit} function rather than the @code{atexit} function.
2080 This option is required for fully standards-compliant handling of static
2081 destructors, but will only work if your C library supports
2082 @code{__cxa_atexit}.
2083
2084 @item -fno-use-cxa-get-exception-ptr
2085 @opindex fno-use-cxa-get-exception-ptr
2086 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2087 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
2088 if the runtime routine is not available.
2089
2090 @item -fvisibility-inlines-hidden
2091 @opindex fvisibility-inlines-hidden
2092 This switch declares that the user does not attempt to compare
2093 pointers to inline methods where the addresses of the two functions
2094 were taken in different shared objects.
2095
2096 The effect of this is that GCC may, effectively, mark inline methods with
2097 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2098 appear in the export table of a DSO and do not require a PLT indirection
2099 when used within the DSO@.  Enabling this option can have a dramatic effect
2100 on load and link times of a DSO as it massively reduces the size of the
2101 dynamic export table when the library makes heavy use of templates.
2102
2103 The behavior of this switch is not quite the same as marking the
2104 methods as hidden directly, because it does not affect static variables
2105 local to the function or cause the compiler to deduce that
2106 the function is defined in only one shared object.
2107
2108 You may mark a method as having a visibility explicitly to negate the
2109 effect of the switch for that method.  For example, if you do want to
2110 compare pointers to a particular inline method, you might mark it as
2111 having default visibility.  Marking the enclosing class with explicit
2112 visibility will have no effect.
2113
2114 Explicitly instantiated inline methods are unaffected by this option
2115 as their linkage might otherwise cross a shared library boundary.
2116 @xref{Template Instantiation}.
2117
2118 @item -fvisibility-ms-compat
2119 @opindex fvisibility-ms-compat
2120 This flag attempts to use visibility settings to make GCC's C++
2121 linkage model compatible with that of Microsoft Visual Studio.
2122
2123 The flag makes these changes to GCC's linkage model:
2124
2125 @enumerate
2126 @item
2127 It sets the default visibility to @code{hidden}, like
2128 @option{-fvisibility=hidden}.
2129
2130 @item
2131 Types, but not their members, are not hidden by default.
2132
2133 @item
2134 The One Definition Rule is relaxed for types without explicit
2135 visibility specifications which are defined in more than one different
2136 shared object: those declarations are permitted if they would have
2137 been permitted when this option was not used.
2138 @end enumerate
2139
2140 In new code it is better to use @option{-fvisibility=hidden} and
2141 export those classes which are intended to be externally visible.
2142 Unfortunately it is possible for code to rely, perhaps accidentally,
2143 on the Visual Studio behavior.
2144
2145 Among the consequences of these changes are that static data members
2146 of the same type with the same name but defined in different shared
2147 objects will be different, so changing one will not change the other;
2148 and that pointers to function members defined in different shared
2149 objects may not compare equal.  When this flag is given, it is a
2150 violation of the ODR to define types with the same name differently.
2151
2152 @item -fno-weak
2153 @opindex fno-weak
2154 Do not use weak symbol support, even if it is provided by the linker.
2155 By default, G++ will use weak symbols if they are available.  This
2156 option exists only for testing, and should not be used by end-users;
2157 it will result in inferior code and has no benefits.  This option may
2158 be removed in a future release of G++.
2159
2160 @item -nostdinc++
2161 @opindex nostdinc++
2162 Do not search for header files in the standard directories specific to
2163 C++, but do still search the other standard directories.  (This option
2164 is used when building the C++ library.)
2165 @end table
2166
2167 In addition, these optimization, warning, and code generation options
2168 have meanings only for C++ programs:
2169
2170 @table @gcctabopt
2171 @item -fno-default-inline
2172 @opindex fno-default-inline
2173 Do not assume @samp{inline} for functions defined inside a class scope.
2174 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2175 functions will have linkage like inline functions; they just won't be
2176 inlined by default.
2177
2178 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2179 @opindex Wabi
2180 @opindex Wno-abi
2181 Warn when G++ generates code that is probably not compatible with the
2182 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2183 all such cases, there are probably some cases that are not warned about,
2184 even though G++ is generating incompatible code.  There may also be
2185 cases where warnings are emitted even though the code that is generated
2186 will be compatible.
2187
2188 You should rewrite your code to avoid these warnings if you are
2189 concerned about the fact that code generated by G++ may not be binary
2190 compatible with code generated by other compilers.
2191
2192 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2193
2194 @itemize @bullet
2195
2196 @item
2197 A template with a non-type template parameter of reference type is
2198 mangled incorrectly:
2199 @smallexample
2200 extern int N;
2201 template <int &> struct S @{@};
2202 void n (S<N>) @{2@}
2203 @end smallexample
2204
2205 This is fixed in @option{-fabi-version=3}.
2206
2207 @item
2208 SIMD vector types declared using @code{__attribute ((vector_size))} are
2209 mangled in a non-standard way that does not allow for overloading of
2210 functions taking vectors of different sizes.
2211
2212 The mangling is changed in @option{-fabi-version=4}.
2213 @end itemize
2214
2215 The known incompatibilities in @option{-fabi-version=1} include:
2216
2217 @itemize @bullet
2218
2219 @item
2220 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2221 pack data into the same byte as a base class.  For example:
2222
2223 @smallexample
2224 struct A @{ virtual void f(); int f1 : 1; @};
2225 struct B : public A @{ int f2 : 1; @};
2226 @end smallexample
2227
2228 @noindent
2229 In this case, G++ will place @code{B::f2} into the same byte
2230 as@code{A::f1}; other compilers will not.  You can avoid this problem
2231 by explicitly padding @code{A} so that its size is a multiple of the
2232 byte size on your platform; that will cause G++ and other compilers to
2233 layout @code{B} identically.
2234
2235 @item
2236 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2237 tail padding when laying out virtual bases.  For example:
2238
2239 @smallexample
2240 struct A @{ virtual void f(); char c1; @};
2241 struct B @{ B(); char c2; @};
2242 struct C : public A, public virtual B @{@};
2243 @end smallexample
2244
2245 @noindent
2246 In this case, G++ will not place @code{B} into the tail-padding for
2247 @code{A}; other compilers will.  You can avoid this problem by
2248 explicitly padding @code{A} so that its size is a multiple of its
2249 alignment (ignoring virtual base classes); that will cause G++ and other
2250 compilers to layout @code{C} identically.
2251
2252 @item
2253 Incorrect handling of bit-fields with declared widths greater than that
2254 of their underlying types, when the bit-fields appear in a union.  For
2255 example:
2256
2257 @smallexample
2258 union U @{ int i : 4096; @};
2259 @end smallexample
2260
2261 @noindent
2262 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2263 union too small by the number of bits in an @code{int}.
2264
2265 @item
2266 Empty classes can be placed at incorrect offsets.  For example:
2267
2268 @smallexample
2269 struct A @{@};
2270
2271 struct B @{
2272   A a;
2273   virtual void f ();
2274 @};
2275
2276 struct C : public B, public A @{@};
2277 @end smallexample
2278
2279 @noindent
2280 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2281 it should be placed at offset zero.  G++ mistakenly believes that the
2282 @code{A} data member of @code{B} is already at offset zero.
2283
2284 @item
2285 Names of template functions whose types involve @code{typename} or
2286 template template parameters can be mangled incorrectly.
2287
2288 @smallexample
2289 template <typename Q>
2290 void f(typename Q::X) @{@}
2291
2292 template <template <typename> class Q>
2293 void f(typename Q<int>::X) @{@}
2294 @end smallexample
2295
2296 @noindent
2297 Instantiations of these templates may be mangled incorrectly.
2298
2299 @end itemize
2300
2301 It also warns psABI related changes.  The known psABI changes at this
2302 point include:
2303
2304 @itemize @bullet
2305
2306 @item
2307 For SYSV/x86-64, when passing union with long double, it is changed to
2308 pass in memory as specified in psABI.  For example:
2309
2310 @smallexample
2311 union U @{
2312   long double ld;
2313   int i;
2314 @};
2315 @end smallexample
2316
2317 @noindent
2318 @code{union U} will always be passed in memory.
2319
2320 @end itemize
2321
2322 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2323 @opindex Wctor-dtor-privacy
2324 @opindex Wno-ctor-dtor-privacy
2325 Warn when a class seems unusable because all the constructors or
2326 destructors in that class are private, and it has neither friends nor
2327 public static member functions.
2328
2329 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2330 @opindex Wnoexcept
2331 @opindex Wno-noexcept
2332 Warn when a noexcept-expression evaluates to false because of a call
2333 to a function that does not have a non-throwing exception
2334 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2335 the compiler to never throw an exception.
2336
2337 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2338 @opindex Wnon-virtual-dtor
2339 @opindex Wno-non-virtual-dtor
2340 Warn when a class has virtual functions and accessible non-virtual
2341 destructor, in which case it would be possible but unsafe to delete
2342 an instance of a derived class through a pointer to the base class.
2343 This warning is also enabled if -Weffc++ is specified.
2344
2345 @item -Wreorder @r{(C++ and Objective-C++ only)}
2346 @opindex Wreorder
2347 @opindex Wno-reorder
2348 @cindex reordering, warning
2349 @cindex warning for reordering of member initializers
2350 Warn when the order of member initializers given in the code does not
2351 match the order in which they must be executed.  For instance:
2352
2353 @smallexample
2354 struct A @{
2355   int i;
2356   int j;
2357   A(): j (0), i (1) @{ @}
2358 @};
2359 @end smallexample
2360
2361 The compiler will rearrange the member initializers for @samp{i}
2362 and @samp{j} to match the declaration order of the members, emitting
2363 a warning to that effect.  This warning is enabled by @option{-Wall}.
2364 @end table
2365
2366 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2367
2368 @table @gcctabopt
2369 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2370 @opindex Weffc++
2371 @opindex Wno-effc++
2372 Warn about violations of the following style guidelines from Scott Meyers'
2373 @cite{Effective C++} book:
2374
2375 @itemize @bullet
2376 @item
2377 Item 11:  Define a copy constructor and an assignment operator for classes
2378 with dynamically allocated memory.
2379
2380 @item
2381 Item 12:  Prefer initialization to assignment in constructors.
2382
2383 @item
2384 Item 14:  Make destructors virtual in base classes.
2385
2386 @item
2387 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2388
2389 @item
2390 Item 23:  Don't try to return a reference when you must return an object.
2391
2392 @end itemize
2393
2394 Also warn about violations of the following style guidelines from
2395 Scott Meyers' @cite{More Effective C++} book:
2396
2397 @itemize @bullet
2398 @item
2399 Item 6:  Distinguish between prefix and postfix forms of increment and
2400 decrement operators.
2401
2402 @item
2403 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2404
2405 @end itemize
2406
2407 When selecting this option, be aware that the standard library
2408 headers do not obey all of these guidelines; use @samp{grep -v}
2409 to filter out those warnings.
2410
2411 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2412 @opindex Wstrict-null-sentinel
2413 @opindex Wno-strict-null-sentinel
2414 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2415 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2416 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2417 it is guaranteed to be of the same size as a pointer.  But this use is
2418 not portable across different compilers.
2419
2420 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2421 @opindex Wno-non-template-friend
2422 @opindex Wnon-template-friend
2423 Disable warnings when non-templatized friend functions are declared
2424 within a template.  Since the advent of explicit template specification
2425 support in G++, if the name of the friend is an unqualified-id (i.e.,
2426 @samp{friend foo(int)}), the C++ language specification demands that the
2427 friend declare or define an ordinary, nontemplate function.  (Section
2428 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2429 could be interpreted as a particular specialization of a templatized
2430 function.  Because this non-conforming behavior is no longer the default
2431 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2432 check existing code for potential trouble spots and is on by default.
2433 This new compiler behavior can be turned off with
2434 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2435 but disables the helpful warning.
2436
2437 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2438 @opindex Wold-style-cast
2439 @opindex Wno-old-style-cast
2440 Warn if an old-style (C-style) cast to a non-void type is used within
2441 a C++ program.  The new-style casts (@samp{dynamic_cast},
2442 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2443 less vulnerable to unintended effects and much easier to search for.
2444
2445 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2446 @opindex Woverloaded-virtual
2447 @opindex Wno-overloaded-virtual
2448 @cindex overloaded virtual function, warning
2449 @cindex warning for overloaded virtual function
2450 Warn when a function declaration hides virtual functions from a
2451 base class.  For example, in:
2452
2453 @smallexample
2454 struct A @{
2455   virtual void f();
2456 @};
2457
2458 struct B: public A @{
2459   void f(int);
2460 @};
2461 @end smallexample
2462
2463 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2464 like:
2465
2466 @smallexample
2467 B* b;
2468 b->f();
2469 @end smallexample
2470
2471 will fail to compile.
2472
2473 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2474 @opindex Wno-pmf-conversions
2475 @opindex Wpmf-conversions
2476 Disable the diagnostic for converting a bound pointer to member function
2477 to a plain pointer.
2478
2479 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2480 @opindex Wsign-promo
2481 @opindex Wno-sign-promo
2482 Warn when overload resolution chooses a promotion from unsigned or
2483 enumerated type to a signed type, over a conversion to an unsigned type of
2484 the same size.  Previous versions of G++ would try to preserve
2485 unsignedness, but the standard mandates the current behavior.
2486
2487 @smallexample
2488 struct A @{
2489   operator int ();
2490   A& operator = (int);
2491 @};
2492
2493 main ()
2494 @{
2495   A a,b;
2496   a = b;
2497 @}
2498 @end smallexample
2499
2500 In this example, G++ will synthesize a default @samp{A& operator =
2501 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2502 @end table
2503
2504 @node Objective-C and Objective-C++ Dialect Options
2505 @section Options Controlling Objective-C and Objective-C++ Dialects
2506
2507 @cindex compiler options, Objective-C and Objective-C++
2508 @cindex Objective-C and Objective-C++ options, command line
2509 @cindex options, Objective-C and Objective-C++
2510 (NOTE: This manual does not describe the Objective-C and Objective-C++
2511 languages themselves.  @xref{Standards,,Language Standards
2512 Supported by GCC}, for references.)
2513
2514 This section describes the command-line options that are only meaningful
2515 for Objective-C and Objective-C++ programs, but you can also use most of
2516 the language-independent GNU compiler options.
2517 For example, you might compile a file @code{some_class.m} like this:
2518
2519 @smallexample
2520 gcc -g -fgnu-runtime -O -c some_class.m
2521 @end smallexample
2522
2523 @noindent
2524 In this example, @option{-fgnu-runtime} is an option meant only for
2525 Objective-C and Objective-C++ programs; you can use the other options with
2526 any language supported by GCC@.
2527
2528 Note that since Objective-C is an extension of the C language, Objective-C
2529 compilations may also use options specific to the C front-end (e.g.,
2530 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2531 C++-specific options (e.g., @option{-Wabi}).
2532
2533 Here is a list of options that are @emph{only} for compiling Objective-C
2534 and Objective-C++ programs:
2535
2536 @table @gcctabopt
2537 @item -fconstant-string-class=@var{class-name}
2538 @opindex fconstant-string-class
2539 Use @var{class-name} as the name of the class to instantiate for each
2540 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2541 class name is @code{NXConstantString} if the GNU runtime is being used, and
2542 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2543 @option{-fconstant-cfstrings} option, if also present, will override the
2544 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2545 to be laid out as constant CoreFoundation strings.
2546
2547 @item -fgnu-runtime
2548 @opindex fgnu-runtime
2549 Generate object code compatible with the standard GNU Objective-C
2550 runtime.  This is the default for most types of systems.
2551
2552 @item -fnext-runtime
2553 @opindex fnext-runtime
2554 Generate output compatible with the NeXT runtime.  This is the default
2555 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2556 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2557 used.
2558
2559 @item -fno-nil-receivers
2560 @opindex fno-nil-receivers
2561 Assume that all Objective-C message dispatches (@code{[receiver
2562 message:arg]}) in this translation unit ensure that the receiver is
2563 not @code{nil}.  This allows for more efficient entry points in the
2564 runtime to be used.  This option is only available in conjunction with
2565 the NeXT runtime and ABI version 0 or 1.
2566
2567 @item -fobjc-abi-version=@var{n}
2568 @opindex fobjc-abi-version
2569 Use version @var{n} of the Objective-C ABI for the selected runtime.
2570 This option is currently supported only for the NeXT runtime.  In that
2571 case, Version 0 is the traditional (32-bit) ABI without support for
2572 properties and other Objective-C 2.0 additions.  Version 1 is the
2573 traditional (32-bit) ABI with support for properties and other
2574 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2575 nothing is specified, the default is Version 0 on 32-bit target
2576 machines, and Version 2 on 64-bit target machines.
2577
2578 @item -fobjc-call-cxx-cdtors
2579 @opindex fobjc-call-cxx-cdtors
2580 For each Objective-C class, check if any of its instance variables is a
2581 C++ object with a non-trivial default constructor.  If so, synthesize a
2582 special @code{- (id) .cxx_construct} instance method that will run
2583 non-trivial default constructors on any such instance variables, in order,
2584 and then return @code{self}.  Similarly, check if any instance variable
2585 is a C++ object with a non-trivial destructor, and if so, synthesize a
2586 special @code{- (void) .cxx_destruct} method that will run
2587 all such default destructors, in reverse order.
2588
2589 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2590 methods thusly generated will only operate on instance variables
2591 declared in the current Objective-C class, and not those inherited
2592 from superclasses.  It is the responsibility of the Objective-C
2593 runtime to invoke all such methods in an object's inheritance
2594 hierarchy.  The @code{- (id) .cxx_construct} methods will be invoked
2595 by the runtime immediately after a new object instance is allocated;
2596 the @code{- (void) .cxx_destruct} methods will be invoked immediately
2597 before the runtime deallocates an object instance.
2598
2599 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2600 support for invoking the @code{- (id) .cxx_construct} and
2601 @code{- (void) .cxx_destruct} methods.
2602
2603 @item -fobjc-direct-dispatch
2604 @opindex fobjc-direct-dispatch
2605 Allow fast jumps to the message dispatcher.  On Darwin this is
2606 accomplished via the comm page.
2607
2608 @item -fobjc-exceptions
2609 @opindex fobjc-exceptions
2610 Enable syntactic support for structured exception handling in
2611 Objective-C, similar to what is offered by C++ and Java.  This option
2612 is required to use the Objective-C keywords @code{@@try},
2613 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2614 @code{@@synchronized}.  This option is available with both the GNU
2615 runtime and the NeXT runtime (but not available in conjunction with
2616 the NeXT runtime on Mac OS X 10.2 and earlier).
2617
2618 @item -fobjc-gc
2619 @opindex fobjc-gc
2620 Enable garbage collection (GC) in Objective-C and Objective-C++
2621 programs.  This option is only available with the NeXT runtime; the
2622 GNU runtime has a different garbage collection implementation that
2623 does not require special compiler flags.
2624
2625 @item -fobjc-nilcheck
2626 @opindex fobjc-nilcheck
2627 For the NeXT runtime with version 2 of the ABI, check for a nil
2628 receiver in method invocations before doing the actual method call.
2629 This is the default and can be disabled using
2630 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2631 checked for nil in this way no matter what this flag is set to.
2632 Currently this flag does nothing when the GNU runtime, or an older
2633 version of the NeXT runtime ABI, is used.
2634
2635 @item -fobjc-std=objc1
2636 @opindex fobjc-std
2637 Conform to the language syntax of Objective-C 1.0, the language
2638 recognized by GCC 4.0.  This only affects the Objective-C additions to
2639 the C/C++ language; it does not affect conformance to C/C++ standards,
2640 which is controlled by the separate C/C++ dialect option flags.  When
2641 this option is used with the Objective-C or Objective-C++ compiler,
2642 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2643 This is useful if you need to make sure that your Objective-C code can
2644 be compiled with older versions of GCC.
2645
2646 @item -freplace-objc-classes
2647 @opindex freplace-objc-classes
2648 Emit a special marker instructing @command{ld(1)} not to statically link in
2649 the resulting object file, and allow @command{dyld(1)} to load it in at
2650 run time instead.  This is used in conjunction with the Fix-and-Continue
2651 debugging mode, where the object file in question may be recompiled and
2652 dynamically reloaded in the course of program execution, without the need
2653 to restart the program itself.  Currently, Fix-and-Continue functionality
2654 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2655 and later.
2656
2657 @item -fzero-link
2658 @opindex fzero-link
2659 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2660 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2661 compile time) with static class references that get initialized at load time,
2662 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2663 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2664 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2665 for individual class implementations to be modified during program execution.
2666 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2667 regardless of command line options.
2668
2669 @item -gen-decls
2670 @opindex gen-decls
2671 Dump interface declarations for all classes seen in the source file to a
2672 file named @file{@var{sourcename}.decl}.
2673
2674 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2675 @opindex Wassign-intercept
2676 @opindex Wno-assign-intercept
2677 Warn whenever an Objective-C assignment is being intercepted by the
2678 garbage collector.
2679
2680 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2681 @opindex Wno-protocol
2682 @opindex Wprotocol
2683 If a class is declared to implement a protocol, a warning is issued for
2684 every method in the protocol that is not implemented by the class.  The
2685 default behavior is to issue a warning for every method not explicitly
2686 implemented in the class, even if a method implementation is inherited
2687 from the superclass.  If you use the @option{-Wno-protocol} option, then
2688 methods inherited from the superclass are considered to be implemented,
2689 and no warning is issued for them.
2690
2691 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2692 @opindex Wselector
2693 @opindex Wno-selector
2694 Warn if multiple methods of different types for the same selector are
2695 found during compilation.  The check is performed on the list of methods
2696 in the final stage of compilation.  Additionally, a check is performed
2697 for each selector appearing in a @code{@@selector(@dots{})}
2698 expression, and a corresponding method for that selector has been found
2699 during compilation.  Because these checks scan the method table only at
2700 the end of compilation, these warnings are not produced if the final
2701 stage of compilation is not reached, for example because an error is
2702 found during compilation, or because the @option{-fsyntax-only} option is
2703 being used.
2704
2705 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2706 @opindex Wstrict-selector-match
2707 @opindex Wno-strict-selector-match
2708 Warn if multiple methods with differing argument and/or return types are
2709 found for a given selector when attempting to send a message using this
2710 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2711 is off (which is the default behavior), the compiler will omit such warnings
2712 if any differences found are confined to types which share the same size
2713 and alignment.
2714
2715 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2716 @opindex Wundeclared-selector
2717 @opindex Wno-undeclared-selector
2718 Warn if a @code{@@selector(@dots{})} expression referring to an
2719 undeclared selector is found.  A selector is considered undeclared if no
2720 method with that name has been declared before the
2721 @code{@@selector(@dots{})} expression, either explicitly in an
2722 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2723 an @code{@@implementation} section.  This option always performs its
2724 checks as soon as a @code{@@selector(@dots{})} expression is found,
2725 while @option{-Wselector} only performs its checks in the final stage of
2726 compilation.  This also enforces the coding style convention
2727 that methods and selectors must be declared before being used.
2728
2729 @item -print-objc-runtime-info
2730 @opindex print-objc-runtime-info
2731 Generate C header describing the largest structure that is passed by
2732 value, if any.
2733
2734 @end table
2735
2736 @node Language Independent Options
2737 @section Options to Control Diagnostic Messages Formatting
2738 @cindex options to control diagnostics formatting
2739 @cindex diagnostic messages
2740 @cindex message formatting
2741
2742 Traditionally, diagnostic messages have been formatted irrespective of
2743 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2744 below can be used to control the diagnostic messages formatting
2745 algorithm, e.g.@: how many characters per line, how often source location
2746 information should be reported.  Right now, only the C++ front end can
2747 honor these options.  However it is expected, in the near future, that
2748 the remaining front ends would be able to digest them correctly.
2749
2750 @table @gcctabopt
2751 @item -fmessage-length=@var{n}
2752 @opindex fmessage-length
2753 Try to format error messages so that they fit on lines of about @var{n}
2754 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2755 the front ends supported by GCC@.  If @var{n} is zero, then no
2756 line-wrapping will be done; each error message will appear on a single
2757 line.
2758
2759 @opindex fdiagnostics-show-location
2760 @item -fdiagnostics-show-location=once
2761 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2762 reporter to emit @emph{once} source location information; that is, in
2763 case the message is too long to fit on a single physical line and has to
2764 be wrapped, the source location won't be emitted (as prefix) again,
2765 over and over, in subsequent continuation lines.  This is the default
2766 behavior.
2767
2768 @item -fdiagnostics-show-location=every-line
2769 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2770 messages reporter to emit the same source location information (as
2771 prefix) for physical lines that result from the process of breaking
2772 a message which is too long to fit on a single line.
2773
2774 @item -fdiagnostics-show-option
2775 @opindex fdiagnostics-show-option
2776 This option instructs the diagnostic machinery to add text to each
2777 diagnostic emitted, which indicates which command line option directly
2778 controls that diagnostic, when such an option is known to the
2779 diagnostic machinery.
2780
2781 @item -Wcoverage-mismatch
2782 @opindex Wcoverage-mismatch
2783 Warn if feedback profiles do not match when using the
2784 @option{-fprofile-use} option.
2785 If a source file was changed between @option{-fprofile-gen} and
2786 @option{-fprofile-use}, the files with the profile feedback can fail
2787 to match the source file and GCC can not use the profile feedback
2788 information.  By default, this warning is enabled and is treated as an
2789 error.  @option{-Wno-coverage-mismatch} can be used to disable the
2790 warning or @option{-Wno-error=coverage-mismatch} can be used to
2791 disable the error.  Disable the error for this warning can result in
2792 poorly optimized code, so disabling the error is useful only in the
2793 case of very minor changes such as bug fixes to an existing code-base.
2794 Completely disabling the warning is not recommended.
2795
2796 @end table
2797
2798 @node Warning Options
2799 @section Options to Request or Suppress Warnings
2800 @cindex options to control warnings
2801 @cindex warning messages
2802 @cindex messages, warning
2803 @cindex suppressing warnings
2804
2805 Warnings are diagnostic messages that report constructions which
2806 are not inherently erroneous but which are risky or suggest there
2807 may have been an error.
2808
2809 The following language-independent options do not enable specific
2810 warnings but control the kinds of diagnostics produced by GCC.
2811
2812 @table @gcctabopt
2813 @cindex syntax checking
2814 @item -fsyntax-only
2815 @opindex fsyntax-only
2816 Check the code for syntax errors, but don't do anything beyond that.
2817
2818 @item -fmax-errors=@var{n}
2819 @opindex fmax-errors
2820 Limits the maximum number of error messages to @var{n}, at which point
2821 GCC bails out rather than attempting to continue processing the source
2822 code.  If @var{n} is 0 (the default), there is no limit on the number
2823 of error messages produced.  If @option{-Wfatal-errors} is also
2824 specified, then @option{-Wfatal-errors} takes precedence over this
2825 option.
2826
2827 @item -w
2828 @opindex w
2829 Inhibit all warning messages.
2830
2831 @item -Werror
2832 @opindex Werror
2833 @opindex Wno-error
2834 Make all warnings into errors.
2835
2836 @item -Werror=
2837 @opindex Werror=
2838 @opindex Wno-error=
2839 Make the specified warning into an error.  The specifier for a warning
2840 is appended, for example @option{-Werror=switch} turns the warnings
2841 controlled by @option{-Wswitch} into errors.  This switch takes a
2842 negative form, to be used to negate @option{-Werror} for specific
2843 warnings, for example @option{-Wno-error=switch} makes
2844 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2845 is in effect.  You can use the @option{-fdiagnostics-show-option}
2846 option to have each controllable warning amended with the option which
2847 controls it, to determine what to use with this option.
2848
2849 Note that specifying @option{-Werror=}@var{foo} automatically implies
2850 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2851 imply anything.
2852
2853 @item -Wfatal-errors
2854 @opindex Wfatal-errors
2855 @opindex Wno-fatal-errors
2856 This option causes the compiler to abort compilation on the first error
2857 occurred rather than trying to keep going and printing further error
2858 messages.
2859
2860 @end table
2861
2862 You can request many specific warnings with options beginning
2863 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2864 implicit declarations.  Each of these specific warning options also
2865 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2866 example, @option{-Wno-implicit}.  This manual lists only one of the
2867 two forms, whichever is not the default.  For further,
2868 language-specific options also refer to @ref{C++ Dialect Options} and
2869 @ref{Objective-C and Objective-C++ Dialect Options}.
2870
2871 When an unrecognized warning option is requested (e.g.,
2872 @option{-Wunknown-warning}), GCC will emit a diagnostic stating
2873 that the option is not recognized.  However, if the @option{-Wno-} form
2874 is used, the behavior is slightly different: No diagnostic will be
2875 produced for @option{-Wno-unknown-warning} unless other diagnostics
2876 are being produced.  This allows the use of new @option{-Wno-} options
2877 with old compilers, but if something goes wrong, the compiler will
2878 warn that an unrecognized option was used.
2879
2880 @table @gcctabopt
2881 @item -pedantic
2882 @opindex pedantic
2883 Issue all the warnings demanded by strict ISO C and ISO C++;
2884 reject all programs that use forbidden extensions, and some other
2885 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2886 version of the ISO C standard specified by any @option{-std} option used.
2887
2888 Valid ISO C and ISO C++ programs should compile properly with or without
2889 this option (though a rare few will require @option{-ansi} or a
2890 @option{-std} option specifying the required version of ISO C)@.  However,
2891 without this option, certain GNU extensions and traditional C and C++
2892 features are supported as well.  With this option, they are rejected.
2893
2894 @option{-pedantic} does not cause warning messages for use of the
2895 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2896 warnings are also disabled in the expression that follows
2897 @code{__extension__}.  However, only system header files should use
2898 these escape routes; application programs should avoid them.
2899 @xref{Alternate Keywords}.
2900
2901 Some users try to use @option{-pedantic} to check programs for strict ISO
2902 C conformance.  They soon find that it does not do quite what they want:
2903 it finds some non-ISO practices, but not all---only those for which
2904 ISO C @emph{requires} a diagnostic, and some others for which
2905 diagnostics have been added.
2906
2907 A feature to report any failure to conform to ISO C might be useful in
2908 some instances, but would require considerable additional work and would
2909 be quite different from @option{-pedantic}.  We don't have plans to
2910 support such a feature in the near future.
2911
2912 Where the standard specified with @option{-std} represents a GNU
2913 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
2914 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2915 extended dialect is based.  Warnings from @option{-pedantic} are given
2916 where they are required by the base standard.  (It would not make sense
2917 for such warnings to be given only for features not in the specified GNU
2918 C dialect, since by definition the GNU dialects of C include all
2919 features the compiler supports with the given option, and there would be
2920 nothing to warn about.)
2921
2922 @item -pedantic-errors
2923 @opindex pedantic-errors
2924 Like @option{-pedantic}, except that errors are produced rather than
2925 warnings.
2926
2927 @item -Wall
2928 @opindex Wall
2929 @opindex Wno-all
2930 This enables all the warnings about constructions that some users
2931 consider questionable, and that are easy to avoid (or modify to
2932 prevent the warning), even in conjunction with macros.  This also
2933 enables some language-specific warnings described in @ref{C++ Dialect
2934 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2935
2936 @option{-Wall} turns on the following warning flags:
2937
2938 @gccoptlist{-Waddress   @gol
2939 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2940 -Wc++0x-compat  @gol
2941 -Wchar-subscripts  @gol
2942 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2943 -Wimplicit-int @r{(C and Objective-C only)} @gol
2944 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
2945 -Wcomment  @gol
2946 -Wformat   @gol
2947 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2948 -Wmissing-braces  @gol
2949 -Wnonnull  @gol
2950 -Wparentheses  @gol
2951 -Wpointer-sign  @gol
2952 -Wreorder   @gol
2953 -Wreturn-type  @gol
2954 -Wsequence-point  @gol
2955 -Wsign-compare @r{(only in C++)}  @gol
2956 -Wstrict-aliasing  @gol
2957 -Wstrict-overflow=1  @gol
2958 -Wswitch  @gol
2959 -Wtrigraphs  @gol
2960 -Wuninitialized  @gol
2961 -Wunknown-pragmas  @gol
2962 -Wunused-function  @gol
2963 -Wunused-label     @gol
2964 -Wunused-value     @gol
2965 -Wunused-variable  @gol
2966 -Wvolatile-register-var @gol
2967 }
2968
2969 Note that some warning flags are not implied by @option{-Wall}.  Some of
2970 them warn about constructions that users generally do not consider
2971 questionable, but which occasionally you might wish to check for;
2972 others warn about constructions that are necessary or hard to avoid in
2973 some cases, and there is no simple way to modify the code to suppress
2974 the warning. Some of them are enabled by @option{-Wextra} but many of
2975 them must be enabled individually.
2976
2977 @item -Wextra
2978 @opindex W
2979 @opindex Wextra
2980 @opindex Wno-extra
2981 This enables some extra warning flags that are not enabled by
2982 @option{-Wall}. (This option used to be called @option{-W}.  The older
2983 name is still supported, but the newer name is more descriptive.)
2984
2985 @gccoptlist{-Wclobbered  @gol
2986 -Wempty-body  @gol
2987 -Wignored-qualifiers @gol
2988 -Wmissing-field-initializers  @gol
2989 -Wmissing-parameter-type @r{(C only)}  @gol
2990 -Wold-style-declaration @r{(C only)}  @gol
2991 -Woverride-init  @gol
2992 -Wsign-compare  @gol
2993 -Wtype-limits  @gol
2994 -Wuninitialized  @gol
2995 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
2996 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2997 }
2998
2999 The option @option{-Wextra} also prints warning messages for the
3000 following cases:
3001
3002 @itemize @bullet
3003
3004 @item
3005 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3006 @samp{>}, or @samp{>=}.
3007
3008 @item
3009 (C++ only) An enumerator and a non-enumerator both appear in a
3010 conditional expression.
3011
3012 @item
3013 (C++ only) Ambiguous virtual bases.
3014
3015 @item
3016 (C++ only) Subscripting an array which has been declared @samp{register}.
3017
3018 @item
3019 (C++ only) Taking the address of a variable which has been declared
3020 @samp{register}.
3021
3022 @item
3023 (C++ only) A base class is not initialized in a derived class' copy
3024 constructor.
3025
3026 @end itemize
3027
3028 @item -Wchar-subscripts
3029 @opindex Wchar-subscripts
3030 @opindex Wno-char-subscripts
3031 Warn if an array subscript has type @code{char}.  This is a common cause
3032 of error, as programmers often forget that this type is signed on some
3033 machines.
3034 This warning is enabled by @option{-Wall}.
3035
3036 @item -Wcomment
3037 @opindex Wcomment
3038 @opindex Wno-comment
3039 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3040 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3041 This warning is enabled by @option{-Wall}.
3042
3043 @item -Wno-cpp \
3044 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3045
3046 Suppress warning messages emitted by @code{#warning} directives.
3047
3048 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3049 @opindex Wdouble-promotion
3050 @opindex Wno-double-promotion
3051 Give a warning when a value of type @code{float} is implicitly
3052 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3053 floating-point unit implement @code{float} in hardware, but emulate
3054 @code{double} in software.  On such a machine, doing computations
3055 using @code{double} values is much more expensive because of the
3056 overhead required for software emulation.  
3057
3058 It is easy to accidentally do computations with @code{double} because
3059 floating-point literals are implicitly of type @code{double}.  For
3060 example, in:
3061 @smallexample
3062 @group
3063 float area(float radius)
3064 @{
3065    return 3.14159 * radius * radius;        
3066 @}
3067 @end group
3068 @end smallexample
3069 the compiler will perform the entire computation with @code{double}
3070 because the floating-point literal is a @code{double}.
3071
3072 @item -Wformat
3073 @opindex Wformat
3074 @opindex Wno-format
3075 @opindex ffreestanding
3076 @opindex fno-builtin
3077 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3078 the arguments supplied have types appropriate to the format string
3079 specified, and that the conversions specified in the format string make
3080 sense.  This includes standard functions, and others specified by format
3081 attributes (@pxref{Function Attributes}), in the @code{printf},
3082 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3083 not in the C standard) families (or other target-specific families).
3084 Which functions are checked without format attributes having been
3085 specified depends on the standard version selected, and such checks of
3086 functions without the attribute specified are disabled by
3087 @option{-ffreestanding} or @option{-fno-builtin}.
3088
3089 The formats are checked against the format features supported by GNU
3090 libc version 2.2.  These include all ISO C90 and C99 features, as well
3091 as features from the Single Unix Specification and some BSD and GNU
3092 extensions.  Other library implementations may not support all these
3093 features; GCC does not support warning about features that go beyond a
3094 particular library's limitations.  However, if @option{-pedantic} is used
3095 with @option{-Wformat}, warnings will be given about format features not
3096 in the selected standard version (but not for @code{strfmon} formats,
3097 since those are not in any version of the C standard).  @xref{C Dialect
3098 Options,,Options Controlling C Dialect}.
3099
3100 Since @option{-Wformat} also checks for null format arguments for
3101 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3102
3103 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3104 aspects of format checking, the options @option{-Wformat-y2k},
3105 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3106 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3107 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3108
3109 @item -Wformat-y2k
3110 @opindex Wformat-y2k
3111 @opindex Wno-format-y2k
3112 If @option{-Wformat} is specified, also warn about @code{strftime}
3113 formats which may yield only a two-digit year.
3114
3115 @item -Wno-format-contains-nul
3116 @opindex Wno-format-contains-nul
3117 @opindex Wformat-contains-nul
3118 If @option{-Wformat} is specified, do not warn about format strings that
3119 contain NUL bytes.
3120
3121 @item -Wno-format-extra-args
3122 @opindex Wno-format-extra-args
3123 @opindex Wformat-extra-args
3124 If @option{-Wformat} is specified, do not warn about excess arguments to a
3125 @code{printf} or @code{scanf} format function.  The C standard specifies
3126 that such arguments are ignored.
3127
3128 Where the unused arguments lie between used arguments that are
3129 specified with @samp{$} operand number specifications, normally
3130 warnings are still given, since the implementation could not know what
3131 type to pass to @code{va_arg} to skip the unused arguments.  However,
3132 in the case of @code{scanf} formats, this option will suppress the
3133 warning if the unused arguments are all pointers, since the Single
3134 Unix Specification says that such unused arguments are allowed.
3135
3136 @item -Wno-format-zero-length @r{(C and Objective-C only)}
3137 @opindex Wno-format-zero-length
3138 @opindex Wformat-zero-length
3139 If @option{-Wformat} is specified, do not warn about zero-length formats.
3140 The C standard specifies that zero-length formats are allowed.
3141
3142 @item -Wformat-nonliteral
3143 @opindex Wformat-nonliteral
3144 @opindex Wno-format-nonliteral
3145 If @option{-Wformat} is specified, also warn if the format string is not a
3146 string literal and so cannot be checked, unless the format function
3147 takes its format arguments as a @code{va_list}.
3148
3149 @item -Wformat-security
3150 @opindex Wformat-security
3151 @opindex Wno-format-security
3152 If @option{-Wformat} is specified, also warn about uses of format
3153 functions that represent possible security problems.  At present, this
3154 warns about calls to @code{printf} and @code{scanf} functions where the
3155 format string is not a string literal and there are no format arguments,
3156 as in @code{printf (foo);}.  This may be a security hole if the format
3157 string came from untrusted input and contains @samp{%n}.  (This is
3158 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3159 in future warnings may be added to @option{-Wformat-security} that are not
3160 included in @option{-Wformat-nonliteral}.)
3161
3162 @item -Wformat=2
3163 @opindex Wformat=2
3164 @opindex Wno-format=2
3165 Enable @option{-Wformat} plus format checks not included in
3166 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
3167 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3168
3169 @item -Wnonnull @r{(C and Objective-C only)}
3170 @opindex Wnonnull
3171 @opindex Wno-nonnull
3172 Warn about passing a null pointer for arguments marked as
3173 requiring a non-null value by the @code{nonnull} function attribute.
3174
3175 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3176 can be disabled with the @option{-Wno-nonnull} option.
3177
3178 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3179 @opindex Winit-self
3180 @opindex Wno-init-self
3181 Warn about uninitialized variables which are initialized with themselves.
3182 Note this option can only be used with the @option{-Wuninitialized} option.
3183
3184 For example, GCC will warn about @code{i} being uninitialized in the
3185 following snippet only when @option{-Winit-self} has been specified:
3186 @smallexample
3187 @group
3188 int f()
3189 @{
3190   int i = i;
3191   return i;
3192 @}
3193 @end group
3194 @end smallexample
3195
3196 @item -Wimplicit-int @r{(C and Objective-C only)}
3197 @opindex Wimplicit-int
3198 @opindex Wno-implicit-int
3199 Warn when a declaration does not specify a type.
3200 This warning is enabled by @option{-Wall}.
3201
3202 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3203 @opindex Wimplicit-function-declaration
3204 @opindex Wno-implicit-function-declaration
3205 Give a warning whenever a function is used before being declared. In
3206 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3207 enabled by default and it is made into an error by
3208 @option{-pedantic-errors}. This warning is also enabled by
3209 @option{-Wall}.
3210
3211 @item -Wimplicit @r{(C and Objective-C only)}
3212 @opindex Wimplicit
3213 @opindex Wno-implicit
3214 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3215 This warning is enabled by @option{-Wall}.
3216
3217 @item -Wignored-qualifiers @r{(C and C++ only)}
3218 @opindex Wignored-qualifiers
3219 @opindex Wno-ignored-qualifiers
3220 Warn if the return type of a function has a type qualifier
3221 such as @code{const}.  For ISO C such a type qualifier has no effect,
3222 since the value returned by a function is not an lvalue.
3223 For C++, the warning is only emitted for scalar types or @code{void}.
3224 ISO C prohibits qualified @code{void} return types on function
3225 definitions, so such return types always receive a warning
3226 even without this option.
3227
3228 This warning is also enabled by @option{-Wextra}.
3229
3230 @item -Wmain
3231 @opindex Wmain
3232 @opindex Wno-main
3233 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3234 a function with external linkage, returning int, taking either zero
3235 arguments, two, or three arguments of appropriate types.  This warning
3236 is enabled by default in C++ and is enabled by either @option{-Wall}
3237 or @option{-pedantic}.
3238
3239 @item -Wmissing-braces
3240 @opindex Wmissing-braces
3241 @opindex Wno-missing-braces
3242 Warn if an aggregate or union initializer is not fully bracketed.  In
3243 the following example, the initializer for @samp{a} is not fully
3244 bracketed, but that for @samp{b} is fully bracketed.
3245
3246 @smallexample
3247 int a[2][2] = @{ 0, 1, 2, 3 @};
3248 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3249 @end smallexample
3250
3251 This warning is enabled by @option{-Wall}.
3252
3253 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3254 @opindex Wmissing-include-dirs
3255 @opindex Wno-missing-include-dirs
3256 Warn if a user-supplied include directory does not exist.
3257
3258 @item -Wparentheses
3259 @opindex Wparentheses
3260 @opindex Wno-parentheses
3261 Warn if parentheses are omitted in certain contexts, such
3262 as when there is an assignment in a context where a truth value
3263 is expected, or when operators are nested whose precedence people
3264 often get confused about.
3265
3266 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3267 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3268 interpretation from that of ordinary mathematical notation.
3269
3270 Also warn about constructions where there may be confusion to which
3271 @code{if} statement an @code{else} branch belongs.  Here is an example of
3272 such a case:
3273
3274 @smallexample
3275 @group
3276 @{
3277   if (a)
3278     if (b)
3279       foo ();
3280   else
3281     bar ();
3282 @}
3283 @end group
3284 @end smallexample
3285
3286 In C/C++, every @code{else} branch belongs to the innermost possible
3287 @code{if} statement, which in this example is @code{if (b)}.  This is
3288 often not what the programmer expected, as illustrated in the above
3289 example by indentation the programmer chose.  When there is the
3290 potential for this confusion, GCC will issue a warning when this flag
3291 is specified.  To eliminate the warning, add explicit braces around
3292 the innermost @code{if} statement so there is no way the @code{else}
3293 could belong to the enclosing @code{if}.  The resulting code would
3294 look like this:
3295
3296 @smallexample
3297 @group
3298 @{
3299   if (a)
3300     @{
3301       if (b)
3302         foo ();
3303       else
3304         bar ();
3305     @}
3306 @}
3307 @end group
3308 @end smallexample
3309
3310 Also warn for dangerous uses of the 
3311 ?: with omitted middle operand GNU extension. When the condition
3312 in the ?: operator is a boolean expression the omitted value will
3313 be always 1. Often the user expects it to be a value computed
3314 inside the conditional expression instead. 
3315
3316 This warning is enabled by @option{-Wall}.
3317
3318 @item -Wsequence-point
3319 @opindex Wsequence-point
3320 @opindex Wno-sequence-point
3321 Warn about code that may have undefined semantics because of violations
3322 of sequence point rules in the C and C++ standards.
3323
3324 The C and C++ standards defines the order in which expressions in a C/C++
3325 program are evaluated in terms of @dfn{sequence points}, which represent
3326 a partial ordering between the execution of parts of the program: those
3327 executed before the sequence point, and those executed after it.  These
3328 occur after the evaluation of a full expression (one which is not part
3329 of a larger expression), after the evaluation of the first operand of a
3330 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3331 function is called (but after the evaluation of its arguments and the
3332 expression denoting the called function), and in certain other places.
3333 Other than as expressed by the sequence point rules, the order of
3334 evaluation of subexpressions of an expression is not specified.  All
3335 these rules describe only a partial order rather than a total order,
3336 since, for example, if two functions are called within one expression
3337 with no sequence point between them, the order in which the functions
3338 are called is not specified.  However, the standards committee have
3339 ruled that function calls do not overlap.
3340
3341 It is not specified when between sequence points modifications to the
3342 values of objects take effect.  Programs whose behavior depends on this
3343 have undefined behavior; the C and C++ standards specify that ``Between
3344 the previous and next sequence point an object shall have its stored
3345 value modified at most once by the evaluation of an expression.
3346 Furthermore, the prior value shall be read only to determine the value
3347 to be stored.''.  If a program breaks these rules, the results on any
3348 particular implementation are entirely unpredictable.
3349
3350 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3351 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3352 diagnosed by this option, and it may give an occasional false positive
3353 result, but in general it has been found fairly effective at detecting
3354 this sort of problem in programs.
3355
3356 The standard is worded confusingly, therefore there is some debate
3357 over the precise meaning of the sequence point rules in subtle cases.
3358 Links to discussions of the problem, including proposed formal
3359 definitions, may be found on the GCC readings page, at
3360 @uref{http://gcc.gnu.org/@/readings.html}.
3361
3362 This warning is enabled by @option{-Wall} for C and C++.
3363
3364 @item -Wreturn-type
3365 @opindex Wreturn-type
3366 @opindex Wno-return-type
3367 Warn whenever a function is defined with a return-type that defaults
3368 to @code{int}.  Also warn about any @code{return} statement with no
3369 return-value in a function whose return-type is not @code{void}
3370 (falling off the end of the function body is considered returning
3371 without a value), and about a @code{return} statement with an
3372 expression in a function whose return-type is @code{void}.
3373
3374 For C++, a function without return type always produces a diagnostic
3375 message, even when @option{-Wno-return-type} is specified.  The only
3376 exceptions are @samp{main} and functions defined in system headers.
3377
3378 This warning is enabled by @option{-Wall}.
3379
3380 @item -Wswitch
3381 @opindex Wswitch
3382 @opindex Wno-switch
3383 Warn whenever a @code{switch} statement has an index of enumerated type
3384 and lacks a @code{case} for one or more of the named codes of that
3385 enumeration.  (The presence of a @code{default} label prevents this
3386 warning.)  @code{case} labels outside the enumeration range also
3387 provoke warnings when this option is used (even if there is a
3388 @code{default} label).
3389 This warning is enabled by @option{-Wall}.
3390
3391 @item -Wswitch-default
3392 @opindex Wswitch-default
3393 @opindex Wno-switch-default
3394 Warn whenever a @code{switch} statement does not have a @code{default}
3395 case.
3396
3397 @item -Wswitch-enum
3398 @opindex Wswitch-enum
3399 @opindex Wno-switch-enum
3400 Warn whenever a @code{switch} statement has an index of enumerated type
3401 and lacks a @code{case} for one or more of the named codes of that
3402 enumeration.  @code{case} labels outside the enumeration range also
3403 provoke warnings when this option is used.  The only difference
3404 between @option{-Wswitch} and this option is that this option gives a
3405 warning about an omitted enumeration code even if there is a
3406 @code{default} label.
3407
3408 @item -Wsync-nand @r{(C and C++ only)}
3409 @opindex Wsync-nand
3410 @opindex Wno-sync-nand
3411 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3412 built-in functions are used.  These functions changed semantics in GCC 4.4.
3413
3414 @item -Wtrigraphs
3415 @opindex Wtrigraphs
3416 @opindex Wno-trigraphs
3417 Warn if any trigraphs are encountered that might change the meaning of
3418 the program (trigraphs within comments are not warned about).
3419 This warning is enabled by @option{-Wall}.
3420
3421 @item -Wunused-but-set-parameter
3422 @opindex Wunused-but-set-parameter
3423 @opindex Wno-unused-but-set-parameter
3424 Warn whenever a function parameter is assigned to, but otherwise unused
3425 (aside from its declaration).
3426
3427 To suppress this warning use the @samp{unused} attribute
3428 (@pxref{Variable Attributes}).
3429
3430 This warning is also enabled by @option{-Wunused} together with
3431 @option{-Wextra}.
3432
3433 @item -Wunused-but-set-variable
3434 @opindex Wunused-but-set-variable
3435 @opindex Wno-unused-but-set-variable
3436 Warn whenever a local variable is assigned to, but otherwise unused
3437 (aside from its declaration).
3438 This warning is enabled by @option{-Wall}.
3439
3440 To suppress this warning use the @samp{unused} attribute
3441 (@pxref{Variable Attributes}).
3442
3443 This warning is also enabled by @option{-Wunused}, which is enabled
3444 by @option{-Wall}.
3445
3446 @item -Wunused-function
3447 @opindex Wunused-function
3448 @opindex Wno-unused-function
3449 Warn whenever a static function is declared but not defined or a
3450 non-inline static function is unused.
3451 This warning is enabled by @option{-Wall}.
3452
3453 @item -Wunused-label
3454 @opindex Wunused-label
3455 @opindex Wno-unused-label
3456 Warn whenever a label is declared but not used.
3457 This warning is enabled by @option{-Wall}.
3458
3459 To suppress this warning use the @samp{unused} attribute
3460 (@pxref{Variable Attributes}).
3461
3462 @item -Wunused-parameter
3463 @opindex Wunused-parameter
3464 @opindex Wno-unused-parameter
3465 Warn whenever a function parameter is unused aside from its declaration.
3466
3467 To suppress this warning use the @samp{unused} attribute
3468 (@pxref{Variable Attributes}).
3469
3470 @item -Wno-unused-result
3471 @opindex Wunused-result
3472 @opindex Wno-unused-result
3473 Do not warn if a caller of a function marked with attribute
3474 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3475 its return value. The default is @option{-Wunused-result}.
3476
3477 @item -Wunused-variable
3478 @opindex Wunused-variable
3479 @opindex Wno-unused-variable
3480 Warn whenever a local variable or non-constant static variable is unused
3481 aside from its declaration.
3482 This warning is enabled by @option{-Wall}.
3483
3484 To suppress this warning use the @samp{unused} attribute
3485 (@pxref{Variable Attributes}).
3486
3487 @item -Wunused-value
3488 @opindex Wunused-value
3489 @opindex Wno-unused-value
3490 Warn whenever a statement computes a result that is explicitly not
3491 used. To suppress this warning cast the unused expression to
3492 @samp{void}. This includes an expression-statement or the left-hand
3493 side of a comma expression that contains no side effects. For example,
3494 an expression such as @samp{x[i,j]} will cause a warning, while
3495 @samp{x[(void)i,j]} will not.
3496
3497 This warning is enabled by @option{-Wall}.
3498
3499 @item -Wunused
3500 @opindex Wunused
3501 @opindex Wno-unused
3502 All the above @option{-Wunused} options combined.
3503
3504 In order to get a warning about an unused function parameter, you must
3505 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3506 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3507
3508 @item -Wuninitialized
3509 @opindex Wuninitialized
3510 @opindex Wno-uninitialized
3511 Warn if an automatic variable is used without first being initialized
3512 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3513 warn if a non-static reference or non-static @samp{const} member
3514 appears in a class without constructors.
3515
3516 If you want to warn about code which uses the uninitialized value of the
3517 variable in its own initializer, use the @option{-Winit-self} option.
3518
3519 These warnings occur for individual uninitialized or clobbered
3520 elements of structure, union or array variables as well as for
3521 variables which are uninitialized or clobbered as a whole.  They do
3522 not occur for variables or elements declared @code{volatile}.  Because
3523 these warnings depend on optimization, the exact variables or elements
3524 for which there are warnings will depend on the precise optimization
3525 options and version of GCC used.
3526
3527 Note that there may be no warning about a variable that is used only
3528 to compute a value that itself is never used, because such
3529 computations may be deleted by data flow analysis before the warnings
3530 are printed.
3531
3532 These warnings are made optional because GCC is not smart
3533 enough to see all the reasons why the code might be correct
3534 despite appearing to have an error.  Here is one example of how
3535 this can happen:
3536
3537 @smallexample
3538 @group
3539 @{
3540   int x;
3541   switch (y)
3542     @{
3543     case 1: x = 1;
3544       break;
3545     case 2: x = 4;
3546       break;
3547     case 3: x = 5;
3548     @}
3549   foo (x);
3550 @}
3551 @end group
3552 @end smallexample
3553
3554 @noindent
3555 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3556 always initialized, but GCC doesn't know this.  Here is
3557 another common case:
3558
3559 @smallexample
3560 @{
3561   int save_y;
3562   if (change_y) save_y = y, y = new_y;
3563   @dots{}
3564   if (change_y) y = save_y;
3565 @}
3566 @end smallexample
3567
3568 @noindent
3569 This has no bug because @code{save_y} is used only if it is set.
3570
3571 @cindex @code{longjmp} warnings
3572 This option also warns when a non-volatile automatic variable might be
3573 changed by a call to @code{longjmp}.  These warnings as well are possible
3574 only in optimizing compilation.
3575
3576 The compiler sees only the calls to @code{setjmp}.  It cannot know
3577 where @code{longjmp} will be called; in fact, a signal handler could
3578 call it at any point in the code.  As a result, you may get a warning
3579 even when there is in fact no problem because @code{longjmp} cannot
3580 in fact be called at the place which would cause a problem.
3581
3582 Some spurious warnings can be avoided if you declare all the functions
3583 you use that never return as @code{noreturn}.  @xref{Function
3584 Attributes}.
3585
3586 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3587
3588 @item -Wunknown-pragmas
3589 @opindex Wunknown-pragmas
3590 @opindex Wno-unknown-pragmas
3591 @cindex warning for unknown pragmas
3592 @cindex unknown pragmas, warning
3593 @cindex pragmas, warning of unknown
3594 Warn when a #pragma directive is encountered which is not understood by
3595 GCC@.  If this command line option is used, warnings will even be issued
3596 for unknown pragmas in system header files.  This is not the case if
3597 the warnings were only enabled by the @option{-Wall} command line option.
3598
3599 @item -Wno-pragmas
3600 @opindex Wno-pragmas
3601 @opindex Wpragmas
3602 Do not warn about misuses of pragmas, such as incorrect parameters,
3603 invalid syntax, or conflicts between pragmas.  See also
3604 @samp{-Wunknown-pragmas}.
3605
3606 @item -Wstrict-aliasing
3607 @opindex Wstrict-aliasing
3608 @opindex Wno-strict-aliasing
3609 This option is only active when @option{-fstrict-aliasing} is active.
3610 It warns about code which might break the strict aliasing rules that the
3611 compiler is using for optimization.  The warning does not catch all
3612 cases, but does attempt to catch the more common pitfalls.  It is
3613 included in @option{-Wall}.
3614 It is equivalent to @option{-Wstrict-aliasing=3}
3615
3616 @item -Wstrict-aliasing=n
3617 @opindex Wstrict-aliasing=n
3618 @opindex Wno-strict-aliasing=n
3619 This option is only active when @option{-fstrict-aliasing} is active.
3620 It warns about code which might break the strict aliasing rules that the
3621 compiler is using for optimization.
3622 Higher levels correspond to higher accuracy (fewer false positives).
3623 Higher levels also correspond to more effort, similar to the way -O works.
3624 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3625 with n=3.
3626
3627 Level 1: Most aggressive, quick, least accurate.
3628 Possibly useful when higher levels
3629 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3630 false negatives.  However, it has many false positives.
3631 Warns for all pointer conversions between possibly incompatible types,
3632 even if never dereferenced.  Runs in the frontend only.
3633
3634 Level 2: Aggressive, quick, not too precise.
3635 May still have many false positives (not as many as level 1 though),
3636 and few false negatives (but possibly more than level 1).
3637 Unlike level 1, it only warns when an address is taken.  Warns about
3638 incomplete types.  Runs in the frontend only.
3639
3640 Level 3 (default for @option{-Wstrict-aliasing}):
3641 Should have very few false positives and few false
3642 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3643 Takes care of the common pun+dereference pattern in the frontend:
3644 @code{*(int*)&some_float}.
3645 If optimization is enabled, it also runs in the backend, where it deals
3646 with multiple statement cases using flow-sensitive points-to information.
3647 Only warns when the converted pointer is dereferenced.
3648 Does not warn about incomplete types.
3649
3650 @item -Wstrict-overflow
3651 @itemx -Wstrict-overflow=@var{n}
3652 @opindex Wstrict-overflow
3653 @opindex Wno-strict-overflow
3654 This option is only active when @option{-fstrict-overflow} is active.
3655 It warns about cases where the compiler optimizes based on the
3656 assumption that signed overflow does not occur.  Note that it does not
3657 warn about all cases where the code might overflow: it only warns
3658 about cases where the compiler implements some optimization.  Thus
3659 this warning depends on the optimization level.
3660
3661 An optimization which assumes that signed overflow does not occur is
3662 perfectly safe if the values of the variables involved are such that
3663 overflow never does, in fact, occur.  Therefore this warning can
3664 easily give a false positive: a warning about code which is not
3665 actually a problem.  To help focus on important issues, several
3666 warning levels are defined.  No warnings are issued for the use of
3667 undefined signed overflow when estimating how many iterations a loop
3668 will require, in particular when determining whether a loop will be
3669 executed at all.
3670
3671 @table @gcctabopt
3672 @item -Wstrict-overflow=1
3673 Warn about cases which are both questionable and easy to avoid.  For
3674 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3675 compiler will simplify this to @code{1}.  This level of
3676 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3677 are not, and must be explicitly requested.
3678
3679 @item -Wstrict-overflow=2
3680 Also warn about other cases where a comparison is simplified to a
3681 constant.  For example: @code{abs (x) >= 0}.  This can only be
3682 simplified when @option{-fstrict-overflow} is in effect, because
3683 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3684 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3685 @option{-Wstrict-overflow=2}.
3686
3687 @item -Wstrict-overflow=3
3688 Also warn about other cases where a comparison is simplified.  For
3689 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3690
3691 @item -Wstrict-overflow=4
3692 Also warn about other simplifications not covered by the above cases.
3693 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3694
3695 @item -Wstrict-overflow=5
3696 Also warn about cases where the compiler reduces the magnitude of a
3697 constant involved in a comparison.  For example: @code{x + 2 > y} will
3698 be simplified to @code{x + 1 >= y}.  This is reported only at the
3699 highest warning level because this simplification applies to many
3700 comparisons, so this warning level will give a very large number of
3701 false positives.
3702 @end table
3703
3704 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3705 @opindex Wsuggest-attribute=
3706 @opindex Wno-suggest-attribute=
3707 Warn for cases where adding an attribute may be beneficial. The
3708 attributes currently supported are listed below.
3709
3710 @table @gcctabopt
3711 @item -Wsuggest-attribute=pure
3712 @itemx -Wsuggest-attribute=const
3713 @itemx -Wsuggest-attribute=noreturn
3714 @opindex Wsuggest-attribute=pure
3715 @opindex Wno-suggest-attribute=pure
3716 @opindex Wsuggest-attribute=const
3717 @opindex Wno-suggest-attribute=const
3718 @opindex Wsuggest-attribute=noreturn
3719 @opindex Wno-suggest-attribute=noreturn
3720
3721 Warn about functions which might be candidates for attributes
3722 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3723 functions visible in other compilation units or (in the case of @code{pure} and
3724 @code{const}) if it cannot prove that the function returns normally. A function
3725 returns normally if it doesn't contain an infinite loop nor returns abnormally
3726 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3727 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3728 higher.  Higher optimization levels improve the accuracy of the analysis.
3729 @end table
3730
3731 @item -Warray-bounds
3732 @opindex Wno-array-bounds
3733 @opindex Warray-bounds
3734 This option is only active when @option{-ftree-vrp} is active
3735 (default for @option{-O2} and above). It warns about subscripts to arrays
3736 that are always out of bounds. This warning is enabled by @option{-Wall}.
3737
3738 @item -Wno-div-by-zero
3739 @opindex Wno-div-by-zero
3740 @opindex Wdiv-by-zero
3741 Do not warn about compile-time integer division by zero.  Floating point
3742 division by zero is not warned about, as it can be a legitimate way of
3743 obtaining infinities and NaNs.
3744
3745 @item -Wsystem-headers
3746 @opindex Wsystem-headers
3747 @opindex Wno-system-headers
3748 @cindex warnings from system headers
3749 @cindex system headers, warnings from
3750 Print warning messages for constructs found in system header files.
3751 Warnings from system headers are normally suppressed, on the assumption
3752 that they usually do not indicate real problems and would only make the
3753 compiler output harder to read.  Using this command line option tells
3754 GCC to emit warnings from system headers as if they occurred in user
3755 code.  However, note that using @option{-Wall} in conjunction with this
3756 option will @emph{not} warn about unknown pragmas in system
3757 headers---for that, @option{-Wunknown-pragmas} must also be used.
3758
3759 @item -Wtrampolines
3760 @opindex Wtrampolines
3761 @opindex Wno-trampolines
3762  Warn about trampolines generated for pointers to nested functions.
3763  
3764  A trampoline is a small piece of data or code that is created at run
3765  time on the stack when the address of a nested function is taken, and
3766  is used to call the nested function indirectly.  For some targets, it
3767  is made up of data only and thus requires no special treatment.  But,
3768  for most targets, it is made up of code and thus requires the stack
3769  to be made executable in order for the program to work properly.
3770
3771 @item -Wfloat-equal
3772 @opindex Wfloat-equal
3773 @opindex Wno-float-equal
3774 Warn if floating point values are used in equality comparisons.
3775
3776 The idea behind this is that sometimes it is convenient (for the
3777 programmer) to consider floating-point values as approximations to
3778 infinitely precise real numbers.  If you are doing this, then you need
3779 to compute (by analyzing the code, or in some other way) the maximum or
3780 likely maximum error that the computation introduces, and allow for it
3781 when performing comparisons (and when producing output, but that's a
3782 different problem).  In particular, instead of testing for equality, you
3783 would check to see whether the two values have ranges that overlap; and
3784 this is done with the relational operators, so equality comparisons are
3785 probably mistaken.
3786
3787 @item -Wtraditional @r{(C and Objective-C only)}
3788 @opindex Wtraditional
3789 @opindex Wno-traditional
3790 Warn about certain constructs that behave differently in traditional and
3791 ISO C@.  Also warn about ISO C constructs that have no traditional C
3792 equivalent, and/or problematic constructs which should be avoided.
3793
3794 @itemize @bullet
3795 @item
3796 Macro parameters that appear within string literals in the macro body.
3797 In traditional C macro replacement takes place within string literals,
3798 but does not in ISO C@.
3799
3800 @item
3801 In traditional C, some preprocessor directives did not exist.
3802 Traditional preprocessors would only consider a line to be a directive
3803 if the @samp{#} appeared in column 1 on the line.  Therefore
3804 @option{-Wtraditional} warns about directives that traditional C
3805 understands but would ignore because the @samp{#} does not appear as the
3806 first character on the line.  It also suggests you hide directives like
3807 @samp{#pragma} not understood by traditional C by indenting them.  Some
3808 traditional implementations would not recognize @samp{#elif}, so it
3809 suggests avoiding it altogether.
3810
3811 @item
3812 A function-like macro that appears without arguments.
3813
3814 @item
3815 The unary plus operator.
3816
3817 @item
3818 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3819 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3820 constants.)  Note, these suffixes appear in macros defined in the system
3821 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3822 Use of these macros in user code might normally lead to spurious
3823 warnings, however GCC's integrated preprocessor has enough context to
3824 avoid warning in these cases.
3825
3826 @item
3827 A function declared external in one block and then used after the end of
3828 the block.
3829
3830 @item
3831 A @code{switch} statement has an operand of type @code{long}.
3832
3833 @item
3834 A non-@code{static} function declaration follows a @code{static} one.
3835 This construct is not accepted by some traditional C compilers.
3836
3837 @item
3838 The ISO type of an integer constant has a different width or
3839 signedness from its traditional type.  This warning is only issued if
3840 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3841 typically represent bit patterns, are not warned about.
3842
3843 @item
3844 Usage of ISO string concatenation is detected.
3845
3846 @item
3847 Initialization of automatic aggregates.
3848
3849 @item
3850 Identifier conflicts with labels.  Traditional C lacks a separate
3851 namespace for labels.
3852
3853 @item
3854 Initialization of unions.  If the initializer is zero, the warning is
3855 omitted.  This is done under the assumption that the zero initializer in
3856 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3857 initializer warnings and relies on default initialization to zero in the
3858 traditional C case.
3859
3860 @item
3861 Conversions by prototypes between fixed/floating point values and vice
3862 versa.  The absence of these prototypes when compiling with traditional
3863 C would cause serious problems.  This is a subset of the possible
3864 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3865
3866 @item
3867 Use of ISO C style function definitions.  This warning intentionally is
3868 @emph{not} issued for prototype declarations or variadic functions
3869 because these ISO C features will appear in your code when using
3870 libiberty's traditional C compatibility macros, @code{PARAMS} and
3871 @code{VPARAMS}.  This warning is also bypassed for nested functions
3872 because that feature is already a GCC extension and thus not relevant to
3873 traditional C compatibility.
3874 @end itemize
3875
3876 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3877 @opindex Wtraditional-conversion
3878 @opindex Wno-traditional-conversion
3879 Warn if a prototype causes a type conversion that is different from what
3880 would happen to the same argument in the absence of a prototype.  This
3881 includes conversions of fixed point to floating and vice versa, and
3882 conversions changing the width or signedness of a fixed point argument
3883 except when the same as the default promotion.
3884
3885 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3886 @opindex Wdeclaration-after-statement
3887 @opindex Wno-declaration-after-statement
3888 Warn when a declaration is found after a statement in a block.  This
3889 construct, known from C++, was introduced with ISO C99 and is by default
3890 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3891 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3892
3893 @item -Wundef
3894 @opindex Wundef
3895 @opindex Wno-undef
3896 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3897
3898 @item -Wno-endif-labels
3899 @opindex Wno-endif-labels
3900 @opindex Wendif-labels
3901 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3902
3903 @item -Wshadow
3904 @opindex Wshadow
3905 @opindex Wno-shadow
3906 Warn whenever a local variable or type declaration shadows another variable,
3907 parameter, type, or class member (in C++), or whenever a built-in function
3908 is shadowed. Note that in C++, the compiler will not warn if a local variable
3909 shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
3910
3911 @item -Wlarger-than=@var{len}
3912 @opindex Wlarger-than=@var{len}
3913 @opindex Wlarger-than-@var{len}
3914 Warn whenever an object of larger than @var{len} bytes is defined.
3915
3916 @item -Wframe-larger-than=@var{len}
3917 @opindex Wframe-larger-than
3918 Warn if the size of a function frame is larger than @var{len} bytes.
3919 The computation done to determine the stack frame size is approximate
3920 and not conservative.
3921 The actual requirements may be somewhat greater than @var{len}
3922 even if you do not get a warning.  In addition, any space allocated
3923 via @code{alloca}, variable-length arrays, or related constructs
3924 is not included by the compiler when determining
3925 whether or not to issue a warning.
3926
3927 @item -Wunsafe-loop-optimizations
3928 @opindex Wunsafe-loop-optimizations
3929 @opindex Wno-unsafe-loop-optimizations
3930 Warn if the loop cannot be optimized because the compiler could not
3931 assume anything on the bounds of the loop indices.  With
3932 @option{-funsafe-loop-optimizations} warn if the compiler made
3933 such assumptions.
3934
3935 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3936 @opindex Wno-pedantic-ms-format
3937 @opindex Wpedantic-ms-format
3938 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3939 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3940 depending on the MS runtime, when you are using the options @option{-Wformat}
3941 and @option{-pedantic} without gnu-extensions.
3942
3943 @item -Wpointer-arith
3944 @opindex Wpointer-arith
3945 @opindex Wno-pointer-arith
3946 Warn about anything that depends on the ``size of'' a function type or
3947 of @code{void}.  GNU C assigns these types a size of 1, for
3948 convenience in calculations with @code{void *} pointers and pointers
3949 to functions.  In C++, warn also when an arithmetic operation involves
3950 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3951
3952 @item -Wtype-limits
3953 @opindex Wtype-limits
3954 @opindex Wno-type-limits
3955 Warn if a comparison is always true or always false due to the limited
3956 range of the data type, but do not warn for constant expressions.  For
3957 example, warn if an unsigned variable is compared against zero with
3958 @samp{<} or @samp{>=}.  This warning is also enabled by
3959 @option{-Wextra}.
3960
3961 @item -Wbad-function-cast @r{(C and Objective-C only)}
3962 @opindex Wbad-function-cast
3963 @opindex Wno-bad-function-cast
3964 Warn whenever a function call is cast to a non-matching type.
3965 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3966
3967 @item -Wc++-compat @r{(C and Objective-C only)}
3968 Warn about ISO C constructs that are outside of the common subset of
3969 ISO C and ISO C++, e.g.@: request for implicit conversion from
3970 @code{void *} to a pointer to non-@code{void} type.
3971
3972 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3973 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3974 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3975 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3976
3977 @item -Wcast-qual
3978 @opindex Wcast-qual
3979 @opindex Wno-cast-qual
3980 Warn whenever a pointer is cast so as to remove a type qualifier from
3981 the target type.  For example, warn if a @code{const char *} is cast
3982 to an ordinary @code{char *}.
3983
3984 Also warn when making a cast which introduces a type qualifier in an
3985 unsafe way.  For example, casting @code{char **} to @code{const char **}
3986 is unsafe, as in this example:
3987
3988 @smallexample
3989   /* p is char ** value.  */
3990   const char **q = (const char **) p;
3991   /* Assignment of readonly string to const char * is OK.  */
3992   *q = "string";
3993   /* Now char** pointer points to read-only memory.  */
3994   **p = 'b';
3995 @end smallexample
3996
3997 @item -Wcast-align
3998 @opindex Wcast-align
3999 @opindex Wno-cast-align
4000 Warn whenever a pointer is cast such that the required alignment of the
4001 target is increased.  For example, warn if a @code{char *} is cast to
4002 an @code{int *} on machines where integers can only be accessed at
4003 two- or four-byte boundaries.
4004
4005 @item -Wwrite-strings
4006 @opindex Wwrite-strings
4007 @opindex Wno-write-strings
4008 When compiling C, give string constants the type @code{const
4009 char[@var{length}]} so that copying the address of one into a
4010 non-@code{const} @code{char *} pointer will get a warning.  These
4011 warnings will help you find at compile time code that can try to write
4012 into a string constant, but only if you have been very careful about
4013 using @code{const} in declarations and prototypes.  Otherwise, it will
4014 just be a nuisance. This is why we did not make @option{-Wall} request
4015 these warnings.
4016
4017 When compiling C++, warn about the deprecated conversion from string
4018 literals to @code{char *}.  This warning is enabled by default for C++
4019 programs.
4020
4021 @item -Wclobbered
4022 @opindex Wclobbered
4023 @opindex Wno-clobbered
4024 Warn for variables that might be changed by @samp{longjmp} or
4025 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4026
4027 @item -Wconversion
4028 @opindex Wconversion
4029 @opindex Wno-conversion
4030 Warn for implicit conversions that may alter a value. This includes
4031 conversions between real and integer, like @code{abs (x)} when
4032 @code{x} is @code{double}; conversions between signed and unsigned,
4033 like @code{unsigned ui = -1}; and conversions to smaller types, like
4034 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4035 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4036 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4037 conversions between signed and unsigned integers can be disabled by
4038 using @option{-Wno-sign-conversion}.
4039
4040 For C++, also warn for confusing overload resolution for user-defined
4041 conversions; and conversions that will never use a type conversion
4042 operator: conversions to @code{void}, the same type, a base class or a
4043 reference to them. Warnings about conversions between signed and
4044 unsigned integers are disabled by default in C++ unless
4045 @option{-Wsign-conversion} is explicitly enabled.
4046
4047 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4048 @opindex Wconversion-null
4049 @opindex Wno-conversion-null
4050 Do not warn for conversions between @code{NULL} and non-pointer
4051 types. @option{-Wconversion-null} is enabled by default.
4052
4053 @item -Wempty-body
4054 @opindex Wempty-body
4055 @opindex Wno-empty-body
4056 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4057 while} statement.  This warning is also enabled by @option{-Wextra}.
4058
4059 @item -Wenum-compare
4060 @opindex Wenum-compare
4061 @opindex Wno-enum-compare
4062 Warn about a comparison between values of different enum types. In C++
4063 this warning is enabled by default.  In C this warning is enabled by
4064 @option{-Wall}.
4065
4066 @item -Wjump-misses-init @r{(C, Objective-C only)}
4067 @opindex Wjump-misses-init
4068 @opindex Wno-jump-misses-init
4069 Warn if a @code{goto} statement or a @code{switch} statement jumps
4070 forward across the initialization of a variable, or jumps backward to a
4071 label after the variable has been initialized.  This only warns about
4072 variables which are initialized when they are declared.  This warning is
4073 only supported for C and Objective C; in C++ this sort of branch is an
4074 error in any case.
4075
4076 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4077 can be disabled with the @option{-Wno-jump-misses-init} option.
4078
4079 @item -Wsign-compare
4080 @opindex Wsign-compare
4081 @opindex Wno-sign-compare
4082 @cindex warning for comparison of signed and unsigned values
4083 @cindex comparison of signed and unsigned values, warning
4084 @cindex signed and unsigned values, comparison warning
4085 Warn when a comparison between signed and unsigned values could produce
4086 an incorrect result when the signed value is converted to unsigned.
4087 This warning is also enabled by @option{-Wextra}; to get the other warnings
4088 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
4089
4090 @item -Wsign-conversion
4091 @opindex Wsign-conversion
4092 @opindex Wno-sign-conversion
4093 Warn for implicit conversions that may change the sign of an integer
4094 value, like assigning a signed integer expression to an unsigned
4095 integer variable. An explicit cast silences the warning. In C, this
4096 option is enabled also by @option{-Wconversion}.
4097
4098 @item -Waddress
4099 @opindex Waddress
4100 @opindex Wno-address
4101 Warn about suspicious uses of memory addresses. These include using
4102 the address of a function in a conditional expression, such as
4103 @code{void func(void); if (func)}, and comparisons against the memory
4104 address of a string literal, such as @code{if (x == "abc")}.  Such
4105 uses typically indicate a programmer error: the address of a function
4106 always evaluates to true, so their use in a conditional usually
4107 indicate that the programmer forgot the parentheses in a function
4108 call; and comparisons against string literals result in unspecified
4109 behavior and are not portable in C, so they usually indicate that the
4110 programmer intended to use @code{strcmp}.  This warning is enabled by
4111 @option{-Wall}.
4112
4113 @item -Wlogical-op
4114 @opindex Wlogical-op
4115 @opindex Wno-logical-op
4116 Warn about suspicious uses of logical operators in expressions.
4117 This includes using logical operators in contexts where a
4118 bit-wise operator is likely to be expected.
4119
4120 @item -Waggregate-return
4121 @opindex Waggregate-return
4122 @opindex Wno-aggregate-return
4123 Warn if any functions that return structures or unions are defined or
4124 called.  (In languages where you can return an array, this also elicits
4125 a warning.)
4126
4127 @item -Wno-attributes
4128 @opindex Wno-attributes
4129 @opindex Wattributes
4130 Do not warn if an unexpected @code{__attribute__} is used, such as
4131 unrecognized attributes, function attributes applied to variables,
4132 etc.  This will not stop errors for incorrect use of supported
4133 attributes.
4134
4135 @item -Wno-builtin-macro-redefined
4136 @opindex Wno-builtin-macro-redefined
4137 @opindex Wbuiltin-macro-redefined
4138 Do not warn if certain built-in macros are redefined.  This suppresses
4139 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4140 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4141
4142 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4143 @opindex Wstrict-prototypes
4144 @opindex Wno-strict-prototypes
4145 Warn if a function is declared or defined without specifying the
4146 argument types.  (An old-style function definition is permitted without
4147 a warning if preceded by a declaration which specifies the argument
4148 types.)
4149
4150 @item -Wold-style-declaration @r{(C and Objective-C only)}
4151 @opindex Wold-style-declaration
4152 @opindex Wno-old-style-declaration
4153 Warn for obsolescent usages, according to the C Standard, in a
4154 declaration. For example, warn if storage-class specifiers like
4155 @code{static} are not the first things in a declaration.  This warning
4156 is also enabled by @option{-Wextra}.
4157
4158 @item -Wold-style-definition @r{(C and Objective-C only)}
4159 @opindex Wold-style-definition
4160 @opindex Wno-old-style-definition
4161 Warn if an old-style function definition is used.  A warning is given
4162 even if there is a previous prototype.
4163
4164 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4165 @opindex Wmissing-parameter-type
4166 @opindex Wno-missing-parameter-type
4167 A function parameter is declared without a type specifier in K&R-style
4168 functions:
4169
4170 @smallexample
4171 void foo(bar) @{ @}
4172 @end smallexample
4173
4174 This warning is also enabled by @option{-Wextra}.
4175
4176 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4177 @opindex Wmissing-prototypes
4178 @opindex Wno-missing-prototypes
4179 Warn if a global function is defined without a previous prototype
4180 declaration.  This warning is issued even if the definition itself
4181 provides a prototype.  The aim is to detect global functions that fail
4182 to be declared in header files.
4183
4184 @item -Wmissing-declarations
4185 @opindex Wmissing-declarations
4186 @opindex Wno-missing-declarations
4187 Warn if a global function is defined without a previous declaration.
4188 Do so even if the definition itself provides a prototype.
4189 Use this option to detect global functions that are not declared in
4190 header files.  In C++, no warnings are issued for function templates,
4191 or for inline functions, or for functions in anonymous namespaces.
4192
4193 @item -Wmissing-field-initializers
4194 @opindex Wmissing-field-initializers
4195 @opindex Wno-missing-field-initializers
4196 @opindex W
4197 @opindex Wextra
4198 @opindex Wno-extra
4199 Warn if a structure's initializer has some fields missing.  For
4200 example, the following code would cause such a warning, because
4201 @code{x.h} is implicitly zero:
4202
4203 @smallexample
4204 struct s @{ int f, g, h; @};
4205 struct s x = @{ 3, 4 @};
4206 @end smallexample
4207
4208 This option does not warn about designated initializers, so the following
4209 modification would not trigger a warning:
4210
4211 @smallexample
4212 struct s @{ int f, g, h; @};
4213 struct s x = @{ .f = 3, .g = 4 @};
4214 @end smallexample
4215
4216 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4217 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
4218
4219 @item -Wmissing-format-attribute
4220 @opindex Wmissing-format-attribute
4221 @opindex Wno-missing-format-attribute
4222 @opindex Wformat
4223 @opindex Wno-format
4224 Warn about function pointers which might be candidates for @code{format}
4225 attributes.  Note these are only possible candidates, not absolute ones.
4226 GCC will guess that function pointers with @code{format} attributes that
4227 are used in assignment, initialization, parameter passing or return
4228 statements should have a corresponding @code{format} attribute in the
4229 resulting type.  I.e.@: the left-hand side of the assignment or
4230 initialization, the type of the parameter variable, or the return type
4231 of the containing function respectively should also have a @code{format}
4232 attribute to avoid the warning.
4233
4234 GCC will also warn about function definitions which might be
4235 candidates for @code{format} attributes.  Again, these are only
4236 possible candidates.  GCC will guess that @code{format} attributes
4237 might be appropriate for any function that calls a function like
4238 @code{vprintf} or @code{vscanf}, but this might not always be the
4239 case, and some functions for which @code{format} attributes are
4240 appropriate may not be detected.
4241
4242 @item -Wno-multichar
4243 @opindex Wno-multichar
4244 @opindex Wmultichar
4245 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4246 Usually they indicate a typo in the user's code, as they have
4247 implementation-defined values, and should not be used in portable code.
4248
4249 @item -Wnormalized=<none|id|nfc|nfkc>
4250 @opindex Wnormalized=
4251 @cindex NFC
4252 @cindex NFKC
4253 @cindex character set, input normalization
4254 In ISO C and ISO C++, two identifiers are different if they are
4255 different sequences of characters.  However, sometimes when characters
4256 outside the basic ASCII character set are used, you can have two
4257 different character sequences that look the same.  To avoid confusion,
4258 the ISO 10646 standard sets out some @dfn{normalization rules} which
4259 when applied ensure that two sequences that look the same are turned into
4260 the same sequence.  GCC can warn you if you are using identifiers which
4261 have not been normalized; this option controls that warning.
4262
4263 There are four levels of warning that GCC supports.  The default is
4264 @option{-Wnormalized=nfc}, which warns about any identifier which is
4265 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4266 recommended form for most uses.
4267
4268 Unfortunately, there are some characters which ISO C and ISO C++ allow
4269 in identifiers that when turned into NFC aren't allowable as
4270 identifiers.  That is, there's no way to use these symbols in portable
4271 ISO C or C++ and have all your identifiers in NFC@.
4272 @option{-Wnormalized=id} suppresses the warning for these characters.
4273 It is hoped that future versions of the standards involved will correct
4274 this, which is why this option is not the default.
4275
4276 You can switch the warning off for all characters by writing
4277 @option{-Wnormalized=none}.  You would only want to do this if you
4278 were using some other normalization scheme (like ``D''), because
4279 otherwise you can easily create bugs that are literally impossible to see.
4280
4281 Some characters in ISO 10646 have distinct meanings but look identical
4282 in some fonts or display methodologies, especially once formatting has
4283 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4284 LETTER N'', will display just like a regular @code{n} which has been
4285 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4286 normalization scheme to convert all these into a standard form as
4287 well, and GCC will warn if your code is not in NFKC if you use
4288 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4289 about every identifier that contains the letter O because it might be
4290 confused with the digit 0, and so is not the default, but may be
4291 useful as a local coding convention if the programming environment is
4292 unable to be fixed to display these characters distinctly.
4293
4294 @item -Wno-deprecated
4295 @opindex Wno-deprecated
4296 @opindex Wdeprecated
4297 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4298
4299 @item -Wno-deprecated-declarations
4300 @opindex Wno-deprecated-declarations
4301 @opindex Wdeprecated-declarations
4302 Do not warn about uses of functions (@pxref{Function Attributes}),
4303 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4304 Attributes}) marked as deprecated by using the @code{deprecated}
4305 attribute.
4306
4307 @item -Wno-overflow
4308 @opindex Wno-overflow
4309 @opindex Woverflow
4310 Do not warn about compile-time overflow in constant expressions.
4311
4312 @item -Woverride-init @r{(C and Objective-C only)}
4313 @opindex Woverride-init
4314 @opindex Wno-override-init
4315 @opindex W
4316 @opindex Wextra
4317 @opindex Wno-extra
4318 Warn if an initialized field without side effects is overridden when
4319 using designated initializers (@pxref{Designated Inits, , Designated
4320 Initializers}).
4321
4322 This warning is included in @option{-Wextra}.  To get other
4323 @option{-Wextra} warnings without this one, use @samp{-Wextra
4324 -Wno-override-init}.
4325
4326 @item -Wpacked
4327 @opindex Wpacked
4328 @opindex Wno-packed
4329 Warn if a structure is given the packed attribute, but the packed
4330 attribute has no effect on the layout or size of the structure.
4331 Such structures may be mis-aligned for little benefit.  For
4332 instance, in this code, the variable @code{f.x} in @code{struct bar}
4333 will be misaligned even though @code{struct bar} does not itself
4334 have the packed attribute:
4335
4336 @smallexample
4337 @group
4338 struct foo @{
4339   int x;
4340   char a, b, c, d;
4341 @} __attribute__((packed));
4342 struct bar @{
4343   char z;
4344   struct foo f;
4345 @};
4346 @end group
4347 @end smallexample
4348
4349 @item -Wpacked-bitfield-compat
4350 @opindex Wpacked-bitfield-compat
4351 @opindex Wno-packed-bitfield-compat
4352 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4353 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4354 the change can lead to differences in the structure layout.  GCC
4355 informs you when the offset of such a field has changed in GCC 4.4.
4356 For example there is no longer a 4-bit padding between field @code{a}
4357 and @code{b} in this structure:
4358
4359 @smallexample
4360 struct foo
4361 @{
4362   char a:4;
4363   char b:8;
4364 @} __attribute__ ((packed));
4365 @end smallexample
4366
4367 This warning is enabled by default.  Use
4368 @option{-Wno-packed-bitfield-compat} to disable this warning.
4369
4370 @item -Wpadded
4371 @opindex Wpadded
4372 @opindex Wno-padded
4373 Warn if padding is included in a structure, either to align an element
4374 of the structure or to align the whole structure.  Sometimes when this
4375 happens it is possible to rearrange the fields of the structure to
4376 reduce the padding and so make the structure smaller.
4377
4378 @item -Wredundant-decls
4379 @opindex Wredundant-decls
4380 @opindex Wno-redundant-decls
4381 Warn if anything is declared more than once in the same scope, even in
4382 cases where multiple declaration is valid and changes nothing.
4383
4384 @item -Wnested-externs @r{(C and Objective-C only)}
4385 @opindex Wnested-externs
4386 @opindex Wno-nested-externs
4387 Warn if an @code{extern} declaration is encountered within a function.
4388
4389 @item -Winline
4390 @opindex Winline
4391 @opindex Wno-inline
4392 Warn if a function can not be inlined and it was declared as inline.
4393 Even with this option, the compiler will not warn about failures to
4394 inline functions declared in system headers.
4395
4396 The compiler uses a variety of heuristics to determine whether or not
4397 to inline a function.  For example, the compiler takes into account
4398 the size of the function being inlined and the amount of inlining
4399 that has already been done in the current function.  Therefore,
4400 seemingly insignificant changes in the source program can cause the
4401 warnings produced by @option{-Winline} to appear or disappear.
4402
4403 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4404 @opindex Wno-invalid-offsetof
4405 @opindex Winvalid-offsetof
4406 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4407 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4408 to a non-POD type is undefined.  In existing C++ implementations,
4409 however, @samp{offsetof} typically gives meaningful results even when
4410 applied to certain kinds of non-POD types. (Such as a simple
4411 @samp{struct} that fails to be a POD type only by virtue of having a
4412 constructor.)  This flag is for users who are aware that they are
4413 writing nonportable code and who have deliberately chosen to ignore the
4414 warning about it.
4415
4416 The restrictions on @samp{offsetof} may be relaxed in a future version
4417 of the C++ standard.
4418
4419 @item -Wno-int-to-pointer-cast
4420 @opindex Wno-int-to-pointer-cast
4421 @opindex Wint-to-pointer-cast
4422 Suppress warnings from casts to pointer type of an integer of a
4423 different size. In C++, casting to a pointer type of smaller size is
4424 an error. @option{Wint-to-pointer-cast} is enabled by default.
4425
4426
4427 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4428 @opindex Wno-pointer-to-int-cast
4429 @opindex Wpointer-to-int-cast
4430 Suppress warnings from casts from a pointer to an integer type of a
4431 different size.
4432
4433 @item -Winvalid-pch
4434 @opindex Winvalid-pch
4435 @opindex Wno-invalid-pch
4436 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4437 the search path but can't be used.
4438
4439 @item -Wlong-long
4440 @opindex Wlong-long
4441 @opindex Wno-long-long
4442 Warn if @samp{long long} type is used.  This is enabled by either
4443 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4444 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4445
4446 @item -Wvariadic-macros
4447 @opindex Wvariadic-macros
4448 @opindex Wno-variadic-macros
4449 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4450 alternate syntax when in pedantic ISO C99 mode.  This is default.
4451 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4452
4453 @item -Wvla
4454 @opindex Wvla
4455 @opindex Wno-vla
4456 Warn if variable length array is used in the code.
4457 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4458 the variable length array.
4459
4460 @item -Wvolatile-register-var
4461 @opindex Wvolatile-register-var
4462 @opindex Wno-volatile-register-var
4463 Warn if a register variable is declared volatile.  The volatile
4464 modifier does not inhibit all optimizations that may eliminate reads
4465 and/or writes to register variables.  This warning is enabled by
4466 @option{-Wall}.
4467
4468 @item -Wdisabled-optimization
4469 @opindex Wdisabled-optimization
4470 @opindex Wno-disabled-optimization
4471 Warn if a requested optimization pass is disabled.  This warning does
4472 not generally indicate that there is anything wrong with your code; it
4473 merely indicates that GCC's optimizers were unable to handle the code
4474 effectively.  Often, the problem is that your code is too big or too
4475 complex; GCC will refuse to optimize programs when the optimization
4476 itself is likely to take inordinate amounts of time.
4477
4478 @item -Wpointer-sign @r{(C and Objective-C only)}
4479 @opindex Wpointer-sign
4480 @opindex Wno-pointer-sign
4481 Warn for pointer argument passing or assignment with different signedness.
4482 This option is only supported for C and Objective-C@.  It is implied by
4483 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4484 @option{-Wno-pointer-sign}.
4485
4486 @item -Wstack-protector
4487 @opindex Wstack-protector
4488 @opindex Wno-stack-protector
4489 This option is only active when @option{-fstack-protector} is active.  It
4490 warns about functions that will not be protected against stack smashing.
4491
4492 @item -Wno-mudflap
4493 @opindex Wno-mudflap
4494 Suppress warnings about constructs that cannot be instrumented by
4495 @option{-fmudflap}.
4496
4497 @item -Woverlength-strings
4498 @opindex Woverlength-strings
4499 @opindex Wno-overlength-strings
4500 Warn about string constants which are longer than the ``minimum
4501 maximum'' length specified in the C standard.  Modern compilers
4502 generally allow string constants which are much longer than the
4503 standard's minimum limit, but very portable programs should avoid
4504 using longer strings.
4505
4506 The limit applies @emph{after} string constant concatenation, and does
4507 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4508 C99, it was raised to 4095.  C++98 does not specify a normative
4509 minimum maximum, so we do not diagnose overlength strings in C++@.
4510
4511 This option is implied by @option{-pedantic}, and can be disabled with
4512 @option{-Wno-overlength-strings}.
4513
4514 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4515 @opindex Wunsuffixed-float-constants
4516
4517 GCC will issue a warning for any floating constant that does not have
4518 a suffix.  When used together with @option{-Wsystem-headers} it will
4519 warn about such constants in system header files.  This can be useful
4520 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4521 from the decimal floating-point extension to C99.
4522 @end table
4523
4524 @node Debugging Options
4525 @section Options for Debugging Your Program or GCC
4526 @cindex options, debugging
4527 @cindex debugging information options
4528
4529 GCC has various special options that are used for debugging
4530 either your program or GCC:
4531
4532 @table @gcctabopt
4533 @item -g
4534 @opindex g
4535 Produce debugging information in the operating system's native format
4536 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4537 information.
4538
4539 On most systems that use stabs format, @option{-g} enables use of extra
4540 debugging information that only GDB can use; this extra information
4541 makes debugging work better in GDB but will probably make other debuggers
4542 crash or
4543 refuse to read the program.  If you want to control for certain whether
4544 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4545 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4546
4547 GCC allows you to use @option{-g} with
4548 @option{-O}.  The shortcuts taken by optimized code may occasionally
4549 produce surprising results: some variables you declared may not exist
4550 at all; flow of control may briefly move where you did not expect it;
4551 some statements may not be executed because they compute constant
4552 results or their values were already at hand; some statements may
4553 execute in different places because they were moved out of loops.
4554
4555 Nevertheless it proves possible to debug optimized output.  This makes
4556 it reasonable to use the optimizer for programs that might have bugs.
4557
4558 The following options are useful when GCC is generated with the
4559 capability for more than one debugging format.
4560
4561 @item -ggdb
4562 @opindex ggdb
4563 Produce debugging information for use by GDB@.  This means to use the
4564 most expressive format available (DWARF 2, stabs, or the native format
4565 if neither of those are supported), including GDB extensions if at all
4566 possible.
4567
4568 @item -gstabs
4569 @opindex gstabs
4570 Produce debugging information in stabs format (if that is supported),
4571 without GDB extensions.  This is the format used by DBX on most BSD
4572 systems.  On MIPS, Alpha and System V Release 4 systems this option
4573 produces stabs debugging output which is not understood by DBX or SDB@.
4574 On System V Release 4 systems this option requires the GNU assembler.
4575
4576 @item -feliminate-unused-debug-symbols
4577 @opindex feliminate-unused-debug-symbols
4578 Produce debugging information in stabs format (if that is supported),
4579 for only symbols that are actually used.
4580
4581 @item -femit-class-debug-always
4582 Instead of emitting debugging information for a C++ class in only one
4583 object file, emit it in all object files using the class.  This option
4584 should be used only with debuggers that are unable to handle the way GCC
4585 normally emits debugging information for classes because using this
4586 option will increase the size of debugging information by as much as a
4587 factor of two.
4588
4589 @item -gstabs+
4590 @opindex gstabs+
4591 Produce debugging information in stabs format (if that is supported),
4592 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4593 use of these extensions is likely to make other debuggers crash or
4594 refuse to read the program.
4595
4596 @item -gcoff
4597 @opindex gcoff
4598 Produce debugging information in COFF format (if that is supported).
4599 This is the format used by SDB on most System V systems prior to
4600 System V Release 4.
4601
4602 @item -gxcoff
4603 @opindex gxcoff
4604 Produce debugging information in XCOFF format (if that is supported).
4605 This is the format used by the DBX debugger on IBM RS/6000 systems.
4606
4607 @item -gxcoff+
4608 @opindex gxcoff+
4609 Produce debugging information in XCOFF format (if that is supported),
4610 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4611 use of these extensions is likely to make other debuggers crash or
4612 refuse to read the program, and may cause assemblers other than the GNU
4613 assembler (GAS) to fail with an error.
4614
4615 @item -gdwarf-@var{version}
4616 @opindex gdwarf-@var{version}
4617 Produce debugging information in DWARF format (if that is
4618 supported).  This is the format used by DBX on IRIX 6.  The value
4619 of @var{version} may be either 2, 3 or 4; the default version is 2.
4620
4621 Note that with DWARF version 2 some ports require, and will always
4622 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4623
4624 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4625 for maximum benefit.
4626
4627 @item -gstrict-dwarf
4628 @opindex gstrict-dwarf
4629 Disallow using extensions of later DWARF standard version than selected
4630 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4631 DWARF extensions from later standard versions is allowed.
4632
4633 @item -gno-strict-dwarf
4634 @opindex gno-strict-dwarf
4635 Allow using extensions of later DWARF standard version than selected with
4636 @option{-gdwarf-@var{version}}.
4637
4638 @item -gvms
4639 @opindex gvms
4640 Produce debugging information in VMS debug format (if that is
4641 supported).  This is the format used by DEBUG on VMS systems.
4642
4643 @item -g@var{level}
4644 @itemx -ggdb@var{level}
4645 @itemx -gstabs@var{level}
4646 @itemx -gcoff@var{level}
4647 @itemx -gxcoff@var{level}
4648 @itemx -gvms@var{level}
4649 Request debugging information and also use @var{level} to specify how
4650 much information.  The default level is 2.
4651
4652 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4653 @option{-g}.
4654
4655 Level 1 produces minimal information, enough for making backtraces in
4656 parts of the program that you don't plan to debug.  This includes
4657 descriptions of functions and external variables, but no information
4658 about local variables and no line numbers.
4659
4660 Level 3 includes extra information, such as all the macro definitions
4661 present in the program.  Some debuggers support macro expansion when
4662 you use @option{-g3}.
4663
4664 @option{-gdwarf-2} does not accept a concatenated debug level, because
4665 GCC used to support an option @option{-gdwarf} that meant to generate
4666 debug information in version 1 of the DWARF format (which is very
4667 different from version 2), and it would have been too confusing.  That
4668 debug format is long obsolete, but the option cannot be changed now.
4669 Instead use an additional @option{-g@var{level}} option to change the
4670 debug level for DWARF.
4671
4672 @item -gtoggle
4673 @opindex gtoggle
4674 Turn off generation of debug info, if leaving out this option would have
4675 generated it, or turn it on at level 2 otherwise.  The position of this
4676 argument in the command line does not matter, it takes effect after all
4677 other options are processed, and it does so only once, no matter how
4678 many times it is given.  This is mainly intended to be used with
4679 @option{-fcompare-debug}.
4680
4681 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4682 @opindex fdump-final-insns
4683 Dump the final internal representation (RTL) to @var{file}.  If the
4684 optional argument is omitted (or if @var{file} is @code{.}), the name
4685 of the dump file will be determined by appending @code{.gkd} to the
4686 compilation output file name.
4687
4688 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4689 @opindex fcompare-debug
4690 @opindex fno-compare-debug
4691 If no error occurs during compilation, run the compiler a second time,
4692 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4693 passed to the second compilation.  Dump the final internal
4694 representation in both compilations, and print an error if they differ.
4695
4696 If the equal sign is omitted, the default @option{-gtoggle} is used.
4697
4698 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4699 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4700 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4701 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4702 is used.
4703
4704 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4705 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4706 of the final representation and the second compilation, preventing even
4707 @env{GCC_COMPARE_DEBUG} from taking effect.
4708
4709 To verify full coverage during @option{-fcompare-debug} testing, set
4710 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4711 which GCC will reject as an invalid option in any actual compilation
4712 (rather than preprocessing, assembly or linking).  To get just a
4713 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4714 not overridden} will do.
4715
4716 @item -fcompare-debug-second
4717 @opindex fcompare-debug-second
4718 This option is implicitly passed to the compiler for the second
4719 compilation requested by @option{-fcompare-debug}, along with options to
4720 silence warnings, and omitting other options that would cause
4721 side-effect compiler outputs to files or to the standard output.  Dump
4722 files and preserved temporary files are renamed so as to contain the
4723 @code{.gk} additional extension during the second compilation, to avoid
4724 overwriting those generated by the first.
4725
4726 When this option is passed to the compiler driver, it causes the
4727 @emph{first} compilation to be skipped, which makes it useful for little
4728 other than debugging the compiler proper.
4729
4730 @item -feliminate-dwarf2-dups
4731 @opindex feliminate-dwarf2-dups
4732 Compress DWARF2 debugging information by eliminating duplicated
4733 information about each symbol.  This option only makes sense when
4734 generating DWARF2 debugging information with @option{-gdwarf-2}.
4735
4736 @item -femit-struct-debug-baseonly
4737 Emit debug information for struct-like types
4738 only when the base name of the compilation source file
4739 matches the base name of file in which the struct was defined.
4740
4741 This option substantially reduces the size of debugging information,
4742 but at significant potential loss in type information to the debugger.
4743 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4744 See @option{-femit-struct-debug-detailed} for more detailed control.
4745
4746 This option works only with DWARF 2.
4747
4748 @item -femit-struct-debug-reduced
4749 Emit debug information for struct-like types
4750 only when the base name of the compilation source file
4751 matches the base name of file in which the type was defined,
4752 unless the struct is a template or defined in a system header.
4753
4754 This option significantly reduces the size of debugging information,
4755 with some potential loss in type information to the debugger.
4756 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4757 See @option{-femit-struct-debug-detailed} for more detailed control.
4758
4759 This option works only with DWARF 2.
4760
4761 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4762 Specify the struct-like types
4763 for which the compiler will generate debug information.
4764 The intent is to reduce duplicate struct debug information
4765 between different object files within the same program.
4766
4767 This option is a detailed version of
4768 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4769 which will serve for most needs.
4770
4771 A specification has the syntax@*
4772 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4773
4774 The optional first word limits the specification to
4775 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4776 A struct type is used directly when it is the type of a variable, member.
4777 Indirect uses arise through pointers to structs.
4778 That is, when use of an incomplete struct would be legal, the use is indirect.
4779 An example is
4780 @samp{struct one direct; struct two * indirect;}.
4781
4782 The optional second word limits the specification to
4783 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4784 Generic structs are a bit complicated to explain.
4785 For C++, these are non-explicit specializations of template classes,
4786 or non-template classes within the above.
4787 Other programming languages have generics,
4788 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4789
4790 The third word specifies the source files for those
4791 structs for which the compiler will emit debug information.
4792 The values @samp{none} and @samp{any} have the normal meaning.
4793 The value @samp{base} means that
4794 the base of name of the file in which the type declaration appears
4795 must match the base of the name of the main compilation file.
4796 In practice, this means that
4797 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4798 but types declared in other header will not.
4799 The value @samp{sys} means those types satisfying @samp{base}
4800 or declared in system or compiler headers.
4801
4802 You may need to experiment to determine the best settings for your application.
4803
4804 The default is @samp{-femit-struct-debug-detailed=all}.
4805
4806 This option works only with DWARF 2.
4807
4808 @item -fenable-icf-debug
4809 @opindex fenable-icf-debug
4810 Generate additional debug information to support identical code folding (ICF).
4811 This option only works with DWARF version 2 or higher.
4812
4813 @item -fno-merge-debug-strings
4814 @opindex fmerge-debug-strings
4815 @opindex fno-merge-debug-strings
4816 Direct the linker to not merge together strings in the debugging
4817 information which are identical in different object files.  Merging is
4818 not supported by all assemblers or linkers.  Merging decreases the size
4819 of the debug information in the output file at the cost of increasing
4820 link processing time.  Merging is enabled by default.
4821
4822 @item -fdebug-prefix-map=@var{old}=@var{new}
4823 @opindex fdebug-prefix-map
4824 When compiling files in directory @file{@var{old}}, record debugging
4825 information describing them as in @file{@var{new}} instead.
4826
4827 @item -fno-dwarf2-cfi-asm
4828 @opindex fdwarf2-cfi-asm
4829 @opindex fno-dwarf2-cfi-asm
4830 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4831 instead of using GAS @code{.cfi_*} directives.
4832
4833 @cindex @command{prof}
4834 @item -p
4835 @opindex p
4836 Generate extra code to write profile information suitable for the
4837 analysis program @command{prof}.  You must use this option when compiling
4838 the source files you want data about, and you must also use it when
4839 linking.
4840
4841 @cindex @command{gprof}
4842 @item -pg
4843 @opindex pg
4844 Generate extra code to write profile information suitable for the
4845 analysis program @command{gprof}.  You must use this option when compiling
4846 the source files you want data about, and you must also use it when
4847 linking.
4848
4849 @item -Q
4850 @opindex Q
4851 Makes the compiler print out each function name as it is compiled, and
4852 print some statistics about each pass when it finishes.
4853
4854 @item -ftime-report
4855 @opindex ftime-report
4856 Makes the compiler print some statistics about the time consumed by each
4857 pass when it finishes.
4858
4859 @item -fmem-report
4860 @opindex fmem-report
4861 Makes the compiler print some statistics about permanent memory
4862 allocation when it finishes.
4863
4864 @item -fpre-ipa-mem-report
4865 @opindex fpre-ipa-mem-report
4866 @item -fpost-ipa-mem-report
4867 @opindex fpost-ipa-mem-report
4868 Makes the compiler print some statistics about permanent memory
4869 allocation before or after interprocedural optimization.
4870
4871 @item -fstack-usage
4872 @opindex fstack-usage
4873 Makes the compiler output stack usage information for the program, on a
4874 per-function basis.  The filename for the dump is made by appending
4875 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
4876 the output file, if explicitly specified and it is not an executable,
4877 otherwise it is the basename of the source file.  An entry is made up
4878 of three fields:
4879
4880 @itemize
4881 @item
4882 The name of the function.
4883 @item
4884 A number of bytes.
4885 @item
4886 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
4887 @end itemize
4888
4889 The qualifier @code{static} means that the function manipulates the stack
4890 statically: a fixed number of bytes are allocated for the frame on function
4891 entry and released on function exit; no stack adjustments are otherwise made
4892 in the function.  The second field is this fixed number of bytes.
4893
4894 The qualifier @code{dynamic} means that the function manipulates the stack
4895 dynamically: in addition to the static allocation described above, stack
4896 adjustments are made in the body of the function, for example to push/pop
4897 arguments around function calls.  If the qualifier @code{bounded} is also
4898 present, the amount of these adjustments is bounded at compile-time and
4899 the second field is an upper bound of the total amount of stack used by
4900 the function.  If it is not present, the amount of these adjustments is
4901 not bounded at compile-time and the second field only represents the
4902 bounded part.
4903
4904 @item -fprofile-arcs
4905 @opindex fprofile-arcs
4906 Add code so that program flow @dfn{arcs} are instrumented.  During
4907 execution the program records how many times each branch and call is
4908 executed and how many times it is taken or returns.  When the compiled
4909 program exits it saves this data to a file called
4910 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4911 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4912 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4913 @var{auxname} is generated from the name of the output file, if
4914 explicitly specified and it is not the final executable, otherwise it is
4915 the basename of the source file.  In both cases any suffix is removed
4916 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4917 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4918 @xref{Cross-profiling}.
4919
4920 @cindex @command{gcov}
4921 @item --coverage
4922 @opindex coverage
4923
4924 This option is used to compile and link code instrumented for coverage
4925 analysis.  The option is a synonym for @option{-fprofile-arcs}
4926 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4927 linking).  See the documentation for those options for more details.
4928
4929 @itemize
4930
4931 @item
4932 Compile the source files with @option{-fprofile-arcs} plus optimization
4933 and code generation options.  For test coverage analysis, use the
4934 additional @option{-ftest-coverage} option.  You do not need to profile
4935 every source file in a program.
4936
4937 @item
4938 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4939 (the latter implies the former).
4940
4941 @item
4942 Run the program on a representative workload to generate the arc profile
4943 information.  This may be repeated any number of times.  You can run
4944 concurrent instances of your program, and provided that the file system
4945 supports locking, the data files will be correctly updated.  Also
4946 @code{fork} calls are detected and correctly handled (double counting
4947 will not happen).
4948
4949 @item
4950 For profile-directed optimizations, compile the source files again with
4951 the same optimization and code generation options plus
4952 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4953 Control Optimization}).
4954
4955 @item
4956 For test coverage analysis, use @command{gcov} to produce human readable
4957 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4958 @command{gcov} documentation for further information.
4959
4960 @end itemize
4961
4962 With @option{-fprofile-arcs}, for each function of your program GCC
4963 creates a program flow graph, then finds a spanning tree for the graph.
4964 Only arcs that are not on the spanning tree have to be instrumented: the
4965 compiler adds code to count the number of times that these arcs are
4966 executed.  When an arc is the only exit or only entrance to a block, the
4967 instrumentation code can be added to the block; otherwise, a new basic
4968 block must be created to hold the instrumentation code.
4969
4970 @need 2000
4971 @item -ftest-coverage
4972 @opindex ftest-coverage
4973 Produce a notes file that the @command{gcov} code-coverage utility
4974 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4975 show program coverage.  Each source file's note file is called
4976 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4977 above for a description of @var{auxname} and instructions on how to
4978 generate test coverage data.  Coverage data will match the source files
4979 more closely, if you do not optimize.
4980
4981 @item -fdbg-cnt-list
4982 @opindex fdbg-cnt-list
4983 Print the name and the counter upper bound for all debug counters.
4984
4985 @item -fdbg-cnt=@var{counter-value-list}
4986 @opindex fdbg-cnt
4987 Set the internal debug counter upper bound.  @var{counter-value-list}
4988 is a comma-separated list of @var{name}:@var{value} pairs
4989 which sets the upper bound of each debug counter @var{name} to @var{value}.
4990 All debug counters have the initial upper bound of @var{UINT_MAX},
4991 thus dbg_cnt() returns true always unless the upper bound is set by this option.
4992 e.g. With -fdbg-cnt=dce:10,tail_call:0
4993 dbg_cnt(dce) will return true only for first 10 invocations
4994 and dbg_cnt(tail_call) will return false always.
4995
4996 @item -d@var{letters}
4997 @itemx -fdump-rtl-@var{pass}
4998 @opindex d
4999 Says to make debugging dumps during compilation at times specified by
5000 @var{letters}.  This is used for debugging the RTL-based passes of the
5001 compiler.  The file names for most of the dumps are made by appending
5002 a pass number and a word to the @var{dumpname}, and the files are
5003 created in the directory of the output file.  Note that the pass
5004 number is computed statically as passes get registered into the pass
5005 manager.  Thus the numbering is not related to the dynamic order of
5006 execution of passes.  In particular, a pass installed by a plugin
5007 could have a number over 200 even if it executed quite early.
5008 @var{dumpname} is generated from the name of the output file, if
5009 explicitly specified and it is not an executable, otherwise it is the
5010 basename of the source file. These switches may have different effects
5011 when @option{-E} is used for preprocessing.
5012
5013 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5014 @option{-d} option @var{letters}.  Here are the possible
5015 letters for use in @var{pass} and @var{letters}, and their meanings:
5016
5017 @table @gcctabopt
5018
5019 @item -fdump-rtl-alignments
5020 @opindex fdump-rtl-alignments
5021 Dump after branch alignments have been computed.
5022
5023 @item -fdump-rtl-asmcons
5024 @opindex fdump-rtl-asmcons
5025 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5026
5027 @item -fdump-rtl-auto_inc_dec
5028 @opindex fdump-rtl-auto_inc_dec
5029 Dump after auto-inc-dec discovery.  This pass is only run on
5030 architectures that have auto inc or auto dec instructions.
5031
5032 @item -fdump-rtl-barriers
5033 @opindex fdump-rtl-barriers
5034 Dump after cleaning up the barrier instructions.
5035
5036 @item -fdump-rtl-bbpart
5037 @opindex fdump-rtl-bbpart
5038 Dump after partitioning hot and cold basic blocks.
5039
5040 @item -fdump-rtl-bbro
5041 @opindex fdump-rtl-bbro
5042 Dump after block reordering.
5043
5044 @item -fdump-rtl-btl1
5045 @itemx -fdump-rtl-btl2
5046 @opindex fdump-rtl-btl2
5047 @opindex fdump-rtl-btl2
5048 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5049 after the two branch
5050 target load optimization passes.
5051
5052 @item -fdump-rtl-bypass
5053 @opindex fdump-rtl-bypass
5054 Dump after jump bypassing and control flow optimizations.
5055
5056 @item -fdump-rtl-combine
5057 @opindex fdump-rtl-combine
5058 Dump after the RTL instruction combination pass.
5059
5060 @item -fdump-rtl-compgotos
5061 @opindex fdump-rtl-compgotos
5062 Dump after duplicating the computed gotos.
5063
5064 @item -fdump-rtl-ce1
5065 @itemx -fdump-rtl-ce2
5066 @itemx -fdump-rtl-ce3
5067 @opindex fdump-rtl-ce1
5068 @opindex fdump-rtl-ce2
5069 @opindex fdump-rtl-ce3
5070 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5071 @option{-fdump-rtl-ce3} enable dumping after the three
5072 if conversion passes.
5073
5074 @itemx -fdump-rtl-cprop_hardreg
5075 @opindex fdump-rtl-cprop_hardreg
5076 Dump after hard register copy propagation.
5077
5078 @itemx -fdump-rtl-csa
5079 @opindex fdump-rtl-csa
5080 Dump after combining stack adjustments.
5081
5082 @item -fdump-rtl-cse1
5083 @itemx -fdump-rtl-cse2
5084 @opindex fdump-rtl-cse1
5085 @opindex fdump-rtl-cse2
5086 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5087 the two common sub-expression elimination passes.
5088
5089 @itemx -fdump-rtl-dce
5090 @opindex fdump-rtl-dce
5091 Dump after the standalone dead code elimination passes.
5092
5093 @itemx -fdump-rtl-dbr
5094 @opindex fdump-rtl-dbr
5095 Dump after delayed branch scheduling.
5096
5097 @item -fdump-rtl-dce1
5098 @itemx -fdump-rtl-dce2
5099 @opindex fdump-rtl-dce1
5100 @opindex fdump-rtl-dce2
5101 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5102 the two dead store elimination passes.
5103
5104 @item -fdump-rtl-eh
5105 @opindex fdump-rtl-eh
5106 Dump after finalization of EH handling code.
5107
5108 @item -fdump-rtl-eh_ranges
5109 @opindex fdump-rtl-eh_ranges
5110 Dump after conversion of EH handling range regions.
5111
5112 @item -fdump-rtl-expand
5113 @opindex fdump-rtl-expand
5114 Dump after RTL generation.
5115
5116 @item -fdump-rtl-fwprop1
5117 @itemx -fdump-rtl-fwprop2
5118 @opindex fdump-rtl-fwprop1
5119 @opindex fdump-rtl-fwprop2
5120 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5121 dumping after the two forward propagation passes.
5122
5123 @item -fdump-rtl-gcse1
5124 @itemx -fdump-rtl-gcse2
5125 @opindex fdump-rtl-gcse1
5126 @opindex fdump-rtl-gcse2
5127 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5128 after global common subexpression elimination.
5129
5130 @item -fdump-rtl-init-regs
5131 @opindex fdump-rtl-init-regs
5132 Dump after the initialization of the registers.
5133
5134 @item -fdump-rtl-initvals
5135 @opindex fdump-rtl-initvals
5136 Dump after the computation of the initial value sets.
5137
5138 @itemx -fdump-rtl-into_cfglayout
5139 @opindex fdump-rtl-into_cfglayout
5140 Dump after converting to cfglayout mode.
5141
5142 @item -fdump-rtl-ira
5143 @opindex fdump-rtl-ira
5144 Dump after iterated register allocation.
5145
5146 @item -fdump-rtl-jump
5147 @opindex fdump-rtl-jump
5148 Dump after the second jump optimization.
5149
5150 @item -fdump-rtl-loop2
5151 @opindex fdump-rtl-loop2
5152 @option{-fdump-rtl-loop2} enables dumping after the rtl
5153 loop optimization passes.
5154
5155 @item -fdump-rtl-mach
5156 @opindex fdump-rtl-mach
5157 Dump after performing the machine dependent reorganization pass, if that
5158 pass exists.
5159
5160 @item -fdump-rtl-mode_sw
5161 @opindex fdump-rtl-mode_sw
5162 Dump after removing redundant mode switches.
5163
5164 @item -fdump-rtl-rnreg
5165 @opindex fdump-rtl-rnreg
5166 Dump after register renumbering.
5167
5168 @itemx -fdump-rtl-outof_cfglayout
5169 @opindex fdump-rtl-outof_cfglayout
5170 Dump after converting from cfglayout mode.
5171
5172 @item -fdump-rtl-peephole2
5173 @opindex fdump-rtl-peephole2
5174 Dump after the peephole pass.
5175
5176 @item -fdump-rtl-postreload
5177 @opindex fdump-rtl-postreload
5178 Dump after post-reload optimizations.
5179
5180 @itemx -fdump-rtl-pro_and_epilogue
5181 @opindex fdump-rtl-pro_and_epilogue
5182 Dump after generating the function pro and epilogues.
5183
5184 @item -fdump-rtl-regmove
5185 @opindex fdump-rtl-regmove
5186 Dump after the register move pass.
5187
5188 @item -fdump-rtl-sched1
5189 @itemx -fdump-rtl-sched2
5190 @opindex fdump-rtl-sched1
5191 @opindex fdump-rtl-sched2
5192 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5193 after the basic block scheduling passes.
5194
5195 @item -fdump-rtl-see
5196 @opindex fdump-rtl-see
5197 Dump after sign extension elimination.
5198
5199 @item -fdump-rtl-seqabstr
5200 @opindex fdump-rtl-seqabstr
5201 Dump after common sequence discovery.
5202
5203 @item -fdump-rtl-shorten
5204 @opindex fdump-rtl-shorten
5205 Dump after shortening branches.
5206
5207 @item -fdump-rtl-sibling
5208 @opindex fdump-rtl-sibling
5209 Dump after sibling call optimizations.
5210
5211 @item -fdump-rtl-split1
5212 @itemx -fdump-rtl-split2
5213 @itemx -fdump-rtl-split3
5214 @itemx -fdump-rtl-split4
5215 @itemx -fdump-rtl-split5
5216 @opindex fdump-rtl-split1
5217 @opindex fdump-rtl-split2
5218 @opindex fdump-rtl-split3
5219 @opindex fdump-rtl-split4
5220 @opindex fdump-rtl-split5
5221 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5222 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5223 @option{-fdump-rtl-split5} enable dumping after five rounds of
5224 instruction splitting.
5225
5226 @item -fdump-rtl-sms
5227 @opindex fdump-rtl-sms
5228 Dump after modulo scheduling.  This pass is only run on some
5229 architectures.
5230
5231 @item -fdump-rtl-stack
5232 @opindex fdump-rtl-stack
5233 Dump after conversion from GCC's "flat register file" registers to the
5234 x87's stack-like registers.  This pass is only run on x86 variants.
5235
5236 @item -fdump-rtl-subreg1
5237 @itemx -fdump-rtl-subreg2
5238 @opindex fdump-rtl-subreg1
5239 @opindex fdump-rtl-subreg2
5240 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5241 the two subreg expansion passes.
5242
5243 @item -fdump-rtl-unshare
5244 @opindex fdump-rtl-unshare
5245 Dump after all rtl has been unshared.
5246
5247 @item -fdump-rtl-vartrack
5248 @opindex fdump-rtl-vartrack
5249 Dump after variable tracking.
5250
5251 @item -fdump-rtl-vregs
5252 @opindex fdump-rtl-vregs
5253 Dump after converting virtual registers to hard registers.
5254
5255 @item -fdump-rtl-web
5256 @opindex fdump-rtl-web
5257 Dump after live range splitting.
5258
5259 @item -fdump-rtl-regclass
5260 @itemx -fdump-rtl-subregs_of_mode_init
5261 @itemx -fdump-rtl-subregs_of_mode_finish
5262 @itemx -fdump-rtl-dfinit
5263 @itemx -fdump-rtl-dfinish
5264 @opindex fdump-rtl-regclass
5265 @opindex fdump-rtl-subregs_of_mode_init
5266 @opindex fdump-rtl-subregs_of_mode_finish
5267 @opindex fdump-rtl-dfinit
5268 @opindex fdump-rtl-dfinish
5269 These dumps are defined but always produce empty files.
5270
5271 @item -fdump-rtl-all
5272 @opindex fdump-rtl-all
5273 Produce all the dumps listed above.
5274
5275 @item -dA
5276 @opindex dA
5277 Annotate the assembler output with miscellaneous debugging information.
5278
5279 @item -dD
5280 @opindex dD
5281 Dump all macro definitions, at the end of preprocessing, in addition to
5282 normal output.
5283
5284 @item -dH
5285 @opindex dH
5286 Produce a core dump whenever an error occurs.
5287
5288 @item -dm
5289 @opindex dm
5290 Print statistics on memory usage, at the end of the run, to
5291 standard error.
5292
5293 @item -dp
5294 @opindex dp
5295 Annotate the assembler output with a comment indicating which
5296 pattern and alternative was used.  The length of each instruction is
5297 also printed.
5298
5299 @item -dP
5300 @opindex dP
5301 Dump the RTL in the assembler output as a comment before each instruction.
5302 Also turns on @option{-dp} annotation.
5303
5304 @item -dv
5305 @opindex dv
5306 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5307 dump a representation of the control flow graph suitable for viewing with VCG
5308 to @file{@var{file}.@var{pass}.vcg}.
5309
5310 @item -dx
5311 @opindex dx
5312 Just generate RTL for a function instead of compiling it.  Usually used
5313 with @option{-fdump-rtl-expand}.
5314 @end table
5315
5316 @item -fdump-noaddr
5317 @opindex fdump-noaddr
5318 When doing debugging dumps, suppress address output.  This makes it more
5319 feasible to use diff on debugging dumps for compiler invocations with
5320 different compiler binaries and/or different
5321 text / bss / data / heap / stack / dso start locations.
5322
5323 @item -fdump-unnumbered
5324 @opindex fdump-unnumbered
5325 When doing debugging dumps, suppress instruction numbers and address output.
5326 This makes it more feasible to use diff on debugging dumps for compiler
5327 invocations with different options, in particular with and without
5328 @option{-g}.
5329
5330 @item -fdump-unnumbered-links
5331 @opindex fdump-unnumbered-links
5332 When doing debugging dumps (see @option{-d} option above), suppress
5333 instruction numbers for the links to the previous and next instructions
5334 in a sequence.
5335
5336 @item -fdump-translation-unit @r{(C++ only)}
5337 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5338 @opindex fdump-translation-unit
5339 Dump a representation of the tree structure for the entire translation
5340 unit to a file.  The file name is made by appending @file{.tu} to the
5341 source file name, and the file is created in the same directory as the
5342 output file.  If the @samp{-@var{options}} form is used, @var{options}
5343 controls the details of the dump as described for the
5344 @option{-fdump-tree} options.
5345
5346 @item -fdump-class-hierarchy @r{(C++ only)}
5347 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5348 @opindex fdump-class-hierarchy
5349 Dump a representation of each class's hierarchy and virtual function
5350 table layout to a file.  The file name is made by appending
5351 @file{.class} to the source file name, and the file is created in the
5352 same directory as the output file.  If the @samp{-@var{options}} form
5353 is used, @var{options} controls the details of the dump as described
5354 for the @option{-fdump-tree} options.
5355
5356 @item -fdump-ipa-@var{switch}
5357 @opindex fdump-ipa
5358 Control the dumping at various stages of inter-procedural analysis
5359 language tree to a file.  The file name is generated by appending a
5360 switch specific suffix to the source file name, and the file is created
5361 in the same directory as the output file.  The following dumps are
5362 possible:
5363
5364 @table @samp
5365 @item all
5366 Enables all inter-procedural analysis dumps.
5367
5368 @item cgraph
5369 Dumps information about call-graph optimization, unused function removal,
5370 and inlining decisions.
5371
5372 @item inline
5373 Dump after function inlining.
5374
5375 @end table
5376
5377 @item -fdump-statistics-@var{option}
5378 @opindex fdump-statistics
5379 Enable and control dumping of pass statistics in a separate file.  The
5380 file name is generated by appending a suffix ending in
5381 @samp{.statistics} to the source file name, and the file is created in
5382 the same directory as the output file.  If the @samp{-@var{option}}
5383 form is used, @samp{-stats} will cause counters to be summed over the
5384 whole compilation unit while @samp{-details} will dump every event as
5385 the passes generate them.  The default with no option is to sum
5386 counters for each function compiled.
5387
5388 @item -fdump-tree-@var{switch}
5389 @itemx -fdump-tree-@var{switch}-@var{options}
5390 @opindex fdump-tree
5391 Control the dumping at various stages of processing the intermediate
5392 language tree to a file.  The file name is generated by appending a
5393 switch specific suffix to the source file name, and the file is
5394 created in the same directory as the output file.  If the
5395 @samp{-@var{options}} form is used, @var{options} is a list of
5396 @samp{-} separated options that control the details of the dump.  Not
5397 all options are applicable to all dumps, those which are not
5398 meaningful will be ignored.  The following options are available
5399
5400 @table @samp
5401 @item address
5402 Print the address of each node.  Usually this is not meaningful as it
5403 changes according to the environment and source file.  Its primary use
5404 is for tying up a dump file with a debug environment.
5405 @item asmname
5406 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5407 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5408 use working backward from mangled names in the assembly file.
5409 @item slim
5410 Inhibit dumping of members of a scope or body of a function merely
5411 because that scope has been reached.  Only dump such items when they
5412 are directly reachable by some other path.  When dumping pretty-printed
5413 trees, this option inhibits dumping the bodies of control structures.
5414 @item raw
5415 Print a raw representation of the tree.  By default, trees are
5416 pretty-printed into a C-like representation.
5417 @item details
5418 Enable more detailed dumps (not honored by every dump option).
5419 @item stats
5420 Enable dumping various statistics about the pass (not honored by every dump
5421 option).
5422 @item blocks
5423 Enable showing basic block boundaries (disabled in raw dumps).
5424 @item vops
5425 Enable showing virtual operands for every statement.
5426 @item lineno
5427 Enable showing line numbers for statements.
5428 @item uid
5429 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5430 @item verbose
5431 Enable showing the tree dump for each statement.
5432 @item eh
5433 Enable showing the EH region number holding each statement.
5434 @item all
5435 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5436 and @option{lineno}.
5437 @end table
5438
5439 The following tree dumps are possible:
5440 @table @samp
5441
5442 @item original
5443 @opindex fdump-tree-original
5444 Dump before any tree based optimization, to @file{@var{file}.original}.
5445
5446 @item optimized
5447 @opindex fdump-tree-optimized
5448 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5449
5450 @item gimple
5451 @opindex fdump-tree-gimple
5452 Dump each function before and after the gimplification pass to a file.  The
5453 file name is made by appending @file{.gimple} to the source file name.
5454
5455 @item cfg
5456 @opindex fdump-tree-cfg
5457 Dump the control flow graph of each function to a file.  The file name is
5458 made by appending @file{.cfg} to the source file name.
5459
5460 @item vcg
5461 @opindex fdump-tree-vcg
5462 Dump the control flow graph of each function to a file in VCG format.  The
5463 file name is made by appending @file{.vcg} to the source file name.  Note
5464 that if the file contains more than one function, the generated file cannot
5465 be used directly by VCG@.  You will need to cut and paste each function's
5466 graph into its own separate file first.
5467
5468 @item ch
5469 @opindex fdump-tree-ch
5470 Dump each function after copying loop headers.  The file name is made by
5471 appending @file{.ch} to the source file name.
5472
5473 @item ssa
5474 @opindex fdump-tree-ssa
5475 Dump SSA related information to a file.  The file name is made by appending
5476 @file{.ssa} to the source file name.
5477
5478 @item alias
5479 @opindex fdump-tree-alias
5480 Dump aliasing information for each function.  The file name is made by
5481 appending @file{.alias} to the source file name.
5482
5483 @item ccp
5484 @opindex fdump-tree-ccp
5485 Dump each function after CCP@.  The file name is made by appending
5486 @file{.ccp} to the source file name.
5487
5488 @item storeccp
5489 @opindex fdump-tree-storeccp
5490 Dump each function after STORE-CCP@.  The file name is made by appending
5491 @file{.storeccp} to the source file name.
5492
5493 @item pre
5494 @opindex fdump-tree-pre
5495 Dump trees after partial redundancy elimination.  The file name is made
5496 by appending @file{.pre} to the source file name.
5497
5498 @item fre
5499 @opindex fdump-tree-fre
5500 Dump trees after full redundancy elimination.  The file name is made
5501 by appending @file{.fre} to the source file name.
5502
5503 @item copyprop
5504 @opindex fdump-tree-copyprop
5505 Dump trees after copy propagation.  The file name is made
5506 by appending @file{.copyprop} to the source file name.
5507
5508 @item store_copyprop
5509 @opindex fdump-tree-store_copyprop
5510 Dump trees after store copy-propagation.  The file name is made
5511 by appending @file{.store_copyprop} to the source file name.
5512
5513 @item dce
5514 @opindex fdump-tree-dce
5515 Dump each function after dead code elimination.  The file name is made by
5516 appending @file{.dce} to the source file name.
5517
5518 @item mudflap
5519 @opindex fdump-tree-mudflap
5520 Dump each function after adding mudflap instrumentation.  The file name is
5521 made by appending @file{.mudflap} to the source file name.
5522
5523 @item sra
5524 @opindex fdump-tree-sra
5525 Dump each function after performing scalar replacement of aggregates.  The
5526 file name is made by appending @file{.sra} to the source file name.
5527
5528 @item sink
5529 @opindex fdump-tree-sink
5530 Dump each function after performing code sinking.  The file name is made
5531 by appending @file{.sink} to the source file name.
5532
5533 @item dom
5534 @opindex fdump-tree-dom
5535 Dump each function after applying dominator tree optimizations.  The file
5536 name is made by appending @file{.dom} to the source file name.
5537
5538 @item dse
5539 @opindex fdump-tree-dse
5540 Dump each function after applying dead store elimination.  The file
5541 name is made by appending @file{.dse} to the source file name.
5542
5543 @item phiopt
5544 @opindex fdump-tree-phiopt
5545 Dump each function after optimizing PHI nodes into straightline code.  The file
5546 name is made by appending @file{.phiopt} to the source file name.
5547
5548 @item forwprop
5549 @opindex fdump-tree-forwprop
5550 Dump each function after forward propagating single use variables.  The file
5551 name is made by appending @file{.forwprop} to the source file name.
5552
5553 @item copyrename
5554 @opindex fdump-tree-copyrename
5555 Dump each function after applying the copy rename optimization.  The file
5556 name is made by appending @file{.copyrename} to the source file name.
5557
5558 @item nrv
5559 @opindex fdump-tree-nrv
5560 Dump each function after applying the named return value optimization on
5561 generic trees.  The file name is made by appending @file{.nrv} to the source
5562 file name.
5563
5564 @item vect
5565 @opindex fdump-tree-vect
5566 Dump each function after applying vectorization of loops.  The file name is
5567 made by appending @file{.vect} to the source file name.
5568
5569 @item slp
5570 @opindex fdump-tree-slp
5571 Dump each function after applying vectorization of basic blocks.  The file name
5572 is made by appending @file{.slp} to the source file name.
5573
5574 @item vrp
5575 @opindex fdump-tree-vrp
5576 Dump each function after Value Range Propagation (VRP).  The file name
5577 is made by appending @file{.vrp} to the source file name.
5578
5579 @item all
5580 @opindex fdump-tree-all
5581 Enable all the available tree dumps with the flags provided in this option.
5582 @end table
5583
5584 @item -ftree-vectorizer-verbose=@var{n}
5585 @opindex ftree-vectorizer-verbose
5586 This option controls the amount of debugging output the vectorizer prints.
5587 This information is written to standard error, unless
5588 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5589 in which case it is output to the usual dump listing file, @file{.vect}.
5590 For @var{n}=0 no diagnostic information is reported.
5591 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5592 and the total number of loops that got vectorized.
5593 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5594 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5595 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5596 level that @option{-fdump-tree-vect-stats} uses.
5597 Higher verbosity levels mean either more information dumped for each
5598 reported loop, or same amount of information reported for more loops:
5599 if @var{n}=3, vectorizer cost model information is reported.
5600 If @var{n}=4, alignment related information is added to the reports.
5601 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5602 memory access-patterns) is added to the reports.
5603 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5604 that did not pass the first analysis phase (i.e., may not be countable, or
5605 may have complicated control-flow).
5606 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5607 If @var{n}=8, SLP related information is added to the reports.
5608 For @var{n}=9, all the information the vectorizer generates during its
5609 analysis and transformation is reported.  This is the same verbosity level
5610 that @option{-fdump-tree-vect-details} uses.
5611
5612 @item -frandom-seed=@var{string}
5613 @opindex frandom-seed
5614 This option provides a seed that GCC uses when it would otherwise use
5615 random numbers.  It is used to generate certain symbol names
5616 that have to be different in every compiled file.  It is also used to
5617 place unique stamps in coverage data files and the object files that
5618 produce them.  You can use the @option{-frandom-seed} option to produce
5619 reproducibly identical object files.
5620
5621 The @var{string} should be different for every file you compile.
5622
5623 @item -fsched-verbose=@var{n}
5624 @opindex fsched-verbose
5625 On targets that use instruction scheduling, this option controls the
5626 amount of debugging output the scheduler prints.  This information is
5627 written to standard error, unless @option{-fdump-rtl-sched1} or
5628 @option{-fdump-rtl-sched2} is specified, in which case it is output
5629 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5630 respectively.  However for @var{n} greater than nine, the output is
5631 always printed to standard error.
5632
5633 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5634 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5635 For @var{n} greater than one, it also output basic block probabilities,
5636 detailed ready list information and unit/insn info.  For @var{n} greater
5637 than two, it includes RTL at abort point, control-flow and regions info.
5638 And for @var{n} over four, @option{-fsched-verbose} also includes
5639 dependence info.
5640
5641 @item -save-temps
5642 @itemx -save-temps=cwd
5643 @opindex save-temps
5644 Store the usual ``temporary'' intermediate files permanently; place them
5645 in the current directory and name them based on the source file.  Thus,
5646 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5647 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5648 preprocessed @file{foo.i} output file even though the compiler now
5649 normally uses an integrated preprocessor.
5650
5651 When used in combination with the @option{-x} command line option,
5652 @option{-save-temps} is sensible enough to avoid over writing an
5653 input source file with the same extension as an intermediate file.
5654 The corresponding intermediate file may be obtained by renaming the
5655 source file before using @option{-save-temps}.
5656
5657 If you invoke GCC in parallel, compiling several different source
5658 files that share a common base name in different subdirectories or the
5659 same source file compiled for multiple output destinations, it is
5660 likely that the different parallel compilers will interfere with each
5661 other, and overwrite the temporary files.  For instance:
5662
5663 @smallexample
5664 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5665 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5666 @end smallexample
5667
5668 may result in @file{foo.i} and @file{foo.o} being written to
5669 simultaneously by both compilers.
5670
5671 @item -save-temps=obj
5672 @opindex save-temps=obj
5673 Store the usual ``temporary'' intermediate files permanently.  If the
5674 @option{-o} option is used, the temporary files are based on the
5675 object file.  If the @option{-o} option is not used, the
5676 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5677
5678 For example:
5679
5680 @smallexample
5681 gcc -save-temps=obj -c foo.c
5682 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5683 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5684 @end smallexample
5685
5686 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5687 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5688 @file{dir2/yfoobar.o}.
5689
5690 @item -time@r{[}=@var{file}@r{]}
5691 @opindex time
5692 Report the CPU time taken by each subprocess in the compilation
5693 sequence.  For C source files, this is the compiler proper and assembler
5694 (plus the linker if linking is done).
5695
5696 Without the specification of an output file, the output looks like this:
5697
5698 @smallexample
5699 # cc1 0.12 0.01
5700 # as 0.00 0.01
5701 @end smallexample
5702
5703 The first number on each line is the ``user time'', that is time spent
5704 executing the program itself.  The second number is ``system time'',
5705 time spent executing operating system routines on behalf of the program.
5706 Both numbers are in seconds.
5707
5708 With the specification of an output file, the output is appended to the
5709 named file, and it looks like this:
5710
5711 @smallexample
5712 0.12 0.01 cc1 @var{options}
5713 0.00 0.01 as @var{options}
5714 @end smallexample
5715
5716 The ``user time'' and the ``system time'' are moved before the program
5717 name, and the options passed to the program are displayed, so that one
5718 can later tell what file was being compiled, and with which options.
5719
5720 @item -fvar-tracking
5721 @opindex fvar-tracking
5722 Run variable tracking pass.  It computes where variables are stored at each
5723 position in code.  Better debugging information is then generated
5724 (if the debugging information format supports this information).
5725
5726 It is enabled by default when compiling with optimization (@option{-Os},
5727 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5728 the debug info format supports it.
5729
5730 @item -fvar-tracking-assignments
5731 @opindex fvar-tracking-assignments
5732 @opindex fno-var-tracking-assignments
5733 Annotate assignments to user variables early in the compilation and
5734 attempt to carry the annotations over throughout the compilation all the
5735 way to the end, in an attempt to improve debug information while
5736 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
5737
5738 It can be enabled even if var-tracking is disabled, in which case
5739 annotations will be created and maintained, but discarded at the end.
5740
5741 @item -fvar-tracking-assignments-toggle
5742 @opindex fvar-tracking-assignments-toggle
5743 @opindex fno-var-tracking-assignments-toggle
5744 Toggle @option{-fvar-tracking-assignments}, in the same way that
5745 @option{-gtoggle} toggles @option{-g}.
5746
5747 @item -print-file-name=@var{library}
5748 @opindex print-file-name
5749 Print the full absolute name of the library file @var{library} that
5750 would be used when linking---and don't do anything else.  With this
5751 option, GCC does not compile or link anything; it just prints the
5752 file name.
5753
5754 @item -print-multi-directory
5755 @opindex print-multi-directory
5756 Print the directory name corresponding to the multilib selected by any
5757 other switches present in the command line.  This directory is supposed
5758 to exist in @env{GCC_EXEC_PREFIX}.
5759
5760 @item -print-multi-lib
5761 @opindex print-multi-lib
5762 Print the mapping from multilib directory names to compiler switches
5763 that enable them.  The directory name is separated from the switches by
5764 @samp{;}, and each switch starts with an @samp{@@} instead of the
5765 @samp{-}, without spaces between multiple switches.  This is supposed to
5766 ease shell-processing.
5767
5768 @item -print-multi-os-directory
5769 @opindex print-multi-os-directory
5770 Print the path to OS libraries for the selected
5771 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
5772 present in the @file{lib} subdirectory and no multilibs are used, this is
5773 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
5774 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
5775 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
5776 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
5777
5778 @item -print-prog-name=@var{program}
5779 @opindex print-prog-name
5780 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5781
5782 @item -print-libgcc-file-name
5783 @opindex print-libgcc-file-name
5784 Same as @option{-print-file-name=libgcc.a}.
5785
5786 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5787 but you do want to link with @file{libgcc.a}.  You can do
5788
5789 @smallexample
5790 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5791 @end smallexample
5792
5793 @item -print-search-dirs
5794 @opindex print-search-dirs
5795 Print the name of the configured installation directory and a list of
5796 program and library directories @command{gcc} will search---and don't do anything else.
5797
5798 This is useful when @command{gcc} prints the error message
5799 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5800 To resolve this you either need to put @file{cpp0} and the other compiler
5801 components where @command{gcc} expects to find them, or you can set the environment
5802 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5803 Don't forget the trailing @samp{/}.
5804 @xref{Environment Variables}.
5805
5806 @item -print-sysroot
5807 @opindex print-sysroot
5808 Print the target sysroot directory that will be used during
5809 compilation.  This is the target sysroot specified either at configure
5810 time or using the @option{--sysroot} option, possibly with an extra
5811 suffix that depends on compilation options.  If no target sysroot is
5812 specified, the option prints nothing.
5813
5814 @item -print-sysroot-headers-suffix
5815 @opindex print-sysroot-headers-suffix
5816 Print the suffix added to the target sysroot when searching for
5817 headers, or give an error if the compiler is not configured with such
5818 a suffix---and don't do anything else.
5819
5820 @item -dumpmachine
5821 @opindex dumpmachine
5822 Print the compiler's target machine (for example,
5823 @samp{i686-pc-linux-gnu})---and don't do anything else.
5824
5825 @item -dumpversion
5826 @opindex dumpversion
5827 Print the compiler version (for example, @samp{3.0})---and don't do
5828 anything else.
5829
5830 @item -dumpspecs
5831 @opindex dumpspecs
5832 Print the compiler's built-in specs---and don't do anything else.  (This
5833 is used when GCC itself is being built.)  @xref{Spec Files}.
5834
5835 @item -feliminate-unused-debug-types
5836 @opindex feliminate-unused-debug-types
5837 Normally, when producing DWARF2 output, GCC will emit debugging
5838 information for all types declared in a compilation
5839 unit, regardless of whether or not they are actually used
5840 in that compilation unit.  Sometimes this is useful, such as
5841 if, in the debugger, you want to cast a value to a type that is
5842 not actually used in your program (but is declared).  More often,
5843 however, this results in a significant amount of wasted space.
5844 With this option, GCC will avoid producing debug symbol output
5845 for types that are nowhere used in the source file being compiled.
5846 @end table
5847
5848 @node Optimize Options
5849 @section Options That Control Optimization
5850 @cindex optimize options
5851 @cindex options, optimization
5852
5853 These options control various sorts of optimizations.
5854
5855 Without any optimization option, the compiler's goal is to reduce the
5856 cost of compilation and to make debugging produce the expected
5857 results.  Statements are independent: if you stop the program with a
5858 breakpoint between statements, you can then assign a new value to any
5859 variable or change the program counter to any other statement in the
5860 function and get exactly the results you would expect from the source
5861 code.
5862
5863 Turning on optimization flags makes the compiler attempt to improve
5864 the performance and/or code size at the expense of compilation time
5865 and possibly the ability to debug the program.
5866
5867 The compiler performs optimization based on the knowledge it has of the
5868 program.  Compiling multiple files at once to a single output file mode allows
5869 the compiler to use information gained from all of the files when compiling
5870 each of them.
5871
5872 Not all optimizations are controlled directly by a flag.  Only
5873 optimizations that have a flag are listed in this section.
5874
5875 Most optimizations are only enabled if an @option{-O} level is set on
5876 the command line.  Otherwise they are disabled, even if individual             
5877 optimization flags are specified.
5878
5879 Depending on the target and how GCC was configured, a slightly different
5880 set of optimizations may be enabled at each @option{-O} level than
5881 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
5882 to find out the exact set of optimizations that are enabled at each level.
5883 @xref{Overall Options}, for examples.
5884
5885 @table @gcctabopt
5886 @item -O
5887 @itemx -O1
5888 @opindex O
5889 @opindex O1
5890 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5891 more memory for a large function.
5892
5893 With @option{-O}, the compiler tries to reduce code size and execution
5894 time, without performing any optimizations that take a great deal of
5895 compilation time.
5896
5897 @option{-O} turns on the following optimization flags:
5898 @gccoptlist{
5899 -fauto-inc-dec @gol
5900 -fcompare-elim @gol
5901 -fcprop-registers @gol
5902 -fdce @gol
5903 -fdefer-pop @gol
5904 -fdelayed-branch @gol
5905 -fdse @gol
5906 -fguess-branch-probability @gol
5907 -fif-conversion2 @gol
5908 -fif-conversion @gol
5909 -fipa-pure-const @gol
5910 -fipa-profile @gol
5911 -fipa-reference @gol
5912 -fmerge-constants
5913 -fsplit-wide-types @gol
5914 -ftree-bit-ccp @gol
5915 -ftree-builtin-call-dce @gol
5916 -ftree-ccp @gol
5917 -ftree-ch @gol
5918 -ftree-copyrename @gol
5919 -ftree-dce @gol
5920 -ftree-dominator-opts @gol
5921 -ftree-dse @gol
5922 -ftree-forwprop @gol
5923 -ftree-fre @gol
5924 -ftree-phiprop @gol
5925 -ftree-sra @gol
5926 -ftree-pta @gol
5927 -ftree-ter @gol
5928 -funit-at-a-time}
5929
5930 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5931 where doing so does not interfere with debugging.
5932
5933 @item -O2
5934 @opindex O2
5935 Optimize even more.  GCC performs nearly all supported optimizations
5936 that do not involve a space-speed tradeoff.
5937 As compared to @option{-O}, this option increases both compilation time
5938 and the performance of the generated code.
5939
5940 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5941 also turns on the following optimization flags:
5942 @gccoptlist{-fthread-jumps @gol
5943 -falign-functions  -falign-jumps @gol
5944 -falign-loops  -falign-labels @gol
5945 -fcaller-saves @gol
5946 -fcrossjumping @gol
5947 -fcse-follow-jumps  -fcse-skip-blocks @gol
5948 -fdelete-null-pointer-checks @gol
5949 -fdevirtualize @gol
5950 -fexpensive-optimizations @gol
5951 -fgcse  -fgcse-lm  @gol
5952 -finline-small-functions @gol
5953 -findirect-inlining @gol
5954 -fipa-sra @gol
5955 -foptimize-sibling-calls @gol
5956 -fpartial-inlining @gol
5957 -fpeephole2 @gol
5958 -fregmove @gol
5959 -freorder-blocks  -freorder-functions @gol
5960 -frerun-cse-after-loop  @gol
5961 -fsched-interblock  -fsched-spec @gol
5962 -fschedule-insns  -fschedule-insns2 @gol
5963 -fstrict-aliasing -fstrict-overflow @gol
5964 -ftree-switch-conversion @gol
5965 -ftree-pre @gol
5966 -ftree-vrp}
5967
5968 Please note the warning under @option{-fgcse} about
5969 invoking @option{-O2} on programs that use computed gotos.
5970
5971 @item -O3
5972 @opindex O3
5973 Optimize yet more.  @option{-O3} turns on all optimizations specified
5974 by @option{-O2} and also turns on the @option{-finline-functions},
5975 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5976 @option{-fgcse-after-reload}, @option{-ftree-vectorize} and
5977 @option{-fipa-cp-clone} options.
5978
5979 @item -O0
5980 @opindex O0
5981 Reduce compilation time and make debugging produce the expected
5982 results.  This is the default.
5983
5984 @item -Os
5985 @opindex Os
5986 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5987 do not typically increase code size.  It also performs further
5988 optimizations designed to reduce code size.
5989
5990 @option{-Os} disables the following optimization flags:
5991 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5992 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5993 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5994
5995 @item -Ofast
5996 @opindex Ofast
5997 Disregard strict standards compliance.  @option{-Ofast} enables all
5998 @option{-O3} optimizations.  It also enables optimizations that are not
5999 valid for all standard compliant programs.
6000 It turns on @option{-ffast-math}.
6001
6002 If you use multiple @option{-O} options, with or without level numbers,
6003 the last such option is the one that is effective.
6004 @end table
6005
6006 Options of the form @option{-f@var{flag}} specify machine-independent
6007 flags.  Most flags have both positive and negative forms; the negative
6008 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
6009 below, only one of the forms is listed---the one you typically will
6010 use.  You can figure out the other form by either removing @samp{no-}
6011 or adding it.
6012
6013 The following options control specific optimizations.  They are either
6014 activated by @option{-O} options or are related to ones that are.  You
6015 can use the following flags in the rare cases when ``fine-tuning'' of
6016 optimizations to be performed is desired.
6017
6018 @table @gcctabopt
6019 @item -fno-default-inline
6020 @opindex fno-default-inline
6021 Do not make member functions inline by default merely because they are
6022 defined inside the class scope (C++ only).  Otherwise, when you specify
6023 @w{@option{-O}}, member functions defined inside class scope are compiled
6024 inline by default; i.e., you don't need to add @samp{inline} in front of
6025 the member function name.
6026
6027 @item -fno-defer-pop
6028 @opindex fno-defer-pop
6029 Always pop the arguments to each function call as soon as that function
6030 returns.  For machines which must pop arguments after a function call,
6031 the compiler normally lets arguments accumulate on the stack for several
6032 function calls and pops them all at once.
6033
6034 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6035
6036 @item -fforward-propagate
6037 @opindex fforward-propagate
6038 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6039 instructions and checks if the result can be simplified.  If loop unrolling
6040 is active, two passes are performed and the second is scheduled after
6041 loop unrolling.
6042
6043 This option is enabled by default at optimization levels @option{-O},
6044 @option{-O2}, @option{-O3}, @option{-Os}.
6045
6046 @item -ffp-contract=@var{style}
6047 @opindex ffp-contract
6048 @option{-ffp-contract=off} disables floating-point expression contraction.
6049 @option{-ffp-contract=fast} enables floating-point expression contraction
6050 such as forming of fused multiply-add operations if the target has
6051 native support for them.
6052 @option{-ffp-contract=on} enables floating-point expression contraction
6053 if allowed by the language standard.  This is currently not implemented
6054 and treated equal to @option{-ffp-contract=off}.
6055
6056 The default is @option{-ffp-contract=fast}.
6057
6058 @item -fomit-frame-pointer
6059 @opindex fomit-frame-pointer
6060 Don't keep the frame pointer in a register for functions that
6061 don't need one.  This avoids the instructions to save, set up and
6062 restore frame pointers; it also makes an extra register available
6063 in many functions.  @strong{It also makes debugging impossible on
6064 some machines.}
6065
6066 On some machines, such as the VAX, this flag has no effect, because
6067 the standard calling sequence automatically handles the frame pointer
6068 and nothing is saved by pretending it doesn't exist.  The
6069 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6070 whether a target machine supports this flag.  @xref{Registers,,Register
6071 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6072
6073 Starting with GCC version 4.6, the default setting (when not optimizing for
6074 size) for 32-bit Linux x86 and 32-bit Darwin x86 targets has been changed to
6075 @option{-fomit-frame-pointer}.  The default can be reverted to
6076 @option{-fno-omit-frame-pointer} by configuring GCC with the
6077 @option{--enable-frame-pointer} configure option.
6078
6079 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6080
6081 @item -foptimize-sibling-calls
6082 @opindex foptimize-sibling-calls
6083 Optimize sibling and tail recursive calls.
6084
6085 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6086
6087 @item -fno-inline
6088 @opindex fno-inline
6089 Don't pay attention to the @code{inline} keyword.  Normally this option
6090 is used to keep the compiler from expanding any functions inline.
6091 Note that if you are not optimizing, no functions can be expanded inline.
6092
6093 @item -finline-small-functions
6094 @opindex finline-small-functions
6095 Integrate functions into their callers when their body is smaller than expected
6096 function call code (so overall size of program gets smaller).  The compiler
6097 heuristically decides which functions are simple enough to be worth integrating
6098 in this way.
6099
6100 Enabled at level @option{-O2}.
6101
6102 @item -findirect-inlining
6103 @opindex findirect-inlining
6104 Inline also indirect calls that are discovered to be known at compile
6105 time thanks to previous inlining.  This option has any effect only
6106 when inlining itself is turned on by the @option{-finline-functions}
6107 or @option{-finline-small-functions} options.
6108
6109 Enabled at level @option{-O2}.
6110
6111 @item -finline-functions
6112 @opindex finline-functions
6113 Integrate all simple functions into their callers.  The compiler
6114 heuristically decides which functions are simple enough to be worth
6115 integrating in this way.
6116
6117 If all calls to a given function are integrated, and the function is
6118 declared @code{static}, then the function is normally not output as
6119 assembler code in its own right.
6120
6121 Enabled at level @option{-O3}.
6122
6123 @item -finline-functions-called-once
6124 @opindex finline-functions-called-once
6125 Consider all @code{static} functions called once for inlining into their
6126 caller even if they are not marked @code{inline}.  If a call to a given
6127 function is integrated, then the function is not output as assembler code
6128 in its own right.
6129
6130 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6131
6132 @item -fearly-inlining
6133 @opindex fearly-inlining
6134 Inline functions marked by @code{always_inline} and functions whose body seems
6135 smaller than the function call overhead early before doing
6136 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6137 makes profiling significantly cheaper and usually inlining faster on programs
6138 having large chains of nested wrapper functions.
6139
6140 Enabled by default.
6141
6142 @item -fipa-sra
6143 @opindex fipa-sra
6144 Perform interprocedural scalar replacement of aggregates, removal of
6145 unused parameters and replacement of parameters passed by reference
6146 by parameters passed by value.
6147
6148 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6149
6150 @item -finline-limit=@var{n}
6151 @opindex finline-limit
6152 By default, GCC limits the size of functions that can be inlined.  This flag
6153 allows coarse control of this limit.  @var{n} is the size of functions that
6154 can be inlined in number of pseudo instructions.
6155
6156 Inlining is actually controlled by a number of parameters, which may be
6157 specified individually by using @option{--param @var{name}=@var{value}}.
6158 The @option{-finline-limit=@var{n}} option sets some of these parameters
6159 as follows:
6160
6161 @table @gcctabopt
6162 @item max-inline-insns-single
6163 is set to @var{n}/2.
6164 @item max-inline-insns-auto
6165 is set to @var{n}/2.
6166 @end table
6167
6168 See below for a documentation of the individual
6169 parameters controlling inlining and for the defaults of these parameters.
6170
6171 @emph{Note:} there may be no value to @option{-finline-limit} that results
6172 in default behavior.
6173
6174 @emph{Note:} pseudo instruction represents, in this particular context, an
6175 abstract measurement of function's size.  In no way does it represent a count
6176 of assembly instructions and as such its exact meaning might change from one
6177 release to an another.
6178
6179 @item -fno-keep-inline-dllexport
6180 @opindex -fno-keep-inline-dllexport
6181 This is a more fine-grained version of @option{-fkeep-inline-functions},
6182 which applies only to functions that are declared using the @code{dllexport}
6183 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6184 Functions}.)
6185
6186 @item -fkeep-inline-functions
6187 @opindex fkeep-inline-functions
6188 In C, emit @code{static} functions that are declared @code{inline}
6189 into the object file, even if the function has been inlined into all
6190 of its callers.  This switch does not affect functions using the
6191 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6192 inline functions into the object file.
6193
6194 @item -fkeep-static-consts
6195 @opindex fkeep-static-consts
6196 Emit variables declared @code{static const} when optimization isn't turned
6197 on, even if the variables aren't referenced.
6198
6199 GCC enables this option by default.  If you want to force the compiler to
6200 check if the variable was referenced, regardless of whether or not
6201 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6202
6203 @item -fmerge-constants
6204 @opindex fmerge-constants
6205 Attempt to merge identical constants (string constants and floating point
6206 constants) across compilation units.
6207
6208 This option is the default for optimized compilation if the assembler and
6209 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6210 behavior.
6211
6212 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6213
6214 @item -fmerge-all-constants
6215 @opindex fmerge-all-constants
6216 Attempt to merge identical constants and identical variables.
6217
6218 This option implies @option{-fmerge-constants}.  In addition to
6219 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6220 arrays or initialized constant variables with integral or floating point
6221 types.  Languages like C or C++ require each variable, including multiple
6222 instances of the same variable in recursive calls, to have distinct locations,
6223 so using this option will result in non-conforming
6224 behavior.
6225
6226 @item -fmodulo-sched
6227 @opindex fmodulo-sched
6228 Perform swing modulo scheduling immediately before the first scheduling
6229 pass.  This pass looks at innermost loops and reorders their
6230 instructions by overlapping different iterations.
6231
6232 @item -fmodulo-sched-allow-regmoves
6233 @opindex fmodulo-sched-allow-regmoves
6234 Perform more aggressive SMS based modulo scheduling with register moves
6235 allowed.  By setting this flag certain anti-dependences edges will be
6236 deleted which will trigger the generation of reg-moves based on the
6237 life-range analysis.  This option is effective only with
6238 @option{-fmodulo-sched} enabled.
6239
6240 @item -fno-branch-count-reg
6241 @opindex fno-branch-count-reg
6242 Do not use ``decrement and branch'' instructions on a count register,
6243 but instead generate a sequence of instructions that decrement a
6244 register, compare it against zero, then branch based upon the result.
6245 This option is only meaningful on architectures that support such
6246 instructions, which include x86, PowerPC, IA-64 and S/390.
6247
6248 The default is @option{-fbranch-count-reg}.
6249
6250 @item -fno-function-cse
6251 @opindex fno-function-cse
6252 Do not put function addresses in registers; make each instruction that
6253 calls a constant function contain the function's address explicitly.
6254
6255 This option results in less efficient code, but some strange hacks
6256 that alter the assembler output may be confused by the optimizations
6257 performed when this option is not used.
6258
6259 The default is @option{-ffunction-cse}
6260
6261 @item -fno-zero-initialized-in-bss
6262 @opindex fno-zero-initialized-in-bss
6263 If the target supports a BSS section, GCC by default puts variables that
6264 are initialized to zero into BSS@.  This can save space in the resulting
6265 code.
6266
6267 This option turns off this behavior because some programs explicitly
6268 rely on variables going to the data section.  E.g., so that the
6269 resulting executable can find the beginning of that section and/or make
6270 assumptions based on that.
6271
6272 The default is @option{-fzero-initialized-in-bss}.
6273
6274 @item -fmudflap -fmudflapth -fmudflapir
6275 @opindex fmudflap
6276 @opindex fmudflapth
6277 @opindex fmudflapir
6278 @cindex bounds checking
6279 @cindex mudflap
6280 For front-ends that support it (C and C++), instrument all risky
6281 pointer/array dereferencing operations, some standard library
6282 string/heap functions, and some other associated constructs with
6283 range/validity tests.  Modules so instrumented should be immune to
6284 buffer overflows, invalid heap use, and some other classes of C/C++
6285 programming errors.  The instrumentation relies on a separate runtime
6286 library (@file{libmudflap}), which will be linked into a program if
6287 @option{-fmudflap} is given at link time.  Run-time behavior of the
6288 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6289 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6290 for its options.
6291
6292 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6293 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6294 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6295 instrumentation should ignore pointer reads.  This produces less
6296 instrumentation (and therefore faster execution) and still provides
6297 some protection against outright memory corrupting writes, but allows
6298 erroneously read data to propagate within a program.
6299
6300 @item -fthread-jumps
6301 @opindex fthread-jumps
6302 Perform optimizations where we check to see if a jump branches to a
6303 location where another comparison subsumed by the first is found.  If
6304 so, the first branch is redirected to either the destination of the
6305 second branch or a point immediately following it, depending on whether
6306 the condition is known to be true or false.
6307
6308 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6309
6310 @item -fsplit-wide-types
6311 @opindex fsplit-wide-types
6312 When using a type that occupies multiple registers, such as @code{long
6313 long} on a 32-bit system, split the registers apart and allocate them
6314 independently.  This normally generates better code for those types,
6315 but may make debugging more difficult.
6316
6317 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6318 @option{-Os}.
6319
6320 @item -fcse-follow-jumps
6321 @opindex fcse-follow-jumps
6322 In common subexpression elimination (CSE), scan through jump instructions
6323 when the target of the jump is not reached by any other path.  For
6324 example, when CSE encounters an @code{if} statement with an
6325 @code{else} clause, CSE will follow the jump when the condition
6326 tested is false.
6327
6328 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6329
6330 @item -fcse-skip-blocks
6331 @opindex fcse-skip-blocks
6332 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6333 follow jumps which conditionally skip over blocks.  When CSE
6334 encounters a simple @code{if} statement with no else clause,
6335 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6336 body of the @code{if}.
6337
6338 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6339
6340 @item -frerun-cse-after-loop
6341 @opindex frerun-cse-after-loop
6342 Re-run common subexpression elimination after loop optimizations has been
6343 performed.
6344
6345 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6346
6347 @item -fgcse
6348 @opindex fgcse
6349 Perform a global common subexpression elimination pass.
6350 This pass also performs global constant and copy propagation.
6351
6352 @emph{Note:} When compiling a program using computed gotos, a GCC
6353 extension, you may get better runtime performance if you disable
6354 the global common subexpression elimination pass by adding
6355 @option{-fno-gcse} to the command line.
6356
6357 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6358
6359 @item -fgcse-lm
6360 @opindex fgcse-lm
6361 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
6362 attempt to move loads which are only killed by stores into themselves.  This
6363 allows a loop containing a load/store sequence to be changed to a load outside
6364 the loop, and a copy/store within the loop.
6365
6366 Enabled by default when gcse is enabled.
6367
6368 @item -fgcse-sm
6369 @opindex fgcse-sm
6370 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6371 global common subexpression elimination.  This pass will attempt to move
6372 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6373 loops containing a load/store sequence can be changed to a load before
6374 the loop and a store after the loop.
6375
6376 Not enabled at any optimization level.
6377
6378 @item -fgcse-las
6379 @opindex fgcse-las
6380 When @option{-fgcse-las} is enabled, the global common subexpression
6381 elimination pass eliminates redundant loads that come after stores to the
6382 same memory location (both partial and full redundancies).
6383
6384 Not enabled at any optimization level.
6385
6386 @item -fgcse-after-reload
6387 @opindex fgcse-after-reload
6388 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6389 pass is performed after reload.  The purpose of this pass is to cleanup
6390 redundant spilling.
6391
6392 @item -funsafe-loop-optimizations
6393 @opindex funsafe-loop-optimizations
6394 If given, the loop optimizer will assume that loop indices do not
6395 overflow, and that the loops with nontrivial exit condition are not
6396 infinite.  This enables a wider range of loop optimizations even if
6397 the loop optimizer itself cannot prove that these assumptions are valid.
6398 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6399 if it finds this kind of loop.
6400
6401 @item -fcrossjumping
6402 @opindex fcrossjumping
6403 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6404 resulting code may or may not perform better than without cross-jumping.
6405
6406 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6407
6408 @item -fauto-inc-dec
6409 @opindex fauto-inc-dec
6410 Combine increments or decrements of addresses with memory accesses.
6411 This pass is always skipped on architectures that do not have
6412 instructions to support this.  Enabled by default at @option{-O} and
6413 higher on architectures that support this.
6414
6415 @item -fdce
6416 @opindex fdce
6417 Perform dead code elimination (DCE) on RTL@.
6418 Enabled by default at @option{-O} and higher.
6419
6420 @item -fdse
6421 @opindex fdse
6422 Perform dead store elimination (DSE) on RTL@.
6423 Enabled by default at @option{-O} and higher.
6424
6425 @item -fif-conversion
6426 @opindex fif-conversion
6427 Attempt to transform conditional jumps into branch-less equivalents.  This
6428 include use of conditional moves, min, max, set flags and abs instructions, and
6429 some tricks doable by standard arithmetics.  The use of conditional execution
6430 on chips where it is available is controlled by @code{if-conversion2}.
6431
6432 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6433
6434 @item -fif-conversion2
6435 @opindex fif-conversion2
6436 Use conditional execution (where available) to transform conditional jumps into
6437 branch-less equivalents.
6438
6439 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6440
6441 @item -fdelete-null-pointer-checks
6442 @opindex fdelete-null-pointer-checks
6443 Assume that programs cannot safely dereference null pointers, and that
6444 no code or data element resides there.  This enables simple constant
6445 folding optimizations at all optimization levels.  In addition, other
6446 optimization passes in GCC use this flag to control global dataflow
6447 analyses that eliminate useless checks for null pointers; these assume
6448 that if a pointer is checked after it has already been dereferenced,
6449 it cannot be null.
6450
6451 Note however that in some environments this assumption is not true.
6452 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6453 for programs which depend on that behavior.
6454
6455 Some targets, especially embedded ones, disable this option at all levels.
6456 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6457 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6458 are enabled independently at different optimization levels.
6459
6460 @item -fdevirtualize
6461 @opindex fdevirtualize
6462 Attempt to convert calls to virtual functions to direct calls.  This
6463 is done both within a procedure and interprocedurally as part of
6464 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
6465 propagation (@option{-fipa-cp}).
6466 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6467
6468 @item -fexpensive-optimizations
6469 @opindex fexpensive-optimizations
6470 Perform a number of minor optimizations that are relatively expensive.
6471
6472 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6473
6474 @item -foptimize-register-move
6475 @itemx -fregmove
6476 @opindex foptimize-register-move
6477 @opindex fregmove
6478 Attempt to reassign register numbers in move instructions and as
6479 operands of other simple instructions in order to maximize the amount of
6480 register tying.  This is especially helpful on machines with two-operand
6481 instructions.
6482
6483 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6484 optimization.
6485
6486 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6487
6488 @item -fira-algorithm=@var{algorithm}
6489 Use specified coloring algorithm for the integrated register
6490 allocator.  The @var{algorithm} argument should be @code{priority} or
6491 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6492 the second one specifies Chaitin-Briggs coloring.  The second
6493 algorithm can be unimplemented for some architectures.  If it is
6494 implemented, it is the default because Chaitin-Briggs coloring as a
6495 rule generates a better code.
6496
6497 @item -fira-region=@var{region}
6498 Use specified regions for the integrated register allocator.  The
6499 @var{region} argument should be one of @code{all}, @code{mixed}, or
6500 @code{one}.  The first value means using all loops as register
6501 allocation regions, the second value which is the default means using
6502 all loops except for loops with small register pressure as the
6503 regions, and third one means using all function as a single region.
6504 The first value can give best result for machines with small size and
6505 irregular register set, the third one results in faster and generates
6506 decent code and the smallest size code, and the default value usually
6507 give the best results in most cases and for most architectures.
6508
6509 @item -fira-loop-pressure
6510 @opindex fira-loop-pressure
6511 Use IRA to evaluate register pressure in loops for decision to move
6512 loop invariants.  Usage of this option usually results in generation
6513 of faster and smaller code on machines with big register files (>= 32
6514 registers) but it can slow compiler down.
6515
6516 This option is enabled at level @option{-O3} for some targets.
6517
6518 @item -fno-ira-share-save-slots
6519 @opindex fno-ira-share-save-slots
6520 Switch off sharing stack slots used for saving call used hard
6521 registers living through a call.  Each hard register will get a
6522 separate stack slot and as a result function stack frame will be
6523 bigger.
6524
6525 @item -fno-ira-share-spill-slots
6526 @opindex fno-ira-share-spill-slots
6527 Switch off sharing stack slots allocated for pseudo-registers.  Each
6528 pseudo-register which did not get a hard register will get a separate
6529 stack slot and as a result function stack frame will be bigger.
6530
6531 @item -fira-verbose=@var{n}
6532 @opindex fira-verbose
6533 Set up how verbose dump file for the integrated register allocator
6534 will be.  Default value is 5.  If the value is greater or equal to 10,
6535 the dump file will be stderr as if the value were @var{n} minus 10.
6536
6537 @item -fdelayed-branch
6538 @opindex fdelayed-branch
6539 If supported for the target machine, attempt to reorder instructions
6540 to exploit instruction slots available after delayed branch
6541 instructions.
6542
6543 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6544
6545 @item -fschedule-insns
6546 @opindex fschedule-insns
6547 If supported for the target machine, attempt to reorder instructions to
6548 eliminate execution stalls due to required data being unavailable.  This
6549 helps machines that have slow floating point or memory load instructions
6550 by allowing other instructions to be issued until the result of the load
6551 or floating point instruction is required.
6552
6553 Enabled at levels @option{-O2}, @option{-O3}.
6554
6555 @item -fschedule-insns2
6556 @opindex fschedule-insns2
6557 Similar to @option{-fschedule-insns}, but requests an additional pass of
6558 instruction scheduling after register allocation has been done.  This is
6559 especially useful on machines with a relatively small number of
6560 registers and where memory load instructions take more than one cycle.
6561
6562 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6563
6564 @item -fno-sched-interblock
6565 @opindex fno-sched-interblock
6566 Don't schedule instructions across basic blocks.  This is normally
6567 enabled by default when scheduling before register allocation, i.e.@:
6568 with @option{-fschedule-insns} or at @option{-O2} or higher.
6569
6570 @item -fno-sched-spec
6571 @opindex fno-sched-spec
6572 Don't allow speculative motion of non-load instructions.  This is normally
6573 enabled by default when scheduling before register allocation, i.e.@:
6574 with @option{-fschedule-insns} or at @option{-O2} or higher.
6575
6576 @item -fsched-pressure
6577 @opindex fsched-pressure
6578 Enable register pressure sensitive insn scheduling before the register
6579 allocation.  This only makes sense when scheduling before register
6580 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6581 @option{-O2} or higher.  Usage of this option can improve the
6582 generated code and decrease its size by preventing register pressure
6583 increase above the number of available hard registers and as a
6584 consequence register spills in the register allocation.
6585
6586 @item -fsched-spec-load
6587 @opindex fsched-spec-load
6588 Allow speculative motion of some load instructions.  This only makes
6589 sense when scheduling before register allocation, i.e.@: with
6590 @option{-fschedule-insns} or at @option{-O2} or higher.
6591
6592 @item -fsched-spec-load-dangerous
6593 @opindex fsched-spec-load-dangerous
6594 Allow speculative motion of more load instructions.  This only makes
6595 sense when scheduling before register allocation, i.e.@: with
6596 @option{-fschedule-insns} or at @option{-O2} or higher.
6597
6598 @item -fsched-stalled-insns
6599 @itemx -fsched-stalled-insns=@var{n}
6600 @opindex fsched-stalled-insns
6601 Define how many insns (if any) can be moved prematurely from the queue
6602 of stalled insns into the ready list, during the second scheduling pass.
6603 @option{-fno-sched-stalled-insns} means that no insns will be moved
6604 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6605 on how many queued insns can be moved prematurely.
6606 @option{-fsched-stalled-insns} without a value is equivalent to
6607 @option{-fsched-stalled-insns=1}.
6608
6609 @item -fsched-stalled-insns-dep
6610 @itemx -fsched-stalled-insns-dep=@var{n}
6611 @opindex fsched-stalled-insns-dep
6612 Define how many insn groups (cycles) will be examined for a dependency
6613 on a stalled insn that is candidate for premature removal from the queue
6614 of stalled insns.  This has an effect only during the second scheduling pass,
6615 and only if @option{-fsched-stalled-insns} is used.
6616 @option{-fno-sched-stalled-insns-dep} is equivalent to
6617 @option{-fsched-stalled-insns-dep=0}.
6618 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6619 @option{-fsched-stalled-insns-dep=1}.
6620
6621 @item -fsched2-use-superblocks
6622 @opindex fsched2-use-superblocks
6623 When scheduling after register allocation, do use superblock scheduling
6624 algorithm.  Superblock scheduling allows motion across basic block boundaries
6625 resulting on faster schedules.  This option is experimental, as not all machine
6626 descriptions used by GCC model the CPU closely enough to avoid unreliable
6627 results from the algorithm.
6628
6629 This only makes sense when scheduling after register allocation, i.e.@: with
6630 @option{-fschedule-insns2} or at @option{-O2} or higher.
6631
6632 @item -fsched-group-heuristic
6633 @opindex fsched-group-heuristic
6634 Enable the group heuristic in the scheduler.  This heuristic favors 
6635 the instruction that belongs to a schedule group.  This is enabled 
6636 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6637 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6638
6639 @item -fsched-critical-path-heuristic
6640 @opindex fsched-critical-path-heuristic
6641 Enable the critical-path heuristic in the scheduler.  This heuristic favors 
6642 instructions on the critical path.  This is enabled by default when 
6643 scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6644 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6645
6646 @item -fsched-spec-insn-heuristic
6647 @opindex fsched-spec-insn-heuristic
6648 Enable the speculative instruction heuristic in the scheduler.  This 
6649 heuristic favors speculative instructions with greater dependency weakness.  
6650 This is enabled by default when scheduling is enabled, i.e.@: 
6651 with @option{-fschedule-insns} or @option{-fschedule-insns2} 
6652 or at @option{-O2} or higher.
6653
6654 @item -fsched-rank-heuristic
6655 @opindex fsched-rank-heuristic
6656 Enable the rank heuristic in the scheduler.  This heuristic favors 
6657 the instruction belonging to a basic block with greater size or frequency.  
6658 This is enabled by default when scheduling is enabled, i.e.@: 
6659 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6660 at @option{-O2} or higher.
6661
6662 @item -fsched-last-insn-heuristic
6663 @opindex fsched-last-insn-heuristic
6664 Enable the last-instruction heuristic in the scheduler.  This heuristic 
6665 favors the instruction that is less dependent on the last instruction
6666 scheduled.  This is enabled by default when scheduling is enabled, 
6667 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6668 at @option{-O2} or higher.
6669
6670 @item -fsched-dep-count-heuristic
6671 @opindex fsched-dep-count-heuristic
6672 Enable the dependent-count heuristic in the scheduler.  This heuristic 
6673 favors the instruction that has more instructions depending on it.  
6674 This is enabled by default when scheduling is enabled, i.e.@: 
6675 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6676 at @option{-O2} or higher.
6677
6678 @item -freschedule-modulo-scheduled-loops
6679 @opindex freschedule-modulo-scheduled-loops
6680 The modulo scheduling comes before the traditional scheduling, if a loop
6681 was modulo scheduled we may want to prevent the later scheduling passes
6682 from changing its schedule, we use this option to control that.
6683
6684 @item -fselective-scheduling
6685 @opindex fselective-scheduling
6686 Schedule instructions using selective scheduling algorithm.  Selective
6687 scheduling runs instead of the first scheduler pass.
6688
6689 @item -fselective-scheduling2
6690 @opindex fselective-scheduling2
6691 Schedule instructions using selective scheduling algorithm.  Selective
6692 scheduling runs instead of the second scheduler pass.
6693
6694 @item -fsel-sched-pipelining
6695 @opindex fsel-sched-pipelining
6696 Enable software pipelining of innermost loops during selective scheduling.
6697 This option has no effect until one of @option{-fselective-scheduling} or
6698 @option{-fselective-scheduling2} is turned on.
6699
6700 @item -fsel-sched-pipelining-outer-loops
6701 @opindex fsel-sched-pipelining-outer-loops
6702 When pipelining loops during selective scheduling, also pipeline outer loops.
6703 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6704
6705 @item -fcaller-saves
6706 @opindex fcaller-saves
6707 Enable values to be allocated in registers that will be clobbered by
6708 function calls, by emitting extra instructions to save and restore the
6709 registers around such calls.  Such allocation is done only when it
6710 seems to result in better code than would otherwise be produced.
6711
6712 This option is always enabled by default on certain machines, usually
6713 those which have no call-preserved registers to use instead.
6714
6715 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6716
6717 @item -fcombine-stack-adjustments
6718 @opindex fcombine-stack-adjustments
6719 Tracks stack adjustments (pushes and pops) and stack memory references
6720 and then tries to find ways to combine them.
6721
6722 Enabled by default at @option{-O1} and higher.
6723
6724 @item -fconserve-stack
6725 @opindex fconserve-stack
6726 Attempt to minimize stack usage.  The compiler will attempt to use less
6727 stack space, even if that makes the program slower.  This option
6728 implies setting the @option{large-stack-frame} parameter to 100
6729 and the @option{large-stack-frame-growth} parameter to 400.
6730
6731 @item -ftree-reassoc
6732 @opindex ftree-reassoc
6733 Perform reassociation on trees.  This flag is enabled by default
6734 at @option{-O} and higher.
6735
6736 @item -ftree-pre
6737 @opindex ftree-pre
6738 Perform partial redundancy elimination (PRE) on trees.  This flag is
6739 enabled by default at @option{-O2} and @option{-O3}.
6740
6741 @item -ftree-forwprop
6742 @opindex ftree-forwprop
6743 Perform forward propagation on trees.  This flag is enabled by default
6744 at @option{-O} and higher.
6745
6746 @item -ftree-fre
6747 @opindex ftree-fre
6748 Perform full redundancy elimination (FRE) on trees.  The difference
6749 between FRE and PRE is that FRE only considers expressions
6750 that are computed on all paths leading to the redundant computation.
6751 This analysis is faster than PRE, though it exposes fewer redundancies.
6752 This flag is enabled by default at @option{-O} and higher.
6753
6754 @item -ftree-phiprop
6755 @opindex ftree-phiprop
6756 Perform hoisting of loads from conditional pointers on trees.  This
6757 pass is enabled by default at @option{-O} and higher.
6758
6759 @item -ftree-copy-prop
6760 @opindex ftree-copy-prop
6761 Perform copy propagation on trees.  This pass eliminates unnecessary
6762 copy operations.  This flag is enabled by default at @option{-O} and
6763 higher.
6764
6765 @item -fipa-pure-const
6766 @opindex fipa-pure-const
6767 Discover which functions are pure or constant.
6768 Enabled by default at @option{-O} and higher.
6769
6770 @item -fipa-reference
6771 @opindex fipa-reference
6772 Discover which static variables do not escape cannot escape the
6773 compilation unit.
6774 Enabled by default at @option{-O} and higher.
6775
6776 @item -fipa-struct-reorg
6777 @opindex fipa-struct-reorg
6778 Perform structure reorganization optimization, that change C-like structures
6779 layout in order to better utilize spatial locality.  This transformation is
6780 affective for programs containing arrays of structures.  Available in two
6781 compilation modes: profile-based (enabled with @option{-fprofile-generate})
6782 or static (which uses built-in heuristics).  It works only in whole program
6783 mode, so it requires @option{-fwhole-program} to be
6784 enabled.  Structures considered @samp{cold} by this transformation are not
6785 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
6786
6787 With this flag, the program debug info reflects a new structure layout.
6788
6789 @item -fipa-pta
6790 @opindex fipa-pta
6791 Perform interprocedural pointer analysis and interprocedural modification
6792 and reference analysis.  This option can cause excessive memory and
6793 compile-time usage on large compilation units.  It is not enabled by
6794 default at any optimization level.
6795
6796 @item -fipa-profile
6797 @opindex fipa-profile
6798 Perform interprocedural profile propagation.  The functions called only from
6799 cold functions are marked as cold. Also functions executed once (such as
6800 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
6801 functions and loop less parts of functions executed once are then optimized for
6802 size.
6803 Enabled by default at @option{-O} and higher.
6804
6805 @item -fipa-cp
6806 @opindex fipa-cp
6807 Perform interprocedural constant propagation.
6808 This optimization analyzes the program to determine when values passed
6809 to functions are constants and then optimizes accordingly.
6810 This optimization can substantially increase performance
6811 if the application has constants passed to functions.
6812 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6813
6814 @item -fipa-cp-clone
6815 @opindex fipa-cp-clone
6816 Perform function cloning to make interprocedural constant propagation stronger.
6817 When enabled, interprocedural constant propagation will perform function cloning
6818 when externally visible function can be called with constant arguments.
6819 Because this optimization can create multiple copies of functions,
6820 it may significantly increase code size
6821 (see @option{--param ipcp-unit-growth=@var{value}}).
6822 This flag is enabled by default at @option{-O3}.
6823
6824 @item -fipa-matrix-reorg
6825 @opindex fipa-matrix-reorg
6826 Perform matrix flattening and transposing.
6827 Matrix flattening tries to replace an @math{m}-dimensional matrix
6828 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
6829 This reduces the level of indirection needed for accessing the elements
6830 of the matrix. The second optimization is matrix transposing that
6831 attempts to change the order of the matrix's dimensions in order to
6832 improve cache locality.
6833 Both optimizations need the @option{-fwhole-program} flag.
6834 Transposing is enabled only if profiling information is available.
6835
6836 @item -ftree-sink
6837 @opindex ftree-sink
6838 Perform forward store motion  on trees.  This flag is
6839 enabled by default at @option{-O} and higher.
6840
6841 @item -ftree-bit-ccp
6842 @opindex ftree-bit-ccp
6843 Perform sparse conditional bit constant propagation on trees and propagate
6844 pointer alignment information.
6845 This pass only operates on local scalar variables and is enabled by default
6846 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
6847
6848 @item -ftree-ccp
6849 @opindex ftree-ccp
6850 Perform sparse conditional constant propagation (CCP) on trees.  This
6851 pass only operates on local scalar variables and is enabled by default
6852 at @option{-O} and higher.
6853
6854 @item -ftree-switch-conversion
6855 Perform conversion of simple initializations in a switch to
6856 initializations from a scalar array.  This flag is enabled by default
6857 at @option{-O2} and higher.
6858
6859 @item -ftree-dce
6860 @opindex ftree-dce
6861 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6862 default at @option{-O} and higher.
6863
6864 @item -ftree-builtin-call-dce
6865 @opindex ftree-builtin-call-dce
6866 Perform conditional dead code elimination (DCE) for calls to builtin functions
6867 that may set @code{errno} but are otherwise side-effect free.  This flag is
6868 enabled by default at @option{-O2} and higher if @option{-Os} is not also
6869 specified.
6870
6871 @item -ftree-dominator-opts
6872 @opindex ftree-dominator-opts
6873 Perform a variety of simple scalar cleanups (constant/copy
6874 propagation, redundancy elimination, range propagation and expression
6875 simplification) based on a dominator tree traversal.  This also
6876 performs jump threading (to reduce jumps to jumps). This flag is
6877 enabled by default at @option{-O} and higher.
6878
6879 @item -ftree-dse
6880 @opindex ftree-dse
6881 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6882 a memory location which will later be overwritten by another store without
6883 any intervening loads.  In this case the earlier store can be deleted.  This
6884 flag is enabled by default at @option{-O} and higher.
6885
6886 @item -ftree-ch
6887 @opindex ftree-ch
6888 Perform loop header copying on trees.  This is beneficial since it increases
6889 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6890 is enabled by default at @option{-O} and higher.  It is not enabled
6891 for @option{-Os}, since it usually increases code size.
6892
6893 @item -ftree-loop-optimize
6894 @opindex ftree-loop-optimize
6895 Perform loop optimizations on trees.  This flag is enabled by default
6896 at @option{-O} and higher.
6897
6898 @item -ftree-loop-linear
6899 @opindex ftree-loop-linear
6900 Perform loop interchange transformations on tree.  Same as
6901 @option{-floop-interchange}.  To use this code transformation, GCC has
6902 to be configured with @option{--with-ppl} and @option{--with-cloog} to
6903 enable the Graphite loop transformation infrastructure.
6904
6905 @item -floop-interchange
6906 @opindex floop-interchange
6907 Perform loop interchange transformations on loops.  Interchanging two
6908 nested loops switches the inner and outer loops.  For example, given a
6909 loop like:
6910 @smallexample
6911 DO J = 1, M
6912   DO I = 1, N
6913     A(J, I) = A(J, I) * C
6914   ENDDO
6915 ENDDO
6916 @end smallexample
6917 loop interchange will transform the loop as if the user had written:
6918 @smallexample
6919 DO I = 1, N
6920   DO J = 1, M
6921     A(J, I) = A(J, I) * C
6922   ENDDO
6923 ENDDO
6924 @end smallexample
6925 which can be beneficial when @code{N} is larger than the caches,
6926 because in Fortran, the elements of an array are stored in memory
6927 contiguously by column, and the original loop iterates over rows,
6928 potentially creating at each access a cache miss.  This optimization
6929 applies to all the languages supported by GCC and is not limited to
6930 Fortran.  To use this code transformation, GCC has to be configured
6931 with @option{--with-ppl} and @option{--with-cloog} to enable the
6932 Graphite loop transformation infrastructure.
6933
6934 @item -floop-strip-mine
6935 @opindex floop-strip-mine
6936 Perform loop strip mining transformations on loops.  Strip mining
6937 splits a loop into two nested loops.  The outer loop has strides
6938 equal to the strip size and the inner loop has strides of the
6939 original loop within a strip.  The strip length can be changed
6940 using the @option{loop-block-tile-size} parameter.  For example,
6941 given a loop like:
6942 @smallexample
6943 DO I = 1, N
6944   A(I) = A(I) + C
6945 ENDDO
6946 @end smallexample
6947 loop strip mining will transform the loop as if the user had written:
6948 @smallexample
6949 DO II = 1, N, 51
6950   DO I = II, min (II + 50, N)
6951     A(I) = A(I) + C
6952   ENDDO
6953 ENDDO
6954 @end smallexample
6955 This optimization applies to all the languages supported by GCC and is
6956 not limited to Fortran.  To use this code transformation, GCC has to
6957 be configured with @option{--with-ppl} and @option{--with-cloog} to
6958 enable the Graphite loop transformation infrastructure.
6959
6960 @item -floop-block
6961 @opindex floop-block
6962 Perform loop blocking transformations on loops.  Blocking strip mines
6963 each loop in the loop nest such that the memory accesses of the
6964 element loops fit inside caches.  The strip length can be changed
6965 using the @option{loop-block-tile-size} parameter.  For example, given
6966 a loop like:
6967 @smallexample
6968 DO I = 1, N
6969   DO J = 1, M
6970     A(J, I) = B(I) + C(J)
6971   ENDDO
6972 ENDDO
6973 @end smallexample
6974 loop blocking will transform the loop as if the user had written:
6975 @smallexample
6976 DO II = 1, N, 51
6977   DO JJ = 1, M, 51
6978     DO I = II, min (II + 50, N)
6979       DO J = JJ, min (JJ + 50, M)
6980         A(J, I) = B(I) + C(J)
6981       ENDDO
6982     ENDDO
6983   ENDDO
6984 ENDDO
6985 @end smallexample
6986 which can be beneficial when @code{M} is larger than the caches,
6987 because the innermost loop will iterate over a smaller amount of data
6988 that can be kept in the caches.  This optimization applies to all the
6989 languages supported by GCC and is not limited to Fortran.  To use this
6990 code transformation, GCC has to be configured with @option{--with-ppl}
6991 and @option{--with-cloog} to enable the Graphite loop transformation
6992 infrastructure.
6993
6994 @item -fgraphite-identity
6995 @opindex fgraphite-identity
6996 Enable the identity transformation for graphite.  For every SCoP we generate
6997 the polyhedral representation and transform it back to gimple.  Using
6998 @option{-fgraphite-identity} we can check the costs or benefits of the
6999 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7000 are also performed by the code generator CLooG, like index splitting and
7001 dead code elimination in loops.
7002
7003 @item -floop-flatten
7004 @opindex floop-flatten
7005 Removes the loop nesting structure: transforms the loop nest into a
7006 single loop.  This transformation can be useful to vectorize all the
7007 levels of the loop nest.
7008
7009 @item -floop-parallelize-all
7010 @opindex floop-parallelize-all
7011 Use the Graphite data dependence analysis to identify loops that can
7012 be parallelized.  Parallelize all the loops that can be analyzed to
7013 not contain loop carried dependences without checking that it is
7014 profitable to parallelize the loops.
7015
7016 @item -fcheck-data-deps
7017 @opindex fcheck-data-deps
7018 Compare the results of several data dependence analyzers.  This option
7019 is used for debugging the data dependence analyzers.
7020
7021 @item -ftree-loop-if-convert
7022 Attempt to transform conditional jumps in the innermost loops to
7023 branch-less equivalents.  The intent is to remove control-flow from
7024 the innermost loops in order to improve the ability of the
7025 vectorization pass to handle these loops.  This is enabled by default
7026 if vectorization is enabled.
7027
7028 @item -ftree-loop-if-convert-stores
7029 Attempt to also if-convert conditional jumps containing memory writes.
7030 This transformation can be unsafe for multi-threaded programs as it
7031 transforms conditional memory writes into unconditional memory writes.
7032 For example,
7033 @smallexample
7034 for (i = 0; i < N; i++)
7035   if (cond)
7036     A[i] = expr;
7037 @end smallexample
7038 would be transformed to
7039 @smallexample
7040 for (i = 0; i < N; i++)
7041   A[i] = cond ? expr : A[i];
7042 @end smallexample
7043 potentially producing data races.
7044
7045 @item -ftree-loop-distribution
7046 Perform loop distribution.  This flag can improve cache performance on
7047 big loop bodies and allow further loop optimizations, like
7048 parallelization or vectorization, to take place.  For example, the loop
7049 @smallexample
7050 DO I = 1, N
7051   A(I) = B(I) + C
7052   D(I) = E(I) * F
7053 ENDDO
7054 @end smallexample
7055 is transformed to
7056 @smallexample
7057 DO I = 1, N
7058    A(I) = B(I) + C
7059 ENDDO
7060 DO I = 1, N
7061    D(I) = E(I) * F
7062 ENDDO
7063 @end smallexample
7064
7065 @item -ftree-loop-distribute-patterns
7066 Perform loop distribution of patterns that can be code generated with
7067 calls to a library.  This flag is enabled by default at @option{-O3}.
7068
7069 This pass distributes the initialization loops and generates a call to
7070 memset zero.  For example, the loop
7071 @smallexample
7072 DO I = 1, N
7073   A(I) = 0
7074   B(I) = A(I) + I
7075 ENDDO
7076 @end smallexample
7077 is transformed to
7078 @smallexample
7079 DO I = 1, N
7080    A(I) = 0
7081 ENDDO
7082 DO I = 1, N
7083    B(I) = A(I) + I
7084 ENDDO
7085 @end smallexample
7086 and the initialization loop is transformed into a call to memset zero.
7087
7088 @item -ftree-loop-im
7089 @opindex ftree-loop-im
7090 Perform loop invariant motion on trees.  This pass moves only invariants that
7091 would be hard to handle at RTL level (function calls, operations that expand to
7092 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7093 operands of conditions that are invariant out of the loop, so that we can use
7094 just trivial invariantness analysis in loop unswitching.  The pass also includes
7095 store motion.
7096
7097 @item -ftree-loop-ivcanon
7098 @opindex ftree-loop-ivcanon
7099 Create a canonical counter for number of iterations in the loop for that
7100 determining number of iterations requires complicated analysis.  Later
7101 optimizations then may determine the number easily.  Useful especially
7102 in connection with unrolling.
7103
7104 @item -fivopts
7105 @opindex fivopts
7106 Perform induction variable optimizations (strength reduction, induction
7107 variable merging and induction variable elimination) on trees.
7108
7109 @item -ftree-parallelize-loops=n
7110 @opindex ftree-parallelize-loops
7111 Parallelize loops, i.e., split their iteration space to run in n threads.
7112 This is only possible for loops whose iterations are independent
7113 and can be arbitrarily reordered.  The optimization is only
7114 profitable on multiprocessor machines, for loops that are CPU-intensive,
7115 rather than constrained e.g.@: by memory bandwidth.  This option
7116 implies @option{-pthread}, and thus is only supported on targets
7117 that have support for @option{-pthread}.
7118
7119 @item -ftree-pta
7120 @opindex ftree-pta
7121 Perform function-local points-to analysis on trees.  This flag is
7122 enabled by default at @option{-O} and higher.
7123
7124 @item -ftree-sra
7125 @opindex ftree-sra
7126 Perform scalar replacement of aggregates.  This pass replaces structure
7127 references with scalars to prevent committing structures to memory too
7128 early.  This flag is enabled by default at @option{-O} and higher.
7129
7130 @item -ftree-copyrename
7131 @opindex ftree-copyrename
7132 Perform copy renaming on trees.  This pass attempts to rename compiler
7133 temporaries to other variables at copy locations, usually resulting in
7134 variable names which more closely resemble the original variables.  This flag
7135 is enabled by default at @option{-O} and higher.
7136
7137 @item -ftree-ter
7138 @opindex ftree-ter
7139 Perform temporary expression replacement during the SSA->normal phase.  Single
7140 use/single def temporaries are replaced at their use location with their
7141 defining expression.  This results in non-GIMPLE code, but gives the expanders
7142 much more complex trees to work on resulting in better RTL generation.  This is
7143 enabled by default at @option{-O} and higher.
7144
7145 @item -ftree-vectorize
7146 @opindex ftree-vectorize
7147 Perform loop vectorization on trees. This flag is enabled by default at
7148 @option{-O3}.
7149
7150 @item -ftree-slp-vectorize
7151 @opindex ftree-slp-vectorize
7152 Perform basic block vectorization on trees. This flag is enabled by default at
7153 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7154
7155 @item -ftree-vect-loop-version
7156 @opindex ftree-vect-loop-version
7157 Perform loop versioning when doing loop vectorization on trees.  When a loop
7158 appears to be vectorizable except that data alignment or data dependence cannot
7159 be determined at compile time then vectorized and non-vectorized versions of
7160 the loop are generated along with runtime checks for alignment or dependence
7161 to control which version is executed.  This option is enabled by default
7162 except at level @option{-Os} where it is disabled.
7163
7164 @item -fvect-cost-model
7165 @opindex fvect-cost-model
7166 Enable cost model for vectorization.
7167
7168 @item -ftree-vrp
7169 @opindex ftree-vrp
7170 Perform Value Range Propagation on trees.  This is similar to the
7171 constant propagation pass, but instead of values, ranges of values are
7172 propagated.  This allows the optimizers to remove unnecessary range
7173 checks like array bound checks and null pointer checks.  This is
7174 enabled by default at @option{-O2} and higher.  Null pointer check
7175 elimination is only done if @option{-fdelete-null-pointer-checks} is
7176 enabled.
7177
7178 @item -ftracer
7179 @opindex ftracer
7180 Perform tail duplication to enlarge superblock size.  This transformation
7181 simplifies the control flow of the function allowing other optimizations to do
7182 better job.
7183
7184 @item -funroll-loops
7185 @opindex funroll-loops
7186 Unroll loops whose number of iterations can be determined at compile
7187 time or upon entry to the loop.  @option{-funroll-loops} implies
7188 @option{-frerun-cse-after-loop}.  This option makes code larger,
7189 and may or may not make it run faster.
7190
7191 @item -funroll-all-loops
7192 @opindex funroll-all-loops
7193 Unroll all loops, even if their number of iterations is uncertain when
7194 the loop is entered.  This usually makes programs run more slowly.
7195 @option{-funroll-all-loops} implies the same options as
7196 @option{-funroll-loops},
7197
7198 @item -fsplit-ivs-in-unroller
7199 @opindex fsplit-ivs-in-unroller
7200 Enables expressing of values of induction variables in later iterations
7201 of the unrolled loop using the value in the first iteration.  This breaks
7202 long dependency chains, thus improving efficiency of the scheduling passes.
7203
7204 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7205 same effect.  However in cases the loop body is more complicated than
7206 a single basic block, this is not reliable.  It also does not work at all
7207 on some of the architectures due to restrictions in the CSE pass.
7208
7209 This optimization is enabled by default.
7210
7211 @item -fvariable-expansion-in-unroller
7212 @opindex fvariable-expansion-in-unroller
7213 With this option, the compiler will create multiple copies of some
7214 local variables when unrolling a loop which can result in superior code.
7215
7216 @item -fpartial-inlining
7217 @opindex fpartial-inlining
7218 Inline parts of functions.  This option has any effect only
7219 when inlining itself is turned on by the @option{-finline-functions}
7220 or @option{-finline-small-functions} options.
7221
7222 Enabled at level @option{-O2}.
7223
7224 @item -fpredictive-commoning
7225 @opindex fpredictive-commoning
7226 Perform predictive commoning optimization, i.e., reusing computations
7227 (especially memory loads and stores) performed in previous
7228 iterations of loops.
7229
7230 This option is enabled at level @option{-O3}.
7231
7232 @item -fprefetch-loop-arrays
7233 @opindex fprefetch-loop-arrays
7234 If supported by the target machine, generate instructions to prefetch
7235 memory to improve the performance of loops that access large arrays.
7236
7237 This option may generate better or worse code; results are highly
7238 dependent on the structure of loops within the source code.
7239
7240 Disabled at level @option{-Os}.
7241
7242 @item -fno-peephole
7243 @itemx -fno-peephole2
7244 @opindex fno-peephole
7245 @opindex fno-peephole2
7246 Disable any machine-specific peephole optimizations.  The difference
7247 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7248 are implemented in the compiler; some targets use one, some use the
7249 other, a few use both.
7250
7251 @option{-fpeephole} is enabled by default.
7252 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7253
7254 @item -fno-guess-branch-probability
7255 @opindex fno-guess-branch-probability
7256 Do not guess branch probabilities using heuristics.
7257
7258 GCC will use heuristics to guess branch probabilities if they are
7259 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7260 heuristics are based on the control flow graph.  If some branch probabilities
7261 are specified by @samp{__builtin_expect}, then the heuristics will be
7262 used to guess branch probabilities for the rest of the control flow graph,
7263 taking the @samp{__builtin_expect} info into account.  The interactions
7264 between the heuristics and @samp{__builtin_expect} can be complex, and in
7265 some cases, it may be useful to disable the heuristics so that the effects
7266 of @samp{__builtin_expect} are easier to understand.
7267
7268 The default is @option{-fguess-branch-probability} at levels
7269 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7270
7271 @item -freorder-blocks
7272 @opindex freorder-blocks
7273 Reorder basic blocks in the compiled function in order to reduce number of
7274 taken branches and improve code locality.
7275
7276 Enabled at levels @option{-O2}, @option{-O3}.
7277
7278 @item -freorder-blocks-and-partition
7279 @opindex freorder-blocks-and-partition
7280 In addition to reordering basic blocks in the compiled function, in order
7281 to reduce number of taken branches, partitions hot and cold basic blocks
7282 into separate sections of the assembly and .o files, to improve
7283 paging and cache locality performance.
7284
7285 This optimization is automatically turned off in the presence of
7286 exception handling, for linkonce sections, for functions with a user-defined
7287 section attribute and on any architecture that does not support named
7288 sections.
7289
7290 @item -freorder-functions
7291 @opindex freorder-functions
7292 Reorder functions in the object file in order to
7293 improve code locality.  This is implemented by using special
7294 subsections @code{.text.hot} for most frequently executed functions and
7295 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7296 the linker so object file format must support named sections and linker must
7297 place them in a reasonable way.
7298
7299 Also profile feedback must be available in to make this option effective.  See
7300 @option{-fprofile-arcs} for details.
7301
7302 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7303
7304 @item -fstrict-aliasing
7305 @opindex fstrict-aliasing
7306 Allow the compiler to assume the strictest aliasing rules applicable to
7307 the language being compiled.  For C (and C++), this activates
7308 optimizations based on the type of expressions.  In particular, an
7309 object of one type is assumed never to reside at the same address as an
7310 object of a different type, unless the types are almost the same.  For
7311 example, an @code{unsigned int} can alias an @code{int}, but not a
7312 @code{void*} or a @code{double}.  A character type may alias any other
7313 type.
7314
7315 @anchor{Type-punning}Pay special attention to code like this:
7316 @smallexample
7317 union a_union @{
7318   int i;
7319   double d;
7320 @};
7321
7322 int f() @{
7323   union a_union t;
7324   t.d = 3.0;
7325   return t.i;
7326 @}
7327 @end smallexample
7328 The practice of reading from a different union member than the one most
7329 recently written to (called ``type-punning'') is common.  Even with
7330 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7331 is accessed through the union type.  So, the code above will work as
7332 expected.  @xref{Structures unions enumerations and bit-fields
7333 implementation}.  However, this code might not:
7334 @smallexample
7335 int f() @{
7336   union a_union t;
7337   int* ip;
7338   t.d = 3.0;
7339   ip = &t.i;
7340   return *ip;
7341 @}
7342 @end smallexample
7343
7344 Similarly, access by taking the address, casting the resulting pointer
7345 and dereferencing the result has undefined behavior, even if the cast
7346 uses a union type, e.g.:
7347 @smallexample
7348 int f() @{
7349   double d = 3.0;
7350   return ((union a_union *) &d)->i;
7351 @}
7352 @end smallexample
7353
7354 The @option{-fstrict-aliasing} option is enabled at levels
7355 @option{-O2}, @option{-O3}, @option{-Os}.
7356
7357 @item -fstrict-overflow
7358 @opindex fstrict-overflow
7359 Allow the compiler to assume strict signed overflow rules, depending
7360 on the language being compiled.  For C (and C++) this means that
7361 overflow when doing arithmetic with signed numbers is undefined, which
7362 means that the compiler may assume that it will not happen.  This
7363 permits various optimizations.  For example, the compiler will assume
7364 that an expression like @code{i + 10 > i} will always be true for
7365 signed @code{i}.  This assumption is only valid if signed overflow is
7366 undefined, as the expression is false if @code{i + 10} overflows when
7367 using twos complement arithmetic.  When this option is in effect any
7368 attempt to determine whether an operation on signed numbers will
7369 overflow must be written carefully to not actually involve overflow.
7370
7371 This option also allows the compiler to assume strict pointer
7372 semantics: given a pointer to an object, if adding an offset to that
7373 pointer does not produce a pointer to the same object, the addition is
7374 undefined.  This permits the compiler to conclude that @code{p + u >
7375 p} is always true for a pointer @code{p} and unsigned integer
7376 @code{u}.  This assumption is only valid because pointer wraparound is
7377 undefined, as the expression is false if @code{p + u} overflows using
7378 twos complement arithmetic.
7379
7380 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7381 that integer signed overflow is fully defined: it wraps.  When
7382 @option{-fwrapv} is used, there is no difference between
7383 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7384 integers.  With @option{-fwrapv} certain types of overflow are
7385 permitted.  For example, if the compiler gets an overflow when doing
7386 arithmetic on constants, the overflowed value can still be used with
7387 @option{-fwrapv}, but not otherwise.
7388
7389 The @option{-fstrict-overflow} option is enabled at levels
7390 @option{-O2}, @option{-O3}, @option{-Os}.
7391
7392 @item -falign-functions
7393 @itemx -falign-functions=@var{n}
7394 @opindex falign-functions
7395 Align the start of functions to the next power-of-two greater than
7396 @var{n}, skipping up to @var{n} bytes.  For instance,
7397 @option{-falign-functions=32} aligns functions to the next 32-byte
7398 boundary, but @option{-falign-functions=24} would align to the next
7399 32-byte boundary only if this can be done by skipping 23 bytes or less.
7400
7401 @option{-fno-align-functions} and @option{-falign-functions=1} are
7402 equivalent and mean that functions will not be aligned.
7403
7404 Some assemblers only support this flag when @var{n} is a power of two;
7405 in that case, it is rounded up.
7406
7407 If @var{n} is not specified or is zero, use a machine-dependent default.
7408
7409 Enabled at levels @option{-O2}, @option{-O3}.
7410
7411 @item -falign-labels
7412 @itemx -falign-labels=@var{n}
7413 @opindex falign-labels
7414 Align all branch targets to a power-of-two boundary, skipping up to
7415 @var{n} bytes like @option{-falign-functions}.  This option can easily
7416 make code slower, because it must insert dummy operations for when the
7417 branch target is reached in the usual flow of the code.
7418
7419 @option{-fno-align-labels} and @option{-falign-labels=1} are
7420 equivalent and mean that labels will not be aligned.
7421
7422 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7423 are greater than this value, then their values are used instead.
7424
7425 If @var{n} is not specified or is zero, use a machine-dependent default
7426 which is very likely to be @samp{1}, meaning no alignment.
7427
7428 Enabled at levels @option{-O2}, @option{-O3}.
7429
7430 @item -falign-loops
7431 @itemx -falign-loops=@var{n}
7432 @opindex falign-loops
7433 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7434 like @option{-falign-functions}.  The hope is that the loop will be
7435 executed many times, which will make up for any execution of the dummy
7436 operations.
7437
7438 @option{-fno-align-loops} and @option{-falign-loops=1} are
7439 equivalent and mean that loops will not be aligned.
7440
7441 If @var{n} is not specified or is zero, use a machine-dependent default.
7442
7443 Enabled at levels @option{-O2}, @option{-O3}.
7444
7445 @item -falign-jumps
7446 @itemx -falign-jumps=@var{n}
7447 @opindex falign-jumps
7448 Align branch targets to a power-of-two boundary, for branch targets
7449 where the targets can only be reached by jumping, skipping up to @var{n}
7450 bytes like @option{-falign-functions}.  In this case, no dummy operations
7451 need be executed.
7452
7453 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7454 equivalent and mean that loops will not be aligned.
7455
7456 If @var{n} is not specified or is zero, use a machine-dependent default.
7457
7458 Enabled at levels @option{-O2}, @option{-O3}.
7459
7460 @item -funit-at-a-time
7461 @opindex funit-at-a-time
7462 This option is left for compatibility reasons. @option{-funit-at-a-time}
7463 has no effect, while @option{-fno-unit-at-a-time} implies
7464 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7465
7466 Enabled by default.
7467
7468 @item -fno-toplevel-reorder
7469 @opindex fno-toplevel-reorder
7470 Do not reorder top-level functions, variables, and @code{asm}
7471 statements.  Output them in the same order that they appear in the
7472 input file.  When this option is used, unreferenced static variables
7473 will not be removed.  This option is intended to support existing code
7474 which relies on a particular ordering.  For new code, it is better to
7475 use attributes.
7476
7477 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
7478 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
7479 targets.
7480
7481 @item -fweb
7482 @opindex fweb
7483 Constructs webs as commonly used for register allocation purposes and assign
7484 each web individual pseudo register.  This allows the register allocation pass
7485 to operate on pseudos directly, but also strengthens several other optimization
7486 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7487 however, make debugging impossible, since variables will no longer stay in a
7488 ``home register''.
7489
7490 Enabled by default with @option{-funroll-loops}.
7491
7492 @item -fwhole-program
7493 @opindex fwhole-program
7494 Assume that the current compilation unit represents the whole program being
7495 compiled.  All public functions and variables with the exception of @code{main}
7496 and those merged by attribute @code{externally_visible} become static functions
7497 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.
7498 While this option is equivalent to proper use of the @code{static} keyword for
7499 programs consisting of a single file, in combination with option
7500 @option{-flto} this flag can be used to
7501 compile many smaller scale programs since the functions and variables become
7502 local for the whole combined compilation unit, not for the single source file
7503 itself.
7504
7505 This option implies @option{-fwhole-file} for Fortran programs.
7506
7507 @item -flto[=@var{n}]
7508 @opindex flto
7509 This option runs the standard link-time optimizer.  When invoked
7510 with source code, it generates GIMPLE (one of GCC's internal
7511 representations) and writes it to special ELF sections in the object
7512 file.  When the object files are linked together, all the function
7513 bodies are read from these ELF sections and instantiated as if they
7514 had been part of the same translation unit.
7515
7516 To use the link-timer optimizer, @option{-flto} needs to be specified at
7517 compile time and during the final link.  For example,
7518
7519 @smallexample
7520 gcc -c -O2 -flto foo.c
7521 gcc -c -O2 -flto bar.c
7522 gcc -o myprog -flto -O2 foo.o bar.o
7523 @end smallexample
7524
7525 The first two invocations to GCC will save a bytecode representation
7526 of GIMPLE into special ELF sections inside @file{foo.o} and
7527 @file{bar.o}.  The final invocation will read the GIMPLE bytecode from
7528 @file{foo.o} and @file{bar.o}, merge the two files into a single
7529 internal image, and compile the result as usual.  Since both
7530 @file{foo.o} and @file{bar.o} are merged into a single image, this
7531 causes all the inter-procedural analyses and optimizations in GCC to
7532 work across the two files as if they were a single one.  This means,
7533 for example, that the inliner will be able to inline functions in
7534 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7535
7536 Another (simpler) way to enable link-time optimization is,
7537
7538 @smallexample
7539 gcc -o myprog -flto -O2 foo.c bar.c
7540 @end smallexample
7541
7542 The above will generate bytecode for @file{foo.c} and @file{bar.c},
7543 merge them together into a single GIMPLE representation and optimize
7544 them as usual to produce @file{myprog}.
7545
7546 The only important thing to keep in mind is that to enable link-time
7547 optimizations the @option{-flto} flag needs to be passed to both the
7548 compile and the link commands.
7549
7550 To make whole program optimization effective, it is necessary to make
7551 certain whole program assumptions.  The compiler needs to know
7552 what functions and variables can be accessed by libraries and runtime
7553 outside of the link time optimized unit.  When supported by the linker,
7554 the linker plugin (see @option{-fuse-linker-plugin}) passes to the
7555 compiler information about used and externally visible symbols.  When
7556 the linker plugin is not available, @option{-fwhole-program} should be
7557 used to allow the compiler to make these assumptions, which will lead
7558 to more aggressive optimization decisions.
7559
7560 Note that when a file is compiled with @option{-flto}, the generated
7561 object file will be larger than a regular object file because it will
7562 contain GIMPLE bytecodes and the usual final code.  This means that
7563 object files with LTO information can be linked as a normal object
7564 file.  So, in the previous example, if the final link is done with
7565
7566 @smallexample
7567 gcc -o myprog foo.o bar.o
7568 @end smallexample
7569
7570 The only difference will be that no inter-procedural optimizations
7571 will be applied to produce @file{myprog}.  The two object files
7572 @file{foo.o} and @file{bar.o} will be simply sent to the regular
7573 linker.
7574
7575 Additionally, the optimization flags used to compile individual files
7576 are not necessarily related to those used at link-time.  For instance,
7577
7578 @smallexample
7579 gcc -c -O0 -flto foo.c
7580 gcc -c -O0 -flto bar.c
7581 gcc -o myprog -flto -O3 foo.o bar.o
7582 @end smallexample
7583
7584 This will produce individual object files with unoptimized assembler
7585 code, but the resulting binary @file{myprog} will be optimized at
7586 @option{-O3}.  Now, if the final binary is generated without
7587 @option{-flto}, then @file{myprog} will not be optimized.
7588
7589 When producing the final binary with @option{-flto}, GCC will only
7590 apply link-time optimizations to those files that contain bytecode.
7591 Therefore, you can mix and match object files and libraries with
7592 GIMPLE bytecodes and final object code.  GCC will automatically select
7593 which files to optimize in LTO mode and which files to link without
7594 further processing.
7595
7596 There are some code generation flags that GCC will preserve when
7597 generating bytecodes, as they need to be used during the final link
7598 stage.  Currently, the following options are saved into the GIMPLE
7599 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7600 @option{-m} target flags.
7601
7602 At link time, these options are read-in and reapplied.  Note that the
7603 current implementation makes no attempt at recognizing conflicting
7604 values for these options.  If two or more files have a conflicting
7605 value (e.g., one file is compiled with @option{-fPIC} and another
7606 isn't), the compiler will simply use the last value read from the
7607 bytecode files.  It is recommended, then, that all the files
7608 participating in the same link be compiled with the same options.
7609
7610 Another feature of LTO is that it is possible to apply interprocedural
7611 optimizations on files written in different languages.  This requires
7612 some support in the language front end.  Currently, the C, C++ and
7613 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7614 something like this should work
7615
7616 @smallexample
7617 gcc -c -flto foo.c
7618 g++ -c -flto bar.cc
7619 gfortran -c -flto baz.f90
7620 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7621 @end smallexample
7622
7623 Notice that the final link is done with @command{g++} to get the C++
7624 runtime libraries and @option{-lgfortran} is added to get the Fortran
7625 runtime libraries.  In general, when mixing languages in LTO mode, you
7626 should use the same link command used when mixing languages in a
7627 regular (non-LTO) compilation.  This means that if your build process
7628 was mixing languages before, all you need to add is @option{-flto} to
7629 all the compile and link commands.
7630
7631 If LTO encounters objects with C linkage declared with incompatible
7632 types in separate translation units to be linked together (undefined
7633 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7634 issued.  The behavior is still undefined at runtime.
7635
7636 If object files containing GIMPLE bytecode are stored in a library archive, say
7637 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
7638 are using a linker with linker plugin support.  To enable this feature, use
7639 the flag @option{-fuse-linker-plugin} at link-time:
7640
7641 @smallexample
7642 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7643 @end smallexample
7644
7645 With the linker plugin enabled, the linker will extract the needed
7646 GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
7647 to make them part of the aggregated GIMPLE image to be optimized.
7648
7649 If you are not using a linker with linker plugin support and/or do not 
7650 enable linker plugin then the objects inside @file{libfoo.a}
7651 will be extracted and linked as usual, but they will not participate
7652 in the LTO optimization process.
7653
7654 Link time optimizations do not require the presence of the whole program to
7655 operate.  If the program does not require any symbols to be exported, it is
7656 possible to combine @option{-flto} and with @option{-fwhole-program} to allow
7657 the interprocedural optimizers to use more aggressive assumptions which may
7658 lead to improved optimization opportunities. 
7659 Use of @option{-fwhole-program} is not needed when linker plugin is
7660 active (see @option{-fuse-linker-plugin}).
7661
7662 Regarding portability: the current implementation of LTO makes no
7663 attempt at generating bytecode that can be ported between different
7664 types of hosts.  The bytecode files are versioned and there is a
7665 strict version check, so bytecode files generated in one version of
7666 GCC will not work with an older/newer version of GCC.
7667
7668 Link time optimization does not play well with generating debugging
7669 information.  Combining @option{-flto} with
7670 @option{-g} is currently experimental and expected to produce wrong
7671 results.
7672
7673 If you specify the optional @var{n}, the optimization and code
7674 generation done at link time is executed in parallel using @var{n}
7675 parallel jobs by utilizing an installed @command{make} program.  The
7676 environment variable @env{MAKE} may be used to override the program
7677 used.  The default value for @var{n} is 1.
7678
7679 You can also specify @option{-flto=jobserver} to use GNU make's 
7680 job server mode to determine the number of parallel jobs. This 
7681 is useful when the Makefile calling GCC is already executing in parallel.
7682 The parent Makefile will need a @samp{+} prepended to the command recipe
7683 for this to work. This will likely only work if @env{MAKE} is 
7684 GNU make.
7685
7686 This option is disabled by default.
7687
7688 @item -flto-partition=@var{alg}
7689 @opindex flto-partition
7690 Specify the partitioning algorithm used by the link time optimizer.
7691 The value is either @code{1to1} to specify a partitioning mirroring
7692 the original source files or @code{balanced} to specify partitioning
7693 into equally sized chunks (whenever possible).  Specifying @code{none}
7694 as an algorithm disables partitioning and streaming completely. The
7695 default value is @code{balanced}.
7696
7697 @item -flto-compression-level=@var{n}
7698 This option specifies the level of compression used for intermediate
7699 language written to LTO object files, and is only meaningful in
7700 conjunction with LTO mode (@option{-flto}).  Valid
7701 values are 0 (no compression) to 9 (maximum compression).  Values
7702 outside this range are clamped to either 0 or 9.  If the option is not
7703 given, a default balanced compression setting is used.
7704
7705 @item -flto-report
7706 Prints a report with internal details on the workings of the link-time
7707 optimizer.  The contents of this report vary from version to version,
7708 it is meant to be useful to GCC developers when processing object
7709 files in LTO mode (via @option{-flto}).
7710
7711 Disabled by default.
7712
7713 @item -fuse-linker-plugin
7714 Enables the use of linker plugin during link time optimization.  This option
7715 relies on the linker plugin support in linker that is available in @code{gold}
7716 or in GNU ld 2.21.51 or newer..
7717
7718 This option enables the extraction of object files with GIMPLE bytecode out of
7719 library archives. This improves the quality of optimization by exposing more
7720 code the the link time optimizer.  This information specify what symbols 
7721 can be accessed externally (by non-LTO object or during dynamic linking).
7722 Resulting code quality improvements on binaries (and shared libraries that do
7723 use hidden visibility) is similar to @code{-fwhole-program}.  See
7724 @option{-flto} for a description on the effect of this flag and how to use it.
7725
7726 Enabled by default when LTO support in GCC is enabled and GCC was compiled
7727 with linker supporting plugins (GNU ld or @code{gold}).
7728
7729 @item -fcompare-elim
7730 @opindex fcompare-elim
7731 After register allocation and post-register allocation instruction splitting,
7732 identify arithmetic instructions that compute processor flags similar to a
7733 comparison operation based on that arithmetic.  If possible, eliminate the
7734 explicit comparison operation.
7735
7736 This pass only applies to certain targets that cannot explicitly represent
7737 the comparison operation before register allocation is complete.
7738
7739 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7740
7741 @item -fcprop-registers
7742 @opindex fcprop-registers
7743 After register allocation and post-register allocation instruction splitting,
7744 we perform a copy-propagation pass to try to reduce scheduling dependencies
7745 and occasionally eliminate the copy.
7746
7747 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7748
7749 @item -fprofile-correction
7750 @opindex fprofile-correction
7751 Profiles collected using an instrumented binary for multi-threaded programs may
7752 be inconsistent due to missed counter updates. When this option is specified,
7753 GCC will use heuristics to correct or smooth out such inconsistencies. By
7754 default, GCC will emit an error message when an inconsistent profile is detected.
7755
7756 @item -fprofile-dir=@var{path}
7757 @opindex fprofile-dir
7758
7759 Set the directory to search for the profile data files in to @var{path}.
7760 This option affects only the profile data generated by
7761 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
7762 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
7763 and its related options.
7764 By default, GCC will use the current directory as @var{path}, thus the
7765 profile data file will appear in the same directory as the object file.
7766
7767 @item -fprofile-generate
7768 @itemx -fprofile-generate=@var{path}
7769 @opindex fprofile-generate
7770
7771 Enable options usually used for instrumenting application to produce
7772 profile useful for later recompilation with profile feedback based
7773 optimization.  You must use @option{-fprofile-generate} both when
7774 compiling and when linking your program.
7775
7776 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
7777
7778 If @var{path} is specified, GCC will look at the @var{path} to find
7779 the profile feedback data files. See @option{-fprofile-dir}.
7780
7781 @item -fprofile-use
7782 @itemx -fprofile-use=@var{path}
7783 @opindex fprofile-use
7784 Enable profile feedback directed optimizations, and optimizations
7785 generally profitable only with profile feedback available.
7786
7787 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
7788 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
7789
7790 By default, GCC emits an error message if the feedback profiles do not
7791 match the source code.  This error can be turned into a warning by using
7792 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
7793 code.
7794
7795 If @var{path} is specified, GCC will look at the @var{path} to find
7796 the profile feedback data files. See @option{-fprofile-dir}.
7797 @end table
7798
7799 The following options control compiler behavior regarding floating
7800 point arithmetic.  These options trade off between speed and
7801 correctness.  All must be specifically enabled.
7802
7803 @table @gcctabopt
7804 @item -ffloat-store
7805 @opindex ffloat-store
7806 Do not store floating point variables in registers, and inhibit other
7807 options that might change whether a floating point value is taken from a
7808 register or memory.
7809
7810 @cindex floating point precision
7811 This option prevents undesirable excess precision on machines such as
7812 the 68000 where the floating registers (of the 68881) keep more
7813 precision than a @code{double} is supposed to have.  Similarly for the
7814 x86 architecture.  For most programs, the excess precision does only
7815 good, but a few programs rely on the precise definition of IEEE floating
7816 point.  Use @option{-ffloat-store} for such programs, after modifying
7817 them to store all pertinent intermediate computations into variables.
7818
7819 @item -fexcess-precision=@var{style}
7820 @opindex fexcess-precision
7821 This option allows further control over excess precision on machines
7822 where floating-point registers have more precision than the IEEE
7823 @code{float} and @code{double} types and the processor does not
7824 support operations rounding to those types.  By default,
7825 @option{-fexcess-precision=fast} is in effect; this means that
7826 operations are carried out in the precision of the registers and that
7827 it is unpredictable when rounding to the types specified in the source
7828 code takes place.  When compiling C, if
7829 @option{-fexcess-precision=standard} is specified then excess
7830 precision will follow the rules specified in ISO C99; in particular,
7831 both casts and assignments cause values to be rounded to their
7832 semantic types (whereas @option{-ffloat-store} only affects
7833 assignments).  This option is enabled by default for C if a strict
7834 conformance option such as @option{-std=c99} is used.
7835
7836 @opindex mfpmath
7837 @option{-fexcess-precision=standard} is not implemented for languages
7838 other than C, and has no effect if
7839 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
7840 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
7841 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
7842 semantics apply without excess precision, and in the latter, rounding
7843 is unpredictable.
7844
7845 @item -ffast-math
7846 @opindex ffast-math
7847 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
7848 @option{-ffinite-math-only}, @option{-fno-rounding-math},
7849 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
7850
7851 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
7852
7853 This option is not turned on by any @option{-O} option besides
7854 @option{-Ofast} since it can result in incorrect output for programs
7855 which depend on an exact implementation of IEEE or ISO rules/specifications
7856 for math functions. It may, however, yield faster code for programs
7857 that do not require the guarantees of these specifications.
7858
7859 @item -fno-math-errno
7860 @opindex fno-math-errno
7861 Do not set ERRNO after calling math functions that are executed
7862 with a single instruction, e.g., sqrt.  A program that relies on
7863 IEEE exceptions for math error handling may want to use this flag
7864 for speed while maintaining IEEE arithmetic compatibility.
7865
7866 This option is not turned on by any @option{-O} option since
7867 it can result in incorrect output for programs which depend on
7868 an exact implementation of IEEE or ISO rules/specifications for
7869 math functions. It may, however, yield faster code for programs
7870 that do not require the guarantees of these specifications.
7871
7872 The default is @option{-fmath-errno}.
7873
7874 On Darwin systems, the math library never sets @code{errno}.  There is
7875 therefore no reason for the compiler to consider the possibility that
7876 it might, and @option{-fno-math-errno} is the default.
7877
7878 @item -funsafe-math-optimizations
7879 @opindex funsafe-math-optimizations
7880
7881 Allow optimizations for floating-point arithmetic that (a) assume
7882 that arguments and results are valid and (b) may violate IEEE or
7883 ANSI standards.  When used at link-time, it may include libraries
7884 or startup files that change the default FPU control word or other
7885 similar optimizations.
7886
7887 This option is not turned on by any @option{-O} option since
7888 it can result in incorrect output for programs which depend on
7889 an exact implementation of IEEE or ISO rules/specifications for
7890 math functions. It may, however, yield faster code for programs
7891 that do not require the guarantees of these specifications.
7892 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
7893 @option{-fassociative-math} and @option{-freciprocal-math}.
7894
7895 The default is @option{-fno-unsafe-math-optimizations}.
7896
7897 @item -fassociative-math
7898 @opindex fassociative-math
7899
7900 Allow re-association of operands in series of floating-point operations.
7901 This violates the ISO C and C++ language standard by possibly changing
7902 computation result.  NOTE: re-ordering may change the sign of zero as
7903 well as ignore NaNs and inhibit or create underflow or overflow (and
7904 thus cannot be used on a code which relies on rounding behavior like
7905 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
7906 and thus may not be used when ordered comparisons are required.
7907 This option requires that both @option{-fno-signed-zeros} and
7908 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
7909 much sense with @option{-frounding-math}. For Fortran the option
7910 is automatically enabled when both @option{-fno-signed-zeros} and
7911 @option{-fno-trapping-math} are in effect.
7912
7913 The default is @option{-fno-associative-math}.
7914
7915 @item -freciprocal-math
7916 @opindex freciprocal-math
7917
7918 Allow the reciprocal of a value to be used instead of dividing by
7919 the value if this enables optimizations.  For example @code{x / y}
7920 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
7921 is subject to common subexpression elimination.  Note that this loses
7922 precision and increases the number of flops operating on the value.
7923
7924 The default is @option{-fno-reciprocal-math}.
7925
7926 @item -ffinite-math-only
7927 @opindex ffinite-math-only
7928 Allow optimizations for floating-point arithmetic that assume
7929 that arguments and results are not NaNs or +-Infs.
7930
7931 This option is not turned on by any @option{-O} option since
7932 it can result in incorrect output for programs which depend on
7933 an exact implementation of IEEE or ISO rules/specifications for
7934 math functions. It may, however, yield faster code for programs
7935 that do not require the guarantees of these specifications.
7936
7937 The default is @option{-fno-finite-math-only}.
7938
7939 @item -fno-signed-zeros
7940 @opindex fno-signed-zeros
7941 Allow optimizations for floating point arithmetic that ignore the
7942 signedness of zero.  IEEE arithmetic specifies the behavior of
7943 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
7944 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
7945 This option implies that the sign of a zero result isn't significant.
7946
7947 The default is @option{-fsigned-zeros}.
7948
7949 @item -fno-trapping-math
7950 @opindex fno-trapping-math
7951 Compile code assuming that floating-point operations cannot generate
7952 user-visible traps.  These traps include division by zero, overflow,
7953 underflow, inexact result and invalid operation.  This option requires
7954 that @option{-fno-signaling-nans} be in effect.  Setting this option may
7955 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
7956
7957 This option should never be turned on by any @option{-O} option since
7958 it can result in incorrect output for programs which depend on
7959 an exact implementation of IEEE or ISO rules/specifications for
7960 math functions.
7961
7962 The default is @option{-ftrapping-math}.
7963
7964 @item -frounding-math
7965 @opindex frounding-math
7966 Disable transformations and optimizations that assume default floating
7967 point rounding behavior.  This is round-to-zero for all floating point
7968 to integer conversions, and round-to-nearest for all other arithmetic
7969 truncations.  This option should be specified for programs that change
7970 the FP rounding mode dynamically, or that may be executed with a
7971 non-default rounding mode.  This option disables constant folding of
7972 floating point expressions at compile-time (which may be affected by
7973 rounding mode) and arithmetic transformations that are unsafe in the
7974 presence of sign-dependent rounding modes.
7975
7976 The default is @option{-fno-rounding-math}.
7977
7978 This option is experimental and does not currently guarantee to
7979 disable all GCC optimizations that are affected by rounding mode.
7980 Future versions of GCC may provide finer control of this setting
7981 using C99's @code{FENV_ACCESS} pragma.  This command line option
7982 will be used to specify the default state for @code{FENV_ACCESS}.
7983
7984 @item -fsignaling-nans
7985 @opindex fsignaling-nans
7986 Compile code assuming that IEEE signaling NaNs may generate user-visible
7987 traps during floating-point operations.  Setting this option disables
7988 optimizations that may change the number of exceptions visible with
7989 signaling NaNs.  This option implies @option{-ftrapping-math}.
7990
7991 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
7992 be defined.
7993
7994 The default is @option{-fno-signaling-nans}.
7995
7996 This option is experimental and does not currently guarantee to
7997 disable all GCC optimizations that affect signaling NaN behavior.
7998
7999 @item -fsingle-precision-constant
8000 @opindex fsingle-precision-constant
8001 Treat floating point constant as single precision constant instead of
8002 implicitly converting it to double precision constant.
8003
8004 @item -fcx-limited-range
8005 @opindex fcx-limited-range
8006 When enabled, this option states that a range reduction step is not
8007 needed when performing complex division.  Also, there is no checking
8008 whether the result of a complex multiplication or division is @code{NaN
8009 + I*NaN}, with an attempt to rescue the situation in that case.  The
8010 default is @option{-fno-cx-limited-range}, but is enabled by
8011 @option{-ffast-math}.
8012
8013 This option controls the default setting of the ISO C99
8014 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8015 all languages.
8016
8017 @item -fcx-fortran-rules
8018 @opindex fcx-fortran-rules
8019 Complex multiplication and division follow Fortran rules.  Range
8020 reduction is done as part of complex division, but there is no checking
8021 whether the result of a complex multiplication or division is @code{NaN
8022 + I*NaN}, with an attempt to rescue the situation in that case.
8023
8024 The default is @option{-fno-cx-fortran-rules}.
8025
8026 @end table
8027
8028 The following options control optimizations that may improve
8029 performance, but are not enabled by any @option{-O} options.  This
8030 section includes experimental options that may produce broken code.
8031
8032 @table @gcctabopt
8033 @item -fbranch-probabilities
8034 @opindex fbranch-probabilities
8035 After running a program compiled with @option{-fprofile-arcs}
8036 (@pxref{Debugging Options,, Options for Debugging Your Program or
8037 @command{gcc}}), you can compile it a second time using
8038 @option{-fbranch-probabilities}, to improve optimizations based on
8039 the number of times each branch was taken.  When the program
8040 compiled with @option{-fprofile-arcs} exits it saves arc execution
8041 counts to a file called @file{@var{sourcename}.gcda} for each source
8042 file.  The information in this data file is very dependent on the
8043 structure of the generated code, so you must use the same source code
8044 and the same optimization options for both compilations.
8045
8046 With @option{-fbranch-probabilities}, GCC puts a
8047 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8048 These can be used to improve optimization.  Currently, they are only
8049 used in one place: in @file{reorg.c}, instead of guessing which path a
8050 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8051 exactly determine which path is taken more often.
8052
8053 @item -fprofile-values
8054 @opindex fprofile-values
8055 If combined with @option{-fprofile-arcs}, it adds code so that some
8056 data about values of expressions in the program is gathered.
8057
8058 With @option{-fbranch-probabilities}, it reads back the data gathered
8059 from profiling values of expressions for usage in optimizations.
8060
8061 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8062
8063 @item -fvpt
8064 @opindex fvpt
8065 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
8066 a code to gather information about values of expressions.
8067
8068 With @option{-fbranch-probabilities}, it reads back the data gathered
8069 and actually performs the optimizations based on them.
8070 Currently the optimizations include specialization of division operation
8071 using the knowledge about the value of the denominator.
8072
8073 @item -frename-registers
8074 @opindex frename-registers
8075 Attempt to avoid false dependencies in scheduled code by making use
8076 of registers left over after register allocation.  This optimization
8077 will most benefit processors with lots of registers.  Depending on the
8078 debug information format adopted by the target, however, it can
8079 make debugging impossible, since variables will no longer stay in
8080 a ``home register''.
8081
8082 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8083
8084 @item -ftracer
8085 @opindex ftracer
8086 Perform tail duplication to enlarge superblock size.  This transformation
8087 simplifies the control flow of the function allowing other optimizations to do
8088 better job.
8089
8090 Enabled with @option{-fprofile-use}.
8091
8092 @item -funroll-loops
8093 @opindex funroll-loops
8094 Unroll loops whose number of iterations can be determined at compile time or
8095 upon entry to the loop.  @option{-funroll-loops} implies
8096 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8097 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8098 small constant number of iterations).  This option makes code larger, and may
8099 or may not make it run faster.
8100
8101 Enabled with @option{-fprofile-use}.
8102
8103 @item -funroll-all-loops
8104 @opindex funroll-all-loops
8105 Unroll all loops, even if their number of iterations is uncertain when
8106 the loop is entered.  This usually makes programs run more slowly.
8107 @option{-funroll-all-loops} implies the same options as
8108 @option{-funroll-loops}.
8109
8110 @item -fpeel-loops
8111 @opindex fpeel-loops
8112 Peels the loops for that there is enough information that they do not
8113 roll much (from profile feedback).  It also turns on complete loop peeling
8114 (i.e.@: complete removal of loops with small constant number of iterations).
8115
8116 Enabled with @option{-fprofile-use}.
8117
8118 @item -fmove-loop-invariants
8119 @opindex fmove-loop-invariants
8120 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8121 at level @option{-O1}
8122
8123 @item -funswitch-loops
8124 @opindex funswitch-loops
8125 Move branches with loop invariant conditions out of the loop, with duplicates
8126 of the loop on both branches (modified according to result of the condition).
8127
8128 @item -ffunction-sections
8129 @itemx -fdata-sections
8130 @opindex ffunction-sections
8131 @opindex fdata-sections
8132 Place each function or data item into its own section in the output
8133 file if the target supports arbitrary sections.  The name of the
8134 function or the name of the data item determines the section's name
8135 in the output file.
8136
8137 Use these options on systems where the linker can perform optimizations
8138 to improve locality of reference in the instruction space.  Most systems
8139 using the ELF object format and SPARC processors running Solaris 2 have
8140 linkers with such optimizations.  AIX may have these optimizations in
8141 the future.
8142
8143 Only use these options when there are significant benefits from doing
8144 so.  When you specify these options, the assembler and linker will
8145 create larger object and executable files and will also be slower.
8146 You will not be able to use @code{gprof} on all systems if you
8147 specify this option and you may have problems with debugging if
8148 you specify both this option and @option{-g}.
8149
8150 @item -fbranch-target-load-optimize
8151 @opindex fbranch-target-load-optimize
8152 Perform branch target register load optimization before prologue / epilogue
8153 threading.
8154 The use of target registers can typically be exposed only during reload,
8155 thus hoisting loads out of loops and doing inter-block scheduling needs
8156 a separate optimization pass.
8157
8158 @item -fbranch-target-load-optimize2
8159 @opindex fbranch-target-load-optimize2
8160 Perform branch target register load optimization after prologue / epilogue
8161 threading.
8162
8163 @item -fbtr-bb-exclusive
8164 @opindex fbtr-bb-exclusive
8165 When performing branch target register load optimization, don't reuse
8166 branch target registers in within any basic block.
8167
8168 @item -fstack-protector
8169 @opindex fstack-protector
8170 Emit extra code to check for buffer overflows, such as stack smashing
8171 attacks.  This is done by adding a guard variable to functions with
8172 vulnerable objects.  This includes functions that call alloca, and
8173 functions with buffers larger than 8 bytes.  The guards are initialized
8174 when a function is entered and then checked when the function exits.
8175 If a guard check fails, an error message is printed and the program exits.
8176
8177 @item -fstack-protector-all
8178 @opindex fstack-protector-all
8179 Like @option{-fstack-protector} except that all functions are protected.
8180
8181 @item -fsection-anchors
8182 @opindex fsection-anchors
8183 Try to reduce the number of symbolic address calculations by using
8184 shared ``anchor'' symbols to address nearby objects.  This transformation
8185 can help to reduce the number of GOT entries and GOT accesses on some
8186 targets.
8187
8188 For example, the implementation of the following function @code{foo}:
8189
8190 @smallexample
8191 static int a, b, c;
8192 int foo (void) @{ return a + b + c; @}
8193 @end smallexample
8194
8195 would usually calculate the addresses of all three variables, but if you
8196 compile it with @option{-fsection-anchors}, it will access the variables
8197 from a common anchor point instead.  The effect is similar to the
8198 following pseudocode (which isn't valid C):
8199
8200 @smallexample
8201 int foo (void)
8202 @{
8203   register int *xr = &x;
8204   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8205 @}
8206 @end smallexample
8207
8208 Not all targets support this option.
8209
8210 @item --param @var{name}=@var{value}
8211 @opindex param
8212 In some places, GCC uses various constants to control the amount of
8213 optimization that is done.  For example, GCC will not inline functions
8214 that contain more that a certain number of instructions.  You can
8215 control some of these constants on the command-line using the
8216 @option{--param} option.
8217
8218 The names of specific parameters, and the meaning of the values, are
8219 tied to the internals of the compiler, and are subject to change
8220 without notice in future releases.
8221
8222 In each case, the @var{value} is an integer.  The allowable choices for
8223 @var{name} are given in the following table:
8224
8225 @table @gcctabopt
8226 @item struct-reorg-cold-struct-ratio
8227 The threshold ratio (as a percentage) between a structure frequency
8228 and the frequency of the hottest structure in the program.  This parameter
8229 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
8230 We say that if the ratio of a structure frequency, calculated by profiling,
8231 to the hottest structure frequency in the program is less than this
8232 parameter, then structure reorganization is not applied to this structure.
8233 The default is 10.
8234
8235 @item predictable-branch-outcome
8236 When branch is predicted to be taken with probability lower than this threshold
8237 (in percent), then it is considered well predictable. The default is 10.
8238
8239 @item max-crossjump-edges
8240 The maximum number of incoming edges to consider for crossjumping.
8241 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8242 the number of edges incoming to each block.  Increasing values mean
8243 more aggressive optimization, making the compile time increase with
8244 probably small improvement in executable size.
8245
8246 @item min-crossjump-insns
8247 The minimum number of instructions which must be matched at the end
8248 of two blocks before crossjumping will be performed on them.  This
8249 value is ignored in the case where all instructions in the block being
8250 crossjumped from are matched.  The default value is 5.
8251
8252 @item max-grow-copy-bb-insns
8253 The maximum code size expansion factor when copying basic blocks
8254 instead of jumping.  The expansion is relative to a jump instruction.
8255 The default value is 8.
8256
8257 @item max-goto-duplication-insns
8258 The maximum number of instructions to duplicate to a block that jumps
8259 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8260 passes, GCC factors computed gotos early in the compilation process,
8261 and unfactors them as late as possible.  Only computed jumps at the
8262 end of a basic blocks with no more than max-goto-duplication-insns are
8263 unfactored.  The default value is 8.
8264
8265 @item max-delay-slot-insn-search
8266 The maximum number of instructions to consider when looking for an
8267 instruction to fill a delay slot.  If more than this arbitrary number of
8268 instructions is searched, the time savings from filling the delay slot
8269 will be minimal so stop searching.  Increasing values mean more
8270 aggressive optimization, making the compile time increase with probably
8271 small improvement in executable run time.
8272
8273 @item max-delay-slot-live-search
8274 When trying to fill delay slots, the maximum number of instructions to
8275 consider when searching for a block with valid live register
8276 information.  Increasing this arbitrarily chosen value means more
8277 aggressive optimization, increasing the compile time.  This parameter
8278 should be removed when the delay slot code is rewritten to maintain the
8279 control-flow graph.
8280
8281 @item max-gcse-memory
8282 The approximate maximum amount of memory that will be allocated in
8283 order to perform the global common subexpression elimination
8284 optimization.  If more memory than specified is required, the
8285 optimization will not be done.
8286
8287 @item max-gcse-insertion-ratio
8288 If the ratio of expression insertions to deletions is larger than this value
8289 for any expression, then RTL PRE will insert or remove the expression and thus
8290 leave partially redundant computations in the instruction stream.  The default value is 20.
8291
8292 @item max-pending-list-length
8293 The maximum number of pending dependencies scheduling will allow
8294 before flushing the current state and starting over.  Large functions
8295 with few branches or calls can create excessively large lists which
8296 needlessly consume memory and resources.
8297
8298 @item max-inline-insns-single
8299 Several parameters control the tree inliner used in gcc.
8300 This number sets the maximum number of instructions (counted in GCC's
8301 internal representation) in a single function that the tree inliner
8302 will consider for inlining.  This only affects functions declared
8303 inline and methods implemented in a class declaration (C++).
8304 The default value is 400.
8305
8306 @item max-inline-insns-auto
8307 When you use @option{-finline-functions} (included in @option{-O3}),
8308 a lot of functions that would otherwise not be considered for inlining
8309 by the compiler will be investigated.  To those functions, a different
8310 (more restrictive) limit compared to functions declared inline can
8311 be applied.
8312 The default value is 40.
8313
8314 @item large-function-insns
8315 The limit specifying really large functions.  For functions larger than this
8316 limit after inlining, inlining is constrained by
8317 @option{--param large-function-growth}.  This parameter is useful primarily
8318 to avoid extreme compilation time caused by non-linear algorithms used by the
8319 backend.
8320 The default value is 2700.
8321
8322 @item large-function-growth
8323 Specifies maximal growth of large function caused by inlining in percents.
8324 The default value is 100 which limits large function growth to 2.0 times
8325 the original size.
8326
8327 @item large-unit-insns
8328 The limit specifying large translation unit.  Growth caused by inlining of
8329 units larger than this limit is limited by @option{--param inline-unit-growth}.
8330 For small units this might be too tight (consider unit consisting of function A
8331 that is inline and B that just calls A three time.  If B is small relative to
8332 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8333 large units consisting of small inlineable functions however the overall unit
8334 growth limit is needed to avoid exponential explosion of code size.  Thus for
8335 smaller units, the size is increased to @option{--param large-unit-insns}
8336 before applying @option{--param inline-unit-growth}.  The default is 10000
8337
8338 @item inline-unit-growth
8339 Specifies maximal overall growth of the compilation unit caused by inlining.
8340 The default value is 30 which limits unit growth to 1.3 times the original
8341 size.
8342
8343 @item ipcp-unit-growth
8344 Specifies maximal overall growth of the compilation unit caused by
8345 interprocedural constant propagation.  The default value is 10 which limits
8346 unit growth to 1.1 times the original size.
8347
8348 @item large-stack-frame
8349 The limit specifying large stack frames.  While inlining the algorithm is trying
8350 to not grow past this limit too much.  Default value is 256 bytes.
8351
8352 @item large-stack-frame-growth
8353 Specifies maximal growth of large stack frames caused by inlining in percents.
8354 The default value is 1000 which limits large stack frame growth to 11 times
8355 the original size.
8356
8357 @item max-inline-insns-recursive
8358 @itemx max-inline-insns-recursive-auto
8359 Specifies maximum number of instructions out-of-line copy of self recursive inline
8360 function can grow into by performing recursive inlining.
8361
8362 For functions declared inline @option{--param max-inline-insns-recursive} is
8363 taken into account.  For function not declared inline, recursive inlining
8364 happens only when @option{-finline-functions} (included in @option{-O3}) is
8365 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8366 default value is 450.
8367
8368 @item max-inline-recursive-depth
8369 @itemx max-inline-recursive-depth-auto
8370 Specifies maximum recursion depth used by the recursive inlining.
8371
8372 For functions declared inline @option{--param max-inline-recursive-depth} is
8373 taken into account.  For function not declared inline, recursive inlining
8374 happens only when @option{-finline-functions} (included in @option{-O3}) is
8375 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8376 default value is 8.
8377
8378 @item min-inline-recursive-probability
8379 Recursive inlining is profitable only for function having deep recursion
8380 in average and can hurt for function having little recursion depth by
8381 increasing the prologue size or complexity of function body to other
8382 optimizers.
8383
8384 When profile feedback is available (see @option{-fprofile-generate}) the actual
8385 recursion depth can be guessed from probability that function will recurse via
8386 given call expression.  This parameter limits inlining only to call expression
8387 whose probability exceeds given threshold (in percents).  The default value is
8388 10.
8389
8390 @item early-inlining-insns
8391 Specify growth that early inliner can make.  In effect it increases amount of
8392 inlining for code having large abstraction penalty.  The default value is 10.
8393
8394 @item max-early-inliner-iterations
8395 @itemx max-early-inliner-iterations
8396 Limit of iterations of early inliner.  This basically bounds number of nested
8397 indirect calls early inliner can resolve.  Deeper chains are still handled by
8398 late inlining.
8399
8400 @item comdat-sharing-probability
8401 @itemx comdat-sharing-probability
8402 Probability (in percent) that C++ inline function with comdat visibility
8403 will be shared across multiple compilation units.  The default value is 20.
8404
8405 @item min-vect-loop-bound
8406 The minimum number of iterations under which a loop will not get vectorized
8407 when @option{-ftree-vectorize} is used.  The number of iterations after
8408 vectorization needs to be greater than the value specified by this option
8409 to allow vectorization.  The default value is 0.
8410
8411 @item gcse-cost-distance-ratio
8412 Scaling factor in calculation of maximum distance an expression
8413 can be moved by GCSE optimizations.  This is currently supported only in the
8414 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
8415 will be with simple expressions, i.e., the expressions which have cost
8416 less than @option{gcse-unrestricted-cost}.  Specifying 0 will disable
8417 hoisting of simple expressions.  The default value is 10.
8418
8419 @item gcse-unrestricted-cost
8420 Cost, roughly measured as the cost of a single typical machine
8421 instruction, at which GCSE optimizations will not constrain
8422 the distance an expression can travel.  This is currently
8423 supported only in the code hoisting pass.  The lesser the cost,
8424 the more aggressive code hoisting will be.  Specifying 0 will
8425 allow all expressions to travel unrestricted distances.
8426 The default value is 3.
8427
8428 @item max-hoist-depth
8429 The depth of search in the dominator tree for expressions to hoist.
8430 This is used to avoid quadratic behavior in hoisting algorithm.
8431 The value of 0 will avoid limiting the search, but may slow down compilation
8432 of huge functions.  The default value is 30.
8433
8434 @item max-unrolled-insns
8435 The maximum number of instructions that a loop should have if that loop
8436 is unrolled, and if the loop is unrolled, it determines how many times
8437 the loop code is unrolled.
8438
8439 @item max-average-unrolled-insns
8440 The maximum number of instructions biased by probabilities of their execution
8441 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8442 it determines how many times the loop code is unrolled.
8443
8444 @item max-unroll-times
8445 The maximum number of unrollings of a single loop.
8446
8447 @item max-peeled-insns
8448 The maximum number of instructions that a loop should have if that loop
8449 is peeled, and if the loop is peeled, it determines how many times
8450 the loop code is peeled.
8451
8452 @item max-peel-times
8453 The maximum number of peelings of a single loop.
8454
8455 @item max-completely-peeled-insns
8456 The maximum number of insns of a completely peeled loop.
8457
8458 @item max-completely-peel-times
8459 The maximum number of iterations of a loop to be suitable for complete peeling.
8460
8461 @item max-completely-peel-loop-nest-depth
8462 The maximum depth of a loop nest suitable for complete peeling.
8463
8464 @item max-unswitch-insns
8465 The maximum number of insns of an unswitched loop.
8466
8467 @item max-unswitch-level
8468 The maximum number of branches unswitched in a single loop.
8469
8470 @item lim-expensive
8471 The minimum cost of an expensive expression in the loop invariant motion.
8472
8473 @item iv-consider-all-candidates-bound
8474 Bound on number of candidates for induction variables below that
8475 all candidates are considered for each use in induction variable
8476 optimizations.  Only the most relevant candidates are considered
8477 if there are more candidates, to avoid quadratic time complexity.
8478
8479 @item iv-max-considered-uses
8480 The induction variable optimizations give up on loops that contain more
8481 induction variable uses.
8482
8483 @item iv-always-prune-cand-set-bound
8484 If number of candidates in the set is smaller than this value,
8485 we always try to remove unnecessary ivs from the set during its
8486 optimization when a new iv is added to the set.
8487
8488 @item scev-max-expr-size
8489 Bound on size of expressions used in the scalar evolutions analyzer.
8490 Large expressions slow the analyzer.
8491
8492 @item scev-max-expr-complexity
8493 Bound on the complexity of the expressions in the scalar evolutions analyzer.
8494 Complex expressions slow the analyzer.
8495
8496 @item omega-max-vars
8497 The maximum number of variables in an Omega constraint system.
8498 The default value is 128.
8499
8500 @item omega-max-geqs
8501 The maximum number of inequalities in an Omega constraint system.
8502 The default value is 256.
8503
8504 @item omega-max-eqs
8505 The maximum number of equalities in an Omega constraint system.
8506 The default value is 128.
8507
8508 @item omega-max-wild-cards
8509 The maximum number of wildcard variables that the Omega solver will
8510 be able to insert.  The default value is 18.
8511
8512 @item omega-hash-table-size
8513 The size of the hash table in the Omega solver.  The default value is
8514 550.
8515
8516 @item omega-max-keys
8517 The maximal number of keys used by the Omega solver.  The default
8518 value is 500.
8519
8520 @item omega-eliminate-redundant-constraints
8521 When set to 1, use expensive methods to eliminate all redundant
8522 constraints.  The default value is 0.
8523
8524 @item vect-max-version-for-alignment-checks
8525 The maximum number of runtime checks that can be performed when
8526 doing loop versioning for alignment in the vectorizer.  See option
8527 ftree-vect-loop-version for more information.
8528
8529 @item vect-max-version-for-alias-checks
8530 The maximum number of runtime checks that can be performed when
8531 doing loop versioning for alias in the vectorizer.  See option
8532 ftree-vect-loop-version for more information.
8533
8534 @item max-iterations-to-track
8535
8536 The maximum number of iterations of a loop the brute force algorithm
8537 for analysis of # of iterations of the loop tries to evaluate.
8538
8539 @item hot-bb-count-fraction
8540 Select fraction of the maximal count of repetitions of basic block in program
8541 given basic block needs to have to be considered hot.
8542
8543 @item hot-bb-frequency-fraction
8544 Select fraction of the entry block frequency of executions of basic block in
8545 function given basic block needs to have to be considered hot
8546
8547 @item max-predicted-iterations
8548 The maximum number of loop iterations we predict statically.  This is useful
8549 in cases where function contain single loop with known bound and other loop
8550 with unknown.  We predict the known number of iterations correctly, while
8551 the unknown number of iterations average to roughly 10.  This means that the
8552 loop without bounds would appear artificially cold relative to the other one.
8553
8554 @item align-threshold
8555
8556 Select fraction of the maximal frequency of executions of basic block in
8557 function given basic block will get aligned.
8558
8559 @item align-loop-iterations
8560
8561 A loop expected to iterate at lest the selected number of iterations will get
8562 aligned.
8563
8564 @item tracer-dynamic-coverage
8565 @itemx tracer-dynamic-coverage-feedback
8566
8567 This value is used to limit superblock formation once the given percentage of
8568 executed instructions is covered.  This limits unnecessary code size
8569 expansion.
8570
8571 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8572 feedback is available.  The real profiles (as opposed to statically estimated
8573 ones) are much less balanced allowing the threshold to be larger value.
8574
8575 @item tracer-max-code-growth
8576 Stop tail duplication once code growth has reached given percentage.  This is
8577 rather hokey argument, as most of the duplicates will be eliminated later in
8578 cross jumping, so it may be set to much higher values than is the desired code
8579 growth.
8580
8581 @item tracer-min-branch-ratio
8582
8583 Stop reverse growth when the reverse probability of best edge is less than this
8584 threshold (in percent).
8585
8586 @item tracer-min-branch-ratio
8587 @itemx tracer-min-branch-ratio-feedback
8588
8589 Stop forward growth if the best edge do have probability lower than this
8590 threshold.
8591
8592 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8593 compilation for profile feedback and one for compilation without.  The value
8594 for compilation with profile feedback needs to be more conservative (higher) in
8595 order to make tracer effective.
8596
8597 @item max-cse-path-length
8598
8599 Maximum number of basic blocks on path that cse considers.  The default is 10.
8600
8601 @item max-cse-insns
8602 The maximum instructions CSE process before flushing. The default is 1000.
8603
8604 @item ggc-min-expand
8605
8606 GCC uses a garbage collector to manage its own memory allocation.  This
8607 parameter specifies the minimum percentage by which the garbage
8608 collector's heap should be allowed to expand between collections.
8609 Tuning this may improve compilation speed; it has no effect on code
8610 generation.
8611
8612 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8613 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
8614 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8615 GCC is not able to calculate RAM on a particular platform, the lower
8616 bound of 30% is used.  Setting this parameter and
8617 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8618 every opportunity.  This is extremely slow, but can be useful for
8619 debugging.
8620
8621 @item ggc-min-heapsize
8622
8623 Minimum size of the garbage collector's heap before it begins bothering
8624 to collect garbage.  The first collection occurs after the heap expands
8625 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8626 tuning this may improve compilation speed, and has no effect on code
8627 generation.
8628
8629 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
8630 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8631 with a lower bound of 4096 (four megabytes) and an upper bound of
8632 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8633 particular platform, the lower bound is used.  Setting this parameter
8634 very large effectively disables garbage collection.  Setting this
8635 parameter and @option{ggc-min-expand} to zero causes a full collection
8636 to occur at every opportunity.
8637
8638 @item max-reload-search-insns
8639 The maximum number of instruction reload should look backward for equivalent
8640 register.  Increasing values mean more aggressive optimization, making the
8641 compile time increase with probably slightly better performance.  The default
8642 value is 100.
8643
8644 @item max-cselib-memory-locations
8645 The maximum number of memory locations cselib should take into account.
8646 Increasing values mean more aggressive optimization, making the compile time
8647 increase with probably slightly better performance.  The default value is 500.
8648
8649 @item reorder-blocks-duplicate
8650 @itemx reorder-blocks-duplicate-feedback
8651
8652 Used by basic block reordering pass to decide whether to use unconditional
8653 branch or duplicate the code on its destination.  Code is duplicated when its
8654 estimated size is smaller than this value multiplied by the estimated size of
8655 unconditional jump in the hot spots of the program.
8656
8657 The @option{reorder-block-duplicate-feedback} is used only when profile
8658 feedback is available and may be set to higher values than
8659 @option{reorder-block-duplicate} since information about the hot spots is more
8660 accurate.
8661
8662 @item max-sched-ready-insns
8663 The maximum number of instructions ready to be issued the scheduler should
8664 consider at any given time during the first scheduling pass.  Increasing
8665 values mean more thorough searches, making the compilation time increase
8666 with probably little benefit.  The default value is 100.
8667
8668 @item max-sched-region-blocks
8669 The maximum number of blocks in a region to be considered for
8670 interblock scheduling.  The default value is 10.
8671
8672 @item max-pipeline-region-blocks
8673 The maximum number of blocks in a region to be considered for
8674 pipelining in the selective scheduler.  The default value is 15.
8675
8676 @item max-sched-region-insns
8677 The maximum number of insns in a region to be considered for
8678 interblock scheduling.  The default value is 100.
8679
8680 @item max-pipeline-region-insns
8681 The maximum number of insns in a region to be considered for
8682 pipelining in the selective scheduler.  The default value is 200.
8683
8684 @item min-spec-prob
8685 The minimum probability (in percents) of reaching a source block
8686 for interblock speculative scheduling.  The default value is 40.
8687
8688 @item max-sched-extend-regions-iters
8689 The maximum number of iterations through CFG to extend regions.
8690 0 - disable region extension,
8691 N - do at most N iterations.
8692 The default value is 0.
8693
8694 @item max-sched-insn-conflict-delay
8695 The maximum conflict delay for an insn to be considered for speculative motion.
8696 The default value is 3.
8697
8698 @item sched-spec-prob-cutoff
8699 The minimal probability of speculation success (in percents), so that
8700 speculative insn will be scheduled.
8701 The default value is 40.
8702
8703 @item sched-mem-true-dep-cost
8704 Minimal distance (in CPU cycles) between store and load targeting same
8705 memory locations.  The default value is 1.
8706
8707 @item selsched-max-lookahead
8708 The maximum size of the lookahead window of selective scheduling.  It is a
8709 depth of search for available instructions.
8710 The default value is 50.
8711
8712 @item selsched-max-sched-times
8713 The maximum number of times that an instruction will be scheduled during
8714 selective scheduling.  This is the limit on the number of iterations
8715 through which the instruction may be pipelined.  The default value is 2.
8716
8717 @item selsched-max-insns-to-rename
8718 The maximum number of best instructions in the ready list that are considered
8719 for renaming in the selective scheduler.  The default value is 2.
8720
8721 @item max-last-value-rtl
8722 The maximum size measured as number of RTLs that can be recorded in an expression
8723 in combiner for a pseudo register as last known value of that register.  The default
8724 is 10000.
8725
8726 @item integer-share-limit
8727 Small integer constants can use a shared data structure, reducing the
8728 compiler's memory usage and increasing its speed.  This sets the maximum
8729 value of a shared integer constant.  The default value is 256.
8730
8731 @item min-virtual-mappings
8732 Specifies the minimum number of virtual mappings in the incremental
8733 SSA updater that should be registered to trigger the virtual mappings
8734 heuristic defined by virtual-mappings-ratio.  The default value is
8735 100.
8736
8737 @item virtual-mappings-ratio
8738 If the number of virtual mappings is virtual-mappings-ratio bigger
8739 than the number of virtual symbols to be updated, then the incremental
8740 SSA updater switches to a full update for those symbols.  The default
8741 ratio is 3.
8742
8743 @item ssp-buffer-size
8744 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
8745 protection when @option{-fstack-protection} is used.
8746
8747 @item max-jump-thread-duplication-stmts
8748 Maximum number of statements allowed in a block that needs to be
8749 duplicated when threading jumps.
8750
8751 @item max-fields-for-field-sensitive
8752 Maximum number of fields in a structure we will treat in
8753 a field sensitive manner during pointer analysis.  The default is zero
8754 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
8755
8756 @item prefetch-latency
8757 Estimate on average number of instructions that are executed before
8758 prefetch finishes.  The distance we prefetch ahead is proportional
8759 to this constant.  Increasing this number may also lead to less
8760 streams being prefetched (see @option{simultaneous-prefetches}).
8761
8762 @item simultaneous-prefetches
8763 Maximum number of prefetches that can run at the same time.
8764
8765 @item l1-cache-line-size
8766 The size of cache line in L1 cache, in bytes.
8767
8768 @item l1-cache-size
8769 The size of L1 cache, in kilobytes.
8770
8771 @item l2-cache-size
8772 The size of L2 cache, in kilobytes.
8773
8774 @item min-insn-to-prefetch-ratio
8775 The minimum ratio between the number of instructions and the
8776 number of prefetches to enable prefetching in a loop.
8777
8778 @item prefetch-min-insn-to-mem-ratio
8779 The minimum ratio between the number of instructions and the
8780 number of memory references to enable prefetching in a loop.
8781
8782 @item use-canonical-types
8783 Whether the compiler should use the ``canonical'' type system.  By
8784 default, this should always be 1, which uses a more efficient internal
8785 mechanism for comparing types in C++ and Objective-C++.  However, if
8786 bugs in the canonical type system are causing compilation failures,
8787 set this value to 0 to disable canonical types.
8788
8789 @item switch-conversion-max-branch-ratio
8790 Switch initialization conversion will refuse to create arrays that are
8791 bigger than @option{switch-conversion-max-branch-ratio} times the number of
8792 branches in the switch.
8793
8794 @item max-partial-antic-length
8795 Maximum length of the partial antic set computed during the tree
8796 partial redundancy elimination optimization (@option{-ftree-pre}) when
8797 optimizing at @option{-O3} and above.  For some sorts of source code
8798 the enhanced partial redundancy elimination optimization can run away,
8799 consuming all of the memory available on the host machine.  This
8800 parameter sets a limit on the length of the sets that are computed,
8801 which prevents the runaway behavior.  Setting a value of 0 for
8802 this parameter will allow an unlimited set length.
8803
8804 @item sccvn-max-scc-size
8805 Maximum size of a strongly connected component (SCC) during SCCVN
8806 processing.  If this limit is hit, SCCVN processing for the whole
8807 function will not be done and optimizations depending on it will
8808 be disabled.  The default maximum SCC size is 10000.
8809
8810 @item ira-max-loops-num
8811 IRA uses a regional register allocation by default.  If a function
8812 contains loops more than number given by the parameter, only at most
8813 given number of the most frequently executed loops will form regions
8814 for the regional register allocation.  The default value of the
8815 parameter is 100.
8816
8817 @item ira-max-conflict-table-size
8818 Although IRA uses a sophisticated algorithm of compression conflict
8819 table, the table can be still big for huge functions.  If the conflict
8820 table for a function could be more than size in MB given by the
8821 parameter, the conflict table is not built and faster, simpler, and
8822 lower quality register allocation algorithm will be used.  The
8823 algorithm do not use pseudo-register conflicts.  The default value of
8824 the parameter is 2000.
8825
8826 @item ira-loop-reserved-regs
8827 IRA can be used to evaluate more accurate register pressure in loops
8828 for decision to move loop invariants (see @option{-O3}).  The number
8829 of available registers reserved for some other purposes is described
8830 by this parameter.  The default value of the parameter is 2 which is
8831 minimal number of registers needed for execution of typical
8832 instruction.  This value is the best found from numerous experiments.
8833
8834 @item loop-invariant-max-bbs-in-loop
8835 Loop invariant motion can be very expensive, both in compile time and
8836 in amount of needed compile time memory, with very large loops.  Loops
8837 with more basic blocks than this parameter won't have loop invariant
8838 motion optimization performed on them.  The default value of the
8839 parameter is 1000 for -O1 and 10000 for -O2 and above.
8840
8841 @item max-vartrack-size
8842 Sets a maximum number of hash table slots to use during variable
8843 tracking dataflow analysis of any function.  If this limit is exceeded
8844 with variable tracking at assignments enabled, analysis for that
8845 function is retried without it, after removing all debug insns from
8846 the function.  If the limit is exceeded even without debug insns, var
8847 tracking analysis is completely disabled for the function.  Setting
8848 the parameter to zero makes it unlimited.
8849
8850 @item min-nondebug-insn-uid
8851 Use uids starting at this parameter for nondebug insns.  The range below
8852 the parameter is reserved exclusively for debug insns created by
8853 @option{-fvar-tracking-assignments}, but debug insns may get
8854 (non-overlapping) uids above it if the reserved range is exhausted.
8855
8856 @item ipa-sra-ptr-growth-factor
8857 IPA-SRA will replace a pointer to an aggregate with one or more new
8858 parameters only when their cumulative size is less or equal to
8859 @option{ipa-sra-ptr-growth-factor} times the size of the original
8860 pointer parameter.
8861
8862 @item graphite-max-nb-scop-params
8863 To avoid exponential effects in the Graphite loop transforms, the
8864 number of parameters in a Static Control Part (SCoP) is bounded.  The
8865 default value is 10 parameters.  A variable whose value is unknown at
8866 compile time and defined outside a SCoP is a parameter of the SCoP.
8867
8868 @item graphite-max-bbs-per-function
8869 To avoid exponential effects in the detection of SCoPs, the size of
8870 the functions analyzed by Graphite is bounded.  The default value is
8871 100 basic blocks.
8872
8873 @item loop-block-tile-size
8874 Loop blocking or strip mining transforms, enabled with
8875 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
8876 loop in the loop nest by a given number of iterations.  The strip
8877 length can be changed using the @option{loop-block-tile-size}
8878 parameter.  The default value is 51 iterations.
8879
8880 @item devirt-type-list-size
8881 IPA-CP attempts to track all possible types passed to a function's
8882 parameter in order to perform devirtualization.
8883 @option{devirt-type-list-size} is the maximum number of types it
8884 stores per a single formal parameter of a function.
8885
8886 @item lto-partitions
8887 Specify desired number of partitions produced during WHOPR compilation.
8888 The number of partitions should exceed the number of CPUs used for compilation.
8889 The default value is 32.
8890
8891 @item lto-minpartition
8892 Size of minimal partition for WHOPR (in estimated instructions).
8893 This prevents expenses of splitting very small programs into too many
8894 partitions.
8895
8896 @item cxx-max-namespaces-for-diagnostic-help
8897 The maximum number of namespaces to consult for suggestions when C++
8898 name lookup fails for an identifier.  The default is 1000.
8899
8900 @end table
8901 @end table
8902
8903 @node Preprocessor Options
8904 @section Options Controlling the Preprocessor
8905 @cindex preprocessor options
8906 @cindex options, preprocessor
8907
8908 These options control the C preprocessor, which is run on each C source
8909 file before actual compilation.
8910
8911 If you use the @option{-E} option, nothing is done except preprocessing.
8912 Some of these options make sense only together with @option{-E} because
8913 they cause the preprocessor output to be unsuitable for actual
8914 compilation.
8915
8916 @table @gcctabopt
8917 @item -Wp,@var{option}
8918 @opindex Wp
8919 You can use @option{-Wp,@var{option}} to bypass the compiler driver
8920 and pass @var{option} directly through to the preprocessor.  If
8921 @var{option} contains commas, it is split into multiple options at the
8922 commas.  However, many options are modified, translated or interpreted
8923 by the compiler driver before being passed to the preprocessor, and
8924 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
8925 interface is undocumented and subject to change, so whenever possible
8926 you should avoid using @option{-Wp} and let the driver handle the
8927 options instead.
8928
8929 @item -Xpreprocessor @var{option}
8930 @opindex Xpreprocessor
8931 Pass @var{option} as an option to the preprocessor.  You can use this to
8932 supply system-specific preprocessor options which GCC does not know how to
8933 recognize.
8934
8935 If you want to pass an option that takes an argument, you must use
8936 @option{-Xpreprocessor} twice, once for the option and once for the argument.
8937 @end table
8938
8939 @include cppopts.texi
8940
8941 @node Assembler Options
8942 @section Passing Options to the Assembler
8943
8944 @c prevent bad page break with this line
8945 You can pass options to the assembler.
8946
8947 @table @gcctabopt
8948 @item -Wa,@var{option}
8949 @opindex Wa
8950 Pass @var{option} as an option to the assembler.  If @var{option}
8951 contains commas, it is split into multiple options at the commas.
8952
8953 @item -Xassembler @var{option}
8954 @opindex Xassembler
8955 Pass @var{option} as an option to the assembler.  You can use this to
8956 supply system-specific assembler options which GCC does not know how to
8957 recognize.
8958
8959 If you want to pass an option that takes an argument, you must use
8960 @option{-Xassembler} twice, once for the option and once for the argument.
8961
8962 @end table
8963
8964 @node Link Options
8965 @section Options for Linking
8966 @cindex link options
8967 @cindex options, linking
8968
8969 These options come into play when the compiler links object files into
8970 an executable output file.  They are meaningless if the compiler is
8971 not doing a link step.
8972
8973 @table @gcctabopt
8974 @cindex file names
8975 @item @var{object-file-name}
8976 A file name that does not end in a special recognized suffix is
8977 considered to name an object file or library.  (Object files are
8978 distinguished from libraries by the linker according to the file
8979 contents.)  If linking is done, these object files are used as input
8980 to the linker.
8981
8982 @item -c
8983 @itemx -S
8984 @itemx -E
8985 @opindex c
8986 @opindex S
8987 @opindex E
8988 If any of these options is used, then the linker is not run, and
8989 object file names should not be used as arguments.  @xref{Overall
8990 Options}.
8991
8992 @cindex Libraries
8993 @item -l@var{library}
8994 @itemx -l @var{library}
8995 @opindex l
8996 Search the library named @var{library} when linking.  (The second
8997 alternative with the library as a separate argument is only for
8998 POSIX compliance and is not recommended.)
8999
9000 It makes a difference where in the command you write this option; the
9001 linker searches and processes libraries and object files in the order they
9002 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9003 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9004 to functions in @samp{z}, those functions may not be loaded.
9005
9006 The linker searches a standard list of directories for the library,
9007 which is actually a file named @file{lib@var{library}.a}.  The linker
9008 then uses this file as if it had been specified precisely by name.
9009
9010 The directories searched include several standard system directories
9011 plus any that you specify with @option{-L}.
9012
9013 Normally the files found this way are library files---archive files
9014 whose members are object files.  The linker handles an archive file by
9015 scanning through it for members which define symbols that have so far
9016 been referenced but not defined.  But if the file that is found is an
9017 ordinary object file, it is linked in the usual fashion.  The only
9018 difference between using an @option{-l} option and specifying a file name
9019 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9020 and searches several directories.
9021
9022 @item -lobjc
9023 @opindex lobjc
9024 You need this special case of the @option{-l} option in order to
9025 link an Objective-C or Objective-C++ program.
9026
9027 @item -nostartfiles
9028 @opindex nostartfiles
9029 Do not use the standard system startup files when linking.
9030 The standard system libraries are used normally, unless @option{-nostdlib}
9031 or @option{-nodefaultlibs} is used.
9032
9033 @item -nodefaultlibs
9034 @opindex nodefaultlibs
9035 Do not use the standard system libraries when linking.
9036 Only the libraries you specify will be passed to the linker, options
9037 specifying linkage of the system libraries, such as @code{-static-libgcc}
9038 or @code{-shared-libgcc}, will be ignored.
9039 The standard startup files are used normally, unless @option{-nostartfiles}
9040 is used.  The compiler may generate calls to @code{memcmp},
9041 @code{memset}, @code{memcpy} and @code{memmove}.
9042 These entries are usually resolved by entries in
9043 libc.  These entry points should be supplied through some other
9044 mechanism when this option is specified.
9045
9046 @item -nostdlib
9047 @opindex nostdlib
9048 Do not use the standard system startup files or libraries when linking.
9049 No startup files and only the libraries you specify will be passed to
9050 the linker, options specifying linkage of the system libraries, such as
9051 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
9052 The compiler may generate calls to @code{memcmp}, @code{memset},
9053 @code{memcpy} and @code{memmove}.
9054 These entries are usually resolved by entries in
9055 libc.  These entry points should be supplied through some other
9056 mechanism when this option is specified.
9057
9058 @cindex @option{-lgcc}, use with @option{-nostdlib}
9059 @cindex @option{-nostdlib} and unresolved references
9060 @cindex unresolved references and @option{-nostdlib}
9061 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9062 @cindex @option{-nodefaultlibs} and unresolved references
9063 @cindex unresolved references and @option{-nodefaultlibs}
9064 One of the standard libraries bypassed by @option{-nostdlib} and
9065 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9066 that GCC uses to overcome shortcomings of particular machines, or special
9067 needs for some languages.
9068 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9069 Collection (GCC) Internals},
9070 for more discussion of @file{libgcc.a}.)
9071 In most cases, you need @file{libgcc.a} even when you want to avoid
9072 other standard libraries.  In other words, when you specify @option{-nostdlib}
9073 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9074 This ensures that you have no unresolved references to internal GCC
9075 library subroutines.  (For example, @samp{__main}, used to ensure C++
9076 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
9077 GNU Compiler Collection (GCC) Internals}.)
9078
9079 @item -pie
9080 @opindex pie
9081 Produce a position independent executable on targets which support it.
9082 For predictable results, you must also specify the same set of options
9083 that were used to generate code (@option{-fpie}, @option{-fPIE},
9084 or model suboptions) when you specify this option.
9085
9086 @item -rdynamic
9087 @opindex rdynamic
9088 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9089 that support it. This instructs the linker to add all symbols, not
9090 only used ones, to the dynamic symbol table. This option is needed
9091 for some uses of @code{dlopen} or to allow obtaining backtraces
9092 from within a program.
9093
9094 @item -s
9095 @opindex s
9096 Remove all symbol table and relocation information from the executable.
9097
9098 @item -static
9099 @opindex static
9100 On systems that support dynamic linking, this prevents linking with the shared
9101 libraries.  On other systems, this option has no effect.
9102
9103 @item -shared
9104 @opindex shared
9105 Produce a shared object which can then be linked with other objects to
9106 form an executable.  Not all systems support this option.  For predictable
9107 results, you must also specify the same set of options that were used to
9108 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
9109 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
9110 needs to build supplementary stub code for constructors to work.  On
9111 multi-libbed systems, @samp{gcc -shared} must select the correct support
9112 libraries to link against.  Failing to supply the correct flags may lead
9113 to subtle defects.  Supplying them in cases where they are not necessary
9114 is innocuous.}
9115
9116 @item -shared-libgcc
9117 @itemx -static-libgcc
9118 @opindex shared-libgcc
9119 @opindex static-libgcc
9120 On systems that provide @file{libgcc} as a shared library, these options
9121 force the use of either the shared or static version respectively.
9122 If no shared version of @file{libgcc} was built when the compiler was
9123 configured, these options have no effect.
9124
9125 There are several situations in which an application should use the
9126 shared @file{libgcc} instead of the static version.  The most common
9127 of these is when the application wishes to throw and catch exceptions
9128 across different shared libraries.  In that case, each of the libraries
9129 as well as the application itself should use the shared @file{libgcc}.
9130
9131 Therefore, the G++ and GCJ drivers automatically add
9132 @option{-shared-libgcc} whenever you build a shared library or a main
9133 executable, because C++ and Java programs typically use exceptions, so
9134 this is the right thing to do.
9135
9136 If, instead, you use the GCC driver to create shared libraries, you may
9137 find that they will not always be linked with the shared @file{libgcc}.
9138 If GCC finds, at its configuration time, that you have a non-GNU linker
9139 or a GNU linker that does not support option @option{--eh-frame-hdr},
9140 it will link the shared version of @file{libgcc} into shared libraries
9141 by default.  Otherwise, it will take advantage of the linker and optimize
9142 away the linking with the shared version of @file{libgcc}, linking with
9143 the static version of libgcc by default.  This allows exceptions to
9144 propagate through such shared libraries, without incurring relocation
9145 costs at library load time.
9146
9147 However, if a library or main executable is supposed to throw or catch
9148 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9149 for the languages used in the program, or using the option
9150 @option{-shared-libgcc}, such that it is linked with the shared
9151 @file{libgcc}.
9152
9153 @item -static-libstdc++
9154 When the @command{g++} program is used to link a C++ program, it will
9155 normally automatically link against @option{libstdc++}.  If
9156 @file{libstdc++} is available as a shared library, and the
9157 @option{-static} option is not used, then this will link against the
9158 shared version of @file{libstdc++}.  That is normally fine.  However, it
9159 is sometimes useful to freeze the version of @file{libstdc++} used by
9160 the program without going all the way to a fully static link.  The
9161 @option{-static-libstdc++} option directs the @command{g++} driver to
9162 link @file{libstdc++} statically, without necessarily linking other
9163 libraries statically.
9164
9165 @item -symbolic
9166 @opindex symbolic
9167 Bind references to global symbols when building a shared object.  Warn
9168 about any unresolved references (unless overridden by the link editor
9169 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
9170 this option.
9171
9172 @item -T @var{script}
9173 @opindex T
9174 @cindex linker script
9175 Use @var{script} as the linker script.  This option is supported by most
9176 systems using the GNU linker.  On some targets, such as bare-board
9177 targets without an operating system, the @option{-T} option may be required
9178 when linking to avoid references to undefined symbols.
9179
9180 @item -Xlinker @var{option}
9181 @opindex Xlinker
9182 Pass @var{option} as an option to the linker.  You can use this to
9183 supply system-specific linker options which GCC does not know how to
9184 recognize.
9185
9186 If you want to pass an option that takes a separate argument, you must use
9187 @option{-Xlinker} twice, once for the option and once for the argument.
9188 For example, to pass @option{-assert definitions}, you must write
9189 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9190 @option{-Xlinker "-assert definitions"}, because this passes the entire
9191 string as a single argument, which is not what the linker expects.
9192
9193 When using the GNU linker, it is usually more convenient to pass
9194 arguments to linker options using the @option{@var{option}=@var{value}}
9195 syntax than as separate arguments.  For example, you can specify
9196 @samp{-Xlinker -Map=output.map} rather than
9197 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9198 this syntax for command-line options.
9199
9200 @item -Wl,@var{option}
9201 @opindex Wl
9202 Pass @var{option} as an option to the linker.  If @var{option} contains
9203 commas, it is split into multiple options at the commas.  You can use this
9204 syntax to pass an argument to the option.
9205 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
9206 linker.  When using the GNU linker, you can also get the same effect with
9207 @samp{-Wl,-Map=output.map}.
9208
9209 @item -u @var{symbol}
9210 @opindex u
9211 Pretend the symbol @var{symbol} is undefined, to force linking of
9212 library modules to define it.  You can use @option{-u} multiple times with
9213 different symbols to force loading of additional library modules.
9214 @end table
9215
9216 @node Directory Options
9217 @section Options for Directory Search
9218 @cindex directory options
9219 @cindex options, directory search
9220 @cindex search path
9221
9222 These options specify directories to search for header files, for
9223 libraries and for parts of the compiler:
9224
9225 @table @gcctabopt
9226 @item -I@var{dir}
9227 @opindex I
9228 Add the directory @var{dir} to the head of the list of directories to be
9229 searched for header files.  This can be used to override a system header
9230 file, substituting your own version, since these directories are
9231 searched before the system header file directories.  However, you should
9232 not use this option to add directories that contain vendor-supplied
9233 system header files (use @option{-isystem} for that).  If you use more than
9234 one @option{-I} option, the directories are scanned in left-to-right
9235 order; the standard system directories come after.
9236
9237 If a standard system include directory, or a directory specified with
9238 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9239 option will be ignored.  The directory will still be searched but as a
9240 system directory at its normal position in the system include chain.
9241 This is to ensure that GCC's procedure to fix buggy system headers and
9242 the ordering for the include_next directive are not inadvertently changed.
9243 If you really need to change the search order for system directories,
9244 use the @option{-nostdinc} and/or @option{-isystem} options.
9245
9246 @item -iplugindir=@var{dir}
9247 Set the directory to search for plugins which are passed
9248 by @option{-fplugin=@var{name}} instead of
9249 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9250 to be used by the user, but only passed by the driver.
9251
9252 @item -iquote@var{dir}
9253 @opindex iquote
9254 Add the directory @var{dir} to the head of the list of directories to
9255 be searched for header files only for the case of @samp{#include
9256 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9257 otherwise just like @option{-I}.
9258
9259 @item -L@var{dir}
9260 @opindex L
9261 Add directory @var{dir} to the list of directories to be searched
9262 for @option{-l}.
9263
9264 @item -B@var{prefix}
9265 @opindex B
9266 This option specifies where to find the executables, libraries,
9267 include files, and data files of the compiler itself.
9268
9269 The compiler driver program runs one or more of the subprograms
9270 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
9271 @var{prefix} as a prefix for each program it tries to run, both with and
9272 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9273
9274 For each subprogram to be run, the compiler driver first tries the
9275 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9276 was not specified, the driver tries two standard prefixes, which are
9277 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9278 those results in a file name that is found, the unmodified program
9279 name is searched for using the directories specified in your
9280 @env{PATH} environment variable.
9281
9282 The compiler will check to see if the path provided by the @option{-B}
9283 refers to a directory, and if necessary it will add a directory
9284 separator character at the end of the path.
9285
9286 @option{-B} prefixes that effectively specify directory names also apply
9287 to libraries in the linker, because the compiler translates these
9288 options into @option{-L} options for the linker.  They also apply to
9289 includes files in the preprocessor, because the compiler translates these
9290 options into @option{-isystem} options for the preprocessor.  In this case,
9291 the compiler appends @samp{include} to the prefix.
9292
9293 The run-time support file @file{libgcc.a} can also be searched for using
9294 the @option{-B} prefix, if needed.  If it is not found there, the two
9295 standard prefixes above are tried, and that is all.  The file is left
9296 out of the link if it is not found by those means.
9297
9298 Another way to specify a prefix much like the @option{-B} prefix is to use
9299 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9300 Variables}.
9301
9302 As a special kludge, if the path provided by @option{-B} is
9303 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9304 9, then it will be replaced by @file{[dir/]include}.  This is to help
9305 with boot-strapping the compiler.
9306
9307 @item -specs=@var{file}
9308 @opindex specs
9309 Process @var{file} after the compiler reads in the standard @file{specs}
9310 file, in order to override the defaults that the @file{gcc} driver
9311 program uses when determining what switches to pass to @file{cc1},
9312 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
9313 @option{-specs=@var{file}} can be specified on the command line, and they
9314 are processed in order, from left to right.
9315
9316 @item --sysroot=@var{dir}
9317 @opindex sysroot
9318 Use @var{dir} as the logical root directory for headers and libraries.
9319 For example, if the compiler would normally search for headers in
9320 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
9321 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9322
9323 If you use both this option and the @option{-isysroot} option, then
9324 the @option{--sysroot} option will apply to libraries, but the
9325 @option{-isysroot} option will apply to header files.
9326
9327 The GNU linker (beginning with version 2.16) has the necessary support
9328 for this option.  If your linker does not support this option, the
9329 header file aspect of @option{--sysroot} will still work, but the
9330 library aspect will not.
9331
9332 @item -I-
9333 @opindex I-
9334 This option has been deprecated.  Please use @option{-iquote} instead for
9335 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9336 Any directories you specify with @option{-I} options before the @option{-I-}
9337 option are searched only for the case of @samp{#include "@var{file}"};
9338 they are not searched for @samp{#include <@var{file}>}.
9339
9340 If additional directories are specified with @option{-I} options after
9341 the @option{-I-}, these directories are searched for all @samp{#include}
9342 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9343 this way.)
9344
9345 In addition, the @option{-I-} option inhibits the use of the current
9346 directory (where the current input file came from) as the first search
9347 directory for @samp{#include "@var{file}"}.  There is no way to
9348 override this effect of @option{-I-}.  With @option{-I.} you can specify
9349 searching the directory which was current when the compiler was
9350 invoked.  That is not exactly the same as what the preprocessor does
9351 by default, but it is often satisfactory.
9352
9353 @option{-I-} does not inhibit the use of the standard system directories
9354 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9355 independent.
9356 @end table
9357
9358 @c man end
9359
9360 @node Spec Files
9361 @section Specifying subprocesses and the switches to pass to them
9362 @cindex Spec Files
9363
9364 @command{gcc} is a driver program.  It performs its job by invoking a
9365 sequence of other programs to do the work of compiling, assembling and
9366 linking.  GCC interprets its command-line parameters and uses these to
9367 deduce which programs it should invoke, and which command-line options
9368 it ought to place on their command lines.  This behavior is controlled
9369 by @dfn{spec strings}.  In most cases there is one spec string for each
9370 program that GCC can invoke, but a few programs have multiple spec
9371 strings to control their behavior.  The spec strings built into GCC can
9372 be overridden by using the @option{-specs=} command-line switch to specify
9373 a spec file.
9374
9375 @dfn{Spec files} are plaintext files that are used to construct spec
9376 strings.  They consist of a sequence of directives separated by blank
9377 lines.  The type of directive is determined by the first non-whitespace
9378 character on the line and it can be one of the following:
9379
9380 @table @code
9381 @item %@var{command}
9382 Issues a @var{command} to the spec file processor.  The commands that can
9383 appear here are:
9384
9385 @table @code
9386 @item %include <@var{file}>
9387 @cindex @code{%include}
9388 Search for @var{file} and insert its text at the current point in the
9389 specs file.
9390
9391 @item %include_noerr <@var{file}>
9392 @cindex @code{%include_noerr}
9393 Just like @samp{%include}, but do not generate an error message if the include
9394 file cannot be found.
9395
9396 @item %rename @var{old_name} @var{new_name}
9397 @cindex @code{%rename}
9398 Rename the spec string @var{old_name} to @var{new_name}.
9399
9400 @end table
9401
9402 @item *[@var{spec_name}]:
9403 This tells the compiler to create, override or delete the named spec
9404 string.  All lines after this directive up to the next directive or
9405 blank line are considered to be the text for the spec string.  If this
9406 results in an empty string then the spec will be deleted.  (Or, if the
9407 spec did not exist, then nothing will happened.)  Otherwise, if the spec
9408 does not currently exist a new spec will be created.  If the spec does
9409 exist then its contents will be overridden by the text of this
9410 directive, unless the first character of that text is the @samp{+}
9411 character, in which case the text will be appended to the spec.
9412
9413 @item [@var{suffix}]:
9414 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9415 and up to the next directive or blank line are considered to make up the
9416 spec string for the indicated suffix.  When the compiler encounters an
9417 input file with the named suffix, it will processes the spec string in
9418 order to work out how to compile that file.  For example:
9419
9420 @smallexample
9421 .ZZ:
9422 z-compile -input %i
9423 @end smallexample
9424
9425 This says that any input file whose name ends in @samp{.ZZ} should be
9426 passed to the program @samp{z-compile}, which should be invoked with the
9427 command-line switch @option{-input} and with the result of performing the
9428 @samp{%i} substitution.  (See below.)
9429
9430 As an alternative to providing a spec string, the text that follows a
9431 suffix directive can be one of the following:
9432
9433 @table @code
9434 @item @@@var{language}
9435 This says that the suffix is an alias for a known @var{language}.  This is
9436 similar to using the @option{-x} command-line switch to GCC to specify a
9437 language explicitly.  For example:
9438
9439 @smallexample
9440 .ZZ:
9441 @@c++
9442 @end smallexample
9443
9444 Says that .ZZ files are, in fact, C++ source files.
9445
9446 @item #@var{name}
9447 This causes an error messages saying:
9448
9449 @smallexample
9450 @var{name} compiler not installed on this system.
9451 @end smallexample
9452 @end table
9453
9454 GCC already has an extensive list of suffixes built into it.
9455 This directive will add an entry to the end of the list of suffixes, but
9456 since the list is searched from the end backwards, it is effectively
9457 possible to override earlier entries using this technique.
9458
9459 @end table
9460
9461 GCC has the following spec strings built into it.  Spec files can
9462 override these strings or create their own.  Note that individual
9463 targets can also add their own spec strings to this list.
9464
9465 @smallexample
9466 asm          Options to pass to the assembler
9467 asm_final    Options to pass to the assembler post-processor
9468 cpp          Options to pass to the C preprocessor
9469 cc1          Options to pass to the C compiler
9470 cc1plus      Options to pass to the C++ compiler
9471 endfile      Object files to include at the end of the link
9472 link         Options to pass to the linker
9473 lib          Libraries to include on the command line to the linker
9474 libgcc       Decides which GCC support library to pass to the linker
9475 linker       Sets the name of the linker
9476 predefines   Defines to be passed to the C preprocessor
9477 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9478              by default
9479 startfile    Object files to include at the start of the link
9480 @end smallexample
9481
9482 Here is a small example of a spec file:
9483
9484 @smallexample
9485 %rename lib                 old_lib
9486
9487 *lib:
9488 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9489 @end smallexample
9490
9491 This example renames the spec called @samp{lib} to @samp{old_lib} and
9492 then overrides the previous definition of @samp{lib} with a new one.
9493 The new definition adds in some extra command-line options before
9494 including the text of the old definition.
9495
9496 @dfn{Spec strings} are a list of command-line options to be passed to their
9497 corresponding program.  In addition, the spec strings can contain
9498 @samp{%}-prefixed sequences to substitute variable text or to
9499 conditionally insert text into the command line.  Using these constructs
9500 it is possible to generate quite complex command lines.
9501
9502 Here is a table of all defined @samp{%}-sequences for spec
9503 strings.  Note that spaces are not generated automatically around the
9504 results of expanding these sequences.  Therefore you can concatenate them
9505 together or combine them with constant text in a single argument.
9506
9507 @table @code
9508 @item %%
9509 Substitute one @samp{%} into the program name or argument.
9510
9511 @item %i
9512 Substitute the name of the input file being processed.
9513
9514 @item %b
9515 Substitute the basename of the input file being processed.
9516 This is the substring up to (and not including) the last period
9517 and not including the directory.
9518
9519 @item %B
9520 This is the same as @samp{%b}, but include the file suffix (text after
9521 the last period).
9522
9523 @item %d
9524 Marks the argument containing or following the @samp{%d} as a
9525 temporary file name, so that that file will be deleted if GCC exits
9526 successfully.  Unlike @samp{%g}, this contributes no text to the
9527 argument.
9528
9529 @item %g@var{suffix}
9530 Substitute a file name that has suffix @var{suffix} and is chosen
9531 once per compilation, and mark the argument in the same way as
9532 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9533 name is now chosen in a way that is hard to predict even when previously
9534 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9535 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9536 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9537 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9538 was simply substituted with a file name chosen once per compilation,
9539 without regard to any appended suffix (which was therefore treated
9540 just like ordinary text), making such attacks more likely to succeed.
9541
9542 @item %u@var{suffix}
9543 Like @samp{%g}, but generates a new temporary file name even if
9544 @samp{%u@var{suffix}} was already seen.
9545
9546 @item %U@var{suffix}
9547 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9548 new one if there is no such last file name.  In the absence of any
9549 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9550 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9551 would involve the generation of two distinct file names, one
9552 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9553 simply substituted with a file name chosen for the previous @samp{%u},
9554 without regard to any appended suffix.
9555
9556 @item %j@var{suffix}
9557 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9558 writable, and if save-temps is off; otherwise, substitute the name
9559 of a temporary file, just like @samp{%u}.  This temporary file is not
9560 meant for communication between processes, but rather as a junk
9561 disposal mechanism.
9562
9563 @item %|@var{suffix}
9564 @itemx %m@var{suffix}
9565 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9566 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9567 all.  These are the two most common ways to instruct a program that it
9568 should read from standard input or write to standard output.  If you
9569 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9570 construct: see for example @file{f/lang-specs.h}.
9571
9572 @item %.@var{SUFFIX}
9573 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9574 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9575 terminated by the next space or %.
9576
9577 @item %w
9578 Marks the argument containing or following the @samp{%w} as the
9579 designated output file of this compilation.  This puts the argument
9580 into the sequence of arguments that @samp{%o} will substitute later.
9581
9582 @item %o
9583 Substitutes the names of all the output files, with spaces
9584 automatically placed around them.  You should write spaces
9585 around the @samp{%o} as well or the results are undefined.
9586 @samp{%o} is for use in the specs for running the linker.
9587 Input files whose names have no recognized suffix are not compiled
9588 at all, but they are included among the output files, so they will
9589 be linked.
9590
9591 @item %O
9592 Substitutes the suffix for object files.  Note that this is
9593 handled specially when it immediately follows @samp{%g, %u, or %U},
9594 because of the need for those to form complete file names.  The
9595 handling is such that @samp{%O} is treated exactly as if it had already
9596 been substituted, except that @samp{%g, %u, and %U} do not currently
9597 support additional @var{suffix} characters following @samp{%O} as they would
9598 following, for example, @samp{.o}.
9599
9600 @item %p
9601 Substitutes the standard macro predefinitions for the
9602 current target machine.  Use this when running @code{cpp}.
9603
9604 @item %P
9605 Like @samp{%p}, but puts @samp{__} before and after the name of each
9606 predefined macro, except for macros that start with @samp{__} or with
9607 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
9608 C@.
9609
9610 @item %I
9611 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
9612 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
9613 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
9614 and @option{-imultilib} as necessary.
9615
9616 @item %s
9617 Current argument is the name of a library or startup file of some sort.
9618 Search for that file in a standard list of directories and substitute
9619 the full name found.  The current working directory is included in the
9620 list of directories scanned.
9621
9622 @item %T
9623 Current argument is the name of a linker script.  Search for that file
9624 in the current list of directories to scan for libraries. If the file
9625 is located insert a @option{--script} option into the command line
9626 followed by the full path name found.  If the file is not found then
9627 generate an error message.  Note: the current working directory is not
9628 searched.
9629
9630 @item %e@var{str}
9631 Print @var{str} as an error message.  @var{str} is terminated by a newline.
9632 Use this when inconsistent options are detected.
9633
9634 @item %(@var{name})
9635 Substitute the contents of spec string @var{name} at this point.
9636
9637 @item %[@var{name}]
9638 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
9639
9640 @item %x@{@var{option}@}
9641 Accumulate an option for @samp{%X}.
9642
9643 @item %X
9644 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
9645 spec string.
9646
9647 @item %Y
9648 Output the accumulated assembler options specified by @option{-Wa}.
9649
9650 @item %Z
9651 Output the accumulated preprocessor options specified by @option{-Wp}.
9652
9653 @item %a
9654 Process the @code{asm} spec.  This is used to compute the
9655 switches to be passed to the assembler.
9656
9657 @item %A
9658 Process the @code{asm_final} spec.  This is a spec string for
9659 passing switches to an assembler post-processor, if such a program is
9660 needed.
9661
9662 @item %l
9663 Process the @code{link} spec.  This is the spec for computing the
9664 command line passed to the linker.  Typically it will make use of the
9665 @samp{%L %G %S %D and %E} sequences.
9666
9667 @item %D
9668 Dump out a @option{-L} option for each directory that GCC believes might
9669 contain startup files.  If the target supports multilibs then the
9670 current multilib directory will be prepended to each of these paths.
9671
9672 @item %L
9673 Process the @code{lib} spec.  This is a spec string for deciding which
9674 libraries should be included on the command line to the linker.
9675
9676 @item %G
9677 Process the @code{libgcc} spec.  This is a spec string for deciding
9678 which GCC support library should be included on the command line to the linker.
9679
9680 @item %S
9681 Process the @code{startfile} spec.  This is a spec for deciding which
9682 object files should be the first ones passed to the linker.  Typically
9683 this might be a file named @file{crt0.o}.
9684
9685 @item %E
9686 Process the @code{endfile} spec.  This is a spec string that specifies
9687 the last object files that will be passed to the linker.
9688
9689 @item %C
9690 Process the @code{cpp} spec.  This is used to construct the arguments
9691 to be passed to the C preprocessor.
9692
9693 @item %1
9694 Process the @code{cc1} spec.  This is used to construct the options to be
9695 passed to the actual C compiler (@samp{cc1}).
9696
9697 @item %2
9698 Process the @code{cc1plus} spec.  This is used to construct the options to be
9699 passed to the actual C++ compiler (@samp{cc1plus}).
9700
9701 @item %*
9702 Substitute the variable part of a matched option.  See below.
9703 Note that each comma in the substituted string is replaced by
9704 a single space.
9705
9706 @item %<@code{S}
9707 Remove all occurrences of @code{-S} from the command line.  Note---this
9708 command is position dependent.  @samp{%} commands in the spec string
9709 before this one will see @code{-S}, @samp{%} commands in the spec string
9710 after this one will not.
9711
9712 @item %:@var{function}(@var{args})
9713 Call the named function @var{function}, passing it @var{args}.
9714 @var{args} is first processed as a nested spec string, then split
9715 into an argument vector in the usual fashion.  The function returns
9716 a string which is processed as if it had appeared literally as part
9717 of the current spec.
9718
9719 The following built-in spec functions are provided:
9720
9721 @table @code
9722 @item @code{getenv}
9723 The @code{getenv} spec function takes two arguments: an environment
9724 variable name and a string.  If the environment variable is not
9725 defined, a fatal error is issued.  Otherwise, the return value is the
9726 value of the environment variable concatenated with the string.  For
9727 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
9728
9729 @smallexample
9730 %:getenv(TOPDIR /include)
9731 @end smallexample
9732
9733 expands to @file{/path/to/top/include}.
9734
9735 @item @code{if-exists}
9736 The @code{if-exists} spec function takes one argument, an absolute
9737 pathname to a file.  If the file exists, @code{if-exists} returns the
9738 pathname.  Here is a small example of its usage:
9739
9740 @smallexample
9741 *startfile:
9742 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
9743 @end smallexample
9744
9745 @item @code{if-exists-else}
9746 The @code{if-exists-else} spec function is similar to the @code{if-exists}
9747 spec function, except that it takes two arguments.  The first argument is
9748 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
9749 returns the pathname.  If it does not exist, it returns the second argument.
9750 This way, @code{if-exists-else} can be used to select one file or another,
9751 based on the existence of the first.  Here is a small example of its usage:
9752
9753 @smallexample
9754 *startfile:
9755 crt0%O%s %:if-exists(crti%O%s) \
9756 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
9757 @end smallexample
9758
9759 @item @code{replace-outfile}
9760 The @code{replace-outfile} spec function takes two arguments.  It looks for the
9761 first argument in the outfiles array and replaces it with the second argument.  Here
9762 is a small example of its usage:
9763
9764 @smallexample
9765 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
9766 @end smallexample
9767
9768 @item @code{remove-outfile}
9769 The @code{remove-outfile} spec function takes one argument.  It looks for the
9770 first argument in the outfiles array and removes it.  Here is a small example
9771 its usage:
9772
9773 @smallexample
9774 %:remove-outfile(-lm)
9775 @end smallexample
9776
9777 @item @code{pass-through-libs}
9778 The @code{pass-through-libs} spec function takes any number of arguments.  It
9779 finds any @option{-l} options and any non-options ending in ".a" (which it
9780 assumes are the names of linker input library archive files) and returns a
9781 result containing all the found arguments each prepended by
9782 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
9783 intended to be passed to the LTO linker plugin.
9784
9785 @smallexample
9786 %:pass-through-libs(%G %L %G)
9787 @end smallexample
9788
9789 @item @code{print-asm-header}
9790 The @code{print-asm-header} function takes no arguments and simply
9791 prints a banner like:
9792
9793 @smallexample
9794 Assembler options
9795 =================
9796
9797 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
9798 @end smallexample
9799
9800 It is used to separate compiler options from assembler options
9801 in the @option{--target-help} output.
9802 @end table
9803
9804 @item %@{@code{S}@}
9805 Substitutes the @code{-S} switch, if that switch was given to GCC@.
9806 If that switch was not specified, this substitutes nothing.  Note that
9807 the leading dash is omitted when specifying this option, and it is
9808 automatically inserted if the substitution is performed.  Thus the spec
9809 string @samp{%@{foo@}} would match the command-line option @option{-foo}
9810 and would output the command line option @option{-foo}.
9811
9812 @item %W@{@code{S}@}
9813 Like %@{@code{S}@} but mark last argument supplied within as a file to be
9814 deleted on failure.
9815
9816 @item %@{@code{S}*@}
9817 Substitutes all the switches specified to GCC whose names start
9818 with @code{-S}, but which also take an argument.  This is used for
9819 switches like @option{-o}, @option{-D}, @option{-I}, etc.
9820 GCC considers @option{-o foo} as being
9821 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
9822 text, including the space.  Thus two arguments would be generated.
9823
9824 @item %@{@code{S}*&@code{T}*@}
9825 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
9826 (the order of @code{S} and @code{T} in the spec is not significant).
9827 There can be any number of ampersand-separated variables; for each the
9828 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
9829
9830 @item %@{@code{S}:@code{X}@}
9831 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
9832
9833 @item %@{!@code{S}:@code{X}@}
9834 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
9835
9836 @item %@{@code{S}*:@code{X}@}
9837 Substitutes @code{X} if one or more switches whose names start with
9838 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
9839 once, no matter how many such switches appeared.  However, if @code{%*}
9840 appears somewhere in @code{X}, then @code{X} will be substituted once
9841 for each matching switch, with the @code{%*} replaced by the part of
9842 that switch that matched the @code{*}.
9843
9844 @item %@{.@code{S}:@code{X}@}
9845 Substitutes @code{X}, if processing a file with suffix @code{S}.
9846
9847 @item %@{!.@code{S}:@code{X}@}
9848 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
9849
9850 @item %@{,@code{S}:@code{X}@}
9851 Substitutes @code{X}, if processing a file for language @code{S}.
9852
9853 @item %@{!,@code{S}:@code{X}@}
9854 Substitutes @code{X}, if not processing a file for language @code{S}.
9855
9856 @item %@{@code{S}|@code{P}:@code{X}@}
9857 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
9858 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
9859 @code{*} sequences as well, although they have a stronger binding than
9860 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
9861 alternatives must be starred, and only the first matching alternative
9862 is substituted.
9863
9864 For example, a spec string like this:
9865
9866 @smallexample
9867 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
9868 @end smallexample
9869
9870 will output the following command-line options from the following input
9871 command-line options:
9872
9873 @smallexample
9874 fred.c        -foo -baz
9875 jim.d         -bar -boggle
9876 -d fred.c     -foo -baz -boggle
9877 -d jim.d      -bar -baz -boggle
9878 @end smallexample
9879
9880 @item %@{S:X; T:Y; :D@}
9881
9882 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
9883 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
9884 be as many clauses as you need.  This may be combined with @code{.},
9885 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
9886
9887
9888 @end table
9889
9890 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
9891 construct may contain other nested @samp{%} constructs or spaces, or
9892 even newlines.  They are processed as usual, as described above.
9893 Trailing white space in @code{X} is ignored.  White space may also
9894 appear anywhere on the left side of the colon in these constructs,
9895 except between @code{.} or @code{*} and the corresponding word.
9896
9897 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
9898 handled specifically in these constructs.  If another value of
9899 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
9900 @option{-W} switch is found later in the command line, the earlier
9901 switch value is ignored, except with @{@code{S}*@} where @code{S} is
9902 just one letter, which passes all matching options.
9903
9904 The character @samp{|} at the beginning of the predicate text is used to
9905 indicate that a command should be piped to the following command, but
9906 only if @option{-pipe} is specified.
9907
9908 It is built into GCC which switches take arguments and which do not.
9909 (You might think it would be useful to generalize this to allow each
9910 compiler's spec to say which switches take arguments.  But this cannot
9911 be done in a consistent fashion.  GCC cannot even decide which input
9912 files have been specified without knowing which switches take arguments,
9913 and it must know which input files to compile in order to tell which
9914 compilers to run).
9915
9916 GCC also knows implicitly that arguments starting in @option{-l} are to be
9917 treated as compiler output files, and passed to the linker in their
9918 proper position among the other output files.
9919
9920 @c man begin OPTIONS
9921
9922 @node Target Options
9923 @section Specifying Target Machine and Compiler Version
9924 @cindex target options
9925 @cindex cross compiling
9926 @cindex specifying machine version
9927 @cindex specifying compiler version and target machine
9928 @cindex compiler version, specifying
9929 @cindex target machine, specifying
9930
9931 The usual way to run GCC is to run the executable called @command{gcc}, or
9932 @command{@var{machine}-gcc} when cross-compiling, or
9933 @command{@var{machine}-gcc-@var{version}} to run a version other than the
9934 one that was installed last.
9935
9936 @node Submodel Options
9937 @section Hardware Models and Configurations
9938 @cindex submodel options
9939 @cindex specifying hardware config
9940 @cindex hardware models and configurations, specifying
9941 @cindex machine dependent options
9942
9943 Each target machine types can have its own
9944 special options, starting with @samp{-m}, to choose among various
9945 hardware models or configurations---for example, 68010 vs 68020,
9946 floating coprocessor or none.  A single installed version of the
9947 compiler can compile for any model or configuration, according to the
9948 options specified.
9949
9950 Some configurations of the compiler also support additional special
9951 options, usually for compatibility with other compilers on the same
9952 platform.
9953
9954 @c This list is ordered alphanumerically by subsection name.
9955 @c It should be the same order and spelling as these options are listed
9956 @c in Machine Dependent Options
9957
9958 @menu
9959 * ARC Options::
9960 * ARM Options::
9961 * AVR Options::
9962 * Blackfin Options::
9963 * CRIS Options::
9964 * CRX Options::
9965 * Darwin Options::
9966 * DEC Alpha Options::
9967 * DEC Alpha/VMS Options::
9968 * FR30 Options::
9969 * FRV Options::
9970 * GNU/Linux Options::
9971 * H8/300 Options::
9972 * HPPA Options::
9973 * i386 and x86-64 Options::
9974 * i386 and x86-64 Windows Options::
9975 * IA-64 Options::
9976 * IA-64/VMS Options::
9977 * LM32 Options::
9978 * M32C Options::
9979 * M32R/D Options::
9980 * M680x0 Options::
9981 * M68hc1x Options::
9982 * MCore Options::
9983 * MeP Options::
9984 * MicroBlaze Options::
9985 * MIPS Options::
9986 * MMIX Options::
9987 * MN10300 Options::
9988 * PDP-11 Options::
9989 * picoChip Options::
9990 * PowerPC Options::
9991 * RS/6000 and PowerPC Options::
9992 * RX Options::
9993 * S/390 and zSeries Options::
9994 * Score Options::
9995 * SH Options::
9996 * Solaris 2 Options::
9997 * SPARC Options::
9998 * SPU Options::
9999 * System V Options::
10000 * V850 Options::
10001 * VAX Options::
10002 * VxWorks Options::
10003 * x86-64 Options::
10004 * Xstormy16 Options::
10005 * Xtensa Options::
10006 * zSeries Options::
10007 @end menu
10008
10009 @node ARC Options
10010 @subsection ARC Options
10011 @cindex ARC Options
10012
10013 These options are defined for ARC implementations:
10014
10015 @table @gcctabopt
10016 @item -EL
10017 @opindex EL
10018 Compile code for little endian mode.  This is the default.
10019
10020 @item -EB
10021 @opindex EB
10022 Compile code for big endian mode.
10023
10024 @item -mmangle-cpu
10025 @opindex mmangle-cpu
10026 Prepend the name of the CPU to all public symbol names.
10027 In multiple-processor systems, there are many ARC variants with different
10028 instruction and register set characteristics.  This flag prevents code
10029 compiled for one CPU to be linked with code compiled for another.
10030 No facility exists for handling variants that are ``almost identical''.
10031 This is an all or nothing option.
10032
10033 @item -mcpu=@var{cpu}
10034 @opindex mcpu
10035 Compile code for ARC variant @var{cpu}.
10036 Which variants are supported depend on the configuration.
10037 All variants support @option{-mcpu=base}, this is the default.
10038
10039 @item -mtext=@var{text-section}
10040 @itemx -mdata=@var{data-section}
10041 @itemx -mrodata=@var{readonly-data-section}
10042 @opindex mtext
10043 @opindex mdata
10044 @opindex mrodata
10045 Put functions, data, and readonly data in @var{text-section},
10046 @var{data-section}, and @var{readonly-data-section} respectively
10047 by default.  This can be overridden with the @code{section} attribute.
10048 @xref{Variable Attributes}.
10049
10050 @end table
10051
10052 @node ARM Options
10053 @subsection ARM Options
10054 @cindex ARM options
10055
10056 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
10057 architectures:
10058
10059 @table @gcctabopt
10060 @item -mabi=@var{name}
10061 @opindex mabi
10062 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
10063 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
10064
10065 @item -mapcs-frame
10066 @opindex mapcs-frame
10067 Generate a stack frame that is compliant with the ARM Procedure Call
10068 Standard for all functions, even if this is not strictly necessary for
10069 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
10070 with this option will cause the stack frames not to be generated for
10071 leaf functions.  The default is @option{-mno-apcs-frame}.
10072
10073 @item -mapcs
10074 @opindex mapcs
10075 This is a synonym for @option{-mapcs-frame}.
10076
10077 @ignore
10078 @c not currently implemented
10079 @item -mapcs-stack-check
10080 @opindex mapcs-stack-check
10081 Generate code to check the amount of stack space available upon entry to
10082 every function (that actually uses some stack space).  If there is
10083 insufficient space available then either the function
10084 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
10085 called, depending upon the amount of stack space required.  The run time
10086 system is required to provide these functions.  The default is
10087 @option{-mno-apcs-stack-check}, since this produces smaller code.
10088
10089 @c not currently implemented
10090 @item -mapcs-float
10091 @opindex mapcs-float
10092 Pass floating point arguments using the float point registers.  This is
10093 one of the variants of the APCS@.  This option is recommended if the
10094 target hardware has a floating point unit or if a lot of floating point
10095 arithmetic is going to be performed by the code.  The default is
10096 @option{-mno-apcs-float}, since integer only code is slightly increased in
10097 size if @option{-mapcs-float} is used.
10098
10099 @c not currently implemented
10100 @item -mapcs-reentrant
10101 @opindex mapcs-reentrant
10102 Generate reentrant, position independent code.  The default is
10103 @option{-mno-apcs-reentrant}.
10104 @end ignore
10105
10106 @item -mthumb-interwork
10107 @opindex mthumb-interwork
10108 Generate code which supports calling between the ARM and Thumb
10109 instruction sets.  Without this option the two instruction sets cannot
10110 be reliably used inside one program.  The default is
10111 @option{-mno-thumb-interwork}, since slightly larger code is generated
10112 when @option{-mthumb-interwork} is specified.
10113
10114 @item -mno-sched-prolog
10115 @opindex mno-sched-prolog
10116 Prevent the reordering of instructions in the function prolog, or the
10117 merging of those instruction with the instructions in the function's
10118 body.  This means that all functions will start with a recognizable set
10119 of instructions (or in fact one of a choice from a small set of
10120 different function prologues), and this information can be used to
10121 locate the start if functions inside an executable piece of code.  The
10122 default is @option{-msched-prolog}.
10123
10124 @item -mfloat-abi=@var{name}
10125 @opindex mfloat-abi
10126 Specifies which floating-point ABI to use.  Permissible values
10127 are: @samp{soft}, @samp{softfp} and @samp{hard}.
10128
10129 Specifying @samp{soft} causes GCC to generate output containing
10130 library calls for floating-point operations.
10131 @samp{softfp} allows the generation of code using hardware floating-point
10132 instructions, but still uses the soft-float calling conventions.
10133 @samp{hard} allows generation of floating-point instructions
10134 and uses FPU-specific calling conventions.
10135
10136 The default depends on the specific target configuration.  Note that
10137 the hard-float and soft-float ABIs are not link-compatible; you must
10138 compile your entire program with the same ABI, and link with a
10139 compatible set of libraries.
10140
10141 @item -mhard-float
10142 @opindex mhard-float
10143 Equivalent to @option{-mfloat-abi=hard}.
10144
10145 @item -msoft-float
10146 @opindex msoft-float
10147 Equivalent to @option{-mfloat-abi=soft}.
10148
10149 @item -mlittle-endian
10150 @opindex mlittle-endian
10151 Generate code for a processor running in little-endian mode.  This is
10152 the default for all standard configurations.
10153
10154 @item -mbig-endian
10155 @opindex mbig-endian
10156 Generate code for a processor running in big-endian mode; the default is
10157 to compile code for a little-endian processor.
10158
10159 @item -mwords-little-endian
10160 @opindex mwords-little-endian
10161 This option only applies when generating code for big-endian processors.
10162 Generate code for a little-endian word order but a big-endian byte
10163 order.  That is, a byte order of the form @samp{32107654}.  Note: this
10164 option should only be used if you require compatibility with code for
10165 big-endian ARM processors generated by versions of the compiler prior to
10166 2.8.
10167
10168 @item -mcpu=@var{name}
10169 @opindex mcpu
10170 This specifies the name of the target ARM processor.  GCC uses this name
10171 to determine what kind of instructions it can emit when generating
10172 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
10173 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
10174 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
10175 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
10176 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
10177 @samp{arm720},
10178 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
10179 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
10180 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
10181 @samp{strongarm1110},
10182 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
10183 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
10184 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
10185 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
10186 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
10187 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
10188 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
10189 @samp{cortex-a5}, @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a15},
10190 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m4}, @samp{cortex-m3},
10191 @samp{cortex-m1},
10192 @samp{cortex-m0},
10193 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10194
10195 @item -mtune=@var{name}
10196 @opindex mtune
10197 This option is very similar to the @option{-mcpu=} option, except that
10198 instead of specifying the actual target processor type, and hence
10199 restricting which instructions can be used, it specifies that GCC should
10200 tune the performance of the code as if the target were of the type
10201 specified in this option, but still choosing the instructions that it
10202 will generate based on the CPU specified by a @option{-mcpu=} option.
10203 For some ARM implementations better performance can be obtained by using
10204 this option.
10205
10206 @item -march=@var{name}
10207 @opindex march
10208 This specifies the name of the target ARM architecture.  GCC uses this
10209 name to determine what kind of instructions it can emit when generating
10210 assembly code.  This option can be used in conjunction with or instead
10211 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
10212 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
10213 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
10214 @samp{armv6}, @samp{armv6j},
10215 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
10216 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
10217 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10218
10219 @item -mfpu=@var{name}
10220 @itemx -mfpe=@var{number}
10221 @itemx -mfp=@var{number}
10222 @opindex mfpu
10223 @opindex mfpe
10224 @opindex mfp
10225 This specifies what floating point hardware (or hardware emulation) is
10226 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
10227 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
10228 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
10229 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
10230 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
10231 @option{-mfp} and @option{-mfpe} are synonyms for
10232 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
10233 of GCC@.
10234
10235 If @option{-msoft-float} is specified this specifies the format of
10236 floating point values.
10237
10238 If the selected floating-point hardware includes the NEON extension
10239 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
10240 operations will not be used by GCC's auto-vectorization pass unless
10241 @option{-funsafe-math-optimizations} is also specified.  This is
10242 because NEON hardware does not fully implement the IEEE 754 standard for
10243 floating-point arithmetic (in particular denormal values are treated as
10244 zero), so the use of NEON instructions may lead to a loss of precision.
10245
10246 @item -mfp16-format=@var{name}
10247 @opindex mfp16-format
10248 Specify the format of the @code{__fp16} half-precision floating-point type.
10249 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
10250 the default is @samp{none}, in which case the @code{__fp16} type is not
10251 defined.  @xref{Half-Precision}, for more information.
10252
10253 @item -mstructure-size-boundary=@var{n}
10254 @opindex mstructure-size-boundary
10255 The size of all structures and unions will be rounded up to a multiple
10256 of the number of bits set by this option.  Permissible values are 8, 32
10257 and 64.  The default value varies for different toolchains.  For the COFF
10258 targeted toolchain the default value is 8.  A value of 64 is only allowed
10259 if the underlying ABI supports it.
10260
10261 Specifying the larger number can produce faster, more efficient code, but
10262 can also increase the size of the program.  Different values are potentially
10263 incompatible.  Code compiled with one value cannot necessarily expect to
10264 work with code or libraries compiled with another value, if they exchange
10265 information using structures or unions.
10266
10267 @item -mabort-on-noreturn
10268 @opindex mabort-on-noreturn
10269 Generate a call to the function @code{abort} at the end of a
10270 @code{noreturn} function.  It will be executed if the function tries to
10271 return.
10272
10273 @item -mlong-calls
10274 @itemx -mno-long-calls
10275 @opindex mlong-calls
10276 @opindex mno-long-calls
10277 Tells the compiler to perform function calls by first loading the
10278 address of the function into a register and then performing a subroutine
10279 call on this register.  This switch is needed if the target function
10280 will lie outside of the 64 megabyte addressing range of the offset based
10281 version of subroutine call instruction.
10282
10283 Even if this switch is enabled, not all function calls will be turned
10284 into long calls.  The heuristic is that static functions, functions
10285 which have the @samp{short-call} attribute, functions that are inside
10286 the scope of a @samp{#pragma no_long_calls} directive and functions whose
10287 definitions have already been compiled within the current compilation
10288 unit, will not be turned into long calls.  The exception to this rule is
10289 that weak function definitions, functions with the @samp{long-call}
10290 attribute or the @samp{section} attribute, and functions that are within
10291 the scope of a @samp{#pragma long_calls} directive, will always be
10292 turned into long calls.
10293
10294 This feature is not enabled by default.  Specifying
10295 @option{-mno-long-calls} will restore the default behavior, as will
10296 placing the function calls within the scope of a @samp{#pragma
10297 long_calls_off} directive.  Note these switches have no effect on how
10298 the compiler generates code to handle function calls via function
10299 pointers.
10300
10301 @item -msingle-pic-base
10302 @opindex msingle-pic-base
10303 Treat the register used for PIC addressing as read-only, rather than
10304 loading it in the prologue for each function.  The run-time system is
10305 responsible for initializing this register with an appropriate value
10306 before execution begins.
10307
10308 @item -mpic-register=@var{reg}
10309 @opindex mpic-register
10310 Specify the register to be used for PIC addressing.  The default is R10
10311 unless stack-checking is enabled, when R9 is used.
10312
10313 @item -mcirrus-fix-invalid-insns
10314 @opindex mcirrus-fix-invalid-insns
10315 @opindex mno-cirrus-fix-invalid-insns
10316 Insert NOPs into the instruction stream to in order to work around
10317 problems with invalid Maverick instruction combinations.  This option
10318 is only valid if the @option{-mcpu=ep9312} option has been used to
10319 enable generation of instructions for the Cirrus Maverick floating
10320 point co-processor.  This option is not enabled by default, since the
10321 problem is only present in older Maverick implementations.  The default
10322 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10323 switch.
10324
10325 @item -mpoke-function-name
10326 @opindex mpoke-function-name
10327 Write the name of each function into the text section, directly
10328 preceding the function prologue.  The generated code is similar to this:
10329
10330 @smallexample
10331      t0
10332          .ascii "arm_poke_function_name", 0
10333          .align
10334      t1
10335          .word 0xff000000 + (t1 - t0)
10336      arm_poke_function_name
10337          mov     ip, sp
10338          stmfd   sp!, @{fp, ip, lr, pc@}
10339          sub     fp, ip, #4
10340 @end smallexample
10341
10342 When performing a stack backtrace, code can inspect the value of
10343 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10344 location @code{pc - 12} and the top 8 bits are set, then we know that
10345 there is a function name embedded immediately preceding this location
10346 and has length @code{((pc[-3]) & 0xff000000)}.
10347
10348 @item -mthumb
10349 @opindex mthumb
10350 Generate code for the Thumb instruction set.  The default is to
10351 use the 32-bit ARM instruction set.
10352 This option automatically enables either 16-bit Thumb-1 or
10353 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
10354 and @option{-march=@var{name}} options.  This option is not passed to the
10355 assembler. If you want to force assembler files to be interpreted as Thumb code,
10356 either add a @samp{.thumb} directive to the source or pass the @option{-mthumb}
10357 option directly to the assembler by prefixing it with @option{-Wa}.
10358
10359 @item -mtpcs-frame
10360 @opindex mtpcs-frame
10361 Generate a stack frame that is compliant with the Thumb Procedure Call
10362 Standard for all non-leaf functions.  (A leaf function is one that does
10363 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10364
10365 @item -mtpcs-leaf-frame
10366 @opindex mtpcs-leaf-frame
10367 Generate a stack frame that is compliant with the Thumb Procedure Call
10368 Standard for all leaf functions.  (A leaf function is one that does
10369 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10370
10371 @item -mcallee-super-interworking
10372 @opindex mcallee-super-interworking
10373 Gives all externally visible functions in the file being compiled an ARM
10374 instruction set header which switches to Thumb mode before executing the
10375 rest of the function.  This allows these functions to be called from
10376 non-interworking code.  This option is not valid in AAPCS configurations
10377 because interworking is enabled by default.
10378
10379 @item -mcaller-super-interworking
10380 @opindex mcaller-super-interworking
10381 Allows calls via function pointers (including virtual functions) to
10382 execute correctly regardless of whether the target code has been
10383 compiled for interworking or not.  There is a small overhead in the cost
10384 of executing a function pointer if this option is enabled.  This option
10385 is not valid in AAPCS configurations because interworking is enabled
10386 by default.
10387
10388 @item -mtp=@var{name}
10389 @opindex mtp
10390 Specify the access model for the thread local storage pointer.  The valid
10391 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10392 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10393 (supported in the arm6k architecture), and @option{auto}, which uses the
10394 best available method for the selected processor.  The default setting is
10395 @option{auto}.
10396
10397 @item -mword-relocations
10398 @opindex mword-relocations
10399 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
10400 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10401 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10402 is specified.
10403
10404 @item -mfix-cortex-m3-ldrd
10405 @opindex mfix-cortex-m3-ldrd
10406 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10407 with overlapping destination and base registers are used.  This option avoids
10408 generating these instructions.  This option is enabled by default when
10409 @option{-mcpu=cortex-m3} is specified.
10410
10411 @end table
10412
10413 @node AVR Options
10414 @subsection AVR Options
10415 @cindex AVR Options
10416
10417 These options are defined for AVR implementations:
10418
10419 @table @gcctabopt
10420 @item -mmcu=@var{mcu}
10421 @opindex mmcu
10422 Specify ATMEL AVR instruction set or MCU type.
10423
10424 Instruction set avr1 is for the minimal AVR core, not supported by the C
10425 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
10426 attiny11, attiny12, attiny15, attiny28).
10427
10428 Instruction set avr2 (default) is for the classic AVR core with up to
10429 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
10430 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
10431 at90c8534, at90s8535).
10432
10433 Instruction set avr3 is for the classic AVR core with up to 128K program
10434 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
10435
10436 Instruction set avr4 is for the enhanced AVR core with up to 8K program
10437 memory space (MCU types: atmega8, atmega83, atmega85).
10438
10439 Instruction set avr5 is for the enhanced AVR core with up to 128K program
10440 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
10441 atmega64, atmega128, at43usb355, at94k).
10442
10443 @item -mno-interrupts
10444 @opindex mno-interrupts
10445 Generated code is not compatible with hardware interrupts.
10446 Code size will be smaller.
10447
10448 @item -mcall-prologues
10449 @opindex mcall-prologues
10450 Functions prologues/epilogues expanded as call to appropriate
10451 subroutines.  Code size will be smaller.
10452
10453 @item -mtiny-stack
10454 @opindex mtiny-stack
10455 Change only the low 8 bits of the stack pointer.
10456
10457 @item -mint8
10458 @opindex mint8
10459 Assume int to be 8 bit integer.  This affects the sizes of all types: A
10460 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
10461 and long long will be 4 bytes.  Please note that this option does not
10462 comply to the C standards, but it will provide you with smaller code
10463 size.
10464 @end table
10465
10466 @node Blackfin Options
10467 @subsection Blackfin Options
10468 @cindex Blackfin Options
10469
10470 @table @gcctabopt
10471 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
10472 @opindex mcpu=
10473 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
10474 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
10475 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
10476 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
10477 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
10478 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
10479 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
10480 @samp{bf561}.
10481 The optional @var{sirevision} specifies the silicon revision of the target
10482 Blackfin processor.  Any workarounds available for the targeted silicon revision
10483 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
10484 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
10485 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
10486 hexadecimal digits representing the major and minor numbers in the silicon
10487 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
10488 is not defined.  If @var{sirevision} is @samp{any}, the
10489 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
10490 If this optional @var{sirevision} is not used, GCC assumes the latest known
10491 silicon revision of the targeted Blackfin processor.
10492
10493 Support for @samp{bf561} is incomplete.  For @samp{bf561},
10494 Only the processor macro is defined.
10495 Without this option, @samp{bf532} is used as the processor by default.
10496 The corresponding predefined processor macros for @var{cpu} is to
10497 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
10498 provided by libgloss to be linked in if @option{-msim} is not given.
10499
10500 @item -msim
10501 @opindex msim
10502 Specifies that the program will be run on the simulator.  This causes
10503 the simulator BSP provided by libgloss to be linked in.  This option
10504 has effect only for @samp{bfin-elf} toolchain.
10505 Certain other options, such as @option{-mid-shared-library} and
10506 @option{-mfdpic}, imply @option{-msim}.
10507
10508 @item -momit-leaf-frame-pointer
10509 @opindex momit-leaf-frame-pointer
10510 Don't keep the frame pointer in a register for leaf functions.  This
10511 avoids the instructions to save, set up and restore frame pointers and
10512 makes an extra register available in leaf functions.  The option
10513 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10514 which might make debugging harder.
10515
10516 @item -mspecld-anomaly
10517 @opindex mspecld-anomaly
10518 When enabled, the compiler will ensure that the generated code does not
10519 contain speculative loads after jump instructions. If this option is used,
10520 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
10521
10522 @item -mno-specld-anomaly
10523 @opindex mno-specld-anomaly
10524 Don't generate extra code to prevent speculative loads from occurring.
10525
10526 @item -mcsync-anomaly
10527 @opindex mcsync-anomaly
10528 When enabled, the compiler will ensure that the generated code does not
10529 contain CSYNC or SSYNC instructions too soon after conditional branches.
10530 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
10531
10532 @item -mno-csync-anomaly
10533 @opindex mno-csync-anomaly
10534 Don't generate extra code to prevent CSYNC or SSYNC instructions from
10535 occurring too soon after a conditional branch.
10536
10537 @item -mlow-64k
10538 @opindex mlow-64k
10539 When enabled, the compiler is free to take advantage of the knowledge that
10540 the entire program fits into the low 64k of memory.
10541
10542 @item -mno-low-64k
10543 @opindex mno-low-64k
10544 Assume that the program is arbitrarily large.  This is the default.
10545
10546 @item -mstack-check-l1
10547 @opindex mstack-check-l1
10548 Do stack checking using information placed into L1 scratchpad memory by the
10549 uClinux kernel.
10550
10551 @item -mid-shared-library
10552 @opindex mid-shared-library
10553 Generate code that supports shared libraries via the library ID method.
10554 This allows for execute in place and shared libraries in an environment
10555 without virtual memory management.  This option implies @option{-fPIC}.
10556 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10557
10558 @item -mno-id-shared-library
10559 @opindex mno-id-shared-library
10560 Generate code that doesn't assume ID based shared libraries are being used.
10561 This is the default.
10562
10563 @item -mleaf-id-shared-library
10564 @opindex mleaf-id-shared-library
10565 Generate code that supports shared libraries via the library ID method,
10566 but assumes that this library or executable won't link against any other
10567 ID shared libraries.  That allows the compiler to use faster code for jumps
10568 and calls.
10569
10570 @item -mno-leaf-id-shared-library
10571 @opindex mno-leaf-id-shared-library
10572 Do not assume that the code being compiled won't link against any ID shared
10573 libraries.  Slower code will be generated for jump and call insns.
10574
10575 @item -mshared-library-id=n
10576 @opindex mshared-library-id
10577 Specified the identification number of the ID based shared library being
10578 compiled.  Specifying a value of 0 will generate more compact code, specifying
10579 other values will force the allocation of that number to the current
10580 library but is no more space or time efficient than omitting this option.
10581
10582 @item -msep-data
10583 @opindex msep-data
10584 Generate code that allows the data segment to be located in a different
10585 area of memory from the text segment.  This allows for execute in place in
10586 an environment without virtual memory management by eliminating relocations
10587 against the text section.
10588
10589 @item -mno-sep-data
10590 @opindex mno-sep-data
10591 Generate code that assumes that the data segment follows the text segment.
10592 This is the default.
10593
10594 @item -mlong-calls
10595 @itemx -mno-long-calls
10596 @opindex mlong-calls
10597 @opindex mno-long-calls
10598 Tells the compiler to perform function calls by first loading the
10599 address of the function into a register and then performing a subroutine
10600 call on this register.  This switch is needed if the target function
10601 will lie outside of the 24 bit addressing range of the offset based
10602 version of subroutine call instruction.
10603
10604 This feature is not enabled by default.  Specifying
10605 @option{-mno-long-calls} will restore the default behavior.  Note these
10606 switches have no effect on how the compiler generates code to handle
10607 function calls via function pointers.
10608
10609 @item -mfast-fp
10610 @opindex mfast-fp
10611 Link with the fast floating-point library. This library relaxes some of
10612 the IEEE floating-point standard's rules for checking inputs against
10613 Not-a-Number (NAN), in the interest of performance.
10614
10615 @item -minline-plt
10616 @opindex minline-plt
10617 Enable inlining of PLT entries in function calls to functions that are
10618 not known to bind locally.  It has no effect without @option{-mfdpic}.
10619
10620 @item -mmulticore
10621 @opindex mmulticore
10622 Build standalone application for multicore Blackfin processor. Proper
10623 start files and link scripts will be used to support multicore.
10624 This option defines @code{__BFIN_MULTICORE}. It can only be used with
10625 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
10626 @option{-mcorea} or @option{-mcoreb}. If it's used without
10627 @option{-mcorea} or @option{-mcoreb}, single application/dual core
10628 programming model is used. In this model, the main function of Core B
10629 should be named as coreb_main. If it's used with @option{-mcorea} or
10630 @option{-mcoreb}, one application per core programming model is used.
10631 If this option is not used, single core application programming
10632 model is used.
10633
10634 @item -mcorea
10635 @opindex mcorea
10636 Build standalone application for Core A of BF561 when using
10637 one application per core programming model. Proper start files
10638 and link scripts will be used to support Core A. This option
10639 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
10640
10641 @item -mcoreb
10642 @opindex mcoreb
10643 Build standalone application for Core B of BF561 when using
10644 one application per core programming model. Proper start files
10645 and link scripts will be used to support Core B. This option
10646 defines @code{__BFIN_COREB}. When this option is used, coreb_main
10647 should be used instead of main. It must be used with
10648 @option{-mmulticore}.
10649
10650 @item -msdram
10651 @opindex msdram
10652 Build standalone application for SDRAM. Proper start files and
10653 link scripts will be used to put the application into SDRAM.
10654 Loader should initialize SDRAM before loading the application
10655 into SDRAM. This option defines @code{__BFIN_SDRAM}.
10656
10657 @item -micplb
10658 @opindex micplb
10659 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
10660 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
10661 are enabled; for standalone applications the default is off.
10662 @end table
10663
10664 @node CRIS Options
10665 @subsection CRIS Options
10666 @cindex CRIS Options
10667
10668 These options are defined specifically for the CRIS ports.
10669
10670 @table @gcctabopt
10671 @item -march=@var{architecture-type}
10672 @itemx -mcpu=@var{architecture-type}
10673 @opindex march
10674 @opindex mcpu
10675 Generate code for the specified architecture.  The choices for
10676 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
10677 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
10678 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
10679 @samp{v10}.
10680
10681 @item -mtune=@var{architecture-type}
10682 @opindex mtune
10683 Tune to @var{architecture-type} everything applicable about the generated
10684 code, except for the ABI and the set of available instructions.  The
10685 choices for @var{architecture-type} are the same as for
10686 @option{-march=@var{architecture-type}}.
10687
10688 @item -mmax-stack-frame=@var{n}
10689 @opindex mmax-stack-frame
10690 Warn when the stack frame of a function exceeds @var{n} bytes.
10691
10692 @item -metrax4
10693 @itemx -metrax100
10694 @opindex metrax4
10695 @opindex metrax100
10696 The options @option{-metrax4} and @option{-metrax100} are synonyms for
10697 @option{-march=v3} and @option{-march=v8} respectively.
10698
10699 @item -mmul-bug-workaround
10700 @itemx -mno-mul-bug-workaround
10701 @opindex mmul-bug-workaround
10702 @opindex mno-mul-bug-workaround
10703 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
10704 models where it applies.  This option is active by default.
10705
10706 @item -mpdebug
10707 @opindex mpdebug
10708 Enable CRIS-specific verbose debug-related information in the assembly
10709 code.  This option also has the effect to turn off the @samp{#NO_APP}
10710 formatted-code indicator to the assembler at the beginning of the
10711 assembly file.
10712
10713 @item -mcc-init
10714 @opindex mcc-init
10715 Do not use condition-code results from previous instruction; always emit
10716 compare and test instructions before use of condition codes.
10717
10718 @item -mno-side-effects
10719 @opindex mno-side-effects
10720 Do not emit instructions with side-effects in addressing modes other than
10721 post-increment.
10722
10723 @item -mstack-align
10724 @itemx -mno-stack-align
10725 @itemx -mdata-align
10726 @itemx -mno-data-align
10727 @itemx -mconst-align
10728 @itemx -mno-const-align
10729 @opindex mstack-align
10730 @opindex mno-stack-align
10731 @opindex mdata-align
10732 @opindex mno-data-align
10733 @opindex mconst-align
10734 @opindex mno-const-align
10735 These options (no-options) arranges (eliminate arrangements) for the
10736 stack-frame, individual data and constants to be aligned for the maximum
10737 single data access size for the chosen CPU model.  The default is to
10738 arrange for 32-bit alignment.  ABI details such as structure layout are
10739 not affected by these options.
10740
10741 @item -m32-bit
10742 @itemx -m16-bit
10743 @itemx -m8-bit
10744 @opindex m32-bit
10745 @opindex m16-bit
10746 @opindex m8-bit
10747 Similar to the stack- data- and const-align options above, these options
10748 arrange for stack-frame, writable data and constants to all be 32-bit,
10749 16-bit or 8-bit aligned.  The default is 32-bit alignment.
10750
10751 @item -mno-prologue-epilogue
10752 @itemx -mprologue-epilogue
10753 @opindex mno-prologue-epilogue
10754 @opindex mprologue-epilogue
10755 With @option{-mno-prologue-epilogue}, the normal function prologue and
10756 epilogue that sets up the stack-frame are omitted and no return
10757 instructions or return sequences are generated in the code.  Use this
10758 option only together with visual inspection of the compiled code: no
10759 warnings or errors are generated when call-saved registers must be saved,
10760 or storage for local variable needs to be allocated.
10761
10762 @item -mno-gotplt
10763 @itemx -mgotplt
10764 @opindex mno-gotplt
10765 @opindex mgotplt
10766 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
10767 instruction sequences that load addresses for functions from the PLT part
10768 of the GOT rather than (traditional on other architectures) calls to the
10769 PLT@.  The default is @option{-mgotplt}.
10770
10771 @item -melf
10772 @opindex melf
10773 Legacy no-op option only recognized with the cris-axis-elf and
10774 cris-axis-linux-gnu targets.
10775
10776 @item -mlinux
10777 @opindex mlinux
10778 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
10779
10780 @item -sim
10781 @opindex sim
10782 This option, recognized for the cris-axis-elf arranges
10783 to link with input-output functions from a simulator library.  Code,
10784 initialized data and zero-initialized data are allocated consecutively.
10785
10786 @item -sim2
10787 @opindex sim2
10788 Like @option{-sim}, but pass linker options to locate initialized data at
10789 0x40000000 and zero-initialized data at 0x80000000.
10790 @end table
10791
10792 @node CRX Options
10793 @subsection CRX Options
10794 @cindex CRX Options
10795
10796 These options are defined specifically for the CRX ports.
10797
10798 @table @gcctabopt
10799
10800 @item -mmac
10801 @opindex mmac
10802 Enable the use of multiply-accumulate instructions. Disabled by default.
10803
10804 @item -mpush-args
10805 @opindex mpush-args
10806 Push instructions will be used to pass outgoing arguments when functions
10807 are called. Enabled by default.
10808 @end table
10809
10810 @node Darwin Options
10811 @subsection Darwin Options
10812 @cindex Darwin options
10813
10814 These options are defined for all architectures running the Darwin operating
10815 system.
10816
10817 FSF GCC on Darwin does not create ``fat'' object files; it will create
10818 an object file for the single architecture that it was built to
10819 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
10820 @option{-arch} options are used; it does so by running the compiler or
10821 linker multiple times and joining the results together with
10822 @file{lipo}.
10823
10824 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
10825 @samp{i686}) is determined by the flags that specify the ISA
10826 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
10827 @option{-force_cpusubtype_ALL} option can be used to override this.
10828
10829 The Darwin tools vary in their behavior when presented with an ISA
10830 mismatch.  The assembler, @file{as}, will only permit instructions to
10831 be used that are valid for the subtype of the file it is generating,
10832 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
10833 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
10834 and print an error if asked to create a shared library with a less
10835 restrictive subtype than its input files (for instance, trying to put
10836 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
10837 for executables, @file{ld}, will quietly give the executable the most
10838 restrictive subtype of any of its input files.
10839
10840 @table @gcctabopt
10841 @item -F@var{dir}
10842 @opindex F
10843 Add the framework directory @var{dir} to the head of the list of
10844 directories to be searched for header files.  These directories are
10845 interleaved with those specified by @option{-I} options and are
10846 scanned in a left-to-right order.
10847
10848 A framework directory is a directory with frameworks in it.  A
10849 framework is a directory with a @samp{"Headers"} and/or
10850 @samp{"PrivateHeaders"} directory contained directly in it that ends
10851 in @samp{".framework"}.  The name of a framework is the name of this
10852 directory excluding the @samp{".framework"}.  Headers associated with
10853 the framework are found in one of those two directories, with
10854 @samp{"Headers"} being searched first.  A subframework is a framework
10855 directory that is in a framework's @samp{"Frameworks"} directory.
10856 Includes of subframework headers can only appear in a header of a
10857 framework that contains the subframework, or in a sibling subframework
10858 header.  Two subframeworks are siblings if they occur in the same
10859 framework.  A subframework should not have the same name as a
10860 framework, a warning will be issued if this is violated.  Currently a
10861 subframework cannot have subframeworks, in the future, the mechanism
10862 may be extended to support this.  The standard frameworks can be found
10863 in @samp{"/System/Library/Frameworks"} and
10864 @samp{"/Library/Frameworks"}.  An example include looks like
10865 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
10866 the name of the framework and header.h is found in the
10867 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
10868
10869 @item -iframework@var{dir}
10870 @opindex iframework
10871 Like @option{-F} except the directory is a treated as a system
10872 directory.  The main difference between this @option{-iframework} and
10873 @option{-F} is that with @option{-iframework} the compiler does not
10874 warn about constructs contained within header files found via
10875 @var{dir}.  This option is valid only for the C family of languages.
10876
10877 @item -gused
10878 @opindex gused
10879 Emit debugging information for symbols that are used.  For STABS
10880 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
10881 This is by default ON@.
10882
10883 @item -gfull
10884 @opindex gfull
10885 Emit debugging information for all symbols and types.
10886
10887 @item -mmacosx-version-min=@var{version}
10888 The earliest version of MacOS X that this executable will run on
10889 is @var{version}.  Typical values of @var{version} include @code{10.1},
10890 @code{10.2}, and @code{10.3.9}.
10891
10892 If the compiler was built to use the system's headers by default,
10893 then the default for this option is the system version on which the
10894 compiler is running, otherwise the default is to make choices which
10895 are compatible with as many systems and code bases as possible.
10896
10897 @item -mkernel
10898 @opindex mkernel
10899 Enable kernel development mode.  The @option{-mkernel} option sets
10900 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
10901 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
10902 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
10903 applicable.  This mode also sets @option{-mno-altivec},
10904 @option{-msoft-float}, @option{-fno-builtin} and
10905 @option{-mlong-branch} for PowerPC targets.
10906
10907 @item -mone-byte-bool
10908 @opindex mone-byte-bool
10909 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
10910 By default @samp{sizeof(bool)} is @samp{4} when compiling for
10911 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
10912 option has no effect on x86.
10913
10914 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
10915 to generate code that is not binary compatible with code generated
10916 without that switch.  Using this switch may require recompiling all
10917 other modules in a program, including system libraries.  Use this
10918 switch to conform to a non-default data model.
10919
10920 @item -mfix-and-continue
10921 @itemx -ffix-and-continue
10922 @itemx -findirect-data
10923 @opindex mfix-and-continue
10924 @opindex ffix-and-continue
10925 @opindex findirect-data
10926 Generate code suitable for fast turn around development.  Needed to
10927 enable gdb to dynamically load @code{.o} files into already running
10928 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
10929 are provided for backwards compatibility.
10930
10931 @item -all_load
10932 @opindex all_load
10933 Loads all members of static archive libraries.
10934 See man ld(1) for more information.
10935
10936 @item -arch_errors_fatal
10937 @opindex arch_errors_fatal
10938 Cause the errors having to do with files that have the wrong architecture
10939 to be fatal.
10940
10941 @item -bind_at_load
10942 @opindex bind_at_load
10943 Causes the output file to be marked such that the dynamic linker will
10944 bind all undefined references when the file is loaded or launched.
10945
10946 @item -bundle
10947 @opindex bundle
10948 Produce a Mach-o bundle format file.
10949 See man ld(1) for more information.
10950
10951 @item -bundle_loader @var{executable}
10952 @opindex bundle_loader
10953 This option specifies the @var{executable} that will be loading the build
10954 output file being linked.  See man ld(1) for more information.
10955
10956 @item -dynamiclib
10957 @opindex dynamiclib
10958 When passed this option, GCC will produce a dynamic library instead of
10959 an executable when linking, using the Darwin @file{libtool} command.
10960
10961 @item -force_cpusubtype_ALL
10962 @opindex force_cpusubtype_ALL
10963 This causes GCC's output file to have the @var{ALL} subtype, instead of
10964 one controlled by the @option{-mcpu} or @option{-march} option.
10965
10966 @item -allowable_client  @var{client_name}
10967 @itemx -client_name
10968 @itemx -compatibility_version
10969 @itemx -current_version
10970 @itemx -dead_strip
10971 @itemx -dependency-file
10972 @itemx -dylib_file
10973 @itemx -dylinker_install_name
10974 @itemx -dynamic
10975 @itemx -exported_symbols_list
10976 @itemx -filelist
10977 @need 800
10978 @itemx -flat_namespace
10979 @itemx -force_flat_namespace
10980 @itemx -headerpad_max_install_names
10981 @itemx -image_base
10982 @itemx -init
10983 @itemx -install_name
10984 @itemx -keep_private_externs
10985 @itemx -multi_module
10986 @itemx -multiply_defined
10987 @itemx -multiply_defined_unused
10988 @need 800
10989 @itemx -noall_load
10990 @itemx -no_dead_strip_inits_and_terms
10991 @itemx -nofixprebinding
10992 @itemx -nomultidefs
10993 @itemx -noprebind
10994 @itemx -noseglinkedit
10995 @itemx -pagezero_size
10996 @itemx -prebind
10997 @itemx -prebind_all_twolevel_modules
10998 @itemx -private_bundle
10999 @need 800
11000 @itemx -read_only_relocs
11001 @itemx -sectalign
11002 @itemx -sectobjectsymbols
11003 @itemx -whyload
11004 @itemx -seg1addr
11005 @itemx -sectcreate
11006 @itemx -sectobjectsymbols
11007 @itemx -sectorder
11008 @itemx -segaddr
11009 @itemx -segs_read_only_addr
11010 @need 800
11011 @itemx -segs_read_write_addr
11012 @itemx -seg_addr_table
11013 @itemx -seg_addr_table_filename
11014 @itemx -seglinkedit
11015 @itemx -segprot
11016 @itemx -segs_read_only_addr
11017 @itemx -segs_read_write_addr
11018 @itemx -single_module
11019 @itemx -static
11020 @itemx -sub_library
11021 @need 800
11022 @itemx -sub_umbrella
11023 @itemx -twolevel_namespace
11024 @itemx -umbrella
11025 @itemx -undefined
11026 @itemx -unexported_symbols_list
11027 @itemx -weak_reference_mismatches
11028 @itemx -whatsloaded
11029 @opindex allowable_client
11030 @opindex client_name
11031 @opindex compatibility_version
11032 @opindex current_version
11033 @opindex dead_strip
11034 @opindex dependency-file
11035 @opindex dylib_file
11036 @opindex dylinker_install_name
11037 @opindex dynamic
11038 @opindex exported_symbols_list
11039 @opindex filelist
11040 @opindex flat_namespace
11041 @opindex force_flat_namespace
11042 @opindex headerpad_max_install_names
11043 @opindex image_base
11044 @opindex init
11045 @opindex install_name
11046 @opindex keep_private_externs
11047 @opindex multi_module
11048 @opindex multiply_defined
11049 @opindex multiply_defined_unused
11050 @opindex noall_load
11051 @opindex no_dead_strip_inits_and_terms
11052 @opindex nofixprebinding
11053 @opindex nomultidefs
11054 @opindex noprebind
11055 @opindex noseglinkedit
11056 @opindex pagezero_size
11057 @opindex prebind
11058 @opindex prebind_all_twolevel_modules
11059 @opindex private_bundle
11060 @opindex read_only_relocs
11061 @opindex sectalign
11062 @opindex sectobjectsymbols
11063 @opindex whyload
11064 @opindex seg1addr
11065 @opindex sectcreate
11066 @opindex sectobjectsymbols
11067 @opindex sectorder
11068 @opindex segaddr
11069 @opindex segs_read_only_addr
11070 @opindex segs_read_write_addr
11071 @opindex seg_addr_table
11072 @opindex seg_addr_table_filename
11073 @opindex seglinkedit
11074 @opindex segprot
11075 @opindex segs_read_only_addr
11076 @opindex segs_read_write_addr
11077 @opindex single_module
11078 @opindex static
11079 @opindex sub_library
11080 @opindex sub_umbrella
11081 @opindex twolevel_namespace
11082 @opindex umbrella
11083 @opindex undefined
11084 @opindex unexported_symbols_list
11085 @opindex weak_reference_mismatches
11086 @opindex whatsloaded
11087 These options are passed to the Darwin linker.  The Darwin linker man page
11088 describes them in detail.
11089 @end table
11090
11091 @node DEC Alpha Options
11092 @subsection DEC Alpha Options
11093
11094 These @samp{-m} options are defined for the DEC Alpha implementations:
11095
11096 @table @gcctabopt
11097 @item -mno-soft-float
11098 @itemx -msoft-float
11099 @opindex mno-soft-float
11100 @opindex msoft-float
11101 Use (do not use) the hardware floating-point instructions for
11102 floating-point operations.  When @option{-msoft-float} is specified,
11103 functions in @file{libgcc.a} will be used to perform floating-point
11104 operations.  Unless they are replaced by routines that emulate the
11105 floating-point operations, or compiled in such a way as to call such
11106 emulations routines, these routines will issue floating-point
11107 operations.   If you are compiling for an Alpha without floating-point
11108 operations, you must ensure that the library is built so as not to call
11109 them.
11110
11111 Note that Alpha implementations without floating-point operations are
11112 required to have floating-point registers.
11113
11114 @item -mfp-reg
11115 @itemx -mno-fp-regs
11116 @opindex mfp-reg
11117 @opindex mno-fp-regs
11118 Generate code that uses (does not use) the floating-point register set.
11119 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
11120 register set is not used, floating point operands are passed in integer
11121 registers as if they were integers and floating-point results are passed
11122 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
11123 so any function with a floating-point argument or return value called by code
11124 compiled with @option{-mno-fp-regs} must also be compiled with that
11125 option.
11126
11127 A typical use of this option is building a kernel that does not use,
11128 and hence need not save and restore, any floating-point registers.
11129
11130 @item -mieee
11131 @opindex mieee
11132 The Alpha architecture implements floating-point hardware optimized for
11133 maximum performance.  It is mostly compliant with the IEEE floating
11134 point standard.  However, for full compliance, software assistance is
11135 required.  This option generates code fully IEEE compliant code
11136 @emph{except} that the @var{inexact-flag} is not maintained (see below).
11137 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
11138 defined during compilation.  The resulting code is less efficient but is
11139 able to correctly support denormalized numbers and exceptional IEEE
11140 values such as not-a-number and plus/minus infinity.  Other Alpha
11141 compilers call this option @option{-ieee_with_no_inexact}.
11142
11143 @item -mieee-with-inexact
11144 @opindex mieee-with-inexact
11145 This is like @option{-mieee} except the generated code also maintains
11146 the IEEE @var{inexact-flag}.  Turning on this option causes the
11147 generated code to implement fully-compliant IEEE math.  In addition to
11148 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
11149 macro.  On some Alpha implementations the resulting code may execute
11150 significantly slower than the code generated by default.  Since there is
11151 very little code that depends on the @var{inexact-flag}, you should
11152 normally not specify this option.  Other Alpha compilers call this
11153 option @option{-ieee_with_inexact}.
11154
11155 @item -mfp-trap-mode=@var{trap-mode}
11156 @opindex mfp-trap-mode
11157 This option controls what floating-point related traps are enabled.
11158 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
11159 The trap mode can be set to one of four values:
11160
11161 @table @samp
11162 @item n
11163 This is the default (normal) setting.  The only traps that are enabled
11164 are the ones that cannot be disabled in software (e.g., division by zero
11165 trap).
11166
11167 @item u
11168 In addition to the traps enabled by @samp{n}, underflow traps are enabled
11169 as well.
11170
11171 @item su
11172 Like @samp{u}, but the instructions are marked to be safe for software
11173 completion (see Alpha architecture manual for details).
11174
11175 @item sui
11176 Like @samp{su}, but inexact traps are enabled as well.
11177 @end table
11178
11179 @item -mfp-rounding-mode=@var{rounding-mode}
11180 @opindex mfp-rounding-mode
11181 Selects the IEEE rounding mode.  Other Alpha compilers call this option
11182 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
11183 of:
11184
11185 @table @samp
11186 @item n
11187 Normal IEEE rounding mode.  Floating point numbers are rounded towards
11188 the nearest machine number or towards the even machine number in case
11189 of a tie.
11190
11191 @item m
11192 Round towards minus infinity.
11193
11194 @item c
11195 Chopped rounding mode.  Floating point numbers are rounded towards zero.
11196
11197 @item d
11198 Dynamic rounding mode.  A field in the floating point control register
11199 (@var{fpcr}, see Alpha architecture reference manual) controls the
11200 rounding mode in effect.  The C library initializes this register for
11201 rounding towards plus infinity.  Thus, unless your program modifies the
11202 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
11203 @end table
11204
11205 @item -mtrap-precision=@var{trap-precision}
11206 @opindex mtrap-precision
11207 In the Alpha architecture, floating point traps are imprecise.  This
11208 means without software assistance it is impossible to recover from a
11209 floating trap and program execution normally needs to be terminated.
11210 GCC can generate code that can assist operating system trap handlers
11211 in determining the exact location that caused a floating point trap.
11212 Depending on the requirements of an application, different levels of
11213 precisions can be selected:
11214
11215 @table @samp
11216 @item p
11217 Program precision.  This option is the default and means a trap handler
11218 can only identify which program caused a floating point exception.
11219
11220 @item f
11221 Function precision.  The trap handler can determine the function that
11222 caused a floating point exception.
11223
11224 @item i
11225 Instruction precision.  The trap handler can determine the exact
11226 instruction that caused a floating point exception.
11227 @end table
11228
11229 Other Alpha compilers provide the equivalent options called
11230 @option{-scope_safe} and @option{-resumption_safe}.
11231
11232 @item -mieee-conformant
11233 @opindex mieee-conformant
11234 This option marks the generated code as IEEE conformant.  You must not
11235 use this option unless you also specify @option{-mtrap-precision=i} and either
11236 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
11237 is to emit the line @samp{.eflag 48} in the function prologue of the
11238 generated assembly file.  Under DEC Unix, this has the effect that
11239 IEEE-conformant math library routines will be linked in.
11240
11241 @item -mbuild-constants
11242 @opindex mbuild-constants
11243 Normally GCC examines a 32- or 64-bit integer constant to
11244 see if it can construct it from smaller constants in two or three
11245 instructions.  If it cannot, it will output the constant as a literal and
11246 generate code to load it from the data segment at runtime.
11247
11248 Use this option to require GCC to construct @emph{all} integer constants
11249 using code, even if it takes more instructions (the maximum is six).
11250
11251 You would typically use this option to build a shared library dynamic
11252 loader.  Itself a shared library, it must relocate itself in memory
11253 before it can find the variables and constants in its own data segment.
11254
11255 @item -malpha-as
11256 @itemx -mgas
11257 @opindex malpha-as
11258 @opindex mgas
11259 Select whether to generate code to be assembled by the vendor-supplied
11260 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
11261
11262 @item -mbwx
11263 @itemx -mno-bwx
11264 @itemx -mcix
11265 @itemx -mno-cix
11266 @itemx -mfix
11267 @itemx -mno-fix
11268 @itemx -mmax
11269 @itemx -mno-max
11270 @opindex mbwx
11271 @opindex mno-bwx
11272 @opindex mcix
11273 @opindex mno-cix
11274 @opindex mfix
11275 @opindex mno-fix
11276 @opindex mmax
11277 @opindex mno-max
11278 Indicate whether GCC should generate code to use the optional BWX,
11279 CIX, FIX and MAX instruction sets.  The default is to use the instruction
11280 sets supported by the CPU type specified via @option{-mcpu=} option or that
11281 of the CPU on which GCC was built if none was specified.
11282
11283 @item -mfloat-vax
11284 @itemx -mfloat-ieee
11285 @opindex mfloat-vax
11286 @opindex mfloat-ieee
11287 Generate code that uses (does not use) VAX F and G floating point
11288 arithmetic instead of IEEE single and double precision.
11289
11290 @item -mexplicit-relocs
11291 @itemx -mno-explicit-relocs
11292 @opindex mexplicit-relocs
11293 @opindex mno-explicit-relocs
11294 Older Alpha assemblers provided no way to generate symbol relocations
11295 except via assembler macros.  Use of these macros does not allow
11296 optimal instruction scheduling.  GNU binutils as of version 2.12
11297 supports a new syntax that allows the compiler to explicitly mark
11298 which relocations should apply to which instructions.  This option
11299 is mostly useful for debugging, as GCC detects the capabilities of
11300 the assembler when it is built and sets the default accordingly.
11301
11302 @item -msmall-data
11303 @itemx -mlarge-data
11304 @opindex msmall-data
11305 @opindex mlarge-data
11306 When @option{-mexplicit-relocs} is in effect, static data is
11307 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
11308 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
11309 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
11310 16-bit relocations off of the @code{$gp} register.  This limits the
11311 size of the small data area to 64KB, but allows the variables to be
11312 directly accessed via a single instruction.
11313
11314 The default is @option{-mlarge-data}.  With this option the data area
11315 is limited to just below 2GB@.  Programs that require more than 2GB of
11316 data must use @code{malloc} or @code{mmap} to allocate the data in the
11317 heap instead of in the program's data segment.
11318
11319 When generating code for shared libraries, @option{-fpic} implies
11320 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
11321
11322 @item -msmall-text
11323 @itemx -mlarge-text
11324 @opindex msmall-text
11325 @opindex mlarge-text
11326 When @option{-msmall-text} is used, the compiler assumes that the
11327 code of the entire program (or shared library) fits in 4MB, and is
11328 thus reachable with a branch instruction.  When @option{-msmall-data}
11329 is used, the compiler can assume that all local symbols share the
11330 same @code{$gp} value, and thus reduce the number of instructions
11331 required for a function call from 4 to 1.
11332
11333 The default is @option{-mlarge-text}.
11334
11335 @item -mcpu=@var{cpu_type}
11336 @opindex mcpu
11337 Set the instruction set and instruction scheduling parameters for
11338 machine type @var{cpu_type}.  You can specify either the @samp{EV}
11339 style name or the corresponding chip number.  GCC supports scheduling
11340 parameters for the EV4, EV5 and EV6 family of processors and will
11341 choose the default values for the instruction set from the processor
11342 you specify.  If you do not specify a processor type, GCC will default
11343 to the processor on which the compiler was built.
11344
11345 Supported values for @var{cpu_type} are
11346
11347 @table @samp
11348 @item ev4
11349 @itemx ev45
11350 @itemx 21064
11351 Schedules as an EV4 and has no instruction set extensions.
11352
11353 @item ev5
11354 @itemx 21164
11355 Schedules as an EV5 and has no instruction set extensions.
11356
11357 @item ev56
11358 @itemx 21164a
11359 Schedules as an EV5 and supports the BWX extension.
11360
11361 @item pca56
11362 @itemx 21164pc
11363 @itemx 21164PC
11364 Schedules as an EV5 and supports the BWX and MAX extensions.
11365
11366 @item ev6
11367 @itemx 21264
11368 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
11369
11370 @item ev67
11371 @itemx 21264a
11372 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
11373 @end table
11374
11375 Native Linux/GNU toolchains also support the value @samp{native},
11376 which selects the best architecture option for the host processor.
11377 @option{-mcpu=native} has no effect if GCC does not recognize
11378 the processor.
11379
11380 @item -mtune=@var{cpu_type}
11381 @opindex mtune
11382 Set only the instruction scheduling parameters for machine type
11383 @var{cpu_type}.  The instruction set is not changed.
11384
11385 Native Linux/GNU toolchains also support the value @samp{native},
11386 which selects the best architecture option for the host processor.
11387 @option{-mtune=native} has no effect if GCC does not recognize
11388 the processor.
11389
11390 @item -mmemory-latency=@var{time}
11391 @opindex mmemory-latency
11392 Sets the latency the scheduler should assume for typical memory
11393 references as seen by the application.  This number is highly
11394 dependent on the memory access patterns used by the application
11395 and the size of the external cache on the machine.
11396
11397 Valid options for @var{time} are
11398
11399 @table @samp
11400 @item @var{number}
11401 A decimal number representing clock cycles.
11402
11403 @item L1
11404 @itemx L2
11405 @itemx L3
11406 @itemx main
11407 The compiler contains estimates of the number of clock cycles for
11408 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
11409 (also called Dcache, Scache, and Bcache), as well as to main memory.
11410 Note that L3 is only valid for EV5.
11411
11412 @end table
11413 @end table
11414
11415 @node DEC Alpha/VMS Options
11416 @subsection DEC Alpha/VMS Options
11417
11418 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
11419
11420 @table @gcctabopt
11421 @item -mvms-return-codes
11422 @opindex mvms-return-codes
11423 Return VMS condition codes from main.  The default is to return POSIX
11424 style condition (e.g.@: error) codes.
11425
11426 @item -mdebug-main=@var{prefix}
11427 @opindex mdebug-main=@var{prefix}
11428 Flag the first routine whose name starts with @var{prefix} as the main
11429 routine for the debugger.
11430
11431 @item -mmalloc64
11432 @opindex mmalloc64
11433 Default to 64bit memory allocation routines.
11434 @end table
11435
11436 @node FR30 Options
11437 @subsection FR30 Options
11438 @cindex FR30 Options
11439
11440 These options are defined specifically for the FR30 port.
11441
11442 @table @gcctabopt
11443
11444 @item -msmall-model
11445 @opindex msmall-model
11446 Use the small address space model.  This can produce smaller code, but
11447 it does assume that all symbolic values and addresses will fit into a
11448 20-bit range.
11449
11450 @item -mno-lsim
11451 @opindex mno-lsim
11452 Assume that run-time support has been provided and so there is no need
11453 to include the simulator library (@file{libsim.a}) on the linker
11454 command line.
11455
11456 @end table
11457
11458 @node FRV Options
11459 @subsection FRV Options
11460 @cindex FRV Options
11461
11462 @table @gcctabopt
11463 @item -mgpr-32
11464 @opindex mgpr-32
11465
11466 Only use the first 32 general purpose registers.
11467
11468 @item -mgpr-64
11469 @opindex mgpr-64
11470
11471 Use all 64 general purpose registers.
11472
11473 @item -mfpr-32
11474 @opindex mfpr-32
11475
11476 Use only the first 32 floating point registers.
11477
11478 @item -mfpr-64
11479 @opindex mfpr-64
11480
11481 Use all 64 floating point registers
11482
11483 @item -mhard-float
11484 @opindex mhard-float
11485
11486 Use hardware instructions for floating point operations.
11487
11488 @item -msoft-float
11489 @opindex msoft-float
11490
11491 Use library routines for floating point operations.
11492
11493 @item -malloc-cc
11494 @opindex malloc-cc
11495
11496 Dynamically allocate condition code registers.
11497
11498 @item -mfixed-cc
11499 @opindex mfixed-cc
11500
11501 Do not try to dynamically allocate condition code registers, only
11502 use @code{icc0} and @code{fcc0}.
11503
11504 @item -mdword
11505 @opindex mdword
11506
11507 Change ABI to use double word insns.
11508
11509 @item -mno-dword
11510 @opindex mno-dword
11511
11512 Do not use double word instructions.
11513
11514 @item -mdouble
11515 @opindex mdouble
11516
11517 Use floating point double instructions.
11518
11519 @item -mno-double
11520 @opindex mno-double
11521
11522 Do not use floating point double instructions.
11523
11524 @item -mmedia
11525 @opindex mmedia
11526
11527 Use media instructions.
11528
11529 @item -mno-media
11530 @opindex mno-media
11531
11532 Do not use media instructions.
11533
11534 @item -mmuladd
11535 @opindex mmuladd
11536
11537 Use multiply and add/subtract instructions.
11538
11539 @item -mno-muladd
11540 @opindex mno-muladd
11541
11542 Do not use multiply and add/subtract instructions.
11543
11544 @item -mfdpic
11545 @opindex mfdpic
11546
11547 Select the FDPIC ABI, that uses function descriptors to represent
11548 pointers to functions.  Without any PIC/PIE-related options, it
11549 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
11550 assumes GOT entries and small data are within a 12-bit range from the
11551 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
11552 are computed with 32 bits.
11553 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11554
11555 @item -minline-plt
11556 @opindex minline-plt
11557
11558 Enable inlining of PLT entries in function calls to functions that are
11559 not known to bind locally.  It has no effect without @option{-mfdpic}.
11560 It's enabled by default if optimizing for speed and compiling for
11561 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
11562 optimization option such as @option{-O3} or above is present in the
11563 command line.
11564
11565 @item -mTLS
11566 @opindex mTLS
11567
11568 Assume a large TLS segment when generating thread-local code.
11569
11570 @item -mtls
11571 @opindex mtls
11572
11573 Do not assume a large TLS segment when generating thread-local code.
11574
11575 @item -mgprel-ro
11576 @opindex mgprel-ro
11577
11578 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
11579 that is known to be in read-only sections.  It's enabled by default,
11580 except for @option{-fpic} or @option{-fpie}: even though it may help
11581 make the global offset table smaller, it trades 1 instruction for 4.
11582 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
11583 one of which may be shared by multiple symbols, and it avoids the need
11584 for a GOT entry for the referenced symbol, so it's more likely to be a
11585 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
11586
11587 @item -multilib-library-pic
11588 @opindex multilib-library-pic
11589
11590 Link with the (library, not FD) pic libraries.  It's implied by
11591 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
11592 @option{-fpic} without @option{-mfdpic}.  You should never have to use
11593 it explicitly.
11594
11595 @item -mlinked-fp
11596 @opindex mlinked-fp
11597
11598 Follow the EABI requirement of always creating a frame pointer whenever
11599 a stack frame is allocated.  This option is enabled by default and can
11600 be disabled with @option{-mno-linked-fp}.
11601
11602 @item -mlong-calls
11603 @opindex mlong-calls
11604
11605 Use indirect addressing to call functions outside the current
11606 compilation unit.  This allows the functions to be placed anywhere
11607 within the 32-bit address space.
11608
11609 @item -malign-labels
11610 @opindex malign-labels
11611
11612 Try to align labels to an 8-byte boundary by inserting nops into the
11613 previous packet.  This option only has an effect when VLIW packing
11614 is enabled.  It doesn't create new packets; it merely adds nops to
11615 existing ones.
11616
11617 @item -mlibrary-pic
11618 @opindex mlibrary-pic
11619
11620 Generate position-independent EABI code.
11621
11622 @item -macc-4
11623 @opindex macc-4
11624
11625 Use only the first four media accumulator registers.
11626
11627 @item -macc-8
11628 @opindex macc-8
11629
11630 Use all eight media accumulator registers.
11631
11632 @item -mpack
11633 @opindex mpack
11634
11635 Pack VLIW instructions.
11636
11637 @item -mno-pack
11638 @opindex mno-pack
11639
11640 Do not pack VLIW instructions.
11641
11642 @item -mno-eflags
11643 @opindex mno-eflags
11644
11645 Do not mark ABI switches in e_flags.
11646
11647 @item -mcond-move
11648 @opindex mcond-move
11649
11650 Enable the use of conditional-move instructions (default).
11651
11652 This switch is mainly for debugging the compiler and will likely be removed
11653 in a future version.
11654
11655 @item -mno-cond-move
11656 @opindex mno-cond-move
11657
11658 Disable the use of conditional-move instructions.
11659
11660 This switch is mainly for debugging the compiler and will likely be removed
11661 in a future version.
11662
11663 @item -mscc
11664 @opindex mscc
11665
11666 Enable the use of conditional set instructions (default).
11667
11668 This switch is mainly for debugging the compiler and will likely be removed
11669 in a future version.
11670
11671 @item -mno-scc
11672 @opindex mno-scc
11673
11674 Disable the use of conditional set instructions.
11675
11676 This switch is mainly for debugging the compiler and will likely be removed
11677 in a future version.
11678
11679 @item -mcond-exec
11680 @opindex mcond-exec
11681
11682 Enable the use of conditional execution (default).
11683
11684 This switch is mainly for debugging the compiler and will likely be removed
11685 in a future version.
11686
11687 @item -mno-cond-exec
11688 @opindex mno-cond-exec
11689
11690 Disable the use of conditional execution.
11691
11692 This switch is mainly for debugging the compiler and will likely be removed
11693 in a future version.
11694
11695 @item -mvliw-branch
11696 @opindex mvliw-branch
11697
11698 Run a pass to pack branches into VLIW instructions (default).
11699
11700 This switch is mainly for debugging the compiler and will likely be removed
11701 in a future version.
11702
11703 @item -mno-vliw-branch
11704 @opindex mno-vliw-branch
11705
11706 Do not run a pass to pack branches into VLIW instructions.
11707
11708 This switch is mainly for debugging the compiler and will likely be removed
11709 in a future version.
11710
11711 @item -mmulti-cond-exec
11712 @opindex mmulti-cond-exec
11713
11714 Enable optimization of @code{&&} and @code{||} in conditional execution
11715 (default).
11716
11717 This switch is mainly for debugging the compiler and will likely be removed
11718 in a future version.
11719
11720 @item -mno-multi-cond-exec
11721 @opindex mno-multi-cond-exec
11722
11723 Disable optimization of @code{&&} and @code{||} in conditional execution.
11724
11725 This switch is mainly for debugging the compiler and will likely be removed
11726 in a future version.
11727
11728 @item -mnested-cond-exec
11729 @opindex mnested-cond-exec
11730
11731 Enable nested conditional execution optimizations (default).
11732
11733 This switch is mainly for debugging the compiler and will likely be removed
11734 in a future version.
11735
11736 @item -mno-nested-cond-exec
11737 @opindex mno-nested-cond-exec
11738
11739 Disable nested conditional execution optimizations.
11740
11741 This switch is mainly for debugging the compiler and will likely be removed
11742 in a future version.
11743
11744 @item -moptimize-membar
11745 @opindex moptimize-membar
11746
11747 This switch removes redundant @code{membar} instructions from the
11748 compiler generated code.  It is enabled by default.
11749
11750 @item -mno-optimize-membar
11751 @opindex mno-optimize-membar
11752
11753 This switch disables the automatic removal of redundant @code{membar}
11754 instructions from the generated code.
11755
11756 @item -mtomcat-stats
11757 @opindex mtomcat-stats
11758
11759 Cause gas to print out tomcat statistics.
11760
11761 @item -mcpu=@var{cpu}
11762 @opindex mcpu
11763
11764 Select the processor type for which to generate code.  Possible values are
11765 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
11766 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
11767
11768 @end table
11769
11770 @node GNU/Linux Options
11771 @subsection GNU/Linux Options
11772
11773 These @samp{-m} options are defined for GNU/Linux targets:
11774
11775 @table @gcctabopt
11776 @item -mglibc
11777 @opindex mglibc
11778 Use the GNU C library.  This is the default except
11779 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
11780
11781 @item -muclibc
11782 @opindex muclibc
11783 Use uClibc C library.  This is the default on
11784 @samp{*-*-linux-*uclibc*} targets.
11785
11786 @item -mbionic
11787 @opindex mbionic
11788 Use Bionic C library.  This is the default on
11789 @samp{*-*-linux-*android*} targets.
11790
11791 @item -mandroid
11792 @opindex mandroid
11793 Compile code compatible with Android platform.  This is the default on
11794 @samp{*-*-linux-*android*} targets.
11795
11796 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
11797 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
11798 this option makes the GCC driver pass Android-specific options to the linker.
11799 Finally, this option causes the preprocessor macro @code{__ANDROID__}
11800 to be defined.
11801
11802 @item -tno-android-cc
11803 @opindex tno-android-cc
11804 Disable compilation effects of @option{-mandroid}, i.e., do not enable
11805 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
11806 @option{-fno-rtti} by default.
11807
11808 @item -tno-android-ld
11809 @opindex tno-android-ld
11810 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
11811 linking options to the linker.
11812
11813 @end table
11814
11815 @node H8/300 Options
11816 @subsection H8/300 Options
11817
11818 These @samp{-m} options are defined for the H8/300 implementations:
11819
11820 @table @gcctabopt
11821 @item -mrelax
11822 @opindex mrelax
11823 Shorten some address references at link time, when possible; uses the
11824 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
11825 ld, Using ld}, for a fuller description.
11826
11827 @item -mh
11828 @opindex mh
11829 Generate code for the H8/300H@.
11830
11831 @item -ms
11832 @opindex ms
11833 Generate code for the H8S@.
11834
11835 @item -mn
11836 @opindex mn
11837 Generate code for the H8S and H8/300H in the normal mode.  This switch
11838 must be used either with @option{-mh} or @option{-ms}.
11839
11840 @item -ms2600
11841 @opindex ms2600
11842 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
11843
11844 @item -mint32
11845 @opindex mint32
11846 Make @code{int} data 32 bits by default.
11847
11848 @item -malign-300
11849 @opindex malign-300
11850 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
11851 The default for the H8/300H and H8S is to align longs and floats on 4
11852 byte boundaries.
11853 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
11854 This option has no effect on the H8/300.
11855 @end table
11856
11857 @node HPPA Options
11858 @subsection HPPA Options
11859 @cindex HPPA Options
11860
11861 These @samp{-m} options are defined for the HPPA family of computers:
11862
11863 @table @gcctabopt
11864 @item -march=@var{architecture-type}
11865 @opindex march
11866 Generate code for the specified architecture.  The choices for
11867 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
11868 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
11869 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
11870 architecture option for your machine.  Code compiled for lower numbered
11871 architectures will run on higher numbered architectures, but not the
11872 other way around.
11873
11874 @item -mpa-risc-1-0
11875 @itemx -mpa-risc-1-1
11876 @itemx -mpa-risc-2-0
11877 @opindex mpa-risc-1-0
11878 @opindex mpa-risc-1-1
11879 @opindex mpa-risc-2-0
11880 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
11881
11882 @item -mbig-switch
11883 @opindex mbig-switch
11884 Generate code suitable for big switch tables.  Use this option only if
11885 the assembler/linker complain about out of range branches within a switch
11886 table.
11887
11888 @item -mjump-in-delay
11889 @opindex mjump-in-delay
11890 Fill delay slots of function calls with unconditional jump instructions
11891 by modifying the return pointer for the function call to be the target
11892 of the conditional jump.
11893
11894 @item -mdisable-fpregs
11895 @opindex mdisable-fpregs
11896 Prevent floating point registers from being used in any manner.  This is
11897 necessary for compiling kernels which perform lazy context switching of
11898 floating point registers.  If you use this option and attempt to perform
11899 floating point operations, the compiler will abort.
11900
11901 @item -mdisable-indexing
11902 @opindex mdisable-indexing
11903 Prevent the compiler from using indexing address modes.  This avoids some
11904 rather obscure problems when compiling MIG generated code under MACH@.
11905
11906 @item -mno-space-regs
11907 @opindex mno-space-regs
11908 Generate code that assumes the target has no space registers.  This allows
11909 GCC to generate faster indirect calls and use unscaled index address modes.
11910
11911 Such code is suitable for level 0 PA systems and kernels.
11912
11913 @item -mfast-indirect-calls
11914 @opindex mfast-indirect-calls
11915 Generate code that assumes calls never cross space boundaries.  This
11916 allows GCC to emit code which performs faster indirect calls.
11917
11918 This option will not work in the presence of shared libraries or nested
11919 functions.
11920
11921 @item -mfixed-range=@var{register-range}
11922 @opindex mfixed-range
11923 Generate code treating the given register range as fixed registers.
11924 A fixed register is one that the register allocator can not use.  This is
11925 useful when compiling kernel code.  A register range is specified as
11926 two registers separated by a dash.  Multiple register ranges can be
11927 specified separated by a comma.
11928
11929 @item -mlong-load-store
11930 @opindex mlong-load-store
11931 Generate 3-instruction load and store sequences as sometimes required by
11932 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
11933 the HP compilers.
11934
11935 @item -mportable-runtime
11936 @opindex mportable-runtime
11937 Use the portable calling conventions proposed by HP for ELF systems.
11938
11939 @item -mgas
11940 @opindex mgas
11941 Enable the use of assembler directives only GAS understands.
11942
11943 @item -mschedule=@var{cpu-type}
11944 @opindex mschedule
11945 Schedule code according to the constraints for the machine type
11946 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
11947 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
11948 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
11949 proper scheduling option for your machine.  The default scheduling is
11950 @samp{8000}.
11951
11952 @item -mlinker-opt
11953 @opindex mlinker-opt
11954 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
11955 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
11956 linkers in which they give bogus error messages when linking some programs.
11957
11958 @item -msoft-float
11959 @opindex msoft-float
11960 Generate output containing library calls for floating point.
11961 @strong{Warning:} the requisite libraries are not available for all HPPA
11962 targets.  Normally the facilities of the machine's usual C compiler are
11963 used, but this cannot be done directly in cross-compilation.  You must make
11964 your own arrangements to provide suitable library functions for
11965 cross-compilation.
11966
11967 @option{-msoft-float} changes the calling convention in the output file;
11968 therefore, it is only useful if you compile @emph{all} of a program with
11969 this option.  In particular, you need to compile @file{libgcc.a}, the
11970 library that comes with GCC, with @option{-msoft-float} in order for
11971 this to work.
11972
11973 @item -msio
11974 @opindex msio
11975 Generate the predefine, @code{_SIO}, for server IO@.  The default is
11976 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
11977 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
11978 options are available under HP-UX and HI-UX@.
11979
11980 @item -mgnu-ld
11981 @opindex mgnu-ld
11982 Use GNU ld specific options.  This passes @option{-shared} to ld when
11983 building a shared library.  It is the default when GCC is configured,
11984 explicitly or implicitly, with the GNU linker.  This option does not
11985 have any affect on which ld is called, it only changes what parameters
11986 are passed to that ld.  The ld that is called is determined by the
11987 @option{--with-ld} configure option, GCC's program search path, and
11988 finally by the user's @env{PATH}.  The linker used by GCC can be printed
11989 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
11990 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11991
11992 @item -mhp-ld
11993 @opindex mhp-ld
11994 Use HP ld specific options.  This passes @option{-b} to ld when building
11995 a shared library and passes @option{+Accept TypeMismatch} to ld on all
11996 links.  It is the default when GCC is configured, explicitly or
11997 implicitly, with the HP linker.  This option does not have any affect on
11998 which ld is called, it only changes what parameters are passed to that
11999 ld.  The ld that is called is determined by the @option{--with-ld}
12000 configure option, GCC's program search path, and finally by the user's
12001 @env{PATH}.  The linker used by GCC can be printed using @samp{which
12002 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
12003 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12004
12005 @item -mlong-calls
12006 @opindex mno-long-calls
12007 Generate code that uses long call sequences.  This ensures that a call
12008 is always able to reach linker generated stubs.  The default is to generate
12009 long calls only when the distance from the call site to the beginning
12010 of the function or translation unit, as the case may be, exceeds a
12011 predefined limit set by the branch type being used.  The limits for
12012 normal calls are 7,600,000 and 240,000 bytes, respectively for the
12013 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
12014 240,000 bytes.
12015
12016 Distances are measured from the beginning of functions when using the
12017 @option{-ffunction-sections} option, or when using the @option{-mgas}
12018 and @option{-mno-portable-runtime} options together under HP-UX with
12019 the SOM linker.
12020
12021 It is normally not desirable to use this option as it will degrade
12022 performance.  However, it may be useful in large applications,
12023 particularly when partial linking is used to build the application.
12024
12025 The types of long calls used depends on the capabilities of the
12026 assembler and linker, and the type of code being generated.  The
12027 impact on systems that support long absolute calls, and long pic
12028 symbol-difference or pc-relative calls should be relatively small.
12029 However, an indirect call is used on 32-bit ELF systems in pic code
12030 and it is quite long.
12031
12032 @item -munix=@var{unix-std}
12033 @opindex march
12034 Generate compiler predefines and select a startfile for the specified
12035 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
12036 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
12037 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
12038 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
12039 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
12040 and later.
12041
12042 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
12043 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
12044 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
12045 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
12046 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
12047 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
12048
12049 It is @emph{important} to note that this option changes the interfaces
12050 for various library routines.  It also affects the operational behavior
12051 of the C library.  Thus, @emph{extreme} care is needed in using this
12052 option.
12053
12054 Library code that is intended to operate with more than one UNIX
12055 standard must test, set and restore the variable @var{__xpg4_extended_mask}
12056 as appropriate.  Most GNU software doesn't provide this capability.
12057
12058 @item -nolibdld
12059 @opindex nolibdld
12060 Suppress the generation of link options to search libdld.sl when the
12061 @option{-static} option is specified on HP-UX 10 and later.
12062
12063 @item -static
12064 @opindex static
12065 The HP-UX implementation of setlocale in libc has a dependency on
12066 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
12067 when the @option{-static} option is specified, special link options
12068 are needed to resolve this dependency.
12069
12070 On HP-UX 10 and later, the GCC driver adds the necessary options to
12071 link with libdld.sl when the @option{-static} option is specified.
12072 This causes the resulting binary to be dynamic.  On the 64-bit port,
12073 the linkers generate dynamic binaries by default in any case.  The
12074 @option{-nolibdld} option can be used to prevent the GCC driver from
12075 adding these link options.
12076
12077 @item -threads
12078 @opindex threads
12079 Add support for multithreading with the @dfn{dce thread} library
12080 under HP-UX@.  This option sets flags for both the preprocessor and
12081 linker.
12082 @end table
12083
12084 @node i386 and x86-64 Options
12085 @subsection Intel 386 and AMD x86-64 Options
12086 @cindex i386 Options
12087 @cindex x86-64 Options
12088 @cindex Intel 386 Options
12089 @cindex AMD x86-64 Options
12090
12091 These @samp{-m} options are defined for the i386 and x86-64 family of
12092 computers:
12093
12094 @table @gcctabopt
12095 @item -mtune=@var{cpu-type}
12096 @opindex mtune
12097 Tune to @var{cpu-type} everything applicable about the generated code, except
12098 for the ABI and the set of available instructions.  The choices for
12099 @var{cpu-type} are:
12100 @table @emph
12101 @item generic
12102 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
12103 If you know the CPU on which your code will run, then you should use
12104 the corresponding @option{-mtune} option instead of
12105 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
12106 of your application will have, then you should use this option.
12107
12108 As new processors are deployed in the marketplace, the behavior of this
12109 option will change.  Therefore, if you upgrade to a newer version of
12110 GCC, the code generated option will change to reflect the processors
12111 that were most common when that version of GCC was released.
12112
12113 There is no @option{-march=generic} option because @option{-march}
12114 indicates the instruction set the compiler can use, and there is no
12115 generic instruction set applicable to all processors.  In contrast,
12116 @option{-mtune} indicates the processor (or, in this case, collection of
12117 processors) for which the code is optimized.
12118 @item native
12119 This selects the CPU to tune for at compilation time by determining
12120 the processor type of the compiling machine.  Using @option{-mtune=native}
12121 will produce code optimized for the local machine under the constraints
12122 of the selected instruction set.  Using @option{-march=native} will
12123 enable all instruction subsets supported by the local machine (hence
12124 the result might not run on different machines).
12125 @item i386
12126 Original Intel's i386 CPU@.
12127 @item i486
12128 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
12129 @item i586, pentium
12130 Intel Pentium CPU with no MMX support.
12131 @item pentium-mmx
12132 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
12133 @item pentiumpro
12134 Intel PentiumPro CPU@.
12135 @item i686
12136 Same as @code{generic}, but when used as @code{march} option, PentiumPro
12137 instruction set will be used, so the code will run on all i686 family chips.
12138 @item pentium2
12139 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
12140 @item pentium3, pentium3m
12141 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
12142 support.
12143 @item pentium-m
12144 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
12145 support.  Used by Centrino notebooks.
12146 @item pentium4, pentium4m
12147 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
12148 @item prescott
12149 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
12150 set support.
12151 @item nocona
12152 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
12153 SSE2 and SSE3 instruction set support.
12154 @item core2
12155 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12156 instruction set support.
12157 @item corei7
12158 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
12159 and SSE4.2 instruction set support.
12160 @item corei7-avx
12161 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
12162 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
12163 @item atom
12164 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12165 instruction set support.
12166 @item k6
12167 AMD K6 CPU with MMX instruction set support.
12168 @item k6-2, k6-3
12169 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
12170 @item athlon, athlon-tbird
12171 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
12172 support.
12173 @item athlon-4, athlon-xp, athlon-mp
12174 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
12175 instruction set support.
12176 @item k8, opteron, athlon64, athlon-fx
12177 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
12178 MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit instruction set extensions.)
12179 @item k8-sse3, opteron-sse3, athlon64-sse3
12180 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
12181 @item amdfam10, barcelona
12182 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
12183 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
12184 instruction set extensions.)
12185 @item winchip-c6
12186 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
12187 set support.
12188 @item winchip2
12189 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
12190 instruction set support.
12191 @item c3
12192 Via C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
12193 implemented for this chip.)
12194 @item c3-2
12195 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
12196 implemented for this chip.)
12197 @item geode
12198 Embedded AMD CPU with MMX and 3DNow!@: instruction set support.
12199 @end table
12200
12201 While picking a specific @var{cpu-type} will schedule things appropriately
12202 for that particular chip, the compiler will not generate any code that
12203 does not run on the i386 without the @option{-march=@var{cpu-type}} option
12204 being used.
12205
12206 @item -march=@var{cpu-type}
12207 @opindex march
12208 Generate instructions for the machine type @var{cpu-type}.  The choices
12209 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
12210 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
12211
12212 @item -mcpu=@var{cpu-type}
12213 @opindex mcpu
12214 A deprecated synonym for @option{-mtune}.
12215
12216 @item -mfpmath=@var{unit}
12217 @opindex mfpmath
12218 Generate floating point arithmetics for selected unit @var{unit}.  The choices
12219 for @var{unit} are:
12220
12221 @table @samp
12222 @item 387
12223 Use the standard 387 floating point coprocessor present majority of chips and
12224 emulated otherwise.  Code compiled with this option will run almost everywhere.
12225 The temporary results are computed in 80bit precision instead of precision
12226 specified by the type resulting in slightly different results compared to most
12227 of other chips.  See @option{-ffloat-store} for more detailed description.
12228
12229 This is the default choice for i386 compiler.
12230
12231 @item sse
12232 Use scalar floating point instructions present in the SSE instruction set.
12233 This instruction set is supported by Pentium3 and newer chips, in the AMD line
12234 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
12235 instruction set supports only single precision arithmetics, thus the double and
12236 extended precision arithmetics is still done using 387.  Later version, present
12237 only in Pentium4 and the future AMD x86-64 chips supports double precision
12238 arithmetics too.
12239
12240 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
12241 or @option{-msse2} switches to enable SSE extensions and make this option
12242 effective.  For the x86-64 compiler, these extensions are enabled by default.
12243
12244 The resulting code should be considerably faster in the majority of cases and avoid
12245 the numerical instability problems of 387 code, but may break some existing
12246 code that expects temporaries to be 80bit.
12247
12248 This is the default choice for the x86-64 compiler.
12249
12250 @item sse,387
12251 @itemx sse+387
12252 @itemx both
12253 Attempt to utilize both instruction sets at once.  This effectively double the
12254 amount of available registers and on chips with separate execution units for
12255 387 and SSE the execution resources too.  Use this option with care, as it is
12256 still experimental, because the GCC register allocator does not model separate
12257 functional units well resulting in instable performance.
12258 @end table
12259
12260 @item -masm=@var{dialect}
12261 @opindex masm=@var{dialect}
12262 Output asm instructions using selected @var{dialect}.  Supported
12263 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
12264 not support @samp{intel}.
12265
12266 @item -mieee-fp
12267 @itemx -mno-ieee-fp
12268 @opindex mieee-fp
12269 @opindex mno-ieee-fp
12270 Control whether or not the compiler uses IEEE floating point
12271 comparisons.  These handle correctly the case where the result of a
12272 comparison is unordered.
12273
12274 @item -msoft-float
12275 @opindex msoft-float
12276 Generate output containing library calls for floating point.
12277 @strong{Warning:} the requisite libraries are not part of GCC@.
12278 Normally the facilities of the machine's usual C compiler are used, but
12279 this can't be done directly in cross-compilation.  You must make your
12280 own arrangements to provide suitable library functions for
12281 cross-compilation.
12282
12283 On machines where a function returns floating point results in the 80387
12284 register stack, some floating point opcodes may be emitted even if
12285 @option{-msoft-float} is used.
12286
12287 @item -mno-fp-ret-in-387
12288 @opindex mno-fp-ret-in-387
12289 Do not use the FPU registers for return values of functions.
12290
12291 The usual calling convention has functions return values of types
12292 @code{float} and @code{double} in an FPU register, even if there
12293 is no FPU@.  The idea is that the operating system should emulate
12294 an FPU@.
12295
12296 The option @option{-mno-fp-ret-in-387} causes such values to be returned
12297 in ordinary CPU registers instead.
12298
12299 @item -mno-fancy-math-387
12300 @opindex mno-fancy-math-387
12301 Some 387 emulators do not support the @code{sin}, @code{cos} and
12302 @code{sqrt} instructions for the 387.  Specify this option to avoid
12303 generating those instructions.  This option is the default on FreeBSD,
12304 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
12305 indicates that the target CPU will always have an FPU and so the
12306 instruction will not need emulation.  As of revision 2.6.1, these
12307 instructions are not generated unless you also use the
12308 @option{-funsafe-math-optimizations} switch.
12309
12310 @item -malign-double
12311 @itemx -mno-align-double
12312 @opindex malign-double
12313 @opindex mno-align-double
12314 Control whether GCC aligns @code{double}, @code{long double}, and
12315 @code{long long} variables on a two word boundary or a one word
12316 boundary.  Aligning @code{double} variables on a two word boundary will
12317 produce code that runs somewhat faster on a @samp{Pentium} at the
12318 expense of more memory.
12319
12320 On x86-64, @option{-malign-double} is enabled by default.
12321
12322 @strong{Warning:} if you use the @option{-malign-double} switch,
12323 structures containing the above types will be aligned differently than
12324 the published application binary interface specifications for the 386
12325 and will not be binary compatible with structures in code compiled
12326 without that switch.
12327
12328 @item -m96bit-long-double
12329 @itemx -m128bit-long-double
12330 @opindex m96bit-long-double
12331 @opindex m128bit-long-double
12332 These switches control the size of @code{long double} type.  The i386
12333 application binary interface specifies the size to be 96 bits,
12334 so @option{-m96bit-long-double} is the default in 32 bit mode.
12335
12336 Modern architectures (Pentium and newer) would prefer @code{long double}
12337 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
12338 conforming to the ABI, this would not be possible.  So specifying a
12339 @option{-m128bit-long-double} will align @code{long double}
12340 to a 16 byte boundary by padding the @code{long double} with an additional
12341 32 bit zero.
12342
12343 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
12344 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
12345
12346 Notice that neither of these options enable any extra precision over the x87
12347 standard of 80 bits for a @code{long double}.
12348
12349 @strong{Warning:} if you override the default value for your target ABI, the
12350 structures and arrays containing @code{long double} variables will change
12351 their size as well as function calling convention for function taking
12352 @code{long double} will be modified.  Hence they will not be binary
12353 compatible with arrays or structures in code compiled without that switch.
12354
12355 @item -mlarge-data-threshold=@var{number}
12356 @opindex mlarge-data-threshold=@var{number}
12357 When @option{-mcmodel=medium} is specified, the data greater than
12358 @var{threshold} are placed in large data section.  This value must be the
12359 same across all object linked into the binary and defaults to 65535.
12360
12361 @item -mrtd
12362 @opindex mrtd
12363 Use a different function-calling convention, in which functions that
12364 take a fixed number of arguments return with the @code{ret} @var{num}
12365 instruction, which pops their arguments while returning.  This saves one
12366 instruction in the caller since there is no need to pop the arguments
12367 there.
12368
12369 You can specify that an individual function is called with this calling
12370 sequence with the function attribute @samp{stdcall}.  You can also
12371 override the @option{-mrtd} option by using the function attribute
12372 @samp{cdecl}.  @xref{Function Attributes}.
12373
12374 @strong{Warning:} this calling convention is incompatible with the one
12375 normally used on Unix, so you cannot use it if you need to call
12376 libraries compiled with the Unix compiler.
12377
12378 Also, you must provide function prototypes for all functions that
12379 take variable numbers of arguments (including @code{printf});
12380 otherwise incorrect code will be generated for calls to those
12381 functions.
12382
12383 In addition, seriously incorrect code will result if you call a
12384 function with too many arguments.  (Normally, extra arguments are
12385 harmlessly ignored.)
12386
12387 @item -mregparm=@var{num}
12388 @opindex mregparm
12389 Control how many registers are used to pass integer arguments.  By
12390 default, no registers are used to pass arguments, and at most 3
12391 registers can be used.  You can control this behavior for a specific
12392 function by using the function attribute @samp{regparm}.
12393 @xref{Function Attributes}.
12394
12395 @strong{Warning:} if you use this switch, and
12396 @var{num} is nonzero, then you must build all modules with the same
12397 value, including any libraries.  This includes the system libraries and
12398 startup modules.
12399
12400 @item -msseregparm
12401 @opindex msseregparm
12402 Use SSE register passing conventions for float and double arguments
12403 and return values.  You can control this behavior for a specific
12404 function by using the function attribute @samp{sseregparm}.
12405 @xref{Function Attributes}.
12406
12407 @strong{Warning:} if you use this switch then you must build all
12408 modules with the same value, including any libraries.  This includes
12409 the system libraries and startup modules.
12410
12411 @item -mvect8-ret-in-mem
12412 @opindex mvect8-ret-in-mem
12413 Return 8-byte vectors in memory instead of MMX registers.  This is the
12414 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
12415 Studio compilers until version 12.  Later compiler versions (starting
12416 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
12417 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
12418 you need to remain compatible with existing code produced by those
12419 previous compiler versions or older versions of GCC.
12420
12421 @item -mpc32
12422 @itemx -mpc64
12423 @itemx -mpc80
12424 @opindex mpc32
12425 @opindex mpc64
12426 @opindex mpc80
12427
12428 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
12429 is specified, the significands of results of floating-point operations are
12430 rounded to 24 bits (single precision); @option{-mpc64} rounds the
12431 significands of results of floating-point operations to 53 bits (double
12432 precision) and @option{-mpc80} rounds the significands of results of
12433 floating-point operations to 64 bits (extended double precision), which is
12434 the default.  When this option is used, floating-point operations in higher
12435 precisions are not available to the programmer without setting the FPU
12436 control word explicitly.
12437
12438 Setting the rounding of floating-point operations to less than the default
12439 80 bits can speed some programs by 2% or more.  Note that some mathematical
12440 libraries assume that extended precision (80 bit) floating-point operations
12441 are enabled by default; routines in such libraries could suffer significant
12442 loss of accuracy, typically through so-called "catastrophic cancellation",
12443 when this option is used to set the precision to less than extended precision.
12444
12445 @item -mstackrealign
12446 @opindex mstackrealign
12447 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
12448 option will generate an alternate prologue and epilogue that realigns the
12449 runtime stack if necessary.  This supports mixing legacy codes that keep
12450 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
12451 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
12452 applicable to individual functions.
12453
12454 @item -mpreferred-stack-boundary=@var{num}
12455 @opindex mpreferred-stack-boundary
12456 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
12457 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
12458 the default is 4 (16 bytes or 128 bits).
12459
12460 @item -mincoming-stack-boundary=@var{num}
12461 @opindex mincoming-stack-boundary
12462 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
12463 boundary.  If @option{-mincoming-stack-boundary} is not specified,
12464 the one specified by @option{-mpreferred-stack-boundary} will be used.
12465
12466 On Pentium and PentiumPro, @code{double} and @code{long double} values
12467 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
12468 suffer significant run time performance penalties.  On Pentium III, the
12469 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
12470 properly if it is not 16 byte aligned.
12471
12472 To ensure proper alignment of this values on the stack, the stack boundary
12473 must be as aligned as that required by any value stored on the stack.
12474 Further, every function must be generated such that it keeps the stack
12475 aligned.  Thus calling a function compiled with a higher preferred
12476 stack boundary from a function compiled with a lower preferred stack
12477 boundary will most likely misalign the stack.  It is recommended that
12478 libraries that use callbacks always use the default setting.
12479
12480 This extra alignment does consume extra stack space, and generally
12481 increases code size.  Code that is sensitive to stack space usage, such
12482 as embedded systems and operating system kernels, may want to reduce the
12483 preferred alignment to @option{-mpreferred-stack-boundary=2}.
12484
12485 @item -mmmx
12486 @itemx -mno-mmx
12487 @itemx -msse
12488 @itemx -mno-sse
12489 @itemx -msse2
12490 @itemx -mno-sse2
12491 @itemx -msse3
12492 @itemx -mno-sse3
12493 @itemx -mssse3
12494 @itemx -mno-ssse3
12495 @itemx -msse4.1
12496 @need 800
12497 @itemx -mno-sse4.1
12498 @itemx -msse4.2
12499 @itemx -mno-sse4.2
12500 @itemx -msse4
12501 @itemx -mno-sse4
12502 @itemx -mavx
12503 @itemx -mno-avx
12504 @itemx -maes
12505 @itemx -mno-aes
12506 @itemx -mpclmul
12507 @need 800
12508 @itemx -mno-pclmul
12509 @itemx -mfsgsbase
12510 @itemx -mno-fsgsbase
12511 @itemx -mrdrnd
12512 @itemx -mno-rdrnd
12513 @itemx -mf16c
12514 @itemx -mno-f16c
12515 @itemx -msse4a
12516 @itemx -mno-sse4a
12517 @itemx -mfma4
12518 @need 800
12519 @itemx -mno-fma4
12520 @itemx -mxop
12521 @itemx -mno-xop
12522 @itemx -mlwp
12523 @itemx -mno-lwp
12524 @itemx -m3dnow
12525 @itemx -mno-3dnow
12526 @itemx -mpopcnt
12527 @itemx -mno-popcnt
12528 @itemx -mabm
12529 @itemx -mno-abm
12530 @itemx -mbmi
12531 @itemx -mno-bmi
12532 @itemx -mtbm
12533 @itemx -mno-tbm
12534 @opindex mmmx
12535 @opindex mno-mmx
12536 @opindex msse
12537 @opindex mno-sse
12538 @opindex m3dnow
12539 @opindex mno-3dnow
12540 These switches enable or disable the use of instructions in the MMX,
12541 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, FSGSBASE, RDRND,
12542 F16C, SSE4A, FMA4, XOP, LWP, ABM, BMI, or 3DNow!@: extended instruction sets.
12543 These extensions are also available as built-in functions: see
12544 @ref{X86 Built-in Functions}, for details of the functions enabled and
12545 disabled by these switches.
12546
12547 To have SSE/SSE2 instructions generated automatically from floating-point
12548 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
12549
12550 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
12551 generates new AVX instructions or AVX equivalence for all SSEx instructions
12552 when needed.
12553
12554 These options will enable GCC to use these extended instructions in
12555 generated code, even without @option{-mfpmath=sse}.  Applications which
12556 perform runtime CPU detection must compile separate files for each
12557 supported architecture, using the appropriate flags.  In particular,
12558 the file containing the CPU detection code should be compiled without
12559 these options.
12560
12561 @item -mfused-madd
12562 @itemx -mno-fused-madd
12563 @opindex mfused-madd
12564 @opindex mno-fused-madd
12565 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12566 instructions.  The default is to use these instructions.
12567
12568 @item -mcld
12569 @opindex mcld
12570 This option instructs GCC to emit a @code{cld} instruction in the prologue
12571 of functions that use string instructions.  String instructions depend on
12572 the DF flag to select between autoincrement or autodecrement mode.  While the
12573 ABI specifies the DF flag to be cleared on function entry, some operating
12574 systems violate this specification by not clearing the DF flag in their
12575 exception dispatchers.  The exception handler can be invoked with the DF flag
12576 set which leads to wrong direction mode, when string instructions are used.
12577 This option can be enabled by default on 32-bit x86 targets by configuring
12578 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
12579 instructions can be suppressed with the @option{-mno-cld} compiler option
12580 in this case.
12581
12582 @item -mvzeroupper
12583 @opindex mvzeroupper
12584 This option instructs GCC to emit a @code{vzeroupper} instruction
12585 before a transfer of control flow out of the function to minimize
12586 AVX to SSE transition penalty as well as remove unnecessary zeroupper 
12587 intrinsics.
12588
12589 @item -mcx16
12590 @opindex mcx16
12591 This option will enable GCC to use CMPXCHG16B instruction in generated code.
12592 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
12593 data types.  This is useful for high resolution counters that could be updated
12594 by multiple processors (or cores).  This instruction is generated as part of
12595 atomic built-in functions: see @ref{Atomic Builtins} for details.
12596
12597 @item -msahf
12598 @opindex msahf
12599 This option will enable GCC to use SAHF instruction in generated 64-bit code.
12600 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
12601 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
12602 SAHF are load and store instructions, respectively, for certain status flags.
12603 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
12604 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
12605
12606 @item -mmovbe
12607 @opindex mmovbe
12608 This option will enable GCC to use movbe instruction to implement
12609 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
12610
12611 @item -mcrc32
12612 @opindex mcrc32
12613 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
12614 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
12615 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
12616
12617 @item -mrecip
12618 @opindex mrecip
12619 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
12620 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
12621 to increase precision instead of DIVSS and SQRTSS (and their vectorized
12622 variants) for single precision floating point arguments.  These instructions
12623 are generated only when @option{-funsafe-math-optimizations} is enabled
12624 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
12625 Note that while the throughput of the sequence is higher than the throughput
12626 of the non-reciprocal instruction, the precision of the sequence can be
12627 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
12628
12629 Note that GCC implements 1.0f/sqrtf(x) in terms of RSQRTSS (or RSQRTPS)
12630 already with @option{-ffast-math} (or the above option combination), and
12631 doesn't need @option{-mrecip}.
12632
12633 @item -mveclibabi=@var{type}
12634 @opindex mveclibabi
12635 Specifies the ABI type to use for vectorizing intrinsics using an
12636 external library.  Supported types are @code{svml} for the Intel short
12637 vector math library and @code{acml} for the AMD math core library style
12638 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
12639 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
12640 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
12641 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
12642 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
12643 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
12644 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
12645 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
12646 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
12647 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
12648 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
12649 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
12650 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
12651 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
12652 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
12653 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
12654 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
12655 compatible library will have to be specified at link time.
12656
12657 @item -mabi=@var{name}
12658 @opindex mabi
12659 Generate code for the specified calling convention.  Permissible values
12660 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
12661 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
12662 ABI when targeting Windows.  On all other systems, the default is the
12663 SYSV ABI.  You can control this behavior for a specific function by
12664 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
12665 @xref{Function Attributes}.
12666
12667 @item -mpush-args
12668 @itemx -mno-push-args
12669 @opindex mpush-args
12670 @opindex mno-push-args
12671 Use PUSH operations to store outgoing parameters.  This method is shorter
12672 and usually equally fast as method using SUB/MOV operations and is enabled
12673 by default.  In some cases disabling it may improve performance because of
12674 improved scheduling and reduced dependencies.
12675
12676 @item -maccumulate-outgoing-args
12677 @opindex maccumulate-outgoing-args
12678 If enabled, the maximum amount of space required for outgoing arguments will be
12679 computed in the function prologue.  This is faster on most modern CPUs
12680 because of reduced dependencies, improved scheduling and reduced stack usage
12681 when preferred stack boundary is not equal to 2.  The drawback is a notable
12682 increase in code size.  This switch implies @option{-mno-push-args}.
12683
12684 @item -mthreads
12685 @opindex mthreads
12686 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
12687 on thread-safe exception handling must compile and link all code with the
12688 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
12689 @option{-D_MT}; when linking, it links in a special thread helper library
12690 @option{-lmingwthrd} which cleans up per thread exception handling data.
12691
12692 @item -mno-align-stringops
12693 @opindex mno-align-stringops
12694 Do not align destination of inlined string operations.  This switch reduces
12695 code size and improves performance in case the destination is already aligned,
12696 but GCC doesn't know about it.
12697
12698 @item -minline-all-stringops
12699 @opindex minline-all-stringops
12700 By default GCC inlines string operations only when destination is known to be
12701 aligned at least to 4 byte boundary.  This enables more inlining, increase code
12702 size, but may improve performance of code that depends on fast memcpy, strlen
12703 and memset for short lengths.
12704
12705 @item -minline-stringops-dynamically
12706 @opindex minline-stringops-dynamically
12707 For string operation of unknown size, inline runtime checks so for small
12708 blocks inline code is used, while for large blocks library call is used.
12709
12710 @item -mstringop-strategy=@var{alg}
12711 @opindex mstringop-strategy=@var{alg}
12712 Overwrite internal decision heuristic about particular algorithm to inline
12713 string operation with.  The allowed values are @code{rep_byte},
12714 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
12715 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
12716 expanding inline loop, @code{libcall} for always expanding library call.
12717
12718 @item -momit-leaf-frame-pointer
12719 @opindex momit-leaf-frame-pointer
12720 Don't keep the frame pointer in a register for leaf functions.  This
12721 avoids the instructions to save, set up and restore frame pointers and
12722 makes an extra register available in leaf functions.  The option
12723 @option{-fomit-frame-pointer} removes the frame pointer for all functions
12724 which might make debugging harder.
12725
12726 @item -mtls-direct-seg-refs
12727 @itemx -mno-tls-direct-seg-refs
12728 @opindex mtls-direct-seg-refs
12729 Controls whether TLS variables may be accessed with offsets from the
12730 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
12731 or whether the thread base pointer must be added.  Whether or not this
12732 is legal depends on the operating system, and whether it maps the
12733 segment to cover the entire TLS area.
12734
12735 For systems that use GNU libc, the default is on.
12736
12737 @item -msse2avx
12738 @itemx -mno-sse2avx
12739 @opindex msse2avx
12740 Specify that the assembler should encode SSE instructions with VEX
12741 prefix.  The option @option{-mavx} turns this on by default.
12742
12743 @item -mfentry
12744 @itemx -mno-fentry
12745 @opindex mfentry
12746 If profiling is active @option{-pg} put the profiling
12747 counter call before prologue.
12748 Note: On x86 architectures the attribute @code{ms_hook_prologue}
12749 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
12750
12751 @item -m8bit-idiv
12752 @itemx -mno-8bit-idiv
12753 @opindex 8bit-idiv
12754 On some processors, like Intel Atom, 8bit unsigned integer divide is
12755 much faster than 32bit/64bit integer divide.  This option will generate a
12756 runt-time check.  If both dividend and divisor are within range of 0
12757 to 255, 8bit unsigned integer divide will be used instead of
12758 32bit/64bit integer divide.
12759
12760 @end table
12761
12762 These @samp{-m} switches are supported in addition to the above
12763 on AMD x86-64 processors in 64-bit environments.
12764
12765 @table @gcctabopt
12766 @item -m32
12767 @itemx -m64
12768 @opindex m32
12769 @opindex m64
12770 Generate code for a 32-bit or 64-bit environment.
12771 The 32-bit environment sets int, long and pointer to 32 bits and
12772 generates code that runs on any i386 system.
12773 The 64-bit environment sets int to 32 bits and long and pointer
12774 to 64 bits and generates code for AMD's x86-64 architecture. For
12775 darwin only the -m64 option turns off the @option{-fno-pic} and
12776 @option{-mdynamic-no-pic} options.
12777
12778 @item -mno-red-zone
12779 @opindex mno-red-zone
12780 Do not use a so called red zone for x86-64 code.  The red zone is mandated
12781 by the x86-64 ABI, it is a 128-byte area beyond the location of the
12782 stack pointer that will not be modified by signal or interrupt handlers
12783 and therefore can be used for temporary data without adjusting the stack
12784 pointer.  The flag @option{-mno-red-zone} disables this red zone.
12785
12786 @item -mcmodel=small
12787 @opindex mcmodel=small
12788 Generate code for the small code model: the program and its symbols must
12789 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
12790 Programs can be statically or dynamically linked.  This is the default
12791 code model.
12792
12793 @item -mcmodel=kernel
12794 @opindex mcmodel=kernel
12795 Generate code for the kernel code model.  The kernel runs in the
12796 negative 2 GB of the address space.
12797 This model has to be used for Linux kernel code.
12798
12799 @item -mcmodel=medium
12800 @opindex mcmodel=medium
12801 Generate code for the medium model: The program is linked in the lower 2
12802 GB of the address space.  Small symbols are also placed there.  Symbols
12803 with sizes larger than @option{-mlarge-data-threshold} are put into
12804 large data or bss sections and can be located above 2GB.  Programs can
12805 be statically or dynamically linked.
12806
12807 @item -mcmodel=large
12808 @opindex mcmodel=large
12809 Generate code for the large model: This model makes no assumptions
12810 about addresses and sizes of sections.
12811 @end table
12812
12813 @node IA-64 Options
12814 @subsection IA-64 Options
12815 @cindex IA-64 Options
12816
12817 These are the @samp{-m} options defined for the Intel IA-64 architecture.
12818
12819 @table @gcctabopt
12820 @item -mbig-endian
12821 @opindex mbig-endian
12822 Generate code for a big endian target.  This is the default for HP-UX@.
12823
12824 @item -mlittle-endian
12825 @opindex mlittle-endian
12826 Generate code for a little endian target.  This is the default for AIX5
12827 and GNU/Linux.
12828
12829 @item -mgnu-as
12830 @itemx -mno-gnu-as
12831 @opindex mgnu-as
12832 @opindex mno-gnu-as
12833 Generate (or don't) code for the GNU assembler.  This is the default.
12834 @c Also, this is the default if the configure option @option{--with-gnu-as}
12835 @c is used.
12836
12837 @item -mgnu-ld
12838 @itemx -mno-gnu-ld
12839 @opindex mgnu-ld
12840 @opindex mno-gnu-ld
12841 Generate (or don't) code for the GNU linker.  This is the default.
12842 @c Also, this is the default if the configure option @option{--with-gnu-ld}
12843 @c is used.
12844
12845 @item -mno-pic
12846 @opindex mno-pic
12847 Generate code that does not use a global pointer register.  The result
12848 is not position independent code, and violates the IA-64 ABI@.
12849
12850 @item -mvolatile-asm-stop
12851 @itemx -mno-volatile-asm-stop
12852 @opindex mvolatile-asm-stop
12853 @opindex mno-volatile-asm-stop
12854 Generate (or don't) a stop bit immediately before and after volatile asm
12855 statements.
12856
12857 @item -mregister-names
12858 @itemx -mno-register-names
12859 @opindex mregister-names
12860 @opindex mno-register-names
12861 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
12862 the stacked registers.  This may make assembler output more readable.
12863
12864 @item -mno-sdata
12865 @itemx -msdata
12866 @opindex mno-sdata
12867 @opindex msdata
12868 Disable (or enable) optimizations that use the small data section.  This may
12869 be useful for working around optimizer bugs.
12870
12871 @item -mconstant-gp
12872 @opindex mconstant-gp
12873 Generate code that uses a single constant global pointer value.  This is
12874 useful when compiling kernel code.
12875
12876 @item -mauto-pic
12877 @opindex mauto-pic
12878 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
12879 This is useful when compiling firmware code.
12880
12881 @item -minline-float-divide-min-latency
12882 @opindex minline-float-divide-min-latency
12883 Generate code for inline divides of floating point values
12884 using the minimum latency algorithm.
12885
12886 @item -minline-float-divide-max-throughput
12887 @opindex minline-float-divide-max-throughput
12888 Generate code for inline divides of floating point values
12889 using the maximum throughput algorithm.
12890
12891 @item -mno-inline-float-divide
12892 @opindex mno-inline-float-divide
12893 Do not generate inline code for divides of floating point values.
12894
12895 @item -minline-int-divide-min-latency
12896 @opindex minline-int-divide-min-latency
12897 Generate code for inline divides of integer values
12898 using the minimum latency algorithm.
12899
12900 @item -minline-int-divide-max-throughput
12901 @opindex minline-int-divide-max-throughput
12902 Generate code for inline divides of integer values
12903 using the maximum throughput algorithm.
12904
12905 @item -mno-inline-int-divide
12906 @opindex mno-inline-int-divide
12907 Do not generate inline code for divides of integer values.
12908
12909 @item -minline-sqrt-min-latency
12910 @opindex minline-sqrt-min-latency
12911 Generate code for inline square roots
12912 using the minimum latency algorithm.
12913
12914 @item -minline-sqrt-max-throughput
12915 @opindex minline-sqrt-max-throughput
12916 Generate code for inline square roots
12917 using the maximum throughput algorithm.
12918
12919 @item -mno-inline-sqrt
12920 @opindex mno-inline-sqrt
12921 Do not generate inline code for sqrt.
12922
12923 @item -mfused-madd
12924 @itemx -mno-fused-madd
12925 @opindex mfused-madd
12926 @opindex mno-fused-madd
12927 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12928 instructions.  The default is to use these instructions.
12929
12930 @item -mno-dwarf2-asm
12931 @itemx -mdwarf2-asm
12932 @opindex mno-dwarf2-asm
12933 @opindex mdwarf2-asm
12934 Don't (or do) generate assembler code for the DWARF2 line number debugging
12935 info.  This may be useful when not using the GNU assembler.
12936
12937 @item -mearly-stop-bits
12938 @itemx -mno-early-stop-bits
12939 @opindex mearly-stop-bits
12940 @opindex mno-early-stop-bits
12941 Allow stop bits to be placed earlier than immediately preceding the
12942 instruction that triggered the stop bit.  This can improve instruction
12943 scheduling, but does not always do so.
12944
12945 @item -mfixed-range=@var{register-range}
12946 @opindex mfixed-range
12947 Generate code treating the given register range as fixed registers.
12948 A fixed register is one that the register allocator can not use.  This is
12949 useful when compiling kernel code.  A register range is specified as
12950 two registers separated by a dash.  Multiple register ranges can be
12951 specified separated by a comma.
12952
12953 @item -mtls-size=@var{tls-size}
12954 @opindex mtls-size
12955 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
12956 64.
12957
12958 @item -mtune=@var{cpu-type}
12959 @opindex mtune
12960 Tune the instruction scheduling for a particular CPU, Valid values are
12961 itanium, itanium1, merced, itanium2, and mckinley.
12962
12963 @item -milp32
12964 @itemx -mlp64
12965 @opindex milp32
12966 @opindex mlp64
12967 Generate code for a 32-bit or 64-bit environment.
12968 The 32-bit environment sets int, long and pointer to 32 bits.
12969 The 64-bit environment sets int to 32 bits and long and pointer
12970 to 64 bits.  These are HP-UX specific flags.
12971
12972 @item -mno-sched-br-data-spec
12973 @itemx -msched-br-data-spec
12974 @opindex mno-sched-br-data-spec
12975 @opindex msched-br-data-spec
12976 (Dis/En)able data speculative scheduling before reload.
12977 This will result in generation of the ld.a instructions and
12978 the corresponding check instructions (ld.c / chk.a).
12979 The default is 'disable'.
12980
12981 @item -msched-ar-data-spec
12982 @itemx -mno-sched-ar-data-spec
12983 @opindex msched-ar-data-spec
12984 @opindex mno-sched-ar-data-spec
12985 (En/Dis)able data speculative scheduling after reload.
12986 This will result in generation of the ld.a instructions and
12987 the corresponding check instructions (ld.c / chk.a).
12988 The default is 'enable'.
12989
12990 @item -mno-sched-control-spec
12991 @itemx -msched-control-spec
12992 @opindex mno-sched-control-spec
12993 @opindex msched-control-spec
12994 (Dis/En)able control speculative scheduling.  This feature is
12995 available only during region scheduling (i.e.@: before reload).
12996 This will result in generation of the ld.s instructions and
12997 the corresponding check instructions chk.s .
12998 The default is 'disable'.
12999
13000 @item -msched-br-in-data-spec
13001 @itemx -mno-sched-br-in-data-spec
13002 @opindex msched-br-in-data-spec
13003 @opindex mno-sched-br-in-data-spec
13004 (En/Dis)able speculative scheduling of the instructions that
13005 are dependent on the data speculative loads before reload.
13006 This is effective only with @option{-msched-br-data-spec} enabled.
13007 The default is 'enable'.
13008
13009 @item -msched-ar-in-data-spec
13010 @itemx -mno-sched-ar-in-data-spec
13011 @opindex msched-ar-in-data-spec
13012 @opindex mno-sched-ar-in-data-spec
13013 (En/Dis)able speculative scheduling of the instructions that
13014 are dependent on the data speculative loads after reload.
13015 This is effective only with @option{-msched-ar-data-spec} enabled.
13016 The default is 'enable'.
13017
13018 @item -msched-in-control-spec
13019 @itemx -mno-sched-in-control-spec
13020 @opindex msched-in-control-spec
13021 @opindex mno-sched-in-control-spec
13022 (En/Dis)able speculative scheduling of the instructions that
13023 are dependent on the control speculative loads.
13024 This is effective only with @option{-msched-control-spec} enabled.
13025 The default is 'enable'.
13026
13027 @item -mno-sched-prefer-non-data-spec-insns
13028 @itemx -msched-prefer-non-data-spec-insns
13029 @opindex mno-sched-prefer-non-data-spec-insns
13030 @opindex msched-prefer-non-data-spec-insns
13031 If enabled, data speculative instructions will be chosen for schedule
13032 only if there are no other choices at the moment.  This will make
13033 the use of the data speculation much more conservative.
13034 The default is 'disable'.
13035
13036 @item -mno-sched-prefer-non-control-spec-insns
13037 @itemx -msched-prefer-non-control-spec-insns
13038 @opindex mno-sched-prefer-non-control-spec-insns
13039 @opindex msched-prefer-non-control-spec-insns
13040 If enabled, control speculative instructions will be chosen for schedule
13041 only if there are no other choices at the moment.  This will make
13042 the use of the control speculation much more conservative.
13043 The default is 'disable'.
13044
13045 @item -mno-sched-count-spec-in-critical-path
13046 @itemx -msched-count-spec-in-critical-path
13047 @opindex mno-sched-count-spec-in-critical-path
13048 @opindex msched-count-spec-in-critical-path
13049 If enabled, speculative dependencies will be considered during
13050 computation of the instructions priorities.  This will make the use of the
13051 speculation a bit more conservative.
13052 The default is 'disable'.
13053
13054 @item -msched-spec-ldc
13055 @opindex msched-spec-ldc
13056 Use a simple data speculation check.  This option is on by default.
13057
13058 @item -msched-control-spec-ldc
13059 @opindex msched-spec-ldc
13060 Use a simple check for control speculation.  This option is on by default.
13061
13062 @item -msched-stop-bits-after-every-cycle
13063 @opindex msched-stop-bits-after-every-cycle
13064 Place a stop bit after every cycle when scheduling.  This option is on
13065 by default.
13066
13067 @item -msched-fp-mem-deps-zero-cost
13068 @opindex msched-fp-mem-deps-zero-cost
13069 Assume that floating-point stores and loads are not likely to cause a conflict
13070 when placed into the same instruction group.  This option is disabled by
13071 default.
13072
13073 @item -msel-sched-dont-check-control-spec
13074 @opindex msel-sched-dont-check-control-spec
13075 Generate checks for control speculation in selective scheduling.
13076 This flag is disabled by default.
13077
13078 @item -msched-max-memory-insns=@var{max-insns}
13079 @opindex msched-max-memory-insns
13080 Limit on the number of memory insns per instruction group, giving lower
13081 priority to subsequent memory insns attempting to schedule in the same
13082 instruction group. Frequently useful to prevent cache bank conflicts.
13083 The default value is 1.
13084
13085 @item -msched-max-memory-insns-hard-limit
13086 @opindex msched-max-memory-insns-hard-limit
13087 Disallow more than `msched-max-memory-insns' in instruction group.
13088 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
13089 when limit is reached but may still schedule memory operations.
13090
13091 @end table
13092
13093 @node IA-64/VMS Options
13094 @subsection IA-64/VMS Options
13095
13096 These @samp{-m} options are defined for the IA-64/VMS implementations:
13097
13098 @table @gcctabopt
13099 @item -mvms-return-codes
13100 @opindex mvms-return-codes
13101 Return VMS condition codes from main. The default is to return POSIX
13102 style condition (e.g.@ error) codes.
13103
13104 @item -mdebug-main=@var{prefix}
13105 @opindex mdebug-main=@var{prefix}
13106 Flag the first routine whose name starts with @var{prefix} as the main
13107 routine for the debugger.
13108
13109 @item -mmalloc64
13110 @opindex mmalloc64
13111 Default to 64bit memory allocation routines.
13112 @end table
13113
13114 @node LM32 Options
13115 @subsection LM32 Options
13116 @cindex LM32 options
13117
13118 These @option{-m} options are defined for the Lattice Mico32 architecture:
13119
13120 @table @gcctabopt
13121 @item -mbarrel-shift-enabled
13122 @opindex mbarrel-shift-enabled
13123 Enable barrel-shift instructions.
13124
13125 @item -mdivide-enabled
13126 @opindex mdivide-enabled
13127 Enable divide and modulus instructions.
13128
13129 @item -mmultiply-enabled
13130 @opindex multiply-enabled
13131 Enable multiply instructions.
13132
13133 @item -msign-extend-enabled
13134 @opindex msign-extend-enabled
13135 Enable sign extend instructions.
13136
13137 @item -muser-enabled
13138 @opindex muser-enabled
13139 Enable user-defined instructions.
13140
13141 @end table
13142
13143 @node M32C Options
13144 @subsection M32C Options
13145 @cindex M32C options
13146
13147 @table @gcctabopt
13148 @item -mcpu=@var{name}
13149 @opindex mcpu=
13150 Select the CPU for which code is generated.  @var{name} may be one of
13151 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
13152 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
13153 the M32C/80 series.
13154
13155 @item -msim
13156 @opindex msim
13157 Specifies that the program will be run on the simulator.  This causes
13158 an alternate runtime library to be linked in which supports, for
13159 example, file I/O@.  You must not use this option when generating
13160 programs that will run on real hardware; you must provide your own
13161 runtime library for whatever I/O functions are needed.
13162
13163 @item -memregs=@var{number}
13164 @opindex memregs=
13165 Specifies the number of memory-based pseudo-registers GCC will use
13166 during code generation.  These pseudo-registers will be used like real
13167 registers, so there is a tradeoff between GCC's ability to fit the
13168 code into available registers, and the performance penalty of using
13169 memory instead of registers.  Note that all modules in a program must
13170 be compiled with the same value for this option.  Because of that, you
13171 must not use this option with the default runtime libraries gcc
13172 builds.
13173
13174 @end table
13175
13176 @node M32R/D Options
13177 @subsection M32R/D Options
13178 @cindex M32R/D options
13179
13180 These @option{-m} options are defined for Renesas M32R/D architectures:
13181
13182 @table @gcctabopt
13183 @item -m32r2
13184 @opindex m32r2
13185 Generate code for the M32R/2@.
13186
13187 @item -m32rx
13188 @opindex m32rx
13189 Generate code for the M32R/X@.
13190
13191 @item -m32r
13192 @opindex m32r
13193 Generate code for the M32R@.  This is the default.
13194
13195 @item -mmodel=small
13196 @opindex mmodel=small
13197 Assume all objects live in the lower 16MB of memory (so that their addresses
13198 can be loaded with the @code{ld24} instruction), and assume all subroutines
13199 are reachable with the @code{bl} instruction.
13200 This is the default.
13201
13202 The addressability of a particular object can be set with the
13203 @code{model} attribute.
13204
13205 @item -mmodel=medium
13206 @opindex mmodel=medium
13207 Assume objects may be anywhere in the 32-bit address space (the compiler
13208 will generate @code{seth/add3} instructions to load their addresses), and
13209 assume all subroutines are reachable with the @code{bl} instruction.
13210
13211 @item -mmodel=large
13212 @opindex mmodel=large
13213 Assume objects may be anywhere in the 32-bit address space (the compiler
13214 will generate @code{seth/add3} instructions to load their addresses), and
13215 assume subroutines may not be reachable with the @code{bl} instruction
13216 (the compiler will generate the much slower @code{seth/add3/jl}
13217 instruction sequence).
13218
13219 @item -msdata=none
13220 @opindex msdata=none
13221 Disable use of the small data area.  Variables will be put into
13222 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
13223 @code{section} attribute has been specified).
13224 This is the default.
13225
13226 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
13227 Objects may be explicitly put in the small data area with the
13228 @code{section} attribute using one of these sections.
13229
13230 @item -msdata=sdata
13231 @opindex msdata=sdata
13232 Put small global and static data in the small data area, but do not
13233 generate special code to reference them.
13234
13235 @item -msdata=use
13236 @opindex msdata=use
13237 Put small global and static data in the small data area, and generate
13238 special instructions to reference them.
13239
13240 @item -G @var{num}
13241 @opindex G
13242 @cindex smaller data references
13243 Put global and static objects less than or equal to @var{num} bytes
13244 into the small data or bss sections instead of the normal data or bss
13245 sections.  The default value of @var{num} is 8.
13246 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
13247 for this option to have any effect.
13248
13249 All modules should be compiled with the same @option{-G @var{num}} value.
13250 Compiling with different values of @var{num} may or may not work; if it
13251 doesn't the linker will give an error message---incorrect code will not be
13252 generated.
13253
13254 @item -mdebug
13255 @opindex mdebug
13256 Makes the M32R specific code in the compiler display some statistics
13257 that might help in debugging programs.
13258
13259 @item -malign-loops
13260 @opindex malign-loops
13261 Align all loops to a 32-byte boundary.
13262
13263 @item -mno-align-loops
13264 @opindex mno-align-loops
13265 Do not enforce a 32-byte alignment for loops.  This is the default.
13266
13267 @item -missue-rate=@var{number}
13268 @opindex missue-rate=@var{number}
13269 Issue @var{number} instructions per cycle.  @var{number} can only be 1
13270 or 2.
13271
13272 @item -mbranch-cost=@var{number}
13273 @opindex mbranch-cost=@var{number}
13274 @var{number} can only be 1 or 2.  If it is 1 then branches will be
13275 preferred over conditional code, if it is 2, then the opposite will
13276 apply.
13277
13278 @item -mflush-trap=@var{number}
13279 @opindex mflush-trap=@var{number}
13280 Specifies the trap number to use to flush the cache.  The default is
13281 12.  Valid numbers are between 0 and 15 inclusive.
13282
13283 @item -mno-flush-trap
13284 @opindex mno-flush-trap
13285 Specifies that the cache cannot be flushed by using a trap.
13286
13287 @item -mflush-func=@var{name}
13288 @opindex mflush-func=@var{name}
13289 Specifies the name of the operating system function to call to flush
13290 the cache.  The default is @emph{_flush_cache}, but a function call
13291 will only be used if a trap is not available.
13292
13293 @item -mno-flush-func
13294 @opindex mno-flush-func
13295 Indicates that there is no OS function for flushing the cache.
13296
13297 @end table
13298
13299 @node M680x0 Options
13300 @subsection M680x0 Options
13301 @cindex M680x0 options
13302
13303 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
13304 The default settings depend on which architecture was selected when
13305 the compiler was configured; the defaults for the most common choices
13306 are given below.
13307
13308 @table @gcctabopt
13309 @item -march=@var{arch}
13310 @opindex march
13311 Generate code for a specific M680x0 or ColdFire instruction set
13312 architecture.  Permissible values of @var{arch} for M680x0
13313 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
13314 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
13315 architectures are selected according to Freescale's ISA classification
13316 and the permissible values are: @samp{isaa}, @samp{isaaplus},
13317 @samp{isab} and @samp{isac}.
13318
13319 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
13320 code for a ColdFire target.  The @var{arch} in this macro is one of the
13321 @option{-march} arguments given above.
13322
13323 When used together, @option{-march} and @option{-mtune} select code
13324 that runs on a family of similar processors but that is optimized
13325 for a particular microarchitecture.
13326
13327 @item -mcpu=@var{cpu}
13328 @opindex mcpu
13329 Generate code for a specific M680x0 or ColdFire processor.
13330 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
13331 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
13332 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
13333 below, which also classifies the CPUs into families:
13334
13335 @multitable @columnfractions 0.20 0.80
13336 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
13337 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
13338 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
13339 @item @samp{5206e} @tab @samp{5206e}
13340 @item @samp{5208} @tab @samp{5207} @samp{5208}
13341 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
13342 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
13343 @item @samp{5216} @tab @samp{5214} @samp{5216}
13344 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
13345 @item @samp{5225} @tab @samp{5224} @samp{5225}
13346 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
13347 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
13348 @item @samp{5249} @tab @samp{5249}
13349 @item @samp{5250} @tab @samp{5250}
13350 @item @samp{5271} @tab @samp{5270} @samp{5271}
13351 @item @samp{5272} @tab @samp{5272}
13352 @item @samp{5275} @tab @samp{5274} @samp{5275}
13353 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
13354 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
13355 @item @samp{5307} @tab @samp{5307}
13356 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
13357 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
13358 @item @samp{5407} @tab @samp{5407}
13359 @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}
13360 @end multitable
13361
13362 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
13363 @var{arch} is compatible with @var{cpu}.  Other combinations of
13364 @option{-mcpu} and @option{-march} are rejected.
13365
13366 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
13367 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
13368 where the value of @var{family} is given by the table above.
13369
13370 @item -mtune=@var{tune}
13371 @opindex mtune
13372 Tune the code for a particular microarchitecture, within the
13373 constraints set by @option{-march} and @option{-mcpu}.
13374 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
13375 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
13376 and @samp{cpu32}.  The ColdFire microarchitectures
13377 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
13378
13379 You can also use @option{-mtune=68020-40} for code that needs
13380 to run relatively well on 68020, 68030 and 68040 targets.
13381 @option{-mtune=68020-60} is similar but includes 68060 targets
13382 as well.  These two options select the same tuning decisions as
13383 @option{-m68020-40} and @option{-m68020-60} respectively.
13384
13385 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
13386 when tuning for 680x0 architecture @var{arch}.  It also defines
13387 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
13388 option is used.  If gcc is tuning for a range of architectures,
13389 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
13390 it defines the macros for every architecture in the range.
13391
13392 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
13393 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
13394 of the arguments given above.
13395
13396 @item -m68000
13397 @itemx -mc68000
13398 @opindex m68000
13399 @opindex mc68000
13400 Generate output for a 68000.  This is the default
13401 when the compiler is configured for 68000-based systems.
13402 It is equivalent to @option{-march=68000}.
13403
13404 Use this option for microcontrollers with a 68000 or EC000 core,
13405 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
13406
13407 @item -m68010
13408 @opindex m68010
13409 Generate output for a 68010.  This is the default
13410 when the compiler is configured for 68010-based systems.
13411 It is equivalent to @option{-march=68010}.
13412
13413 @item -m68020
13414 @itemx -mc68020
13415 @opindex m68020
13416 @opindex mc68020
13417 Generate output for a 68020.  This is the default
13418 when the compiler is configured for 68020-based systems.
13419 It is equivalent to @option{-march=68020}.
13420
13421 @item -m68030
13422 @opindex m68030
13423 Generate output for a 68030.  This is the default when the compiler is
13424 configured for 68030-based systems.  It is equivalent to
13425 @option{-march=68030}.
13426
13427 @item -m68040
13428 @opindex m68040
13429 Generate output for a 68040.  This is the default when the compiler is
13430 configured for 68040-based systems.  It is equivalent to
13431 @option{-march=68040}.
13432
13433 This option inhibits the use of 68881/68882 instructions that have to be
13434 emulated by software on the 68040.  Use this option if your 68040 does not
13435 have code to emulate those instructions.
13436
13437 @item -m68060
13438 @opindex m68060
13439 Generate output for a 68060.  This is the default when the compiler is
13440 configured for 68060-based systems.  It is equivalent to
13441 @option{-march=68060}.
13442
13443 This option inhibits the use of 68020 and 68881/68882 instructions that
13444 have to be emulated by software on the 68060.  Use this option if your 68060
13445 does not have code to emulate those instructions.
13446
13447 @item -mcpu32
13448 @opindex mcpu32
13449 Generate output for a CPU32.  This is the default
13450 when the compiler is configured for CPU32-based systems.
13451 It is equivalent to @option{-march=cpu32}.
13452
13453 Use this option for microcontrollers with a
13454 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
13455 68336, 68340, 68341, 68349 and 68360.
13456
13457 @item -m5200
13458 @opindex m5200
13459 Generate output for a 520X ColdFire CPU@.  This is the default
13460 when the compiler is configured for 520X-based systems.
13461 It is equivalent to @option{-mcpu=5206}, and is now deprecated
13462 in favor of that option.
13463
13464 Use this option for microcontroller with a 5200 core, including
13465 the MCF5202, MCF5203, MCF5204 and MCF5206.
13466
13467 @item -m5206e
13468 @opindex m5206e
13469 Generate output for a 5206e ColdFire CPU@.  The option is now
13470 deprecated in favor of the equivalent @option{-mcpu=5206e}.
13471
13472 @item -m528x
13473 @opindex m528x
13474 Generate output for a member of the ColdFire 528X family.
13475 The option is now deprecated in favor of the equivalent
13476 @option{-mcpu=528x}.
13477
13478 @item -m5307
13479 @opindex m5307
13480 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
13481 in favor of the equivalent @option{-mcpu=5307}.
13482
13483 @item -m5407
13484 @opindex m5407
13485 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
13486 in favor of the equivalent @option{-mcpu=5407}.
13487
13488 @item -mcfv4e
13489 @opindex mcfv4e
13490 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
13491 This includes use of hardware floating point instructions.
13492 The option is equivalent to @option{-mcpu=547x}, and is now
13493 deprecated in favor of that option.
13494
13495 @item -m68020-40
13496 @opindex m68020-40
13497 Generate output for a 68040, without using any of the new instructions.
13498 This results in code which can run relatively efficiently on either a
13499 68020/68881 or a 68030 or a 68040.  The generated code does use the
13500 68881 instructions that are emulated on the 68040.
13501
13502 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
13503
13504 @item -m68020-60
13505 @opindex m68020-60
13506 Generate output for a 68060, without using any of the new instructions.
13507 This results in code which can run relatively efficiently on either a
13508 68020/68881 or a 68030 or a 68040.  The generated code does use the
13509 68881 instructions that are emulated on the 68060.
13510
13511 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
13512
13513 @item -mhard-float
13514 @itemx -m68881
13515 @opindex mhard-float
13516 @opindex m68881
13517 Generate floating-point instructions.  This is the default for 68020
13518 and above, and for ColdFire devices that have an FPU@.  It defines the
13519 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
13520 on ColdFire targets.
13521
13522 @item -msoft-float
13523 @opindex msoft-float
13524 Do not generate floating-point instructions; use library calls instead.
13525 This is the default for 68000, 68010, and 68832 targets.  It is also
13526 the default for ColdFire devices that have no FPU.
13527
13528 @item -mdiv
13529 @itemx -mno-div
13530 @opindex mdiv
13531 @opindex mno-div
13532 Generate (do not generate) ColdFire hardware divide and remainder
13533 instructions.  If @option{-march} is used without @option{-mcpu},
13534 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
13535 architectures.  Otherwise, the default is taken from the target CPU
13536 (either the default CPU, or the one specified by @option{-mcpu}).  For
13537 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
13538 @option{-mcpu=5206e}.
13539
13540 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
13541
13542 @item -mshort
13543 @opindex mshort
13544 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13545 Additionally, parameters passed on the stack are also aligned to a
13546 16-bit boundary even on targets whose API mandates promotion to 32-bit.
13547
13548 @item -mno-short
13549 @opindex mno-short
13550 Do not consider type @code{int} to be 16 bits wide.  This is the default.
13551
13552 @item -mnobitfield
13553 @itemx -mno-bitfield
13554 @opindex mnobitfield
13555 @opindex mno-bitfield
13556 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
13557 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
13558
13559 @item -mbitfield
13560 @opindex mbitfield
13561 Do use the bit-field instructions.  The @option{-m68020} option implies
13562 @option{-mbitfield}.  This is the default if you use a configuration
13563 designed for a 68020.
13564
13565 @item -mrtd
13566 @opindex mrtd
13567 Use a different function-calling convention, in which functions
13568 that take a fixed number of arguments return with the @code{rtd}
13569 instruction, which pops their arguments while returning.  This
13570 saves one instruction in the caller since there is no need to pop
13571 the arguments there.
13572
13573 This calling convention is incompatible with the one normally
13574 used on Unix, so you cannot use it if you need to call libraries
13575 compiled with the Unix compiler.
13576
13577 Also, you must provide function prototypes for all functions that
13578 take variable numbers of arguments (including @code{printf});
13579 otherwise incorrect code will be generated for calls to those
13580 functions.
13581
13582 In addition, seriously incorrect code will result if you call a
13583 function with too many arguments.  (Normally, extra arguments are
13584 harmlessly ignored.)
13585
13586 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
13587 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
13588
13589 @item -mno-rtd
13590 @opindex mno-rtd
13591 Do not use the calling conventions selected by @option{-mrtd}.
13592 This is the default.
13593
13594 @item -malign-int
13595 @itemx -mno-align-int
13596 @opindex malign-int
13597 @opindex mno-align-int
13598 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
13599 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
13600 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
13601 Aligning variables on 32-bit boundaries produces code that runs somewhat
13602 faster on processors with 32-bit busses at the expense of more memory.
13603
13604 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
13605 align structures containing the above types  differently than
13606 most published application binary interface specifications for the m68k.
13607
13608 @item -mpcrel
13609 @opindex mpcrel
13610 Use the pc-relative addressing mode of the 68000 directly, instead of
13611 using a global offset table.  At present, this option implies @option{-fpic},
13612 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
13613 not presently supported with @option{-mpcrel}, though this could be supported for
13614 68020 and higher processors.
13615
13616 @item -mno-strict-align
13617 @itemx -mstrict-align
13618 @opindex mno-strict-align
13619 @opindex mstrict-align
13620 Do not (do) assume that unaligned memory references will be handled by
13621 the system.
13622
13623 @item -msep-data
13624 Generate code that allows the data segment to be located in a different
13625 area of memory from the text segment.  This allows for execute in place in
13626 an environment without virtual memory management.  This option implies
13627 @option{-fPIC}.
13628
13629 @item -mno-sep-data
13630 Generate code that assumes that the data segment follows the text segment.
13631 This is the default.
13632
13633 @item -mid-shared-library
13634 Generate code that supports shared libraries via the library ID method.
13635 This allows for execute in place and shared libraries in an environment
13636 without virtual memory management.  This option implies @option{-fPIC}.
13637
13638 @item -mno-id-shared-library
13639 Generate code that doesn't assume ID based shared libraries are being used.
13640 This is the default.
13641
13642 @item -mshared-library-id=n
13643 Specified the identification number of the ID based shared library being
13644 compiled.  Specifying a value of 0 will generate more compact code, specifying
13645 other values will force the allocation of that number to the current
13646 library but is no more space or time efficient than omitting this option.
13647
13648 @item -mxgot
13649 @itemx -mno-xgot
13650 @opindex mxgot
13651 @opindex mno-xgot
13652 When generating position-independent code for ColdFire, generate code
13653 that works if the GOT has more than 8192 entries.  This code is
13654 larger and slower than code generated without this option.  On M680x0
13655 processors, this option is not needed; @option{-fPIC} suffices.
13656
13657 GCC normally uses a single instruction to load values from the GOT@.
13658 While this is relatively efficient, it only works if the GOT
13659 is smaller than about 64k.  Anything larger causes the linker
13660 to report an error such as:
13661
13662 @cindex relocation truncated to fit (ColdFire)
13663 @smallexample
13664 relocation truncated to fit: R_68K_GOT16O foobar
13665 @end smallexample
13666
13667 If this happens, you should recompile your code with @option{-mxgot}.
13668 It should then work with very large GOTs.  However, code generated with
13669 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
13670 the value of a global symbol.
13671
13672 Note that some linkers, including newer versions of the GNU linker,
13673 can create multiple GOTs and sort GOT entries.  If you have such a linker,
13674 you should only need to use @option{-mxgot} when compiling a single
13675 object file that accesses more than 8192 GOT entries.  Very few do.
13676
13677 These options have no effect unless GCC is generating
13678 position-independent code.
13679
13680 @end table
13681
13682 @node M68hc1x Options
13683 @subsection M68hc1x Options
13684 @cindex M68hc1x options
13685
13686 These are the @samp{-m} options defined for the 68hc11 and 68hc12
13687 microcontrollers.  The default values for these options depends on
13688 which style of microcontroller was selected when the compiler was configured;
13689 the defaults for the most common choices are given below.
13690
13691 @table @gcctabopt
13692 @item -m6811
13693 @itemx -m68hc11
13694 @opindex m6811
13695 @opindex m68hc11
13696 Generate output for a 68HC11.  This is the default
13697 when the compiler is configured for 68HC11-based systems.
13698
13699 @item -m6812
13700 @itemx -m68hc12
13701 @opindex m6812
13702 @opindex m68hc12
13703 Generate output for a 68HC12.  This is the default
13704 when the compiler is configured for 68HC12-based systems.
13705
13706 @item -m68S12
13707 @itemx -m68hcs12
13708 @opindex m68S12
13709 @opindex m68hcs12
13710 Generate output for a 68HCS12.
13711
13712 @item -mauto-incdec
13713 @opindex mauto-incdec
13714 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
13715 addressing modes.
13716
13717 @item -minmax
13718 @itemx -mnominmax
13719 @opindex minmax
13720 @opindex mnominmax
13721 Enable the use of 68HC12 min and max instructions.
13722
13723 @item -mlong-calls
13724 @itemx -mno-long-calls
13725 @opindex mlong-calls
13726 @opindex mno-long-calls
13727 Treat all calls as being far away (near).  If calls are assumed to be
13728 far away, the compiler will use the @code{call} instruction to
13729 call a function and the @code{rtc} instruction for returning.
13730
13731 @item -mshort
13732 @opindex mshort
13733 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13734
13735 @item -msoft-reg-count=@var{count}
13736 @opindex msoft-reg-count
13737 Specify the number of pseudo-soft registers which are used for the
13738 code generation.  The maximum number is 32.  Using more pseudo-soft
13739 register may or may not result in better code depending on the program.
13740 The default is 4 for 68HC11 and 2 for 68HC12.
13741
13742 @end table
13743
13744 @node MCore Options
13745 @subsection MCore Options
13746 @cindex MCore options
13747
13748 These are the @samp{-m} options defined for the Motorola M*Core
13749 processors.
13750
13751 @table @gcctabopt
13752
13753 @item -mhardlit
13754 @itemx -mno-hardlit
13755 @opindex mhardlit
13756 @opindex mno-hardlit
13757 Inline constants into the code stream if it can be done in two
13758 instructions or less.
13759
13760 @item -mdiv
13761 @itemx -mno-div
13762 @opindex mdiv
13763 @opindex mno-div
13764 Use the divide instruction.  (Enabled by default).
13765
13766 @item -mrelax-immediate
13767 @itemx -mno-relax-immediate
13768 @opindex mrelax-immediate
13769 @opindex mno-relax-immediate
13770 Allow arbitrary sized immediates in bit operations.
13771
13772 @item -mwide-bitfields
13773 @itemx -mno-wide-bitfields
13774 @opindex mwide-bitfields
13775 @opindex mno-wide-bitfields
13776 Always treat bit-fields as int-sized.
13777
13778 @item -m4byte-functions
13779 @itemx -mno-4byte-functions
13780 @opindex m4byte-functions
13781 @opindex mno-4byte-functions
13782 Force all functions to be aligned to a four byte boundary.
13783
13784 @item -mcallgraph-data
13785 @itemx -mno-callgraph-data
13786 @opindex mcallgraph-data
13787 @opindex mno-callgraph-data
13788 Emit callgraph information.
13789
13790 @item -mslow-bytes
13791 @itemx -mno-slow-bytes
13792 @opindex mslow-bytes
13793 @opindex mno-slow-bytes
13794 Prefer word access when reading byte quantities.
13795
13796 @item -mlittle-endian
13797 @itemx -mbig-endian
13798 @opindex mlittle-endian
13799 @opindex mbig-endian
13800 Generate code for a little endian target.
13801
13802 @item -m210
13803 @itemx -m340
13804 @opindex m210
13805 @opindex m340
13806 Generate code for the 210 processor.
13807
13808 @item -mno-lsim
13809 @opindex mno-lsim
13810 Assume that run-time support has been provided and so omit the
13811 simulator library (@file{libsim.a)} from the linker command line.
13812
13813 @item -mstack-increment=@var{size}
13814 @opindex mstack-increment
13815 Set the maximum amount for a single stack increment operation.  Large
13816 values can increase the speed of programs which contain functions
13817 that need a large amount of stack space, but they can also trigger a
13818 segmentation fault if the stack is extended too much.  The default
13819 value is 0x1000.
13820
13821 @end table
13822
13823 @node MeP Options
13824 @subsection MeP Options
13825 @cindex MeP options
13826
13827 @table @gcctabopt
13828
13829 @item -mabsdiff
13830 @opindex mabsdiff
13831 Enables the @code{abs} instruction, which is the absolute difference
13832 between two registers.
13833
13834 @item -mall-opts
13835 @opindex mall-opts
13836 Enables all the optional instructions - average, multiply, divide, bit
13837 operations, leading zero, absolute difference, min/max, clip, and
13838 saturation.
13839
13840
13841 @item -maverage
13842 @opindex maverage
13843 Enables the @code{ave} instruction, which computes the average of two
13844 registers.
13845
13846 @item -mbased=@var{n}
13847 @opindex mbased=
13848 Variables of size @var{n} bytes or smaller will be placed in the
13849 @code{.based} section by default.  Based variables use the @code{$tp}
13850 register as a base register, and there is a 128 byte limit to the
13851 @code{.based} section.
13852
13853 @item -mbitops
13854 @opindex mbitops
13855 Enables the bit operation instructions - bit test (@code{btstm}), set
13856 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
13857 test-and-set (@code{tas}).
13858
13859 @item -mc=@var{name}
13860 @opindex mc=
13861 Selects which section constant data will be placed in.  @var{name} may
13862 be @code{tiny}, @code{near}, or @code{far}.
13863
13864 @item -mclip
13865 @opindex mclip
13866 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
13867 useful unless you also provide @code{-mminmax}.
13868
13869 @item -mconfig=@var{name}
13870 @opindex mconfig=
13871 Selects one of the build-in core configurations.  Each MeP chip has
13872 one or more modules in it; each module has a core CPU and a variety of
13873 coprocessors, optional instructions, and peripherals.  The
13874 @code{MeP-Integrator} tool, not part of GCC, provides these
13875 configurations through this option; using this option is the same as
13876 using all the corresponding command line options.  The default
13877 configuration is @code{default}.
13878
13879 @item -mcop
13880 @opindex mcop
13881 Enables the coprocessor instructions.  By default, this is a 32-bit
13882 coprocessor.  Note that the coprocessor is normally enabled via the
13883 @code{-mconfig=} option.
13884
13885 @item -mcop32
13886 @opindex mcop32
13887 Enables the 32-bit coprocessor's instructions.
13888
13889 @item -mcop64
13890 @opindex mcop64
13891 Enables the 64-bit coprocessor's instructions.
13892
13893 @item -mivc2
13894 @opindex mivc2
13895 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
13896
13897 @item -mdc
13898 @opindex mdc
13899 Causes constant variables to be placed in the @code{.near} section.
13900
13901 @item -mdiv
13902 @opindex mdiv
13903 Enables the @code{div} and @code{divu} instructions.
13904
13905 @item -meb
13906 @opindex meb
13907 Generate big-endian code.
13908
13909 @item -mel
13910 @opindex mel
13911 Generate little-endian code.
13912
13913 @item -mio-volatile
13914 @opindex mio-volatile
13915 Tells the compiler that any variable marked with the @code{io}
13916 attribute is to be considered volatile.
13917
13918 @item -ml
13919 @opindex ml
13920 Causes variables to be assigned to the @code{.far} section by default.
13921
13922 @item -mleadz
13923 @opindex mleadz
13924 Enables the @code{leadz} (leading zero) instruction.
13925
13926 @item -mm
13927 @opindex mm
13928 Causes variables to be assigned to the @code{.near} section by default.
13929
13930 @item -mminmax
13931 @opindex mminmax
13932 Enables the @code{min} and @code{max} instructions.
13933
13934 @item -mmult
13935 @opindex mmult
13936 Enables the multiplication and multiply-accumulate instructions.
13937
13938 @item -mno-opts
13939 @opindex mno-opts
13940 Disables all the optional instructions enabled by @code{-mall-opts}.
13941
13942 @item -mrepeat
13943 @opindex mrepeat
13944 Enables the @code{repeat} and @code{erepeat} instructions, used for
13945 low-overhead looping.
13946
13947 @item -ms
13948 @opindex ms
13949 Causes all variables to default to the @code{.tiny} section.  Note
13950 that there is a 65536 byte limit to this section.  Accesses to these
13951 variables use the @code{%gp} base register.
13952
13953 @item -msatur
13954 @opindex msatur
13955 Enables the saturation instructions.  Note that the compiler does not
13956 currently generate these itself, but this option is included for
13957 compatibility with other tools, like @code{as}.
13958
13959 @item -msdram
13960 @opindex msdram
13961 Link the SDRAM-based runtime instead of the default ROM-based runtime.
13962
13963 @item -msim
13964 @opindex msim
13965 Link the simulator runtime libraries.
13966
13967 @item -msimnovec
13968 @opindex msimnovec
13969 Link the simulator runtime libraries, excluding built-in support
13970 for reset and exception vectors and tables.
13971
13972 @item -mtf
13973 @opindex mtf
13974 Causes all functions to default to the @code{.far} section.  Without
13975 this option, functions default to the @code{.near} section.
13976
13977 @item -mtiny=@var{n}
13978 @opindex mtiny=
13979 Variables that are @var{n} bytes or smaller will be allocated to the
13980 @code{.tiny} section.  These variables use the @code{$gp} base
13981 register.  The default for this option is 4, but note that there's a
13982 65536 byte limit to the @code{.tiny} section.
13983
13984 @end table
13985
13986 @node MicroBlaze Options
13987 @subsection MicroBlaze Options
13988 @cindex MicroBlaze Options
13989
13990 @table @gcctabopt
13991
13992 @item -msoft-float
13993 @opindex msoft-float
13994 Use software emulation for floating point (default).
13995
13996 @item -mhard-float
13997 @opindex mhard-float
13998 Use hardware floating point instructions.
13999
14000 @item -mmemcpy
14001 @opindex mmemcpy
14002 Do not optimize block moves, use @code{memcpy}.
14003
14004 @item -mno-clearbss
14005 @opindex mno-clearbss
14006 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
14007
14008 @item -mcpu=@var{cpu-type}
14009 @opindex mcpu=
14010 Use features of and schedule code for given CPU.
14011 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}}, 
14012 where @var{X} is a major version, @var{YY} is the minor version, and 
14013 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
14014 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}. 
14015
14016 @item -mxl-soft-mul
14017 @opindex mxl-soft-mul
14018 Use software multiply emulation (default).
14019
14020 @item -mxl-soft-div
14021 @opindex mxl-soft-div
14022 Use software emulation for divides (default).
14023
14024 @item -mxl-barrel-shift
14025 @opindex mxl-barrel-shift
14026 Use the hardware barrel shifter.
14027
14028 @item -mxl-pattern-compare
14029 @opindex mxl-pattern-compare
14030 Use pattern compare instructions.
14031
14032 @item -msmall-divides
14033 @opindex msmall-divides
14034 Use table lookup optimization for small signed integer divisions.
14035
14036 @item -mxl-stack-check
14037 @opindex mxl-stack-check
14038 This option is deprecated.  Use -fstack-check instead.
14039
14040 @item -mxl-gp-opt
14041 @opindex mxl-gp-opt
14042 Use GP relative sdata/sbss sections.
14043
14044 @item -mxl-multiply-high
14045 @opindex mxl-multiply-high
14046 Use multiply high instructions for high part of 32x32 multiply.
14047
14048 @item -mxl-float-convert
14049 @opindex mxl-float-convert
14050 Use hardware floating point conversion instructions.
14051
14052 @item -mxl-float-sqrt
14053 @opindex mxl-float-sqrt
14054 Use hardware floating point square root instruction.
14055
14056 @item -mxl-mode-@var{app-model}
14057 Select application model @var{app-model}.  Valid models are 
14058 @table @samp
14059 @item executable
14060 normal executable (default), uses startup code @file{crt0.o}.
14061
14062 @item xmdstub
14063 for use with Xilinx Microprocessor Debugger (XMD) based 
14064 software intrusive debug agent called xmdstub. This uses startup file 
14065 @file{crt1.o} and sets the start address of the program to be 0x800.
14066
14067 @item bootstrap
14068 for applications that are loaded using a bootloader.
14069 This model uses startup file @file{crt2.o} which does not contain a processor 
14070 reset vector handler. This is suitable for transferring control on a 
14071 processor reset to the bootloader rather than the application.
14072
14073 @item novectors
14074 for applications that do not require any of the 
14075 MicroBlaze vectors. This option may be useful for applications running
14076 within a monitoring application. This model uses @file{crt3.o} as a startup file.
14077 @end table
14078
14079 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for 
14080 @option{-mxl-mode-@var{app-model}}.
14081
14082 @end table
14083
14084 @node MIPS Options
14085 @subsection MIPS Options
14086 @cindex MIPS options
14087
14088 @table @gcctabopt
14089
14090 @item -EB
14091 @opindex EB
14092 Generate big-endian code.
14093
14094 @item -EL
14095 @opindex EL
14096 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
14097 configurations.
14098
14099 @item -march=@var{arch}
14100 @opindex march
14101 Generate code that will run on @var{arch}, which can be the name of a
14102 generic MIPS ISA, or the name of a particular processor.
14103 The ISA names are:
14104 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
14105 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
14106 The processor names are:
14107 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
14108 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
14109 @samp{5kc}, @samp{5kf},
14110 @samp{20kc},
14111 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
14112 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
14113 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
14114 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
14115 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
14116 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
14117 @samp{m4k},
14118 @samp{octeon},
14119 @samp{orion},
14120 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
14121 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
14122 @samp{rm7000}, @samp{rm9000},
14123 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
14124 @samp{sb1},
14125 @samp{sr71000},
14126 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
14127 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
14128 and @samp{xlr}.
14129 The special value @samp{from-abi} selects the
14130 most compatible architecture for the selected ABI (that is,
14131 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
14132
14133 Native Linux/GNU toolchains also support the value @samp{native},
14134 which selects the best architecture option for the host processor.
14135 @option{-march=native} has no effect if GCC does not recognize
14136 the processor.
14137
14138 In processor names, a final @samp{000} can be abbreviated as @samp{k}
14139 (for example, @samp{-march=r2k}).  Prefixes are optional, and
14140 @samp{vr} may be written @samp{r}.
14141
14142 Names of the form @samp{@var{n}f2_1} refer to processors with
14143 FPUs clocked at half the rate of the core, names of the form
14144 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
14145 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
14146 processors with FPUs clocked a ratio of 3:2 with respect to the core.
14147 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
14148 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
14149 accepted as synonyms for @samp{@var{n}f1_1}.
14150
14151 GCC defines two macros based on the value of this option.  The first
14152 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
14153 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
14154 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
14155 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
14156 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
14157
14158 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
14159 above.  In other words, it will have the full prefix and will not
14160 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
14161 the macro names the resolved architecture (either @samp{"mips1"} or
14162 @samp{"mips3"}).  It names the default architecture when no
14163 @option{-march} option is given.
14164
14165 @item -mtune=@var{arch}
14166 @opindex mtune
14167 Optimize for @var{arch}.  Among other things, this option controls
14168 the way instructions are scheduled, and the perceived cost of arithmetic
14169 operations.  The list of @var{arch} values is the same as for
14170 @option{-march}.
14171
14172 When this option is not used, GCC will optimize for the processor
14173 specified by @option{-march}.  By using @option{-march} and
14174 @option{-mtune} together, it is possible to generate code that will
14175 run on a family of processors, but optimize the code for one
14176 particular member of that family.
14177
14178 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
14179 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
14180 @samp{-march} ones described above.
14181
14182 @item -mips1
14183 @opindex mips1
14184 Equivalent to @samp{-march=mips1}.
14185
14186 @item -mips2
14187 @opindex mips2
14188 Equivalent to @samp{-march=mips2}.
14189
14190 @item -mips3
14191 @opindex mips3
14192 Equivalent to @samp{-march=mips3}.
14193
14194 @item -mips4
14195 @opindex mips4
14196 Equivalent to @samp{-march=mips4}.
14197
14198 @item -mips32
14199 @opindex mips32
14200 Equivalent to @samp{-march=mips32}.
14201
14202 @item -mips32r2
14203 @opindex mips32r2
14204 Equivalent to @samp{-march=mips32r2}.
14205
14206 @item -mips64
14207 @opindex mips64
14208 Equivalent to @samp{-march=mips64}.
14209
14210 @item -mips64r2
14211 @opindex mips64r2
14212 Equivalent to @samp{-march=mips64r2}.
14213
14214 @item -mips16
14215 @itemx -mno-mips16
14216 @opindex mips16
14217 @opindex mno-mips16
14218 Generate (do not generate) MIPS16 code.  If GCC is targetting a
14219 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
14220
14221 MIPS16 code generation can also be controlled on a per-function basis
14222 by means of @code{mips16} and @code{nomips16} attributes.
14223 @xref{Function Attributes}, for more information.
14224
14225 @item -mflip-mips16
14226 @opindex mflip-mips16
14227 Generate MIPS16 code on alternating functions.  This option is provided
14228 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
14229 not intended for ordinary use in compiling user code.
14230
14231 @item -minterlink-mips16
14232 @itemx -mno-interlink-mips16
14233 @opindex minterlink-mips16
14234 @opindex mno-interlink-mips16
14235 Require (do not require) that non-MIPS16 code be link-compatible with
14236 MIPS16 code.
14237
14238 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
14239 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
14240 therefore disables direct jumps unless GCC knows that the target of the
14241 jump is not MIPS16.
14242
14243 @item -mabi=32
14244 @itemx -mabi=o64
14245 @itemx -mabi=n32
14246 @itemx -mabi=64
14247 @itemx -mabi=eabi
14248 @opindex mabi=32
14249 @opindex mabi=o64
14250 @opindex mabi=n32
14251 @opindex mabi=64
14252 @opindex mabi=eabi
14253 Generate code for the given ABI@.
14254
14255 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
14256 generates 64-bit code when you select a 64-bit architecture, but you
14257 can use @option{-mgp32} to get 32-bit code instead.
14258
14259 For information about the O64 ABI, see
14260 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
14261
14262 GCC supports a variant of the o32 ABI in which floating-point registers
14263 are 64 rather than 32 bits wide.  You can select this combination with
14264 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
14265 and @samp{mfhc1} instructions and is therefore only supported for
14266 MIPS32R2 processors.
14267
14268 The register assignments for arguments and return values remain the
14269 same, but each scalar value is passed in a single 64-bit register
14270 rather than a pair of 32-bit registers.  For example, scalar
14271 floating-point values are returned in @samp{$f0} only, not a
14272 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
14273 remains the same, but all 64 bits are saved.
14274
14275 @item -mabicalls
14276 @itemx -mno-abicalls
14277 @opindex mabicalls
14278 @opindex mno-abicalls
14279 Generate (do not generate) code that is suitable for SVR4-style
14280 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
14281 systems.
14282
14283 @item -mshared
14284 @itemx -mno-shared
14285 Generate (do not generate) code that is fully position-independent,
14286 and that can therefore be linked into shared libraries.  This option
14287 only affects @option{-mabicalls}.
14288
14289 All @option{-mabicalls} code has traditionally been position-independent,
14290 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
14291 as an extension, the GNU toolchain allows executables to use absolute
14292 accesses for locally-binding symbols.  It can also use shorter GP
14293 initialization sequences and generate direct calls to locally-defined
14294 functions.  This mode is selected by @option{-mno-shared}.
14295
14296 @option{-mno-shared} depends on binutils 2.16 or higher and generates
14297 objects that can only be linked by the GNU linker.  However, the option
14298 does not affect the ABI of the final executable; it only affects the ABI
14299 of relocatable objects.  Using @option{-mno-shared} will generally make
14300 executables both smaller and quicker.
14301
14302 @option{-mshared} is the default.
14303
14304 @item -mplt
14305 @itemx -mno-plt
14306 @opindex mplt
14307 @opindex mno-plt
14308 Assume (do not assume) that the static and dynamic linkers
14309 support PLTs and copy relocations.  This option only affects
14310 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
14311 has no effect without @samp{-msym32}.
14312
14313 You can make @option{-mplt} the default by configuring
14314 GCC with @option{--with-mips-plt}.  The default is
14315 @option{-mno-plt} otherwise.
14316
14317 @item -mxgot
14318 @itemx -mno-xgot
14319 @opindex mxgot
14320 @opindex mno-xgot
14321 Lift (do not lift) the usual restrictions on the size of the global
14322 offset table.
14323
14324 GCC normally uses a single instruction to load values from the GOT@.
14325 While this is relatively efficient, it will only work if the GOT
14326 is smaller than about 64k.  Anything larger will cause the linker
14327 to report an error such as:
14328
14329 @cindex relocation truncated to fit (MIPS)
14330 @smallexample
14331 relocation truncated to fit: R_MIPS_GOT16 foobar
14332 @end smallexample
14333
14334 If this happens, you should recompile your code with @option{-mxgot}.
14335 It should then work with very large GOTs, although it will also be
14336 less efficient, since it will take three instructions to fetch the
14337 value of a global symbol.
14338
14339 Note that some linkers can create multiple GOTs.  If you have such a
14340 linker, you should only need to use @option{-mxgot} when a single object
14341 file accesses more than 64k's worth of GOT entries.  Very few do.
14342
14343 These options have no effect unless GCC is generating position
14344 independent code.
14345
14346 @item -mgp32
14347 @opindex mgp32
14348 Assume that general-purpose registers are 32 bits wide.
14349
14350 @item -mgp64
14351 @opindex mgp64
14352 Assume that general-purpose registers are 64 bits wide.
14353
14354 @item -mfp32
14355 @opindex mfp32
14356 Assume that floating-point registers are 32 bits wide.
14357
14358 @item -mfp64
14359 @opindex mfp64
14360 Assume that floating-point registers are 64 bits wide.
14361
14362 @item -mhard-float
14363 @opindex mhard-float
14364 Use floating-point coprocessor instructions.
14365
14366 @item -msoft-float
14367 @opindex msoft-float
14368 Do not use floating-point coprocessor instructions.  Implement
14369 floating-point calculations using library calls instead.
14370
14371 @item -msingle-float
14372 @opindex msingle-float
14373 Assume that the floating-point coprocessor only supports single-precision
14374 operations.
14375
14376 @item -mdouble-float
14377 @opindex mdouble-float
14378 Assume that the floating-point coprocessor supports double-precision
14379 operations.  This is the default.
14380
14381 @item -mllsc
14382 @itemx -mno-llsc
14383 @opindex mllsc
14384 @opindex mno-llsc
14385 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
14386 implement atomic memory built-in functions.  When neither option is
14387 specified, GCC will use the instructions if the target architecture
14388 supports them.
14389
14390 @option{-mllsc} is useful if the runtime environment can emulate the
14391 instructions and @option{-mno-llsc} can be useful when compiling for
14392 nonstandard ISAs.  You can make either option the default by
14393 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
14394 respectively.  @option{--with-llsc} is the default for some
14395 configurations; see the installation documentation for details.
14396
14397 @item -mdsp
14398 @itemx -mno-dsp
14399 @opindex mdsp
14400 @opindex mno-dsp
14401 Use (do not use) revision 1 of the MIPS DSP ASE@.
14402 @xref{MIPS DSP Built-in Functions}.  This option defines the
14403 preprocessor macro @samp{__mips_dsp}.  It also defines
14404 @samp{__mips_dsp_rev} to 1.
14405
14406 @item -mdspr2
14407 @itemx -mno-dspr2
14408 @opindex mdspr2
14409 @opindex mno-dspr2
14410 Use (do not use) revision 2 of the MIPS DSP ASE@.
14411 @xref{MIPS DSP Built-in Functions}.  This option defines the
14412 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
14413 It also defines @samp{__mips_dsp_rev} to 2.
14414
14415 @item -msmartmips
14416 @itemx -mno-smartmips
14417 @opindex msmartmips
14418 @opindex mno-smartmips
14419 Use (do not use) the MIPS SmartMIPS ASE.
14420
14421 @item -mpaired-single
14422 @itemx -mno-paired-single
14423 @opindex mpaired-single
14424 @opindex mno-paired-single
14425 Use (do not use) paired-single floating-point instructions.
14426 @xref{MIPS Paired-Single Support}.  This option requires
14427 hardware floating-point support to be enabled.
14428
14429 @item -mdmx
14430 @itemx -mno-mdmx
14431 @opindex mdmx
14432 @opindex mno-mdmx
14433 Use (do not use) MIPS Digital Media Extension instructions.
14434 This option can only be used when generating 64-bit code and requires
14435 hardware floating-point support to be enabled.
14436
14437 @item -mips3d
14438 @itemx -mno-mips3d
14439 @opindex mips3d
14440 @opindex mno-mips3d
14441 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
14442 The option @option{-mips3d} implies @option{-mpaired-single}.
14443
14444 @item -mmt
14445 @itemx -mno-mt
14446 @opindex mmt
14447 @opindex mno-mt
14448 Use (do not use) MT Multithreading instructions.
14449
14450 @item -mlong64
14451 @opindex mlong64
14452 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
14453 an explanation of the default and the way that the pointer size is
14454 determined.
14455
14456 @item -mlong32
14457 @opindex mlong32
14458 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
14459
14460 The default size of @code{int}s, @code{long}s and pointers depends on
14461 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
14462 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
14463 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
14464 or the same size as integer registers, whichever is smaller.
14465
14466 @item -msym32
14467 @itemx -mno-sym32
14468 @opindex msym32
14469 @opindex mno-sym32
14470 Assume (do not assume) that all symbols have 32-bit values, regardless
14471 of the selected ABI@.  This option is useful in combination with
14472 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
14473 to generate shorter and faster references to symbolic addresses.
14474
14475 @item -G @var{num}
14476 @opindex G
14477 Put definitions of externally-visible data in a small data section
14478 if that data is no bigger than @var{num} bytes.  GCC can then access
14479 the data more efficiently; see @option{-mgpopt} for details.
14480
14481 The default @option{-G} option depends on the configuration.
14482
14483 @item -mlocal-sdata
14484 @itemx -mno-local-sdata
14485 @opindex mlocal-sdata
14486 @opindex mno-local-sdata
14487 Extend (do not extend) the @option{-G} behavior to local data too,
14488 such as to static variables in C@.  @option{-mlocal-sdata} is the
14489 default for all configurations.
14490
14491 If the linker complains that an application is using too much small data,
14492 you might want to try rebuilding the less performance-critical parts with
14493 @option{-mno-local-sdata}.  You might also want to build large
14494 libraries with @option{-mno-local-sdata}, so that the libraries leave
14495 more room for the main program.
14496
14497 @item -mextern-sdata
14498 @itemx -mno-extern-sdata
14499 @opindex mextern-sdata
14500 @opindex mno-extern-sdata
14501 Assume (do not assume) that externally-defined data will be in
14502 a small data section if that data is within the @option{-G} limit.
14503 @option{-mextern-sdata} is the default for all configurations.
14504
14505 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
14506 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
14507 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
14508 is placed in a small data section.  If @var{Var} is defined by another
14509 module, you must either compile that module with a high-enough
14510 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
14511 definition.  If @var{Var} is common, you must link the application
14512 with a high-enough @option{-G} setting.
14513
14514 The easiest way of satisfying these restrictions is to compile
14515 and link every module with the same @option{-G} option.  However,
14516 you may wish to build a library that supports several different
14517 small data limits.  You can do this by compiling the library with
14518 the highest supported @option{-G} setting and additionally using
14519 @option{-mno-extern-sdata} to stop the library from making assumptions
14520 about externally-defined data.
14521
14522 @item -mgpopt
14523 @itemx -mno-gpopt
14524 @opindex mgpopt
14525 @opindex mno-gpopt
14526 Use (do not use) GP-relative accesses for symbols that are known to be
14527 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
14528 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
14529 configurations.
14530
14531 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
14532 might not hold the value of @code{_gp}.  For example, if the code is
14533 part of a library that might be used in a boot monitor, programs that
14534 call boot monitor routines will pass an unknown value in @code{$gp}.
14535 (In such situations, the boot monitor itself would usually be compiled
14536 with @option{-G0}.)
14537
14538 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
14539 @option{-mno-extern-sdata}.
14540
14541 @item -membedded-data
14542 @itemx -mno-embedded-data
14543 @opindex membedded-data
14544 @opindex mno-embedded-data
14545 Allocate variables to the read-only data section first if possible, then
14546 next in the small data section if possible, otherwise in data.  This gives
14547 slightly slower code than the default, but reduces the amount of RAM required
14548 when executing, and thus may be preferred for some embedded systems.
14549
14550 @item -muninit-const-in-rodata
14551 @itemx -mno-uninit-const-in-rodata
14552 @opindex muninit-const-in-rodata
14553 @opindex mno-uninit-const-in-rodata
14554 Put uninitialized @code{const} variables in the read-only data section.
14555 This option is only meaningful in conjunction with @option{-membedded-data}.
14556
14557 @item -mcode-readable=@var{setting}
14558 @opindex mcode-readable
14559 Specify whether GCC may generate code that reads from executable sections.
14560 There are three possible settings:
14561
14562 @table @gcctabopt
14563 @item -mcode-readable=yes
14564 Instructions may freely access executable sections.  This is the
14565 default setting.
14566
14567 @item -mcode-readable=pcrel
14568 MIPS16 PC-relative load instructions can access executable sections,
14569 but other instructions must not do so.  This option is useful on 4KSc
14570 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
14571 It is also useful on processors that can be configured to have a dual
14572 instruction/data SRAM interface and that, like the M4K, automatically
14573 redirect PC-relative loads to the instruction RAM.
14574
14575 @item -mcode-readable=no
14576 Instructions must not access executable sections.  This option can be
14577 useful on targets that are configured to have a dual instruction/data
14578 SRAM interface but that (unlike the M4K) do not automatically redirect
14579 PC-relative loads to the instruction RAM.
14580 @end table
14581
14582 @item -msplit-addresses
14583 @itemx -mno-split-addresses
14584 @opindex msplit-addresses
14585 @opindex mno-split-addresses
14586 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
14587 relocation operators.  This option has been superseded by
14588 @option{-mexplicit-relocs} but is retained for backwards compatibility.
14589
14590 @item -mexplicit-relocs
14591 @itemx -mno-explicit-relocs
14592 @opindex mexplicit-relocs
14593 @opindex mno-explicit-relocs
14594 Use (do not use) assembler relocation operators when dealing with symbolic
14595 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
14596 is to use assembler macros instead.
14597
14598 @option{-mexplicit-relocs} is the default if GCC was configured
14599 to use an assembler that supports relocation operators.
14600
14601 @item -mcheck-zero-division
14602 @itemx -mno-check-zero-division
14603 @opindex mcheck-zero-division
14604 @opindex mno-check-zero-division
14605 Trap (do not trap) on integer division by zero.
14606
14607 The default is @option{-mcheck-zero-division}.
14608
14609 @item -mdivide-traps
14610 @itemx -mdivide-breaks
14611 @opindex mdivide-traps
14612 @opindex mdivide-breaks
14613 MIPS systems check for division by zero by generating either a
14614 conditional trap or a break instruction.  Using traps results in
14615 smaller code, but is only supported on MIPS II and later.  Also, some
14616 versions of the Linux kernel have a bug that prevents trap from
14617 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
14618 allow conditional traps on architectures that support them and
14619 @option{-mdivide-breaks} to force the use of breaks.
14620
14621 The default is usually @option{-mdivide-traps}, but this can be
14622 overridden at configure time using @option{--with-divide=breaks}.
14623 Divide-by-zero checks can be completely disabled using
14624 @option{-mno-check-zero-division}.
14625
14626 @item -mmemcpy
14627 @itemx -mno-memcpy
14628 @opindex mmemcpy
14629 @opindex mno-memcpy
14630 Force (do not force) the use of @code{memcpy()} for non-trivial block
14631 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
14632 most constant-sized copies.
14633
14634 @item -mlong-calls
14635 @itemx -mno-long-calls
14636 @opindex mlong-calls
14637 @opindex mno-long-calls
14638 Disable (do not disable) use of the @code{jal} instruction.  Calling
14639 functions using @code{jal} is more efficient but requires the caller
14640 and callee to be in the same 256 megabyte segment.
14641
14642 This option has no effect on abicalls code.  The default is
14643 @option{-mno-long-calls}.
14644
14645 @item -mmad
14646 @itemx -mno-mad
14647 @opindex mmad
14648 @opindex mno-mad
14649 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
14650 instructions, as provided by the R4650 ISA@.
14651
14652 @item -mfused-madd
14653 @itemx -mno-fused-madd
14654 @opindex mfused-madd
14655 @opindex mno-fused-madd
14656 Enable (disable) use of the floating point multiply-accumulate
14657 instructions, when they are available.  The default is
14658 @option{-mfused-madd}.
14659
14660 When multiply-accumulate instructions are used, the intermediate
14661 product is calculated to infinite precision and is not subject to
14662 the FCSR Flush to Zero bit.  This may be undesirable in some
14663 circumstances.
14664
14665 @item -nocpp
14666 @opindex nocpp
14667 Tell the MIPS assembler to not run its preprocessor over user
14668 assembler files (with a @samp{.s} suffix) when assembling them.
14669
14670 @item -mfix-r4000
14671 @itemx -mno-fix-r4000
14672 @opindex mfix-r4000
14673 @opindex mno-fix-r4000
14674 Work around certain R4000 CPU errata:
14675 @itemize @minus
14676 @item
14677 A double-word or a variable shift may give an incorrect result if executed
14678 immediately after starting an integer division.
14679 @item
14680 A double-word or a variable shift may give an incorrect result if executed
14681 while an integer multiplication is in progress.
14682 @item
14683 An integer division may give an incorrect result if started in a delay slot
14684 of a taken branch or a jump.
14685 @end itemize
14686
14687 @item -mfix-r4400
14688 @itemx -mno-fix-r4400
14689 @opindex mfix-r4400
14690 @opindex mno-fix-r4400
14691 Work around certain R4400 CPU errata:
14692 @itemize @minus
14693 @item
14694 A double-word or a variable shift may give an incorrect result if executed
14695 immediately after starting an integer division.
14696 @end itemize
14697
14698 @item -mfix-r10000
14699 @itemx -mno-fix-r10000
14700 @opindex mfix-r10000
14701 @opindex mno-fix-r10000
14702 Work around certain R10000 errata:
14703 @itemize @minus
14704 @item
14705 @code{ll}/@code{sc} sequences may not behave atomically on revisions
14706 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
14707 @end itemize
14708
14709 This option can only be used if the target architecture supports
14710 branch-likely instructions.  @option{-mfix-r10000} is the default when
14711 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
14712 otherwise.
14713
14714 @item -mfix-vr4120
14715 @itemx -mno-fix-vr4120
14716 @opindex mfix-vr4120
14717 Work around certain VR4120 errata:
14718 @itemize @minus
14719 @item
14720 @code{dmultu} does not always produce the correct result.
14721 @item
14722 @code{div} and @code{ddiv} do not always produce the correct result if one
14723 of the operands is negative.
14724 @end itemize
14725 The workarounds for the division errata rely on special functions in
14726 @file{libgcc.a}.  At present, these functions are only provided by
14727 the @code{mips64vr*-elf} configurations.
14728
14729 Other VR4120 errata require a nop to be inserted between certain pairs of
14730 instructions.  These errata are handled by the assembler, not by GCC itself.
14731
14732 @item -mfix-vr4130
14733 @opindex mfix-vr4130
14734 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
14735 workarounds are implemented by the assembler rather than by GCC,
14736 although GCC will avoid using @code{mflo} and @code{mfhi} if the
14737 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
14738 instructions are available instead.
14739
14740 @item -mfix-sb1
14741 @itemx -mno-fix-sb1
14742 @opindex mfix-sb1
14743 Work around certain SB-1 CPU core errata.
14744 (This flag currently works around the SB-1 revision 2
14745 ``F1'' and ``F2'' floating point errata.)
14746
14747 @item -mr10k-cache-barrier=@var{setting}
14748 @opindex mr10k-cache-barrier
14749 Specify whether GCC should insert cache barriers to avoid the
14750 side-effects of speculation on R10K processors.
14751
14752 In common with many processors, the R10K tries to predict the outcome
14753 of a conditional branch and speculatively executes instructions from
14754 the ``taken'' branch.  It later aborts these instructions if the
14755 predicted outcome was wrong.  However, on the R10K, even aborted
14756 instructions can have side effects.
14757
14758 This problem only affects kernel stores and, depending on the system,
14759 kernel loads.  As an example, a speculatively-executed store may load
14760 the target memory into cache and mark the cache line as dirty, even if
14761 the store itself is later aborted.  If a DMA operation writes to the
14762 same area of memory before the ``dirty'' line is flushed, the cached
14763 data will overwrite the DMA-ed data.  See the R10K processor manual
14764 for a full description, including other potential problems.
14765
14766 One workaround is to insert cache barrier instructions before every memory
14767 access that might be speculatively executed and that might have side
14768 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
14769 controls GCC's implementation of this workaround.  It assumes that
14770 aborted accesses to any byte in the following regions will not have
14771 side effects:
14772
14773 @enumerate
14774 @item
14775 the memory occupied by the current function's stack frame;
14776
14777 @item
14778 the memory occupied by an incoming stack argument;
14779
14780 @item
14781 the memory occupied by an object with a link-time-constant address.
14782 @end enumerate
14783
14784 It is the kernel's responsibility to ensure that speculative
14785 accesses to these regions are indeed safe.
14786
14787 If the input program contains a function declaration such as:
14788
14789 @smallexample
14790 void foo (void);
14791 @end smallexample
14792
14793 then the implementation of @code{foo} must allow @code{j foo} and
14794 @code{jal foo} to be executed speculatively.  GCC honors this
14795 restriction for functions it compiles itself.  It expects non-GCC
14796 functions (such as hand-written assembly code) to do the same.
14797
14798 The option has three forms:
14799
14800 @table @gcctabopt
14801 @item -mr10k-cache-barrier=load-store
14802 Insert a cache barrier before a load or store that might be
14803 speculatively executed and that might have side effects even
14804 if aborted.
14805
14806 @item -mr10k-cache-barrier=store
14807 Insert a cache barrier before a store that might be speculatively
14808 executed and that might have side effects even if aborted.
14809
14810 @item -mr10k-cache-barrier=none
14811 Disable the insertion of cache barriers.  This is the default setting.
14812 @end table
14813
14814 @item -mflush-func=@var{func}
14815 @itemx -mno-flush-func
14816 @opindex mflush-func
14817 Specifies the function to call to flush the I and D caches, or to not
14818 call any such function.  If called, the function must take the same
14819 arguments as the common @code{_flush_func()}, that is, the address of the
14820 memory range for which the cache is being flushed, the size of the
14821 memory range, and the number 3 (to flush both caches).  The default
14822 depends on the target GCC was configured for, but commonly is either
14823 @samp{_flush_func} or @samp{__cpu_flush}.
14824
14825 @item mbranch-cost=@var{num}
14826 @opindex mbranch-cost
14827 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14828 This cost is only a heuristic and is not guaranteed to produce
14829 consistent results across releases.  A zero cost redundantly selects
14830 the default, which is based on the @option{-mtune} setting.
14831
14832 @item -mbranch-likely
14833 @itemx -mno-branch-likely
14834 @opindex mbranch-likely
14835 @opindex mno-branch-likely
14836 Enable or disable use of Branch Likely instructions, regardless of the
14837 default for the selected architecture.  By default, Branch Likely
14838 instructions may be generated if they are supported by the selected
14839 architecture.  An exception is for the MIPS32 and MIPS64 architectures
14840 and processors which implement those architectures; for those, Branch
14841 Likely instructions will not be generated by default because the MIPS32
14842 and MIPS64 architectures specifically deprecate their use.
14843
14844 @item -mfp-exceptions
14845 @itemx -mno-fp-exceptions
14846 @opindex mfp-exceptions
14847 Specifies whether FP exceptions are enabled.  This affects how we schedule
14848 FP instructions for some processors.  The default is that FP exceptions are
14849 enabled.
14850
14851 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
14852 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
14853 FP pipe.
14854
14855 @item -mvr4130-align
14856 @itemx -mno-vr4130-align
14857 @opindex mvr4130-align
14858 The VR4130 pipeline is two-way superscalar, but can only issue two
14859 instructions together if the first one is 8-byte aligned.  When this
14860 option is enabled, GCC will align pairs of instructions that it
14861 thinks should execute in parallel.
14862
14863 This option only has an effect when optimizing for the VR4130.
14864 It normally makes code faster, but at the expense of making it bigger.
14865 It is enabled by default at optimization level @option{-O3}.
14866
14867 @item -msynci
14868 @itemx -mno-synci
14869 @opindex msynci
14870 Enable (disable) generation of @code{synci} instructions on
14871 architectures that support it.  The @code{synci} instructions (if
14872 enabled) will be generated when @code{__builtin___clear_cache()} is
14873 compiled.
14874
14875 This option defaults to @code{-mno-synci}, but the default can be
14876 overridden by configuring with @code{--with-synci}.
14877
14878 When compiling code for single processor systems, it is generally safe
14879 to use @code{synci}.  However, on many multi-core (SMP) systems, it
14880 will not invalidate the instruction caches on all cores and may lead
14881 to undefined behavior.
14882
14883 @item -mrelax-pic-calls
14884 @itemx -mno-relax-pic-calls
14885 @opindex mrelax-pic-calls
14886 Try to turn PIC calls that are normally dispatched via register
14887 @code{$25} into direct calls.  This is only possible if the linker can
14888 resolve the destination at link-time and if the destination is within
14889 range for a direct call.
14890
14891 @option{-mrelax-pic-calls} is the default if GCC was configured to use
14892 an assembler and a linker that supports the @code{.reloc} assembly
14893 directive and @code{-mexplicit-relocs} is in effect.  With
14894 @code{-mno-explicit-relocs}, this optimization can be performed by the
14895 assembler and the linker alone without help from the compiler.
14896
14897 @item -mmcount-ra-address
14898 @itemx -mno-mcount-ra-address
14899 @opindex mmcount-ra-address
14900 @opindex mno-mcount-ra-address
14901 Emit (do not emit) code that allows @code{_mcount} to modify the
14902 calling function's return address.  When enabled, this option extends
14903 the usual @code{_mcount} interface with a new @var{ra-address}
14904 parameter, which has type @code{intptr_t *} and is passed in register
14905 @code{$12}.  @code{_mcount} can then modify the return address by
14906 doing both of the following:
14907 @itemize
14908 @item
14909 Returning the new address in register @code{$31}.
14910 @item
14911 Storing the new address in @code{*@var{ra-address}},
14912 if @var{ra-address} is nonnull.
14913 @end itemize
14914
14915 The default is @option{-mno-mcount-ra-address}.
14916
14917 @end table
14918
14919 @node MMIX Options
14920 @subsection MMIX Options
14921 @cindex MMIX Options
14922
14923 These options are defined for the MMIX:
14924
14925 @table @gcctabopt
14926 @item -mlibfuncs
14927 @itemx -mno-libfuncs
14928 @opindex mlibfuncs
14929 @opindex mno-libfuncs
14930 Specify that intrinsic library functions are being compiled, passing all
14931 values in registers, no matter the size.
14932
14933 @item -mepsilon
14934 @itemx -mno-epsilon
14935 @opindex mepsilon
14936 @opindex mno-epsilon
14937 Generate floating-point comparison instructions that compare with respect
14938 to the @code{rE} epsilon register.
14939
14940 @item -mabi=mmixware
14941 @itemx -mabi=gnu
14942 @opindex mabi=mmixware
14943 @opindex mabi=gnu
14944 Generate code that passes function parameters and return values that (in
14945 the called function) are seen as registers @code{$0} and up, as opposed to
14946 the GNU ABI which uses global registers @code{$231} and up.
14947
14948 @item -mzero-extend
14949 @itemx -mno-zero-extend
14950 @opindex mzero-extend
14951 @opindex mno-zero-extend
14952 When reading data from memory in sizes shorter than 64 bits, use (do not
14953 use) zero-extending load instructions by default, rather than
14954 sign-extending ones.
14955
14956 @item -mknuthdiv
14957 @itemx -mno-knuthdiv
14958 @opindex mknuthdiv
14959 @opindex mno-knuthdiv
14960 Make the result of a division yielding a remainder have the same sign as
14961 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
14962 remainder follows the sign of the dividend.  Both methods are
14963 arithmetically valid, the latter being almost exclusively used.
14964
14965 @item -mtoplevel-symbols
14966 @itemx -mno-toplevel-symbols
14967 @opindex mtoplevel-symbols
14968 @opindex mno-toplevel-symbols
14969 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
14970 code can be used with the @code{PREFIX} assembly directive.
14971
14972 @item -melf
14973 @opindex melf
14974 Generate an executable in the ELF format, rather than the default
14975 @samp{mmo} format used by the @command{mmix} simulator.
14976
14977 @item -mbranch-predict
14978 @itemx -mno-branch-predict
14979 @opindex mbranch-predict
14980 @opindex mno-branch-predict
14981 Use (do not use) the probable-branch instructions, when static branch
14982 prediction indicates a probable branch.
14983
14984 @item -mbase-addresses
14985 @itemx -mno-base-addresses
14986 @opindex mbase-addresses
14987 @opindex mno-base-addresses
14988 Generate (do not generate) code that uses @emph{base addresses}.  Using a
14989 base address automatically generates a request (handled by the assembler
14990 and the linker) for a constant to be set up in a global register.  The
14991 register is used for one or more base address requests within the range 0
14992 to 255 from the value held in the register.  The generally leads to short
14993 and fast code, but the number of different data items that can be
14994 addressed is limited.  This means that a program that uses lots of static
14995 data may require @option{-mno-base-addresses}.
14996
14997 @item -msingle-exit
14998 @itemx -mno-single-exit
14999 @opindex msingle-exit
15000 @opindex mno-single-exit
15001 Force (do not force) generated code to have a single exit point in each
15002 function.
15003 @end table
15004
15005 @node MN10300 Options
15006 @subsection MN10300 Options
15007 @cindex MN10300 options
15008
15009 These @option{-m} options are defined for Matsushita MN10300 architectures:
15010
15011 @table @gcctabopt
15012 @item -mmult-bug
15013 @opindex mmult-bug
15014 Generate code to avoid bugs in the multiply instructions for the MN10300
15015 processors.  This is the default.
15016
15017 @item -mno-mult-bug
15018 @opindex mno-mult-bug
15019 Do not generate code to avoid bugs in the multiply instructions for the
15020 MN10300 processors.
15021
15022 @item -mam33
15023 @opindex mam33
15024 Generate code which uses features specific to the AM33 processor.
15025
15026 @item -mno-am33
15027 @opindex mno-am33
15028 Do not generate code which uses features specific to the AM33 processor.  This
15029 is the default.
15030
15031 @item -mam33-2
15032 @opindex mam33-2
15033 Generate code which uses features specific to the AM33/2.0 processor.
15034
15035 @item -mam34
15036 @opindex mam34
15037 Generate code which uses features specific to the AM34 processor.
15038
15039 @item -mtune=@var{cpu-type}
15040 @opindex mtune
15041 Use the timing characteristics of the indicated CPU type when
15042 scheduling instructions.  This does not change the targeted processor
15043 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
15044 @samp{am33-2} or @samp{am34}.
15045
15046 @item -mreturn-pointer-on-d0
15047 @opindex mreturn-pointer-on-d0
15048 When generating a function which returns a pointer, return the pointer
15049 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
15050 only in a0, and attempts to call such functions without a prototype
15051 would result in errors.  Note that this option is on by default; use
15052 @option{-mno-return-pointer-on-d0} to disable it.
15053
15054 @item -mno-crt0
15055 @opindex mno-crt0
15056 Do not link in the C run-time initialization object file.
15057
15058 @item -mrelax
15059 @opindex mrelax
15060 Indicate to the linker that it should perform a relaxation optimization pass
15061 to shorten branches, calls and absolute memory addresses.  This option only
15062 has an effect when used on the command line for the final link step.
15063
15064 This option makes symbolic debugging impossible.
15065
15066 @item -mliw
15067 @opindex mliw
15068 Allow the compiler to generate @emph{Long Instruction Word}
15069 instructions if the target is the @samp{AM33} or later.  This is the
15070 default.  This option defines the preprocessor macro @samp{__LIW__}.
15071
15072 @item -mnoliw
15073 @opindex mnoliw
15074 Do not allow the compiler to generate @emph{Long Instruction Word}
15075 instructions.  This option defines the preprocessor macro
15076 @samp{__NO_LIW__}.
15077
15078 @end table
15079
15080 @node PDP-11 Options
15081 @subsection PDP-11 Options
15082 @cindex PDP-11 Options
15083
15084 These options are defined for the PDP-11:
15085
15086 @table @gcctabopt
15087 @item -mfpu
15088 @opindex mfpu
15089 Use hardware FPP floating point.  This is the default.  (FIS floating
15090 point on the PDP-11/40 is not supported.)
15091
15092 @item -msoft-float
15093 @opindex msoft-float
15094 Do not use hardware floating point.
15095
15096 @item -mac0
15097 @opindex mac0
15098 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
15099
15100 @item -mno-ac0
15101 @opindex mno-ac0
15102 Return floating-point results in memory.  This is the default.
15103
15104 @item -m40
15105 @opindex m40
15106 Generate code for a PDP-11/40.
15107
15108 @item -m45
15109 @opindex m45
15110 Generate code for a PDP-11/45.  This is the default.
15111
15112 @item -m10
15113 @opindex m10
15114 Generate code for a PDP-11/10.
15115
15116 @item -mbcopy-builtin
15117 @opindex mbcopy-builtin
15118 Use inline @code{movmemhi} patterns for copying memory.  This is the
15119 default.
15120
15121 @item -mbcopy
15122 @opindex mbcopy
15123 Do not use inline @code{movmemhi} patterns for copying memory.
15124
15125 @item -mint16
15126 @itemx -mno-int32
15127 @opindex mint16
15128 @opindex mno-int32
15129 Use 16-bit @code{int}.  This is the default.
15130
15131 @item -mint32
15132 @itemx -mno-int16
15133 @opindex mint32
15134 @opindex mno-int16
15135 Use 32-bit @code{int}.
15136
15137 @item -mfloat64
15138 @itemx -mno-float32
15139 @opindex mfloat64
15140 @opindex mno-float32
15141 Use 64-bit @code{float}.  This is the default.
15142
15143 @item -mfloat32
15144 @itemx -mno-float64
15145 @opindex mfloat32
15146 @opindex mno-float64
15147 Use 32-bit @code{float}.
15148
15149 @item -mabshi
15150 @opindex mabshi
15151 Use @code{abshi2} pattern.  This is the default.
15152
15153 @item -mno-abshi
15154 @opindex mno-abshi
15155 Do not use @code{abshi2} pattern.
15156
15157 @item -mbranch-expensive
15158 @opindex mbranch-expensive
15159 Pretend that branches are expensive.  This is for experimenting with
15160 code generation only.
15161
15162 @item -mbranch-cheap
15163 @opindex mbranch-cheap
15164 Do not pretend that branches are expensive.  This is the default.
15165
15166 @item -munix-asm
15167 @opindex munix-asm
15168 Use Unix assembler syntax.  This is the default when configured for
15169 @samp{pdp11-*-bsd}.
15170
15171 @item -mdec-asm
15172 @opindex mdec-asm
15173 Use DEC assembler syntax.  This is the default when configured for any
15174 PDP-11 target other than @samp{pdp11-*-bsd}.
15175 @end table
15176
15177 @node picoChip Options
15178 @subsection picoChip Options
15179 @cindex picoChip options
15180
15181 These @samp{-m} options are defined for picoChip implementations:
15182
15183 @table @gcctabopt
15184
15185 @item -mae=@var{ae_type}
15186 @opindex mcpu
15187 Set the instruction set, register set, and instruction scheduling
15188 parameters for array element type @var{ae_type}.  Supported values
15189 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
15190
15191 @option{-mae=ANY} selects a completely generic AE type.  Code
15192 generated with this option will run on any of the other AE types.  The
15193 code will not be as efficient as it would be if compiled for a specific
15194 AE type, and some types of operation (e.g., multiplication) will not
15195 work properly on all types of AE.
15196
15197 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
15198 for compiled code, and is the default.
15199
15200 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
15201 option may suffer from poor performance of byte (char) manipulation,
15202 since the DSP AE does not provide hardware support for byte load/stores.
15203
15204 @item -msymbol-as-address
15205 Enable the compiler to directly use a symbol name as an address in a
15206 load/store instruction, without first loading it into a
15207 register.  Typically, the use of this option will generate larger
15208 programs, which run faster than when the option isn't used.  However, the
15209 results vary from program to program, so it is left as a user option,
15210 rather than being permanently enabled.
15211
15212 @item -mno-inefficient-warnings
15213 Disables warnings about the generation of inefficient code.  These
15214 warnings can be generated, for example, when compiling code which
15215 performs byte-level memory operations on the MAC AE type.  The MAC AE has
15216 no hardware support for byte-level memory operations, so all byte
15217 load/stores must be synthesized from word load/store operations.  This is
15218 inefficient and a warning will be generated indicating to the programmer
15219 that they should rewrite the code to avoid byte operations, or to target
15220 an AE type which has the necessary hardware support.  This option enables
15221 the warning to be turned off.
15222
15223 @end table
15224
15225 @node PowerPC Options
15226 @subsection PowerPC Options
15227 @cindex PowerPC options
15228
15229 These are listed under @xref{RS/6000 and PowerPC Options}.
15230
15231 @node RS/6000 and PowerPC Options
15232 @subsection IBM RS/6000 and PowerPC Options
15233 @cindex RS/6000 and PowerPC Options
15234 @cindex IBM RS/6000 and PowerPC Options
15235
15236 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
15237 @table @gcctabopt
15238 @item -mpower
15239 @itemx -mno-power
15240 @itemx -mpower2
15241 @itemx -mno-power2
15242 @itemx -mpowerpc
15243 @itemx -mno-powerpc
15244 @itemx -mpowerpc-gpopt
15245 @itemx -mno-powerpc-gpopt
15246 @itemx -mpowerpc-gfxopt
15247 @itemx -mno-powerpc-gfxopt
15248 @need 800
15249 @itemx -mpowerpc64
15250 @itemx -mno-powerpc64
15251 @itemx -mmfcrf
15252 @itemx -mno-mfcrf
15253 @itemx -mpopcntb
15254 @itemx -mno-popcntb
15255 @itemx -mpopcntd
15256 @itemx -mno-popcntd
15257 @itemx -mfprnd
15258 @itemx -mno-fprnd
15259 @need 800
15260 @itemx -mcmpb
15261 @itemx -mno-cmpb
15262 @itemx -mmfpgpr
15263 @itemx -mno-mfpgpr
15264 @itemx -mhard-dfp
15265 @itemx -mno-hard-dfp
15266 @opindex mpower
15267 @opindex mno-power
15268 @opindex mpower2
15269 @opindex mno-power2
15270 @opindex mpowerpc
15271 @opindex mno-powerpc
15272 @opindex mpowerpc-gpopt
15273 @opindex mno-powerpc-gpopt
15274 @opindex mpowerpc-gfxopt
15275 @opindex mno-powerpc-gfxopt
15276 @opindex mpowerpc64
15277 @opindex mno-powerpc64
15278 @opindex mmfcrf
15279 @opindex mno-mfcrf
15280 @opindex mpopcntb
15281 @opindex mno-popcntb
15282 @opindex mpopcntd
15283 @opindex mno-popcntd
15284 @opindex mfprnd
15285 @opindex mno-fprnd
15286 @opindex mcmpb
15287 @opindex mno-cmpb
15288 @opindex mmfpgpr
15289 @opindex mno-mfpgpr
15290 @opindex mhard-dfp
15291 @opindex mno-hard-dfp
15292 GCC supports two related instruction set architectures for the
15293 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
15294 instructions supported by the @samp{rios} chip set used in the original
15295 RS/6000 systems and the @dfn{PowerPC} instruction set is the
15296 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
15297 the IBM 4xx, 6xx, and follow-on microprocessors.
15298
15299 Neither architecture is a subset of the other.  However there is a
15300 large common subset of instructions supported by both.  An MQ
15301 register is included in processors supporting the POWER architecture.
15302
15303 You use these options to specify which instructions are available on the
15304 processor you are using.  The default value of these options is
15305 determined when configuring GCC@.  Specifying the
15306 @option{-mcpu=@var{cpu_type}} overrides the specification of these
15307 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
15308 rather than the options listed above.
15309
15310 The @option{-mpower} option allows GCC to generate instructions that
15311 are found only in the POWER architecture and to use the MQ register.
15312 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
15313 to generate instructions that are present in the POWER2 architecture but
15314 not the original POWER architecture.
15315
15316 The @option{-mpowerpc} option allows GCC to generate instructions that
15317 are found only in the 32-bit subset of the PowerPC architecture.
15318 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
15319 GCC to use the optional PowerPC architecture instructions in the
15320 General Purpose group, including floating-point square root.  Specifying
15321 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
15322 use the optional PowerPC architecture instructions in the Graphics
15323 group, including floating-point select.
15324
15325 The @option{-mmfcrf} option allows GCC to generate the move from
15326 condition register field instruction implemented on the POWER4
15327 processor and other processors that support the PowerPC V2.01
15328 architecture.
15329 The @option{-mpopcntb} option allows GCC to generate the popcount and
15330 double precision FP reciprocal estimate instruction implemented on the
15331 POWER5 processor and other processors that support the PowerPC V2.02
15332 architecture.
15333 The @option{-mpopcntd} option allows GCC to generate the popcount
15334 instruction implemented on the POWER7 processor and other processors
15335 that support the PowerPC V2.06 architecture.
15336 The @option{-mfprnd} option allows GCC to generate the FP round to
15337 integer instructions implemented on the POWER5+ processor and other
15338 processors that support the PowerPC V2.03 architecture.
15339 The @option{-mcmpb} option allows GCC to generate the compare bytes
15340 instruction implemented on the POWER6 processor and other processors
15341 that support the PowerPC V2.05 architecture.
15342 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
15343 general purpose register instructions implemented on the POWER6X
15344 processor and other processors that support the extended PowerPC V2.05
15345 architecture.
15346 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
15347 point instructions implemented on some POWER processors.
15348
15349 The @option{-mpowerpc64} option allows GCC to generate the additional
15350 64-bit instructions that are found in the full PowerPC64 architecture
15351 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
15352 @option{-mno-powerpc64}.
15353
15354 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
15355 will use only the instructions in the common subset of both
15356 architectures plus some special AIX common-mode calls, and will not use
15357 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
15358 permits GCC to use any instruction from either architecture and to
15359 allow use of the MQ register; specify this for the Motorola MPC601.
15360
15361 @item -mnew-mnemonics
15362 @itemx -mold-mnemonics
15363 @opindex mnew-mnemonics
15364 @opindex mold-mnemonics
15365 Select which mnemonics to use in the generated assembler code.  With
15366 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
15367 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
15368 assembler mnemonics defined for the POWER architecture.  Instructions
15369 defined in only one architecture have only one mnemonic; GCC uses that
15370 mnemonic irrespective of which of these options is specified.
15371
15372 GCC defaults to the mnemonics appropriate for the architecture in
15373 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
15374 value of these option.  Unless you are building a cross-compiler, you
15375 should normally not specify either @option{-mnew-mnemonics} or
15376 @option{-mold-mnemonics}, but should instead accept the default.
15377
15378 @item -mcpu=@var{cpu_type}
15379 @opindex mcpu
15380 Set architecture type, register usage, choice of mnemonics, and
15381 instruction scheduling parameters for machine type @var{cpu_type}.
15382 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
15383 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
15384 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
15385 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
15386 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
15387 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
15388 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
15389 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
15390 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
15391 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
15392 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
15393
15394 @option{-mcpu=common} selects a completely generic processor.  Code
15395 generated under this option will run on any POWER or PowerPC processor.
15396 GCC will use only the instructions in the common subset of both
15397 architectures, and will not use the MQ register.  GCC assumes a generic
15398 processor model for scheduling purposes.
15399
15400 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
15401 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
15402 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
15403 types, with an appropriate, generic processor model assumed for
15404 scheduling purposes.
15405
15406 The other options specify a specific processor.  Code generated under
15407 those options will run best on that processor, and may not run at all on
15408 others.
15409
15410 The @option{-mcpu} options automatically enable or disable the
15411 following options:
15412
15413 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
15414 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
15415 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
15416 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
15417
15418 The particular options set for any particular CPU will vary between
15419 compiler versions, depending on what setting seems to produce optimal
15420 code for that CPU; it doesn't necessarily reflect the actual hardware's
15421 capabilities.  If you wish to set an individual option to a particular
15422 value, you may specify it after the @option{-mcpu} option, like
15423 @samp{-mcpu=970 -mno-altivec}.
15424
15425 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
15426 not enabled or disabled by the @option{-mcpu} option at present because
15427 AIX does not have full support for these options.  You may still
15428 enable or disable them individually if you're sure it'll work in your
15429 environment.
15430
15431 @item -mtune=@var{cpu_type}
15432 @opindex mtune
15433 Set the instruction scheduling parameters for machine type
15434 @var{cpu_type}, but do not set the architecture type, register usage, or
15435 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
15436 values for @var{cpu_type} are used for @option{-mtune} as for
15437 @option{-mcpu}.  If both are specified, the code generated will use the
15438 architecture, registers, and mnemonics set by @option{-mcpu}, but the
15439 scheduling parameters set by @option{-mtune}.
15440
15441 @item -mcmodel=small
15442 @opindex mcmodel=small
15443 Generate PowerPC64 code for the small model: The TOC is limited to
15444 64k.
15445
15446 @item -mcmodel=medium
15447 @opindex mcmodel=medium
15448 Generate PowerPC64 code for the medium model: The TOC and other static
15449 data may be up to a total of 4G in size.
15450
15451 @item -mcmodel=large
15452 @opindex mcmodel=large
15453 Generate PowerPC64 code for the large model: The TOC may be up to 4G
15454 in size.  Other data and code is only limited by the 64-bit address
15455 space.
15456
15457 @item -maltivec
15458 @itemx -mno-altivec
15459 @opindex maltivec
15460 @opindex mno-altivec
15461 Generate code that uses (does not use) AltiVec instructions, and also
15462 enable the use of built-in functions that allow more direct access to
15463 the AltiVec instruction set.  You may also need to set
15464 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
15465 enhancements.
15466
15467 @item -mvrsave
15468 @itemx -mno-vrsave
15469 @opindex mvrsave
15470 @opindex mno-vrsave
15471 Generate VRSAVE instructions when generating AltiVec code.
15472
15473 @item -mgen-cell-microcode
15474 @opindex mgen-cell-microcode
15475 Generate Cell microcode instructions
15476
15477 @item -mwarn-cell-microcode
15478 @opindex mwarn-cell-microcode
15479 Warning when a Cell microcode instruction is going to emitted.  An example
15480 of a Cell microcode instruction is a variable shift.
15481
15482 @item -msecure-plt
15483 @opindex msecure-plt
15484 Generate code that allows ld and ld.so to build executables and shared
15485 libraries with non-exec .plt and .got sections.  This is a PowerPC
15486 32-bit SYSV ABI option.
15487
15488 @item -mbss-plt
15489 @opindex mbss-plt
15490 Generate code that uses a BSS .plt section that ld.so fills in, and
15491 requires .plt and .got sections that are both writable and executable.
15492 This is a PowerPC 32-bit SYSV ABI option.
15493
15494 @item -misel
15495 @itemx -mno-isel
15496 @opindex misel
15497 @opindex mno-isel
15498 This switch enables or disables the generation of ISEL instructions.
15499
15500 @item -misel=@var{yes/no}
15501 This switch has been deprecated.  Use @option{-misel} and
15502 @option{-mno-isel} instead.
15503
15504 @item -mspe
15505 @itemx -mno-spe
15506 @opindex mspe
15507 @opindex mno-spe
15508 This switch enables or disables the generation of SPE simd
15509 instructions.
15510
15511 @item -mpaired
15512 @itemx -mno-paired
15513 @opindex mpaired
15514 @opindex mno-paired
15515 This switch enables or disables the generation of PAIRED simd
15516 instructions.
15517
15518 @item -mspe=@var{yes/no}
15519 This option has been deprecated.  Use @option{-mspe} and
15520 @option{-mno-spe} instead.
15521
15522 @item -mvsx
15523 @itemx -mno-vsx
15524 @opindex mvsx
15525 @opindex mno-vsx
15526 Generate code that uses (does not use) vector/scalar (VSX)
15527 instructions, and also enable the use of built-in functions that allow
15528 more direct access to the VSX instruction set.
15529
15530 @item -mfloat-gprs=@var{yes/single/double/no}
15531 @itemx -mfloat-gprs
15532 @opindex mfloat-gprs
15533 This switch enables or disables the generation of floating point
15534 operations on the general purpose registers for architectures that
15535 support it.
15536
15537 The argument @var{yes} or @var{single} enables the use of
15538 single-precision floating point operations.
15539
15540 The argument @var{double} enables the use of single and
15541 double-precision floating point operations.
15542
15543 The argument @var{no} disables floating point operations on the
15544 general purpose registers.
15545
15546 This option is currently only available on the MPC854x.
15547
15548 @item -m32
15549 @itemx -m64
15550 @opindex m32
15551 @opindex m64
15552 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
15553 targets (including GNU/Linux).  The 32-bit environment sets int, long
15554 and pointer to 32 bits and generates code that runs on any PowerPC
15555 variant.  The 64-bit environment sets int to 32 bits and long and
15556 pointer to 64 bits, and generates code for PowerPC64, as for
15557 @option{-mpowerpc64}.
15558
15559 @item -mfull-toc
15560 @itemx -mno-fp-in-toc
15561 @itemx -mno-sum-in-toc
15562 @itemx -mminimal-toc
15563 @opindex mfull-toc
15564 @opindex mno-fp-in-toc
15565 @opindex mno-sum-in-toc
15566 @opindex mminimal-toc
15567 Modify generation of the TOC (Table Of Contents), which is created for
15568 every executable file.  The @option{-mfull-toc} option is selected by
15569 default.  In that case, GCC will allocate at least one TOC entry for
15570 each unique non-automatic variable reference in your program.  GCC
15571 will also place floating-point constants in the TOC@.  However, only
15572 16,384 entries are available in the TOC@.
15573
15574 If you receive a linker error message that saying you have overflowed
15575 the available TOC space, you can reduce the amount of TOC space used
15576 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
15577 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
15578 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
15579 generate code to calculate the sum of an address and a constant at
15580 run-time instead of putting that sum into the TOC@.  You may specify one
15581 or both of these options.  Each causes GCC to produce very slightly
15582 slower and larger code at the expense of conserving TOC space.
15583
15584 If you still run out of space in the TOC even when you specify both of
15585 these options, specify @option{-mminimal-toc} instead.  This option causes
15586 GCC to make only one TOC entry for every file.  When you specify this
15587 option, GCC will produce code that is slower and larger but which
15588 uses extremely little TOC space.  You may wish to use this option
15589 only on files that contain less frequently executed code.
15590
15591 @item -maix64
15592 @itemx -maix32
15593 @opindex maix64
15594 @opindex maix32
15595 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
15596 @code{long} type, and the infrastructure needed to support them.
15597 Specifying @option{-maix64} implies @option{-mpowerpc64} and
15598 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
15599 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
15600
15601 @item -mxl-compat
15602 @itemx -mno-xl-compat
15603 @opindex mxl-compat
15604 @opindex mno-xl-compat
15605 Produce code that conforms more closely to IBM XL compiler semantics
15606 when using AIX-compatible ABI@.  Pass floating-point arguments to
15607 prototyped functions beyond the register save area (RSA) on the stack
15608 in addition to argument FPRs.  Do not assume that most significant
15609 double in 128-bit long double value is properly rounded when comparing
15610 values and converting to double.  Use XL symbol names for long double
15611 support routines.
15612
15613 The AIX calling convention was extended but not initially documented to
15614 handle an obscure K&R C case of calling a function that takes the
15615 address of its arguments with fewer arguments than declared.  IBM XL
15616 compilers access floating point arguments which do not fit in the
15617 RSA from the stack when a subroutine is compiled without
15618 optimization.  Because always storing floating-point arguments on the
15619 stack is inefficient and rarely needed, this option is not enabled by
15620 default and only is necessary when calling subroutines compiled by IBM
15621 XL compilers without optimization.
15622
15623 @item -mpe
15624 @opindex mpe
15625 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
15626 application written to use message passing with special startup code to
15627 enable the application to run.  The system must have PE installed in the
15628 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
15629 must be overridden with the @option{-specs=} option to specify the
15630 appropriate directory location.  The Parallel Environment does not
15631 support threads, so the @option{-mpe} option and the @option{-pthread}
15632 option are incompatible.
15633
15634 @item -malign-natural
15635 @itemx -malign-power
15636 @opindex malign-natural
15637 @opindex malign-power
15638 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
15639 @option{-malign-natural} overrides the ABI-defined alignment of larger
15640 types, such as floating-point doubles, on their natural size-based boundary.
15641 The option @option{-malign-power} instructs GCC to follow the ABI-specified
15642 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
15643
15644 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
15645 is not supported.
15646
15647 @item -msoft-float
15648 @itemx -mhard-float
15649 @opindex msoft-float
15650 @opindex mhard-float
15651 Generate code that does not use (uses) the floating-point register set.
15652 Software floating point emulation is provided if you use the
15653 @option{-msoft-float} option, and pass the option to GCC when linking.
15654
15655 @item -msingle-float
15656 @itemx -mdouble-float
15657 @opindex msingle-float
15658 @opindex mdouble-float
15659 Generate code for single or double-precision floating point operations.
15660 @option{-mdouble-float} implies @option{-msingle-float}.
15661
15662 @item -msimple-fpu
15663 @opindex msimple-fpu
15664 Do not generate sqrt and div instructions for hardware floating point unit.
15665
15666 @item -mfpu
15667 @opindex mfpu
15668 Specify type of floating point unit.  Valid values are @var{sp_lite}
15669 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
15670 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
15671 and @var{dp_full} (equivalent to -mdouble-float).
15672
15673 @item -mxilinx-fpu
15674 @opindex mxilinx-fpu
15675 Perform optimizations for floating point unit on Xilinx PPC 405/440.
15676
15677 @item -mmultiple
15678 @itemx -mno-multiple
15679 @opindex mmultiple
15680 @opindex mno-multiple
15681 Generate code that uses (does not use) the load multiple word
15682 instructions and the store multiple word instructions.  These
15683 instructions are generated by default on POWER systems, and not
15684 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
15685 endian PowerPC systems, since those instructions do not work when the
15686 processor is in little endian mode.  The exceptions are PPC740 and
15687 PPC750 which permit the instructions usage in little endian mode.
15688
15689 @item -mstring
15690 @itemx -mno-string
15691 @opindex mstring
15692 @opindex mno-string
15693 Generate code that uses (does not use) the load string instructions
15694 and the store string word instructions to save multiple registers and
15695 do small block moves.  These instructions are generated by default on
15696 POWER systems, and not generated on PowerPC systems.  Do not use
15697 @option{-mstring} on little endian PowerPC systems, since those
15698 instructions do not work when the processor is in little endian mode.
15699 The exceptions are PPC740 and PPC750 which permit the instructions
15700 usage in little endian mode.
15701
15702 @item -mupdate
15703 @itemx -mno-update
15704 @opindex mupdate
15705 @opindex mno-update
15706 Generate code that uses (does not use) the load or store instructions
15707 that update the base register to the address of the calculated memory
15708 location.  These instructions are generated by default.  If you use
15709 @option{-mno-update}, there is a small window between the time that the
15710 stack pointer is updated and the address of the previous frame is
15711 stored, which means code that walks the stack frame across interrupts or
15712 signals may get corrupted data.
15713
15714 @item -mavoid-indexed-addresses
15715 @itemx -mno-avoid-indexed-addresses
15716 @opindex mavoid-indexed-addresses
15717 @opindex mno-avoid-indexed-addresses
15718 Generate code that tries to avoid (not avoid) the use of indexed load
15719 or store instructions. These instructions can incur a performance
15720 penalty on Power6 processors in certain situations, such as when
15721 stepping through large arrays that cross a 16M boundary.  This option
15722 is enabled by default when targetting Power6 and disabled otherwise.
15723
15724 @item -mfused-madd
15725 @itemx -mno-fused-madd
15726 @opindex mfused-madd
15727 @opindex mno-fused-madd
15728 Generate code that uses (does not use) the floating point multiply and
15729 accumulate instructions.  These instructions are generated by default
15730 if hardware floating point is used.  The machine dependent
15731 @option{-mfused-madd} option is now mapped to the machine independent
15732 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
15733 mapped to @option{-ffp-contract=off}.
15734
15735 @item -mmulhw
15736 @itemx -mno-mulhw
15737 @opindex mmulhw
15738 @opindex mno-mulhw
15739 Generate code that uses (does not use) the half-word multiply and
15740 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
15741 These instructions are generated by default when targetting those
15742 processors.
15743
15744 @item -mdlmzb
15745 @itemx -mno-dlmzb
15746 @opindex mdlmzb
15747 @opindex mno-dlmzb
15748 Generate code that uses (does not use) the string-search @samp{dlmzb}
15749 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
15750 generated by default when targetting those processors.
15751
15752 @item -mno-bit-align
15753 @itemx -mbit-align
15754 @opindex mno-bit-align
15755 @opindex mbit-align
15756 On System V.4 and embedded PowerPC systems do not (do) force structures
15757 and unions that contain bit-fields to be aligned to the base type of the
15758 bit-field.
15759
15760 For example, by default a structure containing nothing but 8
15761 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
15762 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
15763 the structure would be aligned to a 1 byte boundary and be one byte in
15764 size.
15765
15766 @item -mno-strict-align
15767 @itemx -mstrict-align
15768 @opindex mno-strict-align
15769 @opindex mstrict-align
15770 On System V.4 and embedded PowerPC systems do not (do) assume that
15771 unaligned memory references will be handled by the system.
15772
15773 @item -mrelocatable
15774 @itemx -mno-relocatable
15775 @opindex mrelocatable
15776 @opindex mno-relocatable
15777 Generate code that allows (does not allow) a static executable to be
15778 relocated to a different address at runtime.  A simple embedded
15779 PowerPC system loader should relocate the entire contents of
15780 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
15781 a table of 32-bit addresses generated by this option.  For this to
15782 work, all objects linked together must be compiled with
15783 @option{-mrelocatable} or @option{-mrelocatable-lib}.
15784 @option{-mrelocatable} code aligns the stack to an 8 byte boundary.
15785
15786 @item -mrelocatable-lib
15787 @itemx -mno-relocatable-lib
15788 @opindex mrelocatable-lib
15789 @opindex mno-relocatable-lib
15790 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
15791 @code{.fixup} section to allow static executables to be relocated at
15792 runtime, but @option{-mrelocatable-lib} does not use the smaller stack
15793 alignment of @option{-mrelocatable}.  Objects compiled with
15794 @option{-mrelocatable-lib} may be linked with objects compiled with
15795 any combination of the @option{-mrelocatable} options.
15796
15797 @item -mno-toc
15798 @itemx -mtoc
15799 @opindex mno-toc
15800 @opindex mtoc
15801 On System V.4 and embedded PowerPC systems do not (do) assume that
15802 register 2 contains a pointer to a global area pointing to the addresses
15803 used in the program.
15804
15805 @item -mlittle
15806 @itemx -mlittle-endian
15807 @opindex mlittle
15808 @opindex mlittle-endian
15809 On System V.4 and embedded PowerPC systems compile code for the
15810 processor in little endian mode.  The @option{-mlittle-endian} option is
15811 the same as @option{-mlittle}.
15812
15813 @item -mbig
15814 @itemx -mbig-endian
15815 @opindex mbig
15816 @opindex mbig-endian
15817 On System V.4 and embedded PowerPC systems compile code for the
15818 processor in big endian mode.  The @option{-mbig-endian} option is
15819 the same as @option{-mbig}.
15820
15821 @item -mdynamic-no-pic
15822 @opindex mdynamic-no-pic
15823 On Darwin and Mac OS X systems, compile code so that it is not
15824 relocatable, but that its external references are relocatable.  The
15825 resulting code is suitable for applications, but not shared
15826 libraries.
15827
15828 @item -msingle-pic-base
15829 @opindex msingle-pic-base
15830 Treat the register used for PIC addressing as read-only, rather than
15831 loading it in the prologue for each function.  The run-time system is
15832 responsible for initializing this register with an appropriate value
15833 before execution begins.
15834
15835 @item -mprioritize-restricted-insns=@var{priority}
15836 @opindex mprioritize-restricted-insns
15837 This option controls the priority that is assigned to
15838 dispatch-slot restricted instructions during the second scheduling
15839 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
15840 @var{no/highest/second-highest} priority to dispatch slot restricted
15841 instructions.
15842
15843 @item -msched-costly-dep=@var{dependence_type}
15844 @opindex msched-costly-dep
15845 This option controls which dependences are considered costly
15846 by the target during instruction scheduling.  The argument
15847 @var{dependence_type} takes one of the following values:
15848 @var{no}: no dependence is costly,
15849 @var{all}: all dependences are costly,
15850 @var{true_store_to_load}: a true dependence from store to load is costly,
15851 @var{store_to_load}: any dependence from store to load is costly,
15852 @var{number}: any dependence which latency >= @var{number} is costly.
15853
15854 @item -minsert-sched-nops=@var{scheme}
15855 @opindex minsert-sched-nops
15856 This option controls which nop insertion scheme will be used during
15857 the second scheduling pass.  The argument @var{scheme} takes one of the
15858 following values:
15859 @var{no}: Don't insert nops.
15860 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
15861 according to the scheduler's grouping.
15862 @var{regroup_exact}: Insert nops to force costly dependent insns into
15863 separate groups.  Insert exactly as many nops as needed to force an insn
15864 to a new group, according to the estimated processor grouping.
15865 @var{number}: Insert nops to force costly dependent insns into
15866 separate groups.  Insert @var{number} nops to force an insn to a new group.
15867
15868 @item -mcall-sysv
15869 @opindex mcall-sysv
15870 On System V.4 and embedded PowerPC systems compile code using calling
15871 conventions that adheres to the March 1995 draft of the System V
15872 Application Binary Interface, PowerPC processor supplement.  This is the
15873 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
15874
15875 @item -mcall-sysv-eabi
15876 @itemx -mcall-eabi
15877 @opindex mcall-sysv-eabi
15878 @opindex mcall-eabi
15879 Specify both @option{-mcall-sysv} and @option{-meabi} options.
15880
15881 @item -mcall-sysv-noeabi
15882 @opindex mcall-sysv-noeabi
15883 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
15884
15885 @item -mcall-aixdesc
15886 @opindex m
15887 On System V.4 and embedded PowerPC systems compile code for the AIX
15888 operating system.
15889
15890 @item -mcall-linux
15891 @opindex mcall-linux
15892 On System V.4 and embedded PowerPC systems compile code for the
15893 Linux-based GNU system.
15894
15895 @item -mcall-gnu
15896 @opindex mcall-gnu
15897 On System V.4 and embedded PowerPC systems compile code for the
15898 Hurd-based GNU system.
15899
15900 @item -mcall-freebsd
15901 @opindex mcall-freebsd
15902 On System V.4 and embedded PowerPC systems compile code for the
15903 FreeBSD operating system.
15904
15905 @item -mcall-netbsd
15906 @opindex mcall-netbsd
15907 On System V.4 and embedded PowerPC systems compile code for the
15908 NetBSD operating system.
15909
15910 @item -mcall-openbsd
15911 @opindex mcall-netbsd
15912 On System V.4 and embedded PowerPC systems compile code for the
15913 OpenBSD operating system.
15914
15915 @item -maix-struct-return
15916 @opindex maix-struct-return
15917 Return all structures in memory (as specified by the AIX ABI)@.
15918
15919 @item -msvr4-struct-return
15920 @opindex msvr4-struct-return
15921 Return structures smaller than 8 bytes in registers (as specified by the
15922 SVR4 ABI)@.
15923
15924 @item -mabi=@var{abi-type}
15925 @opindex mabi
15926 Extend the current ABI with a particular extension, or remove such extension.
15927 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
15928 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
15929
15930 @item -mabi=spe
15931 @opindex mabi=spe
15932 Extend the current ABI with SPE ABI extensions.  This does not change
15933 the default ABI, instead it adds the SPE ABI extensions to the current
15934 ABI@.
15935
15936 @item -mabi=no-spe
15937 @opindex mabi=no-spe
15938 Disable Booke SPE ABI extensions for the current ABI@.
15939
15940 @item -mabi=ibmlongdouble
15941 @opindex mabi=ibmlongdouble
15942 Change the current ABI to use IBM extended precision long double.
15943 This is a PowerPC 32-bit SYSV ABI option.
15944
15945 @item -mabi=ieeelongdouble
15946 @opindex mabi=ieeelongdouble
15947 Change the current ABI to use IEEE extended precision long double.
15948 This is a PowerPC 32-bit Linux ABI option.
15949
15950 @item -mprototype
15951 @itemx -mno-prototype
15952 @opindex mprototype
15953 @opindex mno-prototype
15954 On System V.4 and embedded PowerPC systems assume that all calls to
15955 variable argument functions are properly prototyped.  Otherwise, the
15956 compiler must insert an instruction before every non prototyped call to
15957 set or clear bit 6 of the condition code register (@var{CR}) to
15958 indicate whether floating point values were passed in the floating point
15959 registers in case the function takes a variable arguments.  With
15960 @option{-mprototype}, only calls to prototyped variable argument functions
15961 will set or clear the bit.
15962
15963 @item -msim
15964 @opindex msim
15965 On embedded PowerPC systems, assume that the startup module is called
15966 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
15967 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
15968 configurations.
15969
15970 @item -mmvme
15971 @opindex mmvme
15972 On embedded PowerPC systems, assume that the startup module is called
15973 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
15974 @file{libc.a}.
15975
15976 @item -mads
15977 @opindex mads
15978 On embedded PowerPC systems, assume that the startup module is called
15979 @file{crt0.o} and the standard C libraries are @file{libads.a} and
15980 @file{libc.a}.
15981
15982 @item -myellowknife
15983 @opindex myellowknife
15984 On embedded PowerPC systems, assume that the startup module is called
15985 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
15986 @file{libc.a}.
15987
15988 @item -mvxworks
15989 @opindex mvxworks
15990 On System V.4 and embedded PowerPC systems, specify that you are
15991 compiling for a VxWorks system.
15992
15993 @item -memb
15994 @opindex memb
15995 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
15996 header to indicate that @samp{eabi} extended relocations are used.
15997
15998 @item -meabi
15999 @itemx -mno-eabi
16000 @opindex meabi
16001 @opindex mno-eabi
16002 On System V.4 and embedded PowerPC systems do (do not) adhere to the
16003 Embedded Applications Binary Interface (eabi) which is a set of
16004 modifications to the System V.4 specifications.  Selecting @option{-meabi}
16005 means that the stack is aligned to an 8 byte boundary, a function
16006 @code{__eabi} is called to from @code{main} to set up the eabi
16007 environment, and the @option{-msdata} option can use both @code{r2} and
16008 @code{r13} to point to two separate small data areas.  Selecting
16009 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
16010 do not call an initialization function from @code{main}, and the
16011 @option{-msdata} option will only use @code{r13} to point to a single
16012 small data area.  The @option{-meabi} option is on by default if you
16013 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
16014
16015 @item -msdata=eabi
16016 @opindex msdata=eabi
16017 On System V.4 and embedded PowerPC systems, put small initialized
16018 @code{const} global and static data in the @samp{.sdata2} section, which
16019 is pointed to by register @code{r2}.  Put small initialized
16020 non-@code{const} global and static data in the @samp{.sdata} section,
16021 which is pointed to by register @code{r13}.  Put small uninitialized
16022 global and static data in the @samp{.sbss} section, which is adjacent to
16023 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
16024 incompatible with the @option{-mrelocatable} option.  The
16025 @option{-msdata=eabi} option also sets the @option{-memb} option.
16026
16027 @item -msdata=sysv
16028 @opindex msdata=sysv
16029 On System V.4 and embedded PowerPC systems, put small global and static
16030 data in the @samp{.sdata} section, which is pointed to by register
16031 @code{r13}.  Put small uninitialized global and static data in the
16032 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
16033 The @option{-msdata=sysv} option is incompatible with the
16034 @option{-mrelocatable} option.
16035
16036 @item -msdata=default
16037 @itemx -msdata
16038 @opindex msdata=default
16039 @opindex msdata
16040 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
16041 compile code the same as @option{-msdata=eabi}, otherwise compile code the
16042 same as @option{-msdata=sysv}.
16043
16044 @item -msdata=data
16045 @opindex msdata=data
16046 On System V.4 and embedded PowerPC systems, put small global
16047 data in the @samp{.sdata} section.  Put small uninitialized global
16048 data in the @samp{.sbss} section.  Do not use register @code{r13}
16049 to address small data however.  This is the default behavior unless
16050 other @option{-msdata} options are used.
16051
16052 @item -msdata=none
16053 @itemx -mno-sdata
16054 @opindex msdata=none
16055 @opindex mno-sdata
16056 On embedded PowerPC systems, put all initialized global and static data
16057 in the @samp{.data} section, and all uninitialized data in the
16058 @samp{.bss} section.
16059
16060 @item -mblock-move-inline-limit=@var{num}
16061 @opindex mblock-move-inline-limit
16062 Inline all block moves (such as calls to @code{memcpy} or structure
16063 copies) less than or equal to @var{num} bytes.  The minimum value for
16064 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
16065 targets.  The default value is target-specific.
16066
16067 @item -G @var{num}
16068 @opindex G
16069 @cindex smaller data references (PowerPC)
16070 @cindex .sdata/.sdata2 references (PowerPC)
16071 On embedded PowerPC systems, put global and static items less than or
16072 equal to @var{num} bytes into the small data or bss sections instead of
16073 the normal data or bss section.  By default, @var{num} is 8.  The
16074 @option{-G @var{num}} switch is also passed to the linker.
16075 All modules should be compiled with the same @option{-G @var{num}} value.
16076
16077 @item -mregnames
16078 @itemx -mno-regnames
16079 @opindex mregnames
16080 @opindex mno-regnames
16081 On System V.4 and embedded PowerPC systems do (do not) emit register
16082 names in the assembly language output using symbolic forms.
16083
16084 @item -mlongcall
16085 @itemx -mno-longcall
16086 @opindex mlongcall
16087 @opindex mno-longcall
16088 By default assume that all calls are far away so that a longer more
16089 expensive calling sequence is required.  This is required for calls
16090 further than 32 megabytes (33,554,432 bytes) from the current location.
16091 A short call will be generated if the compiler knows
16092 the call cannot be that far away.  This setting can be overridden by
16093 the @code{shortcall} function attribute, or by @code{#pragma
16094 longcall(0)}.
16095
16096 Some linkers are capable of detecting out-of-range calls and generating
16097 glue code on the fly.  On these systems, long calls are unnecessary and
16098 generate slower code.  As of this writing, the AIX linker can do this,
16099 as can the GNU linker for PowerPC/64.  It is planned to add this feature
16100 to the GNU linker for 32-bit PowerPC systems as well.
16101
16102 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
16103 callee, L42'', plus a ``branch island'' (glue code).  The two target
16104 addresses represent the callee and the ``branch island''.  The
16105 Darwin/PPC linker will prefer the first address and generate a ``bl
16106 callee'' if the PPC ``bl'' instruction will reach the callee directly;
16107 otherwise, the linker will generate ``bl L42'' to call the ``branch
16108 island''.  The ``branch island'' is appended to the body of the
16109 calling function; it computes the full 32-bit address of the callee
16110 and jumps to it.
16111
16112 On Mach-O (Darwin) systems, this option directs the compiler emit to
16113 the glue for every direct call, and the Darwin linker decides whether
16114 to use or discard it.
16115
16116 In the future, we may cause GCC to ignore all longcall specifications
16117 when the linker is known to generate glue.
16118
16119 @item -mtls-markers
16120 @itemx -mno-tls-markers
16121 @opindex mtls-markers
16122 @opindex mno-tls-markers
16123 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
16124 specifying the function argument.  The relocation allows ld to
16125 reliably associate function call with argument setup instructions for
16126 TLS optimization, which in turn allows gcc to better schedule the
16127 sequence.
16128
16129 @item -pthread
16130 @opindex pthread
16131 Adds support for multithreading with the @dfn{pthreads} library.
16132 This option sets flags for both the preprocessor and linker.
16133
16134 @item -mrecip
16135 @itemx -mno-recip
16136 @opindex mrecip
16137 This option will enable GCC to use the reciprocal estimate and
16138 reciprocal square root estimate instructions with additional
16139 Newton-Raphson steps to increase precision instead of doing a divide or
16140 square root and divide for floating point arguments.  You should use
16141 the @option{-ffast-math} option when using @option{-mrecip} (or at
16142 least @option{-funsafe-math-optimizations},
16143 @option{-finite-math-only}, @option{-freciprocal-math} and
16144 @option{-fno-trapping-math}).  Note that while the throughput of the
16145 sequence is generally higher than the throughput of the non-reciprocal
16146 instruction, the precision of the sequence can be decreased by up to 2
16147 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
16148 roots.
16149
16150 @item -mrecip=@var{opt}
16151 @opindex mrecip=opt
16152 This option allows to control which reciprocal estimate instructions
16153 may be used.  @var{opt} is a comma separated list of options, that may
16154 be preceded by a @code{!} to invert the option:
16155 @code{all}: enable all estimate instructions,
16156 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
16157 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
16158 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
16159 @code{divf}: enable the single precision reciprocal approximation instructions;
16160 @code{divd}: enable the double precision reciprocal approximation instructions;
16161 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
16162 @code{rsqrtf}: enable the single precision reciprocal square root approximation instructions;
16163 @code{rsqrtd}: enable the double precision reciprocal square root approximation instructions;
16164
16165 So for example, @option{-mrecip=all,!rsqrtd} would enable the
16166 all of the reciprocal estimate instructions, except for the
16167 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
16168 which handle the double precision reciprocal square root calculations.
16169
16170 @item -mrecip-precision
16171 @itemx -mno-recip-precision
16172 @opindex mrecip-precision
16173 Assume (do not assume) that the reciprocal estimate instructions
16174 provide higher precision estimates than is mandated by the powerpc
16175 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
16176 automatically selects @option{-mrecip-precision}.  The double
16177 precision square root estimate instructions are not generated by
16178 default on low precision machines, since they do not provide an
16179 estimate that converges after three steps.
16180
16181 @item -mveclibabi=@var{type}
16182 @opindex mveclibabi
16183 Specifies the ABI type to use for vectorizing intrinsics using an
16184 external library.  The only type supported at present is @code{mass},
16185 which specifies to use IBM's Mathematical Acceleration Subsystem
16186 (MASS) libraries for vectorizing intrinsics using external libraries.
16187 GCC will currently emit calls to @code{acosd2}, @code{acosf4},
16188 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
16189 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
16190 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
16191 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
16192 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
16193 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
16194 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
16195 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
16196 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
16197 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
16198 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
16199 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
16200 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
16201 for power7.  Both @option{-ftree-vectorize} and
16202 @option{-funsafe-math-optimizations} have to be enabled.  The MASS
16203 libraries will have to be specified at link time.
16204
16205 @item -mfriz
16206 @itemx -mno-friz
16207 @opindex mfriz
16208 Generate (do not generate) the @code{friz} instruction when the
16209 @option{-funsafe-math-optimizations} option is used to optimize
16210 rounding a floating point value to 64-bit integer and back to floating
16211 point.  The @code{friz} instruction does not return the same value if
16212 the floating point number is too large to fit in an integer.
16213 @end table
16214
16215 @node RX Options
16216 @subsection RX Options
16217 @cindex RX Options
16218
16219 These command line options are defined for RX targets:
16220
16221 @table @gcctabopt
16222 @item -m64bit-doubles
16223 @itemx -m32bit-doubles
16224 @opindex m64bit-doubles
16225 @opindex m32bit-doubles
16226 Make the @code{double} data type be 64-bits (@option{-m64bit-doubles})
16227 or 32-bits (@option{-m32bit-doubles}) in size.  The default is
16228 @option{-m32bit-doubles}.  @emph{Note} RX floating point hardware only
16229 works on 32-bit values, which is why the default is
16230 @option{-m32bit-doubles}.
16231
16232 @item -fpu
16233 @itemx -nofpu
16234 @opindex fpu
16235 @opindex nofpu
16236 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
16237 floating point hardware.  The default is enabled for the @var{RX600}
16238 series and disabled for the @var{RX200} series.
16239
16240 Floating point instructions will only be generated for 32-bit floating
16241 point values however, so if the @option{-m64bit-doubles} option is in
16242 use then the FPU hardware will not be used for doubles.
16243
16244 @emph{Note} If the @option{-fpu} option is enabled then
16245 @option{-funsafe-math-optimizations} is also enabled automatically.
16246 This is because the RX FPU instructions are themselves unsafe.
16247
16248 @item -mcpu=@var{name}
16249 @opindex -mcpu
16250 Selects the type of RX CPU to be targeted.  Currently three types are
16251 supported, the generic @var{RX600} and @var{RX200} series hardware and
16252 the specific @var{RX610} CPU.  The default is @var{RX600}.
16253
16254 The only difference between @var{RX600} and @var{RX610} is that the
16255 @var{RX610} does not support the @code{MVTIPL} instruction.
16256
16257 The @var{RX200} series does not have a hardware floating point unit
16258 and so @option{-nofpu} is enabled by default when this type is
16259 selected.
16260
16261 @item -mbig-endian-data
16262 @itemx -mlittle-endian-data
16263 @opindex mbig-endian-data
16264 @opindex mlittle-endian-data
16265 Store data (but not code) in the big-endian format.  The default is
16266 @option{-mlittle-endian-data}, i.e.@: to store data in the little endian
16267 format.
16268
16269 @item -msmall-data-limit=@var{N}
16270 @opindex msmall-data-limit
16271 Specifies the maximum size in bytes of global and static variables
16272 which can be placed into the small data area.  Using the small data
16273 area can lead to smaller and faster code, but the size of area is
16274 limited and it is up to the programmer to ensure that the area does
16275 not overflow.  Also when the small data area is used one of the RX's
16276 registers (@code{r13}) is reserved for use pointing to this area, so
16277 it is no longer available for use by the compiler.  This could result
16278 in slower and/or larger code if variables which once could have been
16279 held in @code{r13} are now pushed onto the stack.
16280
16281 Note, common variables (variables which have not been initialised) and
16282 constants are not placed into the small data area as they are assigned
16283 to other sections in the output executable.
16284
16285 The default value is zero, which disables this feature.  Note, this
16286 feature is not enabled by default with higher optimization levels
16287 (@option{-O2} etc) because of the potentially detrimental effects of
16288 reserving register @code{r13}.  It is up to the programmer to
16289 experiment and discover whether this feature is of benefit to their
16290 program.
16291
16292 @item -msim
16293 @itemx -mno-sim
16294 @opindex msim
16295 @opindex mno-sim
16296 Use the simulator runtime.  The default is to use the libgloss board
16297 specific runtime.
16298
16299 @item -mas100-syntax
16300 @itemx -mno-as100-syntax
16301 @opindex mas100-syntax
16302 @opindex mno-as100-syntax
16303 When generating assembler output use a syntax that is compatible with
16304 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
16305 assembler but it has some restrictions so generating it is not the
16306 default option.
16307
16308 @item -mmax-constant-size=@var{N}
16309 @opindex mmax-constant-size
16310 Specifies the maximum size, in bytes, of a constant that can be used as
16311 an operand in a RX instruction.  Although the RX instruction set does
16312 allow constants of up to 4 bytes in length to be used in instructions,
16313 a longer value equates to a longer instruction.  Thus in some
16314 circumstances it can be beneficial to restrict the size of constants
16315 that are used in instructions.  Constants that are too big are instead
16316 placed into a constant pool and referenced via register indirection.
16317
16318 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
16319 or 4 means that constants of any size are allowed.
16320
16321 @item -mrelax
16322 @opindex mrelax
16323 Enable linker relaxation.  Linker relaxation is a process whereby the
16324 linker will attempt to reduce the size of a program by finding shorter
16325 versions of various instructions.  Disabled by default.
16326
16327 @item -mint-register=@var{N}
16328 @opindex mint-register
16329 Specify the number of registers to reserve for fast interrupt handler
16330 functions.  The value @var{N} can be between 0 and 4.  A value of 1
16331 means that register @code{r13} will be reserved for the exclusive use
16332 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
16333 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
16334 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
16335 A value of 0, the default, does not reserve any registers.
16336
16337 @item -msave-acc-in-interrupts
16338 @opindex msave-acc-in-interrupts
16339 Specifies that interrupt handler functions should preserve the
16340 accumulator register.  This is only necessary if normal code might use
16341 the accumulator register, for example because it performs 64-bit
16342 multiplications.  The default is to ignore the accumulator as this
16343 makes the interrupt handlers faster.
16344
16345 @end table
16346
16347 @emph{Note:} The generic GCC command line @option{-ffixed-@var{reg}}
16348 has special significance to the RX port when used with the
16349 @code{interrupt} function attribute.  This attribute indicates a
16350 function intended to process fast interrupts.  GCC will will ensure
16351 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
16352 and/or @code{r13} and only provided that the normal use of the
16353 corresponding registers have been restricted via the
16354 @option{-ffixed-@var{reg}} or @option{-mint-register} command line
16355 options.
16356
16357 @node S/390 and zSeries Options
16358 @subsection S/390 and zSeries Options
16359 @cindex S/390 and zSeries Options
16360
16361 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
16362
16363 @table @gcctabopt
16364 @item -mhard-float
16365 @itemx -msoft-float
16366 @opindex mhard-float
16367 @opindex msoft-float
16368 Use (do not use) the hardware floating-point instructions and registers
16369 for floating-point operations.  When @option{-msoft-float} is specified,
16370 functions in @file{libgcc.a} will be used to perform floating-point
16371 operations.  When @option{-mhard-float} is specified, the compiler
16372 generates IEEE floating-point instructions.  This is the default.
16373
16374 @item -mhard-dfp
16375 @itemx -mno-hard-dfp
16376 @opindex mhard-dfp
16377 @opindex mno-hard-dfp
16378 Use (do not use) the hardware decimal-floating-point instructions for
16379 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
16380 specified, functions in @file{libgcc.a} will be used to perform
16381 decimal-floating-point operations.  When @option{-mhard-dfp} is
16382 specified, the compiler generates decimal-floating-point hardware
16383 instructions.  This is the default for @option{-march=z9-ec} or higher.
16384
16385 @item -mlong-double-64
16386 @itemx -mlong-double-128
16387 @opindex mlong-double-64
16388 @opindex mlong-double-128
16389 These switches control the size of @code{long double} type. A size
16390 of 64bit makes the @code{long double} type equivalent to the @code{double}
16391 type. This is the default.
16392
16393 @item -mbackchain
16394 @itemx -mno-backchain
16395 @opindex mbackchain
16396 @opindex mno-backchain
16397 Store (do not store) the address of the caller's frame as backchain pointer
16398 into the callee's stack frame.
16399 A backchain may be needed to allow debugging using tools that do not understand
16400 DWARF-2 call frame information.
16401 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
16402 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
16403 the backchain is placed into the topmost word of the 96/160 byte register
16404 save area.
16405
16406 In general, code compiled with @option{-mbackchain} is call-compatible with
16407 code compiled with @option{-mmo-backchain}; however, use of the backchain
16408 for debugging purposes usually requires that the whole binary is built with
16409 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
16410 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16411 to build a linux kernel use @option{-msoft-float}.
16412
16413 The default is to not maintain the backchain.
16414
16415 @item -mpacked-stack
16416 @itemx -mno-packed-stack
16417 @opindex mpacked-stack
16418 @opindex mno-packed-stack
16419 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
16420 specified, the compiler uses the all fields of the 96/160 byte register save
16421 area only for their default purpose; unused fields still take up stack space.
16422 When @option{-mpacked-stack} is specified, register save slots are densely
16423 packed at the top of the register save area; unused space is reused for other
16424 purposes, allowing for more efficient use of the available stack space.
16425 However, when @option{-mbackchain} is also in effect, the topmost word of
16426 the save area is always used to store the backchain, and the return address
16427 register is always saved two words below the backchain.
16428
16429 As long as the stack frame backchain is not used, code generated with
16430 @option{-mpacked-stack} is call-compatible with code generated with
16431 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
16432 S/390 or zSeries generated code that uses the stack frame backchain at run
16433 time, not just for debugging purposes.  Such code is not call-compatible
16434 with code compiled with @option{-mpacked-stack}.  Also, note that the
16435 combination of @option{-mbackchain},
16436 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16437 to build a linux kernel use @option{-msoft-float}.
16438
16439 The default is to not use the packed stack layout.
16440
16441 @item -msmall-exec
16442 @itemx -mno-small-exec
16443 @opindex msmall-exec
16444 @opindex mno-small-exec
16445 Generate (or do not generate) code using the @code{bras} instruction
16446 to do subroutine calls.
16447 This only works reliably if the total executable size does not
16448 exceed 64k.  The default is to use the @code{basr} instruction instead,
16449 which does not have this limitation.
16450
16451 @item -m64
16452 @itemx -m31
16453 @opindex m64
16454 @opindex m31
16455 When @option{-m31} is specified, generate code compliant to the
16456 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
16457 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
16458 particular to generate 64-bit instructions.  For the @samp{s390}
16459 targets, the default is @option{-m31}, while the @samp{s390x}
16460 targets default to @option{-m64}.
16461
16462 @item -mzarch
16463 @itemx -mesa
16464 @opindex mzarch
16465 @opindex mesa
16466 When @option{-mzarch} is specified, generate code using the
16467 instructions available on z/Architecture.
16468 When @option{-mesa} is specified, generate code using the
16469 instructions available on ESA/390.  Note that @option{-mesa} is
16470 not possible with @option{-m64}.
16471 When generating code compliant to the GNU/Linux for S/390 ABI,
16472 the default is @option{-mesa}.  When generating code compliant
16473 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
16474
16475 @item -mmvcle
16476 @itemx -mno-mvcle
16477 @opindex mmvcle
16478 @opindex mno-mvcle
16479 Generate (or do not generate) code using the @code{mvcle} instruction
16480 to perform block moves.  When @option{-mno-mvcle} is specified,
16481 use a @code{mvc} loop instead.  This is the default unless optimizing for
16482 size.
16483
16484 @item -mdebug
16485 @itemx -mno-debug
16486 @opindex mdebug
16487 @opindex mno-debug
16488 Print (or do not print) additional debug information when compiling.
16489 The default is to not print debug information.
16490
16491 @item -march=@var{cpu-type}
16492 @opindex march
16493 Generate code that will run on @var{cpu-type}, which is the name of a system
16494 representing a certain processor type.  Possible values for
16495 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
16496 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
16497 When generating code using the instructions available on z/Architecture,
16498 the default is @option{-march=z900}.  Otherwise, the default is
16499 @option{-march=g5}.
16500
16501 @item -mtune=@var{cpu-type}
16502 @opindex mtune
16503 Tune to @var{cpu-type} everything applicable about the generated code,
16504 except for the ABI and the set of available instructions.
16505 The list of @var{cpu-type} values is the same as for @option{-march}.
16506 The default is the value used for @option{-march}.
16507
16508 @item -mtpf-trace
16509 @itemx -mno-tpf-trace
16510 @opindex mtpf-trace
16511 @opindex mno-tpf-trace
16512 Generate code that adds (does not add) in TPF OS specific branches to trace
16513 routines in the operating system.  This option is off by default, even
16514 when compiling for the TPF OS@.
16515
16516 @item -mfused-madd
16517 @itemx -mno-fused-madd
16518 @opindex mfused-madd
16519 @opindex mno-fused-madd
16520 Generate code that uses (does not use) the floating point multiply and
16521 accumulate instructions.  These instructions are generated by default if
16522 hardware floating point is used.
16523
16524 @item -mwarn-framesize=@var{framesize}
16525 @opindex mwarn-framesize
16526 Emit a warning if the current function exceeds the given frame size.  Because
16527 this is a compile time check it doesn't need to be a real problem when the program
16528 runs.  It is intended to identify functions which most probably cause
16529 a stack overflow.  It is useful to be used in an environment with limited stack
16530 size e.g.@: the linux kernel.
16531
16532 @item -mwarn-dynamicstack
16533 @opindex mwarn-dynamicstack
16534 Emit a warning if the function calls alloca or uses dynamically
16535 sized arrays.  This is generally a bad idea with a limited stack size.
16536
16537 @item -mstack-guard=@var{stack-guard}
16538 @itemx -mstack-size=@var{stack-size}
16539 @opindex mstack-guard
16540 @opindex mstack-size
16541 If these options are provided the s390 back end emits additional instructions in
16542 the function prologue which trigger a trap if the stack size is @var{stack-guard}
16543 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
16544 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
16545 the frame size of the compiled function is chosen.
16546 These options are intended to be used to help debugging stack overflow problems.
16547 The additionally emitted code causes only little overhead and hence can also be
16548 used in production like systems without greater performance degradation.  The given
16549 values have to be exact powers of 2 and @var{stack-size} has to be greater than
16550 @var{stack-guard} without exceeding 64k.
16551 In order to be efficient the extra code makes the assumption that the stack starts
16552 at an address aligned to the value given by @var{stack-size}.
16553 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
16554 @end table
16555
16556 @node Score Options
16557 @subsection Score Options
16558 @cindex Score Options
16559
16560 These options are defined for Score implementations:
16561
16562 @table @gcctabopt
16563 @item -meb
16564 @opindex meb
16565 Compile code for big endian mode.  This is the default.
16566
16567 @item -mel
16568 @opindex mel
16569 Compile code for little endian mode.
16570
16571 @item -mnhwloop
16572 @opindex mnhwloop
16573 Disable generate bcnz instruction.
16574
16575 @item -muls
16576 @opindex muls
16577 Enable generate unaligned load and store instruction.
16578
16579 @item -mmac
16580 @opindex mmac
16581 Enable the use of multiply-accumulate instructions. Disabled by default.
16582
16583 @item -mscore5
16584 @opindex mscore5
16585 Specify the SCORE5 as the target architecture.
16586
16587 @item -mscore5u
16588 @opindex mscore5u
16589 Specify the SCORE5U of the target architecture.
16590
16591 @item -mscore7
16592 @opindex mscore7
16593 Specify the SCORE7 as the target architecture. This is the default.
16594
16595 @item -mscore7d
16596 @opindex mscore7d
16597 Specify the SCORE7D as the target architecture.
16598 @end table
16599
16600 @node SH Options
16601 @subsection SH Options
16602
16603 These @samp{-m} options are defined for the SH implementations:
16604
16605 @table @gcctabopt
16606 @item -m1
16607 @opindex m1
16608 Generate code for the SH1.
16609
16610 @item -m2
16611 @opindex m2
16612 Generate code for the SH2.
16613
16614 @item -m2e
16615 Generate code for the SH2e.
16616
16617 @item -m2a-nofpu
16618 @opindex m2a-nofpu
16619 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
16620 that the floating-point unit is not used.
16621
16622 @item -m2a-single-only
16623 @opindex m2a-single-only
16624 Generate code for the SH2a-FPU, in such a way that no double-precision
16625 floating point operations are used.
16626
16627 @item -m2a-single
16628 @opindex m2a-single
16629 Generate code for the SH2a-FPU assuming the floating-point unit is in
16630 single-precision mode by default.
16631
16632 @item -m2a
16633 @opindex m2a
16634 Generate code for the SH2a-FPU assuming the floating-point unit is in
16635 double-precision mode by default.
16636
16637 @item -m3
16638 @opindex m3
16639 Generate code for the SH3.
16640
16641 @item -m3e
16642 @opindex m3e
16643 Generate code for the SH3e.
16644
16645 @item -m4-nofpu
16646 @opindex m4-nofpu
16647 Generate code for the SH4 without a floating-point unit.
16648
16649 @item -m4-single-only
16650 @opindex m4-single-only
16651 Generate code for the SH4 with a floating-point unit that only
16652 supports single-precision arithmetic.
16653
16654 @item -m4-single
16655 @opindex m4-single
16656 Generate code for the SH4 assuming the floating-point unit is in
16657 single-precision mode by default.
16658
16659 @item -m4
16660 @opindex m4
16661 Generate code for the SH4.
16662
16663 @item -m4a-nofpu
16664 @opindex m4a-nofpu
16665 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
16666 floating-point unit is not used.
16667
16668 @item -m4a-single-only
16669 @opindex m4a-single-only
16670 Generate code for the SH4a, in such a way that no double-precision
16671 floating point operations are used.
16672
16673 @item -m4a-single
16674 @opindex m4a-single
16675 Generate code for the SH4a assuming the floating-point unit is in
16676 single-precision mode by default.
16677
16678 @item -m4a
16679 @opindex m4a
16680 Generate code for the SH4a.
16681
16682 @item -m4al
16683 @opindex m4al
16684 Same as @option{-m4a-nofpu}, except that it implicitly passes
16685 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
16686 instructions at the moment.
16687
16688 @item -mb
16689 @opindex mb
16690 Compile code for the processor in big endian mode.
16691
16692 @item -ml
16693 @opindex ml
16694 Compile code for the processor in little endian mode.
16695
16696 @item -mdalign
16697 @opindex mdalign
16698 Align doubles at 64-bit boundaries.  Note that this changes the calling
16699 conventions, and thus some functions from the standard C library will
16700 not work unless you recompile it first with @option{-mdalign}.
16701
16702 @item -mrelax
16703 @opindex mrelax
16704 Shorten some address references at link time, when possible; uses the
16705 linker option @option{-relax}.
16706
16707 @item -mbigtable
16708 @opindex mbigtable
16709 Use 32-bit offsets in @code{switch} tables.  The default is to use
16710 16-bit offsets.
16711
16712 @item -mbitops
16713 @opindex mbitops
16714 Enable the use of bit manipulation instructions on SH2A.
16715
16716 @item -mfmovd
16717 @opindex mfmovd
16718 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
16719 alignment constraints.
16720
16721 @item -mhitachi
16722 @opindex mhitachi
16723 Comply with the calling conventions defined by Renesas.
16724
16725 @item -mrenesas
16726 @opindex mhitachi
16727 Comply with the calling conventions defined by Renesas.
16728
16729 @item -mno-renesas
16730 @opindex mhitachi
16731 Comply with the calling conventions defined for GCC before the Renesas
16732 conventions were available.  This option is the default for all
16733 targets of the SH toolchain except for @samp{sh-symbianelf}.
16734
16735 @item -mnomacsave
16736 @opindex mnomacsave
16737 Mark the @code{MAC} register as call-clobbered, even if
16738 @option{-mhitachi} is given.
16739
16740 @item -mieee
16741 @opindex mieee
16742 Increase IEEE-compliance of floating-point code.
16743 At the moment, this is equivalent to @option{-fno-finite-math-only}.
16744 When generating 16 bit SH opcodes, getting IEEE-conforming results for
16745 comparisons of NANs / infinities incurs extra overhead in every
16746 floating point comparison, therefore the default is set to
16747 @option{-ffinite-math-only}.
16748
16749 @item -minline-ic_invalidate
16750 @opindex minline-ic_invalidate
16751 Inline code to invalidate instruction cache entries after setting up
16752 nested function trampolines.
16753 This option has no effect if -musermode is in effect and the selected
16754 code generation option (e.g. -m4) does not allow the use of the icbi
16755 instruction.
16756 If the selected code generation option does not allow the use of the icbi
16757 instruction, and -musermode is not in effect, the inlined code will
16758 manipulate the instruction cache address array directly with an associative
16759 write.  This not only requires privileged mode, but it will also
16760 fail if the cache line had been mapped via the TLB and has become unmapped.
16761
16762 @item -misize
16763 @opindex misize
16764 Dump instruction size and location in the assembly code.
16765
16766 @item -mpadstruct
16767 @opindex mpadstruct
16768 This option is deprecated.  It pads structures to multiple of 4 bytes,
16769 which is incompatible with the SH ABI@.
16770
16771 @item -mspace
16772 @opindex mspace
16773 Optimize for space instead of speed.  Implied by @option{-Os}.
16774
16775 @item -mprefergot
16776 @opindex mprefergot
16777 When generating position-independent code, emit function calls using
16778 the Global Offset Table instead of the Procedure Linkage Table.
16779
16780 @item -musermode
16781 @opindex musermode
16782 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
16783 if the inlined code would not work in user mode.
16784 This is the default when the target is @code{sh-*-linux*}.
16785
16786 @item -multcost=@var{number}
16787 @opindex multcost=@var{number}
16788 Set the cost to assume for a multiply insn.
16789
16790 @item -mdiv=@var{strategy}
16791 @opindex mdiv=@var{strategy}
16792 Set the division strategy to use for SHmedia code.  @var{strategy} must be
16793 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
16794 inv:call2, inv:fp .
16795 "fp" performs the operation in floating point.  This has a very high latency,
16796 but needs only a few instructions, so it might be a good choice if
16797 your code has enough easily exploitable ILP to allow the compiler to
16798 schedule the floating point instructions together with other instructions.
16799 Division by zero causes a floating point exception.
16800 "inv" uses integer operations to calculate the inverse of the divisor,
16801 and then multiplies the dividend with the inverse.  This strategy allows
16802 cse and hoisting of the inverse calculation.  Division by zero calculates
16803 an unspecified result, but does not trap.
16804 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
16805 have been found, or if the entire operation has been hoisted to the same
16806 place, the last stages of the inverse calculation are intertwined with the
16807 final multiply to reduce the overall latency, at the expense of using a few
16808 more instructions, and thus offering fewer scheduling opportunities with
16809 other code.
16810 "call" calls a library function that usually implements the inv:minlat
16811 strategy.
16812 This gives high code density for m5-*media-nofpu compilations.
16813 "call2" uses a different entry point of the same library function, where it
16814 assumes that a pointer to a lookup table has already been set up, which
16815 exposes the pointer load to cse / code hoisting optimizations.
16816 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
16817 code generation, but if the code stays unoptimized, revert to the "call",
16818 "call2", or "fp" strategies, respectively.  Note that the
16819 potentially-trapping side effect of division by zero is carried by a
16820 separate instruction, so it is possible that all the integer instructions
16821 are hoisted out, but the marker for the side effect stays where it is.
16822 A recombination to fp operations or a call is not possible in that case.
16823 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
16824 that the inverse calculation was nor separated from the multiply, they speed
16825 up division where the dividend fits into 20 bits (plus sign where applicable),
16826 by inserting a test to skip a number of operations in this case; this test
16827 slows down the case of larger dividends.  inv20u assumes the case of a such
16828 a small dividend to be unlikely, and inv20l assumes it to be likely.
16829
16830 @item -maccumulate-outgoing-args
16831 @opindex maccumulate-outgoing-args
16832 Reserve space once for outgoing arguments in the function prologue rather 
16833 than around each call.  Generally beneficial for performance and size.  Also
16834 needed for unwinding to avoid changing the stack frame around conditional code.
16835
16836 @item -mdivsi3_libfunc=@var{name}
16837 @opindex mdivsi3_libfunc=@var{name}
16838 Set the name of the library function used for 32 bit signed division to
16839 @var{name}.  This only affect the name used in the call and inv:call
16840 division strategies, and the compiler will still expect the same
16841 sets of input/output/clobbered registers as if this option was not present.
16842
16843 @item -mfixed-range=@var{register-range}
16844 @opindex mfixed-range
16845 Generate code treating the given register range as fixed registers.
16846 A fixed register is one that the register allocator can not use.  This is
16847 useful when compiling kernel code.  A register range is specified as
16848 two registers separated by a dash.  Multiple register ranges can be
16849 specified separated by a comma.
16850
16851 @item -madjust-unroll
16852 @opindex madjust-unroll
16853 Throttle unrolling to avoid thrashing target registers.
16854 This option only has an effect if the gcc code base supports the
16855 TARGET_ADJUST_UNROLL_MAX target hook.
16856
16857 @item -mindexed-addressing
16858 @opindex mindexed-addressing
16859 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
16860 This is only safe if the hardware and/or OS implement 32 bit wrap-around
16861 semantics for the indexed addressing mode.  The architecture allows the
16862 implementation of processors with 64 bit MMU, which the OS could use to
16863 get 32 bit addressing, but since no current hardware implementation supports
16864 this or any other way to make the indexed addressing mode safe to use in
16865 the 32 bit ABI, the default is -mno-indexed-addressing.
16866
16867 @item -mgettrcost=@var{number}
16868 @opindex mgettrcost=@var{number}
16869 Set the cost assumed for the gettr instruction to @var{number}.
16870 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
16871
16872 @item -mpt-fixed
16873 @opindex mpt-fixed
16874 Assume pt* instructions won't trap.  This will generally generate better
16875 scheduled code, but is unsafe on current hardware.  The current architecture
16876 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
16877 This has the unintentional effect of making it unsafe to schedule ptabs /
16878 ptrel before a branch, or hoist it out of a loop.  For example,
16879 __do_global_ctors, a part of libgcc that runs constructors at program
16880 startup, calls functions in a list which is delimited by @minus{}1.  With the
16881 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
16882 That means that all the constructors will be run a bit quicker, but when
16883 the loop comes to the end of the list, the program crashes because ptabs
16884 loads @minus{}1 into a target register.  Since this option is unsafe for any
16885 hardware implementing the current architecture specification, the default
16886 is -mno-pt-fixed.  Unless the user specifies a specific cost with
16887 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
16888 this deters register allocation using target registers for storing
16889 ordinary integers.
16890
16891 @item -minvalid-symbols
16892 @opindex minvalid-symbols
16893 Assume symbols might be invalid.  Ordinary function symbols generated by
16894 the compiler will always be valid to load with movi/shori/ptabs or
16895 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
16896 to generate symbols that will cause ptabs / ptrel to trap.
16897 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
16898 It will then prevent cross-basic-block cse, hoisting and most scheduling
16899 of symbol loads.  The default is @option{-mno-invalid-symbols}.
16900 @end table
16901
16902 @node Solaris 2 Options
16903 @subsection Solaris 2 Options
16904 @cindex Solaris 2 options
16905
16906 These @samp{-m} options are supported on Solaris 2:
16907
16908 @table @gcctabopt
16909 @item -mimpure-text
16910 @opindex mimpure-text
16911 @option{-mimpure-text}, used in addition to @option{-shared}, tells
16912 the compiler to not pass @option{-z text} to the linker when linking a
16913 shared object.  Using this option, you can link position-dependent
16914 code into a shared object.
16915
16916 @option{-mimpure-text} suppresses the ``relocations remain against
16917 allocatable but non-writable sections'' linker error message.
16918 However, the necessary relocations will trigger copy-on-write, and the
16919 shared object is not actually shared across processes.  Instead of
16920 using @option{-mimpure-text}, you should compile all source code with
16921 @option{-fpic} or @option{-fPIC}.
16922
16923 @end table
16924
16925 These switches are supported in addition to the above on Solaris 2:
16926
16927 @table @gcctabopt
16928 @item -threads
16929 @opindex threads
16930 Add support for multithreading using the Solaris threads library.  This
16931 option sets flags for both the preprocessor and linker.  This option does
16932 not affect the thread safety of object code produced by the compiler or
16933 that of libraries supplied with it.
16934
16935 @item -pthreads
16936 @opindex pthreads
16937 Add support for multithreading using the POSIX threads library.  This
16938 option sets flags for both the preprocessor and linker.  This option does
16939 not affect the thread safety of object code produced  by the compiler or
16940 that of libraries supplied with it.
16941
16942 @item -pthread
16943 @opindex pthread
16944 This is a synonym for @option{-pthreads}.
16945 @end table
16946
16947 @node SPARC Options
16948 @subsection SPARC Options
16949 @cindex SPARC options
16950
16951 These @samp{-m} options are supported on the SPARC:
16952
16953 @table @gcctabopt
16954 @item -mno-app-regs
16955 @itemx -mapp-regs
16956 @opindex mno-app-regs
16957 @opindex mapp-regs
16958 Specify @option{-mapp-regs} to generate output using the global registers
16959 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
16960 is the default.
16961
16962 To be fully SVR4 ABI compliant at the cost of some performance loss,
16963 specify @option{-mno-app-regs}.  You should compile libraries and system
16964 software with this option.
16965
16966 @item -mfpu
16967 @itemx -mhard-float
16968 @opindex mfpu
16969 @opindex mhard-float
16970 Generate output containing floating point instructions.  This is the
16971 default.
16972
16973 @item -mno-fpu
16974 @itemx -msoft-float
16975 @opindex mno-fpu
16976 @opindex msoft-float
16977 Generate output containing library calls for floating point.
16978 @strong{Warning:} the requisite libraries are not available for all SPARC
16979 targets.  Normally the facilities of the machine's usual C compiler are
16980 used, but this cannot be done directly in cross-compilation.  You must make
16981 your own arrangements to provide suitable library functions for
16982 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
16983 @samp{sparclite-*-*} do provide software floating point support.
16984
16985 @option{-msoft-float} changes the calling convention in the output file;
16986 therefore, it is only useful if you compile @emph{all} of a program with
16987 this option.  In particular, you need to compile @file{libgcc.a}, the
16988 library that comes with GCC, with @option{-msoft-float} in order for
16989 this to work.
16990
16991 @item -mhard-quad-float
16992 @opindex mhard-quad-float
16993 Generate output containing quad-word (long double) floating point
16994 instructions.
16995
16996 @item -msoft-quad-float
16997 @opindex msoft-quad-float
16998 Generate output containing library calls for quad-word (long double)
16999 floating point instructions.  The functions called are those specified
17000 in the SPARC ABI@.  This is the default.
17001
17002 As of this writing, there are no SPARC implementations that have hardware
17003 support for the quad-word floating point instructions.  They all invoke
17004 a trap handler for one of these instructions, and then the trap handler
17005 emulates the effect of the instruction.  Because of the trap handler overhead,
17006 this is much slower than calling the ABI library routines.  Thus the
17007 @option{-msoft-quad-float} option is the default.
17008
17009 @item -mno-unaligned-doubles
17010 @itemx -munaligned-doubles
17011 @opindex mno-unaligned-doubles
17012 @opindex munaligned-doubles
17013 Assume that doubles have 8 byte alignment.  This is the default.
17014
17015 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
17016 alignment only if they are contained in another type, or if they have an
17017 absolute address.  Otherwise, it assumes they have 4 byte alignment.
17018 Specifying this option avoids some rare compatibility problems with code
17019 generated by other compilers.  It is not the default because it results
17020 in a performance loss, especially for floating point code.
17021
17022 @item -mno-faster-structs
17023 @itemx -mfaster-structs
17024 @opindex mno-faster-structs
17025 @opindex mfaster-structs
17026 With @option{-mfaster-structs}, the compiler assumes that structures
17027 should have 8 byte alignment.  This enables the use of pairs of
17028 @code{ldd} and @code{std} instructions for copies in structure
17029 assignment, in place of twice as many @code{ld} and @code{st} pairs.
17030 However, the use of this changed alignment directly violates the SPARC
17031 ABI@.  Thus, it's intended only for use on targets where the developer
17032 acknowledges that their resulting code will not be directly in line with
17033 the rules of the ABI@.
17034
17035 @item -mcpu=@var{cpu_type}
17036 @opindex mcpu
17037 Set the instruction set, register set, and instruction scheduling parameters
17038 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
17039 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
17040 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
17041 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
17042 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
17043
17044 Default instruction scheduling parameters are used for values that select
17045 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
17046 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
17047
17048 Here is a list of each supported architecture and their supported
17049 implementations.
17050
17051 @smallexample
17052     v7:             cypress
17053     v8:             supersparc, hypersparc, leon
17054     sparclite:      f930, f934, sparclite86x
17055     sparclet:       tsc701
17056     v9:             ultrasparc, ultrasparc3, niagara, niagara2
17057 @end smallexample
17058
17059 By default (unless configured otherwise), GCC generates code for the V7
17060 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
17061 additionally optimizes it for the Cypress CY7C602 chip, as used in the
17062 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
17063 SPARCStation 1, 2, IPX etc.
17064
17065 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
17066 architecture.  The only difference from V7 code is that the compiler emits
17067 the integer multiply and integer divide instructions which exist in SPARC-V8
17068 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
17069 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
17070 2000 series.
17071
17072 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
17073 the SPARC architecture.  This adds the integer multiply, integer divide step
17074 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
17075 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
17076 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
17077 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
17078 MB86934 chip, which is the more recent SPARClite with FPU@.
17079
17080 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
17081 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
17082 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
17083 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
17084 optimizes it for the TEMIC SPARClet chip.
17085
17086 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
17087 architecture.  This adds 64-bit integer and floating-point move instructions,
17088 3 additional floating-point condition code registers and conditional move
17089 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
17090 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
17091 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
17092 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
17093 @option{-mcpu=niagara}, the compiler additionally optimizes it for
17094 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
17095 additionally optimizes it for Sun UltraSPARC T2 chips.
17096
17097 @item -mtune=@var{cpu_type}
17098 @opindex mtune
17099 Set the instruction scheduling parameters for machine type
17100 @var{cpu_type}, but do not set the instruction set or register set that the
17101 option @option{-mcpu=@var{cpu_type}} would.
17102
17103 The same values for @option{-mcpu=@var{cpu_type}} can be used for
17104 @option{-mtune=@var{cpu_type}}, but the only useful values are those
17105 that select a particular CPU implementation.  Those are @samp{cypress},
17106 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
17107 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
17108 @samp{niagara}, and @samp{niagara2}.
17109
17110 @item -mv8plus
17111 @itemx -mno-v8plus
17112 @opindex mv8plus
17113 @opindex mno-v8plus
17114 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
17115 difference from the V8 ABI is that the global and out registers are
17116 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
17117 mode for all SPARC-V9 processors.
17118
17119 @item -mvis
17120 @itemx -mno-vis
17121 @opindex mvis
17122 @opindex mno-vis
17123 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
17124 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
17125 @end table
17126
17127 These @samp{-m} options are supported in addition to the above
17128 on SPARC-V9 processors in 64-bit environments:
17129
17130 @table @gcctabopt
17131 @item -mlittle-endian
17132 @opindex mlittle-endian
17133 Generate code for a processor running in little-endian mode.  It is only
17134 available for a few configurations and most notably not on Solaris and Linux.
17135
17136 @item -m32
17137 @itemx -m64
17138 @opindex m32
17139 @opindex m64
17140 Generate code for a 32-bit or 64-bit environment.
17141 The 32-bit environment sets int, long and pointer to 32 bits.
17142 The 64-bit environment sets int to 32 bits and long and pointer
17143 to 64 bits.
17144
17145 @item -mcmodel=medlow
17146 @opindex mcmodel=medlow
17147 Generate code for the Medium/Low code model: 64-bit addresses, programs
17148 must be linked in the low 32 bits of memory.  Programs can be statically
17149 or dynamically linked.
17150
17151 @item -mcmodel=medmid
17152 @opindex mcmodel=medmid
17153 Generate code for the Medium/Middle code model: 64-bit addresses, programs
17154 must be linked in the low 44 bits of memory, the text and data segments must
17155 be less than 2GB in size and the data segment must be located within 2GB of
17156 the text segment.
17157
17158 @item -mcmodel=medany
17159 @opindex mcmodel=medany
17160 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
17161 may be linked anywhere in memory, the text and data segments must be less
17162 than 2GB in size and the data segment must be located within 2GB of the
17163 text segment.
17164
17165 @item -mcmodel=embmedany
17166 @opindex mcmodel=embmedany
17167 Generate code for the Medium/Anywhere code model for embedded systems:
17168 64-bit addresses, the text and data segments must be less than 2GB in
17169 size, both starting anywhere in memory (determined at link time).  The
17170 global register %g4 points to the base of the data segment.  Programs
17171 are statically linked and PIC is not supported.
17172
17173 @item -mstack-bias
17174 @itemx -mno-stack-bias
17175 @opindex mstack-bias
17176 @opindex mno-stack-bias
17177 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
17178 frame pointer if present, are offset by @minus{}2047 which must be added back
17179 when making stack frame references.  This is the default in 64-bit mode.
17180 Otherwise, assume no such offset is present.
17181 @end table
17182
17183 @node SPU Options
17184 @subsection SPU Options
17185 @cindex SPU options
17186
17187 These @samp{-m} options are supported on the SPU:
17188
17189 @table @gcctabopt
17190 @item -mwarn-reloc
17191 @itemx -merror-reloc
17192 @opindex mwarn-reloc
17193 @opindex merror-reloc
17194
17195 The loader for SPU does not handle dynamic relocations.  By default, GCC
17196 will give an error when it generates code that requires a dynamic
17197 relocation.  @option{-mno-error-reloc} disables the error,
17198 @option{-mwarn-reloc} will generate a warning instead.
17199
17200 @item -msafe-dma
17201 @itemx -munsafe-dma
17202 @opindex msafe-dma
17203 @opindex munsafe-dma
17204
17205 Instructions which initiate or test completion of DMA must not be
17206 reordered with respect to loads and stores of the memory which is being
17207 accessed.  Users typically address this problem using the volatile
17208 keyword, but that can lead to inefficient code in places where the
17209 memory is known to not change.  Rather than mark the memory as volatile
17210 we treat the DMA instructions as potentially effecting all memory.  With
17211 @option{-munsafe-dma} users must use the volatile keyword to protect
17212 memory accesses.
17213
17214 @item -mbranch-hints
17215 @opindex mbranch-hints
17216
17217 By default, GCC will generate a branch hint instruction to avoid
17218 pipeline stalls for always taken or probably taken branches.  A hint
17219 will not be generated closer than 8 instructions away from its branch.
17220 There is little reason to disable them, except for debugging purposes,
17221 or to make an object a little bit smaller.
17222
17223 @item -msmall-mem
17224 @itemx -mlarge-mem
17225 @opindex msmall-mem
17226 @opindex mlarge-mem
17227
17228 By default, GCC generates code assuming that addresses are never larger
17229 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
17230 a full 32 bit address.
17231
17232 @item -mstdmain
17233 @opindex mstdmain
17234
17235 By default, GCC links against startup code that assumes the SPU-style
17236 main function interface (which has an unconventional parameter list).
17237 With @option{-mstdmain}, GCC will link your program against startup
17238 code that assumes a C99-style interface to @code{main}, including a
17239 local copy of @code{argv} strings.
17240
17241 @item -mfixed-range=@var{register-range}
17242 @opindex mfixed-range
17243 Generate code treating the given register range as fixed registers.
17244 A fixed register is one that the register allocator can not use.  This is
17245 useful when compiling kernel code.  A register range is specified as
17246 two registers separated by a dash.  Multiple register ranges can be
17247 specified separated by a comma.
17248
17249 @item -mea32
17250 @itemx -mea64
17251 @opindex mea32
17252 @opindex mea64
17253 Compile code assuming that pointers to the PPU address space accessed
17254 via the @code{__ea} named address space qualifier are either 32 or 64
17255 bits wide.  The default is 32 bits.  As this is an ABI changing option,
17256 all object code in an executable must be compiled with the same setting.
17257
17258 @item -maddress-space-conversion
17259 @itemx -mno-address-space-conversion
17260 @opindex maddress-space-conversion
17261 @opindex mno-address-space-conversion
17262 Allow/disallow treating the @code{__ea} address space as superset
17263 of the generic address space.  This enables explicit type casts
17264 between @code{__ea} and generic pointer as well as implicit
17265 conversions of generic pointers to @code{__ea} pointers.  The
17266 default is to allow address space pointer conversions.
17267
17268 @item -mcache-size=@var{cache-size}
17269 @opindex mcache-size
17270 This option controls the version of libgcc that the compiler links to an
17271 executable and selects a software-managed cache for accessing variables
17272 in the @code{__ea} address space with a particular cache size.  Possible
17273 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
17274 and @samp{128}.  The default cache size is 64KB.
17275
17276 @item -matomic-updates
17277 @itemx -mno-atomic-updates
17278 @opindex matomic-updates
17279 @opindex mno-atomic-updates
17280 This option controls the version of libgcc that the compiler links to an
17281 executable and selects whether atomic updates to the software-managed
17282 cache of PPU-side variables are used.  If you use atomic updates, changes
17283 to a PPU variable from SPU code using the @code{__ea} named address space
17284 qualifier will not interfere with changes to other PPU variables residing
17285 in the same cache line from PPU code.  If you do not use atomic updates,
17286 such interference may occur; however, writing back cache lines will be
17287 more efficient.  The default behavior is to use atomic updates.
17288
17289 @item -mdual-nops
17290 @itemx -mdual-nops=@var{n}
17291 @opindex mdual-nops
17292 By default, GCC will insert nops to increase dual issue when it expects
17293 it to increase performance.  @var{n} can be a value from 0 to 10.  A
17294 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
17295 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
17296
17297 @item -mhint-max-nops=@var{n}
17298 @opindex mhint-max-nops
17299 Maximum number of nops to insert for a branch hint.  A branch hint must
17300 be at least 8 instructions away from the branch it is effecting.  GCC
17301 will insert up to @var{n} nops to enforce this, otherwise it will not
17302 generate the branch hint.
17303
17304 @item -mhint-max-distance=@var{n}
17305 @opindex mhint-max-distance
17306 The encoding of the branch hint instruction limits the hint to be within
17307 256 instructions of the branch it is effecting.  By default, GCC makes
17308 sure it is within 125.
17309
17310 @item -msafe-hints
17311 @opindex msafe-hints
17312 Work around a hardware bug which causes the SPU to stall indefinitely.
17313 By default, GCC will insert the @code{hbrp} instruction to make sure
17314 this stall won't happen.
17315
17316 @end table
17317
17318 @node System V Options
17319 @subsection Options for System V
17320
17321 These additional options are available on System V Release 4 for
17322 compatibility with other compilers on those systems:
17323
17324 @table @gcctabopt
17325 @item -G
17326 @opindex G
17327 Create a shared object.
17328 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
17329
17330 @item -Qy
17331 @opindex Qy
17332 Identify the versions of each tool used by the compiler, in a
17333 @code{.ident} assembler directive in the output.
17334
17335 @item -Qn
17336 @opindex Qn
17337 Refrain from adding @code{.ident} directives to the output file (this is
17338 the default).
17339
17340 @item -YP,@var{dirs}
17341 @opindex YP
17342 Search the directories @var{dirs}, and no others, for libraries
17343 specified with @option{-l}.
17344
17345 @item -Ym,@var{dir}
17346 @opindex Ym
17347 Look in the directory @var{dir} to find the M4 preprocessor.
17348 The assembler uses this option.
17349 @c This is supposed to go with a -Yd for predefined M4 macro files, but
17350 @c the generic assembler that comes with Solaris takes just -Ym.
17351 @end table
17352
17353 @node V850 Options
17354 @subsection V850 Options
17355 @cindex V850 Options
17356
17357 These @samp{-m} options are defined for V850 implementations:
17358
17359 @table @gcctabopt
17360 @item -mlong-calls
17361 @itemx -mno-long-calls
17362 @opindex mlong-calls
17363 @opindex mno-long-calls
17364 Treat all calls as being far away (near).  If calls are assumed to be
17365 far away, the compiler will always load the functions address up into a
17366 register, and call indirect through the pointer.
17367
17368 @item -mno-ep
17369 @itemx -mep
17370 @opindex mno-ep
17371 @opindex mep
17372 Do not optimize (do optimize) basic blocks that use the same index
17373 pointer 4 or more times to copy pointer into the @code{ep} register, and
17374 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
17375 option is on by default if you optimize.
17376
17377 @item -mno-prolog-function
17378 @itemx -mprolog-function
17379 @opindex mno-prolog-function
17380 @opindex mprolog-function
17381 Do not use (do use) external functions to save and restore registers
17382 at the prologue and epilogue of a function.  The external functions
17383 are slower, but use less code space if more than one function saves
17384 the same number of registers.  The @option{-mprolog-function} option
17385 is on by default if you optimize.
17386
17387 @item -mspace
17388 @opindex mspace
17389 Try to make the code as small as possible.  At present, this just turns
17390 on the @option{-mep} and @option{-mprolog-function} options.
17391
17392 @item -mtda=@var{n}
17393 @opindex mtda
17394 Put static or global variables whose size is @var{n} bytes or less into
17395 the tiny data area that register @code{ep} points to.  The tiny data
17396 area can hold up to 256 bytes in total (128 bytes for byte references).
17397
17398 @item -msda=@var{n}
17399 @opindex msda
17400 Put static or global variables whose size is @var{n} bytes or less into
17401 the small data area that register @code{gp} points to.  The small data
17402 area can hold up to 64 kilobytes.
17403
17404 @item -mzda=@var{n}
17405 @opindex mzda
17406 Put static or global variables whose size is @var{n} bytes or less into
17407 the first 32 kilobytes of memory.
17408
17409 @item -mv850
17410 @opindex mv850
17411 Specify that the target processor is the V850.
17412
17413 @item -mbig-switch
17414 @opindex mbig-switch
17415 Generate code suitable for big switch tables.  Use this option only if
17416 the assembler/linker complain about out of range branches within a switch
17417 table.
17418
17419 @item -mapp-regs
17420 @opindex mapp-regs
17421 This option will cause r2 and r5 to be used in the code generated by
17422 the compiler.  This setting is the default.
17423
17424 @item -mno-app-regs
17425 @opindex mno-app-regs
17426 This option will cause r2 and r5 to be treated as fixed registers.
17427
17428 @item -mv850e2v3
17429 @opindex mv850e2v3
17430 Specify that the target processor is the V850E2V3.  The preprocessor
17431 constants @samp{__v850e2v3__} will be defined if
17432 this option is used.
17433
17434 @item -mv850e2
17435 @opindex mv850e2
17436 Specify that the target processor is the V850E2.  The preprocessor
17437 constants @samp{__v850e2__} will be defined if
17438
17439 @item -mv850e1
17440 @opindex mv850e1
17441 Specify that the target processor is the V850E1.  The preprocessor
17442 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
17443
17444 @item -mv850es
17445 @opindex mv850es
17446 Specify that the target processor is the V850ES.  This is an alias for
17447 the @option{-mv850e1} option.
17448
17449 @item -mv850e
17450 @opindex mv850e
17451 Specify that the target processor is the V850E@.  The preprocessor
17452 constant @samp{__v850e__} will be defined if this option is used.
17453
17454 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
17455 nor @option{-mv850e2} nor @option{-mv850e2v3}
17456 are defined then a default target processor will be chosen and the
17457 relevant @samp{__v850*__} preprocessor constant will be defined.
17458
17459 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
17460 defined, regardless of which processor variant is the target.
17461
17462 @item -mdisable-callt
17463 @opindex mdisable-callt
17464 This option will suppress generation of the CALLT instruction for the
17465 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
17466 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
17467
17468 @end table
17469
17470 @node VAX Options
17471 @subsection VAX Options
17472 @cindex VAX options
17473
17474 These @samp{-m} options are defined for the VAX:
17475
17476 @table @gcctabopt
17477 @item -munix
17478 @opindex munix
17479 Do not output certain jump instructions (@code{aobleq} and so on)
17480 that the Unix assembler for the VAX cannot handle across long
17481 ranges.
17482
17483 @item -mgnu
17484 @opindex mgnu
17485 Do output those jump instructions, on the assumption that you
17486 will assemble with the GNU assembler.
17487
17488 @item -mg
17489 @opindex mg
17490 Output code for g-format floating point numbers instead of d-format.
17491 @end table
17492
17493 @node VxWorks Options
17494 @subsection VxWorks Options
17495 @cindex VxWorks Options
17496
17497 The options in this section are defined for all VxWorks targets.
17498 Options specific to the target hardware are listed with the other
17499 options for that target.
17500
17501 @table @gcctabopt
17502 @item -mrtp
17503 @opindex mrtp
17504 GCC can generate code for both VxWorks kernels and real time processes
17505 (RTPs).  This option switches from the former to the latter.  It also
17506 defines the preprocessor macro @code{__RTP__}.
17507
17508 @item -non-static
17509 @opindex non-static
17510 Link an RTP executable against shared libraries rather than static
17511 libraries.  The options @option{-static} and @option{-shared} can
17512 also be used for RTPs (@pxref{Link Options}); @option{-static}
17513 is the default.
17514
17515 @item -Bstatic
17516 @itemx -Bdynamic
17517 @opindex Bstatic
17518 @opindex Bdynamic
17519 These options are passed down to the linker.  They are defined for
17520 compatibility with Diab.
17521
17522 @item -Xbind-lazy
17523 @opindex Xbind-lazy
17524 Enable lazy binding of function calls.  This option is equivalent to
17525 @option{-Wl,-z,now} and is defined for compatibility with Diab.
17526
17527 @item -Xbind-now
17528 @opindex Xbind-now
17529 Disable lazy binding of function calls.  This option is the default and
17530 is defined for compatibility with Diab.
17531 @end table
17532
17533 @node x86-64 Options
17534 @subsection x86-64 Options
17535 @cindex x86-64 options
17536
17537 These are listed under @xref{i386 and x86-64 Options}.
17538
17539 @node i386 and x86-64 Windows Options
17540 @subsection i386 and x86-64 Windows Options
17541 @cindex i386 and x86-64 Windows Options
17542
17543 These additional options are available for Windows targets:
17544
17545 @table @gcctabopt
17546 @item -mconsole
17547 @opindex mconsole
17548 This option is available for Cygwin and MinGW targets.  It
17549 specifies that a console application is to be generated, by
17550 instructing the linker to set the PE header subsystem type
17551 required for console applications.
17552 This is the default behavior for Cygwin and MinGW targets.
17553
17554 @item -mdll
17555 @opindex mdll
17556 This option is available for Cygwin and MinGW targets.  It
17557 specifies that a DLL - a dynamic link library - is to be
17558 generated, enabling the selection of the required runtime
17559 startup object and entry point.
17560
17561 @item -mnop-fun-dllimport
17562 @opindex mnop-fun-dllimport
17563 This option is available for Cygwin and MinGW targets.  It
17564 specifies that the dllimport attribute should be ignored.
17565
17566 @item -mthread
17567 @opindex mthread
17568 This option is available for MinGW targets. It specifies
17569 that MinGW-specific thread support is to be used.
17570
17571 @item -municode
17572 @opindex municode
17573 This option is available for mingw-w64 targets.  It specifies
17574 that the UNICODE macro is getting pre-defined and that the
17575 unicode capable runtime startup code is chosen.
17576
17577 @item -mwin32
17578 @opindex mwin32
17579 This option is available for Cygwin and MinGW targets.  It
17580 specifies that the typical Windows pre-defined macros are to
17581 be set in the pre-processor, but does not influence the choice
17582 of runtime library/startup code.
17583
17584 @item -mwindows
17585 @opindex mwindows
17586 This option is available for Cygwin and MinGW targets.  It
17587 specifies that a GUI application is to be generated by
17588 instructing the linker to set the PE header subsystem type
17589 appropriately.
17590
17591 @item -fno-set-stack-executable
17592 @opindex fno-set-stack-executable
17593 This option is available for MinGW targets. It specifies that
17594 the executable flag for stack used by nested functions isn't
17595 set. This is necessary for binaries running in kernel mode of
17596 Windows, as there the user32 API, which is used to set executable
17597 privileges, isn't available.
17598
17599 @item -mpe-aligned-commons
17600 @opindex mpe-aligned-commons
17601 This option is available for Cygwin and MinGW targets.  It
17602 specifies that the GNU extension to the PE file format that
17603 permits the correct alignment of COMMON variables should be
17604 used when generating code.  It will be enabled by default if
17605 GCC detects that the target assembler found during configuration
17606 supports the feature.
17607 @end table
17608
17609 See also under @ref{i386 and x86-64 Options} for standard options.
17610
17611 @node Xstormy16 Options
17612 @subsection Xstormy16 Options
17613 @cindex Xstormy16 Options
17614
17615 These options are defined for Xstormy16:
17616
17617 @table @gcctabopt
17618 @item -msim
17619 @opindex msim
17620 Choose startup files and linker script suitable for the simulator.
17621 @end table
17622
17623 @node Xtensa Options
17624 @subsection Xtensa Options
17625 @cindex Xtensa Options
17626
17627 These options are supported for Xtensa targets:
17628
17629 @table @gcctabopt
17630 @item -mconst16
17631 @itemx -mno-const16
17632 @opindex mconst16
17633 @opindex mno-const16
17634 Enable or disable use of @code{CONST16} instructions for loading
17635 constant values.  The @code{CONST16} instruction is currently not a
17636 standard option from Tensilica.  When enabled, @code{CONST16}
17637 instructions are always used in place of the standard @code{L32R}
17638 instructions.  The use of @code{CONST16} is enabled by default only if
17639 the @code{L32R} instruction is not available.
17640
17641 @item -mfused-madd
17642 @itemx -mno-fused-madd
17643 @opindex mfused-madd
17644 @opindex mno-fused-madd
17645 Enable or disable use of fused multiply/add and multiply/subtract
17646 instructions in the floating-point option.  This has no effect if the
17647 floating-point option is not also enabled.  Disabling fused multiply/add
17648 and multiply/subtract instructions forces the compiler to use separate
17649 instructions for the multiply and add/subtract operations.  This may be
17650 desirable in some cases where strict IEEE 754-compliant results are
17651 required: the fused multiply add/subtract instructions do not round the
17652 intermediate result, thereby producing results with @emph{more} bits of
17653 precision than specified by the IEEE standard.  Disabling fused multiply
17654 add/subtract instructions also ensures that the program output is not
17655 sensitive to the compiler's ability to combine multiply and add/subtract
17656 operations.
17657
17658 @item -mserialize-volatile
17659 @itemx -mno-serialize-volatile
17660 @opindex mserialize-volatile
17661 @opindex mno-serialize-volatile
17662 When this option is enabled, GCC inserts @code{MEMW} instructions before
17663 @code{volatile} memory references to guarantee sequential consistency.
17664 The default is @option{-mserialize-volatile}.  Use
17665 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
17666
17667 @item -mforce-no-pic
17668 @opindex mforce-no-pic
17669 For targets, like GNU/Linux, where all user-mode Xtensa code must be
17670 position-independent code (PIC), this option disables PIC for compiling
17671 kernel code.
17672
17673 @item -mtext-section-literals
17674 @itemx -mno-text-section-literals
17675 @opindex mtext-section-literals
17676 @opindex mno-text-section-literals
17677 Control the treatment of literal pools.  The default is
17678 @option{-mno-text-section-literals}, which places literals in a separate
17679 section in the output file.  This allows the literal pool to be placed
17680 in a data RAM/ROM, and it also allows the linker to combine literal
17681 pools from separate object files to remove redundant literals and
17682 improve code size.  With @option{-mtext-section-literals}, the literals
17683 are interspersed in the text section in order to keep them as close as
17684 possible to their references.  This may be necessary for large assembly
17685 files.
17686
17687 @item -mtarget-align
17688 @itemx -mno-target-align
17689 @opindex mtarget-align
17690 @opindex mno-target-align
17691 When this option is enabled, GCC instructs the assembler to
17692 automatically align instructions to reduce branch penalties at the
17693 expense of some code density.  The assembler attempts to widen density
17694 instructions to align branch targets and the instructions following call
17695 instructions.  If there are not enough preceding safe density
17696 instructions to align a target, no widening will be performed.  The
17697 default is @option{-mtarget-align}.  These options do not affect the
17698 treatment of auto-aligned instructions like @code{LOOP}, which the
17699 assembler will always align, either by widening density instructions or
17700 by inserting no-op instructions.
17701
17702 @item -mlongcalls
17703 @itemx -mno-longcalls
17704 @opindex mlongcalls
17705 @opindex mno-longcalls
17706 When this option is enabled, GCC instructs the assembler to translate
17707 direct calls to indirect calls unless it can determine that the target
17708 of a direct call is in the range allowed by the call instruction.  This
17709 translation typically occurs for calls to functions in other source
17710 files.  Specifically, the assembler translates a direct @code{CALL}
17711 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
17712 The default is @option{-mno-longcalls}.  This option should be used in
17713 programs where the call target can potentially be out of range.  This
17714 option is implemented in the assembler, not the compiler, so the
17715 assembly code generated by GCC will still show direct call
17716 instructions---look at the disassembled object code to see the actual
17717 instructions.  Note that the assembler will use an indirect call for
17718 every cross-file call, not just those that really will be out of range.
17719 @end table
17720
17721 @node zSeries Options
17722 @subsection zSeries Options
17723 @cindex zSeries options
17724
17725 These are listed under @xref{S/390 and zSeries Options}.
17726
17727 @node Code Gen Options
17728 @section Options for Code Generation Conventions
17729 @cindex code generation conventions
17730 @cindex options, code generation
17731 @cindex run-time options
17732
17733 These machine-independent options control the interface conventions
17734 used in code generation.
17735
17736 Most of them have both positive and negative forms; the negative form
17737 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
17738 one of the forms is listed---the one which is not the default.  You
17739 can figure out the other form by either removing @samp{no-} or adding
17740 it.
17741
17742 @table @gcctabopt
17743 @item -fbounds-check
17744 @opindex fbounds-check
17745 For front-ends that support it, generate additional code to check that
17746 indices used to access arrays are within the declared range.  This is
17747 currently only supported by the Java and Fortran front-ends, where
17748 this option defaults to true and false respectively.
17749
17750 @item -ftrapv
17751 @opindex ftrapv
17752 This option generates traps for signed overflow on addition, subtraction,
17753 multiplication operations.
17754
17755 @item -fwrapv
17756 @opindex fwrapv
17757 This option instructs the compiler to assume that signed arithmetic
17758 overflow of addition, subtraction and multiplication wraps around
17759 using twos-complement representation.  This flag enables some optimizations
17760 and disables others.  This option is enabled by default for the Java
17761 front-end, as required by the Java language specification.
17762
17763 @item -fexceptions
17764 @opindex fexceptions
17765 Enable exception handling.  Generates extra code needed to propagate
17766 exceptions.  For some targets, this implies GCC will generate frame
17767 unwind information for all functions, which can produce significant data
17768 size overhead, although it does not affect execution.  If you do not
17769 specify this option, GCC will enable it by default for languages like
17770 C++ which normally require exception handling, and disable it for
17771 languages like C that do not normally require it.  However, you may need
17772 to enable this option when compiling C code that needs to interoperate
17773 properly with exception handlers written in C++.  You may also wish to
17774 disable this option if you are compiling older C++ programs that don't
17775 use exception handling.
17776
17777 @item -fnon-call-exceptions
17778 @opindex fnon-call-exceptions
17779 Generate code that allows trapping instructions to throw exceptions.
17780 Note that this requires platform-specific runtime support that does
17781 not exist everywhere.  Moreover, it only allows @emph{trapping}
17782 instructions to throw exceptions, i.e.@: memory references or floating
17783 point instructions.  It does not allow exceptions to be thrown from
17784 arbitrary signal handlers such as @code{SIGALRM}.
17785
17786 @item -funwind-tables
17787 @opindex funwind-tables
17788 Similar to @option{-fexceptions}, except that it will just generate any needed
17789 static data, but will not affect the generated code in any other way.
17790 You will normally not enable this option; instead, a language processor
17791 that needs this handling would enable it on your behalf.
17792
17793 @item -fasynchronous-unwind-tables
17794 @opindex fasynchronous-unwind-tables
17795 Generate unwind table in dwarf2 format, if supported by target machine.  The
17796 table is exact at each instruction boundary, so it can be used for stack
17797 unwinding from asynchronous events (such as debugger or garbage collector).
17798
17799 @item -fpcc-struct-return
17800 @opindex fpcc-struct-return
17801 Return ``short'' @code{struct} and @code{union} values in memory like
17802 longer ones, rather than in registers.  This convention is less
17803 efficient, but it has the advantage of allowing intercallability between
17804 GCC-compiled files and files compiled with other compilers, particularly
17805 the Portable C Compiler (pcc).
17806
17807 The precise convention for returning structures in memory depends
17808 on the target configuration macros.
17809
17810 Short structures and unions are those whose size and alignment match
17811 that of some integer type.
17812
17813 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
17814 switch is not binary compatible with code compiled with the
17815 @option{-freg-struct-return} switch.
17816 Use it to conform to a non-default application binary interface.
17817
17818 @item -freg-struct-return
17819 @opindex freg-struct-return
17820 Return @code{struct} and @code{union} values in registers when possible.
17821 This is more efficient for small structures than
17822 @option{-fpcc-struct-return}.
17823
17824 If you specify neither @option{-fpcc-struct-return} nor
17825 @option{-freg-struct-return}, GCC defaults to whichever convention is
17826 standard for the target.  If there is no standard convention, GCC
17827 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
17828 the principal compiler.  In those cases, we can choose the standard, and
17829 we chose the more efficient register return alternative.
17830
17831 @strong{Warning:} code compiled with the @option{-freg-struct-return}
17832 switch is not binary compatible with code compiled with the
17833 @option{-fpcc-struct-return} switch.
17834 Use it to conform to a non-default application binary interface.
17835
17836 @item -fshort-enums
17837 @opindex fshort-enums
17838 Allocate to an @code{enum} type only as many bytes as it needs for the
17839 declared range of possible values.  Specifically, the @code{enum} type
17840 will be equivalent to the smallest integer type which has enough room.
17841
17842 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
17843 code that is not binary compatible with code generated without that switch.
17844 Use it to conform to a non-default application binary interface.
17845
17846 @item -fshort-double
17847 @opindex fshort-double
17848 Use the same size for @code{double} as for @code{float}.
17849
17850 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
17851 code that is not binary compatible with code generated without that switch.
17852 Use it to conform to a non-default application binary interface.
17853
17854 @item -fshort-wchar
17855 @opindex fshort-wchar
17856 Override the underlying type for @samp{wchar_t} to be @samp{short
17857 unsigned int} instead of the default for the target.  This option is
17858 useful for building programs to run under WINE@.
17859
17860 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
17861 code that is not binary compatible with code generated without that switch.
17862 Use it to conform to a non-default application binary interface.
17863
17864 @item -fno-common
17865 @opindex fno-common
17866 In C code, controls the placement of uninitialized global variables.
17867 Unix C compilers have traditionally permitted multiple definitions of
17868 such variables in different compilation units by placing the variables
17869 in a common block.
17870 This is the behavior specified by @option{-fcommon}, and is the default
17871 for GCC on most targets.
17872 On the other hand, this behavior is not required by ISO C, and on some
17873 targets may carry a speed or code size penalty on variable references.
17874 The @option{-fno-common} option specifies that the compiler should place
17875 uninitialized global variables in the data section of the object file,
17876 rather than generating them as common blocks.
17877 This has the effect that if the same variable is declared
17878 (without @code{extern}) in two different compilations,
17879 you will get a multiple-definition error when you link them.
17880 In this case, you must compile with @option{-fcommon} instead.
17881 Compiling with @option{-fno-common} is useful on targets for which
17882 it provides better performance, or if you wish to verify that the
17883 program will work on other systems which always treat uninitialized
17884 variable declarations this way.
17885
17886 @item -fno-ident
17887 @opindex fno-ident
17888 Ignore the @samp{#ident} directive.
17889
17890 @item -finhibit-size-directive
17891 @opindex finhibit-size-directive
17892 Don't output a @code{.size} assembler directive, or anything else that
17893 would cause trouble if the function is split in the middle, and the
17894 two halves are placed at locations far apart in memory.  This option is
17895 used when compiling @file{crtstuff.c}; you should not need to use it
17896 for anything else.
17897
17898 @item -fverbose-asm
17899 @opindex fverbose-asm
17900 Put extra commentary information in the generated assembly code to
17901 make it more readable.  This option is generally only of use to those
17902 who actually need to read the generated assembly code (perhaps while
17903 debugging the compiler itself).
17904
17905 @option{-fno-verbose-asm}, the default, causes the
17906 extra information to be omitted and is useful when comparing two assembler
17907 files.
17908
17909 @item -frecord-gcc-switches
17910 @opindex frecord-gcc-switches
17911 This switch causes the command line that was used to invoke the
17912 compiler to be recorded into the object file that is being created.
17913 This switch is only implemented on some targets and the exact format
17914 of the recording is target and binary file format dependent, but it
17915 usually takes the form of a section containing ASCII text.  This
17916 switch is related to the @option{-fverbose-asm} switch, but that
17917 switch only records information in the assembler output file as
17918 comments, so it never reaches the object file.
17919
17920 @item -fpic
17921 @opindex fpic
17922 @cindex global offset table
17923 @cindex PIC
17924 Generate position-independent code (PIC) suitable for use in a shared
17925 library, if supported for the target machine.  Such code accesses all
17926 constant addresses through a global offset table (GOT)@.  The dynamic
17927 loader resolves the GOT entries when the program starts (the dynamic
17928 loader is not part of GCC; it is part of the operating system).  If
17929 the GOT size for the linked executable exceeds a machine-specific
17930 maximum size, you get an error message from the linker indicating that
17931 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
17932 instead.  (These maximums are 8k on the SPARC and 32k
17933 on the m68k and RS/6000.  The 386 has no such limit.)
17934
17935 Position-independent code requires special support, and therefore works
17936 only on certain machines.  For the 386, GCC supports PIC for System V
17937 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
17938 position-independent.
17939
17940 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17941 are defined to 1.
17942
17943 @item -fPIC
17944 @opindex fPIC
17945 If supported for the target machine, emit position-independent code,
17946 suitable for dynamic linking and avoiding any limit on the size of the
17947 global offset table.  This option makes a difference on the m68k,
17948 PowerPC and SPARC@.
17949
17950 Position-independent code requires special support, and therefore works
17951 only on certain machines.
17952
17953 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17954 are defined to 2.
17955
17956 @item -fpie
17957 @itemx -fPIE
17958 @opindex fpie
17959 @opindex fPIE
17960 These options are similar to @option{-fpic} and @option{-fPIC}, but
17961 generated position independent code can be only linked into executables.
17962 Usually these options are used when @option{-pie} GCC option will be
17963 used during linking.
17964
17965 @option{-fpie} and @option{-fPIE} both define the macros
17966 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
17967 for @option{-fpie} and 2 for @option{-fPIE}.
17968
17969 @item -fno-jump-tables
17970 @opindex fno-jump-tables
17971 Do not use jump tables for switch statements even where it would be
17972 more efficient than other code generation strategies.  This option is
17973 of use in conjunction with @option{-fpic} or @option{-fPIC} for
17974 building code which forms part of a dynamic linker and cannot
17975 reference the address of a jump table.  On some targets, jump tables
17976 do not require a GOT and this option is not needed.
17977
17978 @item -ffixed-@var{reg}
17979 @opindex ffixed
17980 Treat the register named @var{reg} as a fixed register; generated code
17981 should never refer to it (except perhaps as a stack pointer, frame
17982 pointer or in some other fixed role).
17983
17984 @var{reg} must be the name of a register.  The register names accepted
17985 are machine-specific and are defined in the @code{REGISTER_NAMES}
17986 macro in the machine description macro file.
17987
17988 This flag does not have a negative form, because it specifies a
17989 three-way choice.
17990
17991 @item -fcall-used-@var{reg}
17992 @opindex fcall-used
17993 Treat the register named @var{reg} as an allocable register that is
17994 clobbered by function calls.  It may be allocated for temporaries or
17995 variables that do not live across a call.  Functions compiled this way
17996 will not save and restore the register @var{reg}.
17997
17998 It is an error to used this flag with the frame pointer or stack pointer.
17999 Use of this flag for other registers that have fixed pervasive roles in
18000 the machine's execution model will produce disastrous results.
18001
18002 This flag does not have a negative form, because it specifies a
18003 three-way choice.
18004
18005 @item -fcall-saved-@var{reg}
18006 @opindex fcall-saved
18007 Treat the register named @var{reg} as an allocable register saved by
18008 functions.  It may be allocated even for temporaries or variables that
18009 live across a call.  Functions compiled this way will save and restore
18010 the register @var{reg} if they use it.
18011
18012 It is an error to used this flag with the frame pointer or stack pointer.
18013 Use of this flag for other registers that have fixed pervasive roles in
18014 the machine's execution model will produce disastrous results.
18015
18016 A different sort of disaster will result from the use of this flag for
18017 a register in which function values may be returned.
18018
18019 This flag does not have a negative form, because it specifies a
18020 three-way choice.
18021
18022 @item -fpack-struct[=@var{n}]
18023 @opindex fpack-struct
18024 Without a value specified, pack all structure members together without
18025 holes.  When a value is specified (which must be a small power of two), pack
18026 structure members according to this value, representing the maximum
18027 alignment (that is, objects with default alignment requirements larger than
18028 this will be output potentially unaligned at the next fitting location.
18029
18030 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
18031 code that is not binary compatible with code generated without that switch.
18032 Additionally, it makes the code suboptimal.
18033 Use it to conform to a non-default application binary interface.
18034
18035 @item -finstrument-functions
18036 @opindex finstrument-functions
18037 Generate instrumentation calls for entry and exit to functions.  Just
18038 after function entry and just before function exit, the following
18039 profiling functions will be called with the address of the current
18040 function and its call site.  (On some platforms,
18041 @code{__builtin_return_address} does not work beyond the current
18042 function, so the call site information may not be available to the
18043 profiling functions otherwise.)
18044
18045 @smallexample
18046 void __cyg_profile_func_enter (void *this_fn,
18047                                void *call_site);
18048 void __cyg_profile_func_exit  (void *this_fn,
18049                                void *call_site);
18050 @end smallexample
18051
18052 The first argument is the address of the start of the current function,
18053 which may be looked up exactly in the symbol table.
18054
18055 This instrumentation is also done for functions expanded inline in other
18056 functions.  The profiling calls will indicate where, conceptually, the
18057 inline function is entered and exited.  This means that addressable
18058 versions of such functions must be available.  If all your uses of a
18059 function are expanded inline, this may mean an additional expansion of
18060 code size.  If you use @samp{extern inline} in your C code, an
18061 addressable version of such functions must be provided.  (This is
18062 normally the case anyways, but if you get lucky and the optimizer always
18063 expands the functions inline, you might have gotten away without
18064 providing static copies.)
18065
18066 A function may be given the attribute @code{no_instrument_function}, in
18067 which case this instrumentation will not be done.  This can be used, for
18068 example, for the profiling functions listed above, high-priority
18069 interrupt routines, and any functions from which the profiling functions
18070 cannot safely be called (perhaps signal handlers, if the profiling
18071 routines generate output or allocate memory).
18072
18073 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
18074 @opindex finstrument-functions-exclude-file-list
18075
18076 Set the list of functions that are excluded from instrumentation (see
18077 the description of @code{-finstrument-functions}).  If the file that
18078 contains a function definition matches with one of @var{file}, then
18079 that function is not instrumented.  The match is done on substrings:
18080 if the @var{file} parameter is a substring of the file name, it is
18081 considered to be a match.
18082
18083 For example:
18084
18085 @smallexample
18086 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
18087 @end smallexample
18088
18089 @noindent
18090 will exclude any inline function defined in files whose pathnames
18091 contain @code{/bits/stl} or @code{include/sys}.
18092
18093 If, for some reason, you want to include letter @code{','} in one of
18094 @var{sym}, write @code{'\,'}. For example,
18095 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
18096 (note the single quote surrounding the option).
18097
18098 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
18099 @opindex finstrument-functions-exclude-function-list
18100
18101 This is similar to @code{-finstrument-functions-exclude-file-list},
18102 but this option sets the list of function names to be excluded from
18103 instrumentation.  The function name to be matched is its user-visible
18104 name, such as @code{vector<int> blah(const vector<int> &)}, not the
18105 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
18106 match is done on substrings: if the @var{sym} parameter is a substring
18107 of the function name, it is considered to be a match.  For C99 and C++
18108 extended identifiers, the function name must be given in UTF-8, not
18109 using universal character names.
18110
18111 @item -fstack-check
18112 @opindex fstack-check
18113 Generate code to verify that you do not go beyond the boundary of the
18114 stack.  You should specify this flag if you are running in an
18115 environment with multiple threads, but only rarely need to specify it in
18116 a single-threaded environment since stack overflow is automatically
18117 detected on nearly all systems if there is only one stack.
18118
18119 Note that this switch does not actually cause checking to be done; the
18120 operating system or the language runtime must do that.  The switch causes
18121 generation of code to ensure that they see the stack being extended.
18122
18123 You can additionally specify a string parameter: @code{no} means no
18124 checking, @code{generic} means force the use of old-style checking,
18125 @code{specific} means use the best checking method and is equivalent
18126 to bare @option{-fstack-check}.
18127
18128 Old-style checking is a generic mechanism that requires no specific
18129 target support in the compiler but comes with the following drawbacks:
18130
18131 @enumerate
18132 @item
18133 Modified allocation strategy for large objects: they will always be
18134 allocated dynamically if their size exceeds a fixed threshold.
18135
18136 @item
18137 Fixed limit on the size of the static frame of functions: when it is
18138 topped by a particular function, stack checking is not reliable and
18139 a warning is issued by the compiler.
18140
18141 @item
18142 Inefficiency: because of both the modified allocation strategy and the
18143 generic implementation, the performances of the code are hampered.
18144 @end enumerate
18145
18146 Note that old-style stack checking is also the fallback method for
18147 @code{specific} if no target support has been added in the compiler.
18148
18149 @item -fstack-limit-register=@var{reg}
18150 @itemx -fstack-limit-symbol=@var{sym}
18151 @itemx -fno-stack-limit
18152 @opindex fstack-limit-register
18153 @opindex fstack-limit-symbol
18154 @opindex fno-stack-limit
18155 Generate code to ensure that the stack does not grow beyond a certain value,
18156 either the value of a register or the address of a symbol.  If the stack
18157 would grow beyond the value, a signal is raised.  For most targets,
18158 the signal is raised before the stack overruns the boundary, so
18159 it is possible to catch the signal without taking special precautions.
18160
18161 For instance, if the stack starts at absolute address @samp{0x80000000}
18162 and grows downwards, you can use the flags
18163 @option{-fstack-limit-symbol=__stack_limit} and
18164 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
18165 of 128KB@.  Note that this may only work with the GNU linker.
18166
18167 @item -fsplit-stack
18168 @opindex fsplit-stack
18169 Generate code to automatically split the stack before it overflows.
18170 The resulting program has a discontiguous stack which can only
18171 overflow if the program is unable to allocate any more memory.  This
18172 is most useful when running threaded programs, as it is no longer
18173 necessary to calculate a good stack size to use for each thread.  This
18174 is currently only implemented for the i386 and x86_64 backends running
18175 GNU/Linux.
18176
18177 When code compiled with @option{-fsplit-stack} calls code compiled
18178 without @option{-fsplit-stack}, there may not be much stack space
18179 available for the latter code to run.  If compiling all code,
18180 including library code, with @option{-fsplit-stack} is not an option,
18181 then the linker can fix up these calls so that the code compiled
18182 without @option{-fsplit-stack} always has a large stack.  Support for
18183 this is implemented in the gold linker in GNU binutils release 2.21
18184 and later.
18185
18186 @item -fleading-underscore
18187 @opindex fleading-underscore
18188 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
18189 change the way C symbols are represented in the object file.  One use
18190 is to help link with legacy assembly code.
18191
18192 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
18193 generate code that is not binary compatible with code generated without that
18194 switch.  Use it to conform to a non-default application binary interface.
18195 Not all targets provide complete support for this switch.
18196
18197 @item -ftls-model=@var{model}
18198 @opindex ftls-model
18199 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
18200 The @var{model} argument should be one of @code{global-dynamic},
18201 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
18202
18203 The default without @option{-fpic} is @code{initial-exec}; with
18204 @option{-fpic} the default is @code{global-dynamic}.
18205
18206 @item -fvisibility=@var{default|internal|hidden|protected}
18207 @opindex fvisibility
18208 Set the default ELF image symbol visibility to the specified option---all
18209 symbols will be marked with this unless overridden within the code.
18210 Using this feature can very substantially improve linking and
18211 load times of shared object libraries, produce more optimized
18212 code, provide near-perfect API export and prevent symbol clashes.
18213 It is @strong{strongly} recommended that you use this in any shared objects
18214 you distribute.
18215
18216 Despite the nomenclature, @code{default} always means public; i.e.,
18217 available to be linked against from outside the shared object.
18218 @code{protected} and @code{internal} are pretty useless in real-world
18219 usage so the only other commonly used option will be @code{hidden}.
18220 The default if @option{-fvisibility} isn't specified is
18221 @code{default}, i.e., make every
18222 symbol public---this causes the same behavior as previous versions of
18223 GCC@.
18224
18225 A good explanation of the benefits offered by ensuring ELF
18226 symbols have the correct visibility is given by ``How To Write
18227 Shared Libraries'' by Ulrich Drepper (which can be found at
18228 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
18229 solution made possible by this option to marking things hidden when
18230 the default is public is to make the default hidden and mark things
18231 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
18232 and @code{__attribute__ ((visibility("default")))} instead of
18233 @code{__declspec(dllexport)} you get almost identical semantics with
18234 identical syntax.  This is a great boon to those working with
18235 cross-platform projects.
18236
18237 For those adding visibility support to existing code, you may find
18238 @samp{#pragma GCC visibility} of use.  This works by you enclosing
18239 the declarations you wish to set visibility for with (for example)
18240 @samp{#pragma GCC visibility push(hidden)} and
18241 @samp{#pragma GCC visibility pop}.
18242 Bear in mind that symbol visibility should be viewed @strong{as
18243 part of the API interface contract} and thus all new code should
18244 always specify visibility when it is not the default; i.e., declarations
18245 only for use within the local DSO should @strong{always} be marked explicitly
18246 as hidden as so to avoid PLT indirection overheads---making this
18247 abundantly clear also aids readability and self-documentation of the code.
18248 Note that due to ISO C++ specification requirements, operator new and
18249 operator delete must always be of default visibility.
18250
18251 Be aware that headers from outside your project, in particular system
18252 headers and headers from any other library you use, may not be
18253 expecting to be compiled with visibility other than the default.  You
18254 may need to explicitly say @samp{#pragma GCC visibility push(default)}
18255 before including any such headers.
18256
18257 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
18258 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
18259 no modifications.  However, this means that calls to @samp{extern}
18260 functions with no explicit visibility will use the PLT, so it is more
18261 effective to use @samp{__attribute ((visibility))} and/or
18262 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
18263 declarations should be treated as hidden.
18264
18265 Note that @samp{-fvisibility} does affect C++ vague linkage
18266 entities. This means that, for instance, an exception class that will
18267 be thrown between DSOs must be explicitly marked with default
18268 visibility so that the @samp{type_info} nodes will be unified between
18269 the DSOs.
18270
18271 An overview of these techniques, their benefits and how to use them
18272 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
18273
18274 @item -fstrict-volatile-bitfields
18275 @opindex fstrict-volatile-bitfields
18276 This option should be used if accesses to volatile bitfields (or other
18277 structure fields, although the compiler usually honors those types
18278 anyway) should use a single access of the width of the
18279 field's type, aligned to a natural alignment if possible.  For
18280 example, targets with memory-mapped peripheral registers might require
18281 all such accesses to be 16 bits wide; with this flag the user could
18282 declare all peripheral bitfields as ``unsigned short'' (assuming short
18283 is 16 bits on these targets) to force GCC to use 16 bit accesses
18284 instead of, perhaps, a more efficient 32 bit access.
18285
18286 If this option is disabled, the compiler will use the most efficient
18287 instruction.  In the previous example, that might be a 32-bit load
18288 instruction, even though that will access bytes that do not contain
18289 any portion of the bitfield, or memory-mapped registers unrelated to
18290 the one being updated.
18291
18292 If the target requires strict alignment, and honoring the field
18293 type would require violating this alignment, a warning is issued.
18294 If the field has @code{packed} attribute, the access is done without
18295 honoring the field type.  If the field doesn't have @code{packed}
18296 attribute, the access is done honoring the field type.  In both cases,
18297 GCC assumes that the user knows something about the target hardware
18298 that it is unaware of.
18299
18300 The default value of this option is determined by the application binary
18301 interface for the target processor.
18302
18303 @end table
18304
18305 @c man end
18306
18307 @node Environment Variables
18308 @section Environment Variables Affecting GCC
18309 @cindex environment variables
18310
18311 @c man begin ENVIRONMENT
18312 This section describes several environment variables that affect how GCC
18313 operates.  Some of them work by specifying directories or prefixes to use
18314 when searching for various kinds of files.  Some are used to specify other
18315 aspects of the compilation environment.
18316
18317 Note that you can also specify places to search using options such as
18318 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
18319 take precedence over places specified using environment variables, which
18320 in turn take precedence over those specified by the configuration of GCC@.
18321 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
18322 GNU Compiler Collection (GCC) Internals}.
18323
18324 @table @env
18325 @item LANG
18326 @itemx LC_CTYPE
18327 @c @itemx LC_COLLATE
18328 @itemx LC_MESSAGES
18329 @c @itemx LC_MONETARY
18330 @c @itemx LC_NUMERIC
18331 @c @itemx LC_TIME
18332 @itemx LC_ALL
18333 @findex LANG
18334 @findex LC_CTYPE
18335 @c @findex LC_COLLATE
18336 @findex LC_MESSAGES
18337 @c @findex LC_MONETARY
18338 @c @findex LC_NUMERIC
18339 @c @findex LC_TIME
18340 @findex LC_ALL
18341 @cindex locale
18342 These environment variables control the way that GCC uses
18343 localization information that allow GCC to work with different
18344 national conventions.  GCC inspects the locale categories
18345 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
18346 so.  These locale categories can be set to any value supported by your
18347 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
18348 Kingdom encoded in UTF-8.
18349
18350 The @env{LC_CTYPE} environment variable specifies character
18351 classification.  GCC uses it to determine the character boundaries in
18352 a string; this is needed for some multibyte encodings that contain quote
18353 and escape characters that would otherwise be interpreted as a string
18354 end or escape.
18355
18356 The @env{LC_MESSAGES} environment variable specifies the language to
18357 use in diagnostic messages.
18358
18359 If the @env{LC_ALL} environment variable is set, it overrides the value
18360 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
18361 and @env{LC_MESSAGES} default to the value of the @env{LANG}
18362 environment variable.  If none of these variables are set, GCC
18363 defaults to traditional C English behavior.
18364
18365 @item TMPDIR
18366 @findex TMPDIR
18367 If @env{TMPDIR} is set, it specifies the directory to use for temporary
18368 files.  GCC uses temporary files to hold the output of one stage of
18369 compilation which is to be used as input to the next stage: for example,
18370 the output of the preprocessor, which is the input to the compiler
18371 proper.
18372
18373 @item GCC_EXEC_PREFIX
18374 @findex GCC_EXEC_PREFIX
18375 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
18376 names of the subprograms executed by the compiler.  No slash is added
18377 when this prefix is combined with the name of a subprogram, but you can
18378 specify a prefix that ends with a slash if you wish.
18379
18380 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
18381 an appropriate prefix to use based on the pathname it was invoked with.
18382
18383 If GCC cannot find the subprogram using the specified prefix, it
18384 tries looking in the usual places for the subprogram.
18385
18386 The default value of @env{GCC_EXEC_PREFIX} is
18387 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
18388 the installed compiler. In many cases @var{prefix} is the value
18389 of @code{prefix} when you ran the @file{configure} script.
18390
18391 Other prefixes specified with @option{-B} take precedence over this prefix.
18392
18393 This prefix is also used for finding files such as @file{crt0.o} that are
18394 used for linking.
18395
18396 In addition, the prefix is used in an unusual way in finding the
18397 directories to search for header files.  For each of the standard
18398 directories whose name normally begins with @samp{/usr/local/lib/gcc}
18399 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
18400 replacing that beginning with the specified prefix to produce an
18401 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
18402 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
18403 These alternate directories are searched first; the standard directories
18404 come next. If a standard directory begins with the configured
18405 @var{prefix} then the value of @var{prefix} is replaced by
18406 @env{GCC_EXEC_PREFIX} when looking for header files.
18407
18408 @item COMPILER_PATH
18409 @findex COMPILER_PATH
18410 The value of @env{COMPILER_PATH} is a colon-separated list of
18411 directories, much like @env{PATH}.  GCC tries the directories thus
18412 specified when searching for subprograms, if it can't find the
18413 subprograms using @env{GCC_EXEC_PREFIX}.
18414
18415 @item LIBRARY_PATH
18416 @findex LIBRARY_PATH
18417 The value of @env{LIBRARY_PATH} is a colon-separated list of
18418 directories, much like @env{PATH}.  When configured as a native compiler,
18419 GCC tries the directories thus specified when searching for special
18420 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
18421 using GCC also uses these directories when searching for ordinary
18422 libraries for the @option{-l} option (but directories specified with
18423 @option{-L} come first).
18424
18425 @item LANG
18426 @findex LANG
18427 @cindex locale definition
18428 This variable is used to pass locale information to the compiler.  One way in
18429 which this information is used is to determine the character set to be used
18430 when character literals, string literals and comments are parsed in C and C++.
18431 When the compiler is configured to allow multibyte characters,
18432 the following values for @env{LANG} are recognized:
18433
18434 @table @samp
18435 @item C-JIS
18436 Recognize JIS characters.
18437 @item C-SJIS
18438 Recognize SJIS characters.
18439 @item C-EUCJP
18440 Recognize EUCJP characters.
18441 @end table
18442
18443 If @env{LANG} is not defined, or if it has some other value, then the
18444 compiler will use mblen and mbtowc as defined by the default locale to
18445 recognize and translate multibyte characters.
18446 @end table
18447
18448 @noindent
18449 Some additional environments variables affect the behavior of the
18450 preprocessor.
18451
18452 @include cppenv.texi
18453
18454 @c man end
18455
18456 @node Precompiled Headers
18457 @section Using Precompiled Headers
18458 @cindex precompiled headers
18459 @cindex speed of compilation
18460
18461 Often large projects have many header files that are included in every
18462 source file.  The time the compiler takes to process these header files
18463 over and over again can account for nearly all of the time required to
18464 build the project.  To make builds faster, GCC allows users to
18465 `precompile' a header file; then, if builds can use the precompiled
18466 header file they will be much faster.
18467
18468 To create a precompiled header file, simply compile it as you would any
18469 other file, if necessary using the @option{-x} option to make the driver
18470 treat it as a C or C++ header file.  You will probably want to use a
18471 tool like @command{make} to keep the precompiled header up-to-date when
18472 the headers it contains change.
18473
18474 A precompiled header file will be searched for when @code{#include} is
18475 seen in the compilation.  As it searches for the included file
18476 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
18477 compiler looks for a precompiled header in each directory just before it
18478 looks for the include file in that directory.  The name searched for is
18479 the name specified in the @code{#include} with @samp{.gch} appended.  If
18480 the precompiled header file can't be used, it is ignored.
18481
18482 For instance, if you have @code{#include "all.h"}, and you have
18483 @file{all.h.gch} in the same directory as @file{all.h}, then the
18484 precompiled header file will be used if possible, and the original
18485 header will be used otherwise.
18486
18487 Alternatively, you might decide to put the precompiled header file in a
18488 directory and use @option{-I} to ensure that directory is searched
18489 before (or instead of) the directory containing the original header.
18490 Then, if you want to check that the precompiled header file is always
18491 used, you can put a file of the same name as the original header in this
18492 directory containing an @code{#error} command.
18493
18494 This also works with @option{-include}.  So yet another way to use
18495 precompiled headers, good for projects not designed with precompiled
18496 header files in mind, is to simply take most of the header files used by
18497 a project, include them from another header file, precompile that header
18498 file, and @option{-include} the precompiled header.  If the header files
18499 have guards against multiple inclusion, they will be skipped because
18500 they've already been included (in the precompiled header).
18501
18502 If you need to precompile the same header file for different
18503 languages, targets, or compiler options, you can instead make a
18504 @emph{directory} named like @file{all.h.gch}, and put each precompiled
18505 header in the directory, perhaps using @option{-o}.  It doesn't matter
18506 what you call the files in the directory, every precompiled header in
18507 the directory will be considered.  The first precompiled header
18508 encountered in the directory that is valid for this compilation will
18509 be used; they're searched in no particular order.
18510
18511 There are many other possibilities, limited only by your imagination,
18512 good sense, and the constraints of your build system.
18513
18514 A precompiled header file can be used only when these conditions apply:
18515
18516 @itemize
18517 @item
18518 Only one precompiled header can be used in a particular compilation.
18519
18520 @item
18521 A precompiled header can't be used once the first C token is seen.  You
18522 can have preprocessor directives before a precompiled header; you can
18523 even include a precompiled header from inside another header, so long as
18524 there are no C tokens before the @code{#include}.
18525
18526 @item
18527 The precompiled header file must be produced for the same language as
18528 the current compilation.  You can't use a C precompiled header for a C++
18529 compilation.
18530
18531 @item
18532 The precompiled header file must have been produced by the same compiler
18533 binary as the current compilation is using.
18534
18535 @item
18536 Any macros defined before the precompiled header is included must
18537 either be defined in the same way as when the precompiled header was
18538 generated, or must not affect the precompiled header, which usually
18539 means that they don't appear in the precompiled header at all.
18540
18541 The @option{-D} option is one way to define a macro before a
18542 precompiled header is included; using a @code{#define} can also do it.
18543 There are also some options that define macros implicitly, like
18544 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
18545 defined this way.
18546
18547 @item If debugging information is output when using the precompiled
18548 header, using @option{-g} or similar, the same kind of debugging information
18549 must have been output when building the precompiled header.  However,
18550 a precompiled header built using @option{-g} can be used in a compilation
18551 when no debugging information is being output.
18552
18553 @item The same @option{-m} options must generally be used when building
18554 and using the precompiled header.  @xref{Submodel Options},
18555 for any cases where this rule is relaxed.
18556
18557 @item Each of the following options must be the same when building and using
18558 the precompiled header:
18559
18560 @gccoptlist{-fexceptions}
18561
18562 @item
18563 Some other command-line options starting with @option{-f},
18564 @option{-p}, or @option{-O} must be defined in the same way as when
18565 the precompiled header was generated.  At present, it's not clear
18566 which options are safe to change and which are not; the safest choice
18567 is to use exactly the same options when generating and using the
18568 precompiled header.  The following are known to be safe:
18569
18570 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
18571 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
18572 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
18573 -pedantic-errors}
18574
18575 @end itemize
18576
18577 For all of these except the last, the compiler will automatically
18578 ignore the precompiled header if the conditions aren't met.  If you
18579 find an option combination that doesn't work and doesn't cause the
18580 precompiled header to be ignored, please consider filing a bug report,
18581 see @ref{Bugs}.
18582
18583 If you do use differing options when generating and using the
18584 precompiled header, the actual behavior will be a mixture of the
18585 behavior for the options.  For instance, if you use @option{-g} to
18586 generate the precompiled header but not when using it, you may or may
18587 not get debugging information for routines in the precompiled header.