OSDN Git Service

2011-03-27 Jonathan Wakely <jwakely.gcc@gmail.com>
[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 -fno-diagnostics-show-option}
231
232 @item Warning Options
233 @xref{Warning Options,,Options to Request or Suppress Warnings}.
234 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -pedantic @gol
235 -pedantic-errors @gol
236 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
237 -Wno-attributes -Wno-builtin-macro-redefined @gol
238 -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
239 -Wchar-subscripts -Wclobbered  -Wcomment @gol
240 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
241 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
242 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
243 -Wno-endif-labels -Werror  -Werror=* @gol
244 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
245 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
246 -Wformat-security  -Wformat-y2k @gol
247 -Wframe-larger-than=@var{len} -Wjump-misses-init -Wignored-qualifiers @gol
248 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
249 -Winit-self  -Winline @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{i386 and x86-64 Windows Options}
617 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
618 -mnop-fun-dllimport -mthread @gol
619 -municode -mwin32 -mwindows -fno-set-stack-executable}
620
621 @emph{IA-64 Options}
622 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
623 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
624 -mconstant-gp  -mauto-pic  -mfused-madd @gol
625 -minline-float-divide-min-latency @gol
626 -minline-float-divide-max-throughput @gol
627 -mno-inline-float-divide @gol
628 -minline-int-divide-min-latency @gol
629 -minline-int-divide-max-throughput  @gol
630 -mno-inline-int-divide @gol
631 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
632 -mno-inline-sqrt @gol
633 -mdwarf2-asm -mearly-stop-bits @gol
634 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
635 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
636 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
637 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
638 -msched-spec-ldc -msched-spec-control-ldc @gol
639 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
640 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
641 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
642 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
643
644 @emph{IA-64/VMS Options}
645 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
646
647 @emph{LM32 Options}
648 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
649 -msign-extend-enabled -muser-enabled}
650
651 @emph{M32R/D Options}
652 @gccoptlist{-m32r2 -m32rx -m32r @gol
653 -mdebug @gol
654 -malign-loops -mno-align-loops @gol
655 -missue-rate=@var{number} @gol
656 -mbranch-cost=@var{number} @gol
657 -mmodel=@var{code-size-model-type} @gol
658 -msdata=@var{sdata-type} @gol
659 -mno-flush-func -mflush-func=@var{name} @gol
660 -mno-flush-trap -mflush-trap=@var{number} @gol
661 -G @var{num}}
662
663 @emph{M32C Options}
664 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
665
666 @emph{M680x0 Options}
667 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
668 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
669 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
670 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
671 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
672 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
673 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
674 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
675 -mxgot -mno-xgot}
676
677 @emph{M68hc1x Options}
678 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
679 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
680 -msoft-reg-count=@var{count}}
681
682 @emph{MCore Options}
683 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
684 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
685 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
686 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
687 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
688
689 @emph{MeP Options}
690 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
691 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
692 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
693 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
694 -mtiny=@var{n}}
695
696 @emph{MicroBlaze Options}
697 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
698 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
699 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
700 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
701 -mxl-mode-@var{app-model}}
702
703 @emph{MIPS Options}
704 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
705 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
706 -mips64  -mips64r2 @gol
707 -mips16  -mno-mips16  -mflip-mips16 @gol
708 -minterlink-mips16  -mno-interlink-mips16 @gol
709 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
710 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
711 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
712 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
713 -mfpu=@var{fpu-type} @gol
714 -msmartmips  -mno-smartmips @gol
715 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
716 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
717 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
718 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
719 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
720 -membedded-data  -mno-embedded-data @gol
721 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
722 -mcode-readable=@var{setting} @gol
723 -msplit-addresses  -mno-split-addresses @gol
724 -mexplicit-relocs  -mno-explicit-relocs @gol
725 -mcheck-zero-division  -mno-check-zero-division @gol
726 -mdivide-traps  -mdivide-breaks @gol
727 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
728 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
729 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
730 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
731 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
732 -mflush-func=@var{func}  -mno-flush-func @gol
733 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
734 -mfp-exceptions -mno-fp-exceptions @gol
735 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
736 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
737
738 @emph{MMIX Options}
739 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
740 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
741 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
742 -mno-base-addresses  -msingle-exit  -mno-single-exit}
743
744 @emph{MN10300 Options}
745 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
746 -mno-am33 -mam33 -mam33-2 -mam34 @gol
747 -mtune=@var{cpu-type} @gol
748 -mreturn-pointer-on-d0 @gol
749 -mno-crt0  -mrelax -mliw}
750
751 @emph{PDP-11 Options}
752 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
753 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
754 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
755 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
756 -mbranch-expensive  -mbranch-cheap @gol
757 -munix-asm  -mdec-asm}
758
759 @emph{picoChip Options}
760 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
761 -msymbol-as-address -mno-inefficient-warnings}
762
763 @emph{PowerPC Options}
764 See RS/6000 and PowerPC Options.
765
766 @emph{RS/6000 and PowerPC Options}
767 @gccoptlist{-mcpu=@var{cpu-type} @gol
768 -mtune=@var{cpu-type} @gol
769 -mcmodel=@var{code-model} @gol
770 -mpower  -mno-power  -mpower2  -mno-power2 @gol
771 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
772 -maltivec  -mno-altivec @gol
773 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
774 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
775 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
776 -mfprnd  -mno-fprnd @gol
777 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
778 -mnew-mnemonics  -mold-mnemonics @gol
779 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
780 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
781 -malign-power  -malign-natural @gol
782 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
783 -msingle-float -mdouble-float -msimple-fpu @gol
784 -mstring  -mno-string  -mupdate  -mno-update @gol
785 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
786 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
787 -mstrict-align  -mno-strict-align  -mrelocatable @gol
788 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
789 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
790 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
791 -mprioritize-restricted-insns=@var{priority} @gol
792 -msched-costly-dep=@var{dependence_type} @gol
793 -minsert-sched-nops=@var{scheme} @gol
794 -mcall-sysv  -mcall-netbsd @gol
795 -maix-struct-return  -msvr4-struct-return @gol
796 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
797 -mblock-move-inline-limit=@var{num} @gol
798 -misel -mno-isel @gol
799 -misel=yes  -misel=no @gol
800 -mspe -mno-spe @gol
801 -mspe=yes  -mspe=no @gol
802 -mpaired @gol
803 -mgen-cell-microcode -mwarn-cell-microcode @gol
804 -mvrsave -mno-vrsave @gol
805 -mmulhw -mno-mulhw @gol
806 -mdlmzb -mno-dlmzb @gol
807 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
808 -mprototype  -mno-prototype @gol
809 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
810 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
811 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision
812 -mno-recip-precision @gol
813 -mveclibabi=@var{type} -mfriz -mno-friz}
814
815 @emph{RX Options}
816 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
817 -mcpu=@gol
818 -mbig-endian-data -mlittle-endian-data @gol
819 -msmall-data @gol
820 -msim  -mno-sim@gol
821 -mas100-syntax -mno-as100-syntax@gol
822 -mrelax@gol
823 -mmax-constant-size=@gol
824 -mint-register=@gol
825 -msave-acc-in-interrupts}
826
827 @emph{S/390 and zSeries Options}
828 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
829 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
830 -mlong-double-64 -mlong-double-128 @gol
831 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
832 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
833 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
834 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
835 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
836
837 @emph{Score Options}
838 @gccoptlist{-meb -mel @gol
839 -mnhwloop @gol
840 -muls @gol
841 -mmac @gol
842 -mscore5 -mscore5u -mscore7 -mscore7d}
843
844 @emph{SH Options}
845 @gccoptlist{-m1  -m2  -m2e @gol
846 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
847 -m3  -m3e @gol
848 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
849 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
850 -m5-64media  -m5-64media-nofpu @gol
851 -m5-32media  -m5-32media-nofpu @gol
852 -m5-compact  -m5-compact-nofpu @gol
853 -mb  -ml  -mdalign  -mrelax @gol
854 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
855 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
856 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
857 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
858 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
859 -maccumulate-outgoing-args -minvalid-symbols}
860
861 @emph{Solaris 2 Options}
862 @gccoptlist{-mimpure-text  -mno-impure-text @gol
863 -threads -pthreads -pthread}
864
865 @emph{SPARC Options}
866 @gccoptlist{-mcpu=@var{cpu-type} @gol
867 -mtune=@var{cpu-type} @gol
868 -mcmodel=@var{code-model} @gol
869 -m32  -m64  -mapp-regs  -mno-app-regs @gol
870 -mfaster-structs  -mno-faster-structs @gol
871 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
872 -mhard-quad-float  -msoft-quad-float @gol
873 -mlittle-endian @gol
874 -mstack-bias  -mno-stack-bias @gol
875 -munaligned-doubles  -mno-unaligned-doubles @gol
876 -mv8plus  -mno-v8plus  -mvis  -mno-vis}
877
878 @emph{SPU Options}
879 @gccoptlist{-mwarn-reloc -merror-reloc @gol
880 -msafe-dma -munsafe-dma @gol
881 -mbranch-hints @gol
882 -msmall-mem -mlarge-mem -mstdmain @gol
883 -mfixed-range=@var{register-range} @gol
884 -mea32 -mea64 @gol
885 -maddress-space-conversion -mno-address-space-conversion @gol
886 -mcache-size=@var{cache-size} @gol
887 -matomic-updates -mno-atomic-updates}
888
889 @emph{System V Options}
890 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
891
892 @emph{V850 Options}
893 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
894 -mprolog-function  -mno-prolog-function  -mspace @gol
895 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
896 -mapp-regs  -mno-app-regs @gol
897 -mdisable-callt  -mno-disable-callt @gol
898 -mv850e2v3 @gol
899 -mv850e2 @gol
900 -mv850e1 -mv850es @gol
901 -mv850e @gol
902 -mv850  -mbig-switch}
903
904 @emph{VAX Options}
905 @gccoptlist{-mg  -mgnu  -munix}
906
907 @emph{VxWorks Options}
908 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
909 -Xbind-lazy  -Xbind-now}
910
911 @emph{x86-64 Options}
912 See i386 and x86-64 Options.
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/gcc-4.6/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 -fno-diagnostics-show-option
2775 @opindex fno-diagnostics-show-option
2776 @opindex fdiagnostics-show-option
2777 By default, each diagnostic emitted includes text which indicates the
2778 command line option that directly controls the diagnostic (if such an
2779 option is known to the diagnostic machinery).  Specifying the
2780 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2781
2782 @item -Wcoverage-mismatch
2783 @opindex Wcoverage-mismatch
2784 Warn if feedback profiles do not match when using the
2785 @option{-fprofile-use} option.
2786 If a source file was changed between @option{-fprofile-gen} and
2787 @option{-fprofile-use}, the files with the profile feedback can fail
2788 to match the source file and GCC can not use the profile feedback
2789 information.  By default, this warning is enabled and is treated as an
2790 error.  @option{-Wno-coverage-mismatch} can be used to disable the
2791 warning or @option{-Wno-error=coverage-mismatch} can be used to
2792 disable the error.  Disable the error for this warning can result in
2793 poorly optimized code, so disabling the error is useful only in the
2794 case of very minor changes such as bug fixes to an existing code-base.
2795 Completely disabling the warning is not recommended.
2796
2797 @end table
2798
2799 @node Warning Options
2800 @section Options to Request or Suppress Warnings
2801 @cindex options to control warnings
2802 @cindex warning messages
2803 @cindex messages, warning
2804 @cindex suppressing warnings
2805
2806 Warnings are diagnostic messages that report constructions which
2807 are not inherently erroneous but which are risky or suggest there
2808 may have been an error.
2809
2810 The following language-independent options do not enable specific
2811 warnings but control the kinds of diagnostics produced by GCC.
2812
2813 @table @gcctabopt
2814 @cindex syntax checking
2815 @item -fsyntax-only
2816 @opindex fsyntax-only
2817 Check the code for syntax errors, but don't do anything beyond that.
2818
2819 @item -fmax-errors=@var{n}
2820 @opindex fmax-errors
2821 Limits the maximum number of error messages to @var{n}, at which point
2822 GCC bails out rather than attempting to continue processing the source
2823 code.  If @var{n} is 0 (the default), there is no limit on the number
2824 of error messages produced.  If @option{-Wfatal-errors} is also
2825 specified, then @option{-Wfatal-errors} takes precedence over this
2826 option.
2827
2828 @item -w
2829 @opindex w
2830 Inhibit all warning messages.
2831
2832 @item -Werror
2833 @opindex Werror
2834 @opindex Wno-error
2835 Make all warnings into errors.
2836
2837 @item -Werror=
2838 @opindex Werror=
2839 @opindex Wno-error=
2840 Make the specified warning into an error.  The specifier for a warning
2841 is appended, for example @option{-Werror=switch} turns the warnings
2842 controlled by @option{-Wswitch} into errors.  This switch takes a
2843 negative form, to be used to negate @option{-Werror} for specific
2844 warnings, for example @option{-Wno-error=switch} makes
2845 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2846 is in effect.
2847
2848 The warning message for each controllable warning includes the
2849 option which controls the warning.  That option can then be used with
2850 @option{-Werror=} and @option{-Wno-error=} as described above.
2851 (Printing of the option in the warning message can be disabled using the
2852 @option{-fno-diagnostics-show-option} flag.)
2853
2854 Note that specifying @option{-Werror=}@var{foo} automatically implies
2855 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2856 imply anything.
2857
2858 @item -Wfatal-errors
2859 @opindex Wfatal-errors
2860 @opindex Wno-fatal-errors
2861 This option causes the compiler to abort compilation on the first error
2862 occurred rather than trying to keep going and printing further error
2863 messages.
2864
2865 @end table
2866
2867 You can request many specific warnings with options beginning
2868 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2869 implicit declarations.  Each of these specific warning options also
2870 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2871 example, @option{-Wno-implicit}.  This manual lists only one of the
2872 two forms, whichever is not the default.  For further,
2873 language-specific options also refer to @ref{C++ Dialect Options} and
2874 @ref{Objective-C and Objective-C++ Dialect Options}.
2875
2876 When an unrecognized warning option is requested (e.g.,
2877 @option{-Wunknown-warning}), GCC will emit a diagnostic stating
2878 that the option is not recognized.  However, if the @option{-Wno-} form
2879 is used, the behavior is slightly different: No diagnostic will be
2880 produced for @option{-Wno-unknown-warning} unless other diagnostics
2881 are being produced.  This allows the use of new @option{-Wno-} options
2882 with old compilers, but if something goes wrong, the compiler will
2883 warn that an unrecognized option was used.
2884
2885 @table @gcctabopt
2886 @item -pedantic
2887 @opindex pedantic
2888 Issue all the warnings demanded by strict ISO C and ISO C++;
2889 reject all programs that use forbidden extensions, and some other
2890 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2891 version of the ISO C standard specified by any @option{-std} option used.
2892
2893 Valid ISO C and ISO C++ programs should compile properly with or without
2894 this option (though a rare few will require @option{-ansi} or a
2895 @option{-std} option specifying the required version of ISO C)@.  However,
2896 without this option, certain GNU extensions and traditional C and C++
2897 features are supported as well.  With this option, they are rejected.
2898
2899 @option{-pedantic} does not cause warning messages for use of the
2900 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2901 warnings are also disabled in the expression that follows
2902 @code{__extension__}.  However, only system header files should use
2903 these escape routes; application programs should avoid them.
2904 @xref{Alternate Keywords}.
2905
2906 Some users try to use @option{-pedantic} to check programs for strict ISO
2907 C conformance.  They soon find that it does not do quite what they want:
2908 it finds some non-ISO practices, but not all---only those for which
2909 ISO C @emph{requires} a diagnostic, and some others for which
2910 diagnostics have been added.
2911
2912 A feature to report any failure to conform to ISO C might be useful in
2913 some instances, but would require considerable additional work and would
2914 be quite different from @option{-pedantic}.  We don't have plans to
2915 support such a feature in the near future.
2916
2917 Where the standard specified with @option{-std} represents a GNU
2918 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
2919 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2920 extended dialect is based.  Warnings from @option{-pedantic} are given
2921 where they are required by the base standard.  (It would not make sense
2922 for such warnings to be given only for features not in the specified GNU
2923 C dialect, since by definition the GNU dialects of C include all
2924 features the compiler supports with the given option, and there would be
2925 nothing to warn about.)
2926
2927 @item -pedantic-errors
2928 @opindex pedantic-errors
2929 Like @option{-pedantic}, except that errors are produced rather than
2930 warnings.
2931
2932 @item -Wall
2933 @opindex Wall
2934 @opindex Wno-all
2935 This enables all the warnings about constructions that some users
2936 consider questionable, and that are easy to avoid (or modify to
2937 prevent the warning), even in conjunction with macros.  This also
2938 enables some language-specific warnings described in @ref{C++ Dialect
2939 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2940
2941 @option{-Wall} turns on the following warning flags:
2942
2943 @gccoptlist{-Waddress   @gol
2944 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2945 -Wc++0x-compat  @gol
2946 -Wchar-subscripts  @gol
2947 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2948 -Wimplicit-int @r{(C and Objective-C only)} @gol
2949 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
2950 -Wcomment  @gol
2951 -Wformat   @gol
2952 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2953 -Wmissing-braces  @gol
2954 -Wnonnull  @gol
2955 -Wparentheses  @gol
2956 -Wpointer-sign  @gol
2957 -Wreorder   @gol
2958 -Wreturn-type  @gol
2959 -Wsequence-point  @gol
2960 -Wsign-compare @r{(only in C++)}  @gol
2961 -Wstrict-aliasing  @gol
2962 -Wstrict-overflow=1  @gol
2963 -Wswitch  @gol
2964 -Wtrigraphs  @gol
2965 -Wuninitialized  @gol
2966 -Wunknown-pragmas  @gol
2967 -Wunused-function  @gol
2968 -Wunused-label     @gol
2969 -Wunused-value     @gol
2970 -Wunused-variable  @gol
2971 -Wvolatile-register-var @gol
2972 }
2973
2974 Note that some warning flags are not implied by @option{-Wall}.  Some of
2975 them warn about constructions that users generally do not consider
2976 questionable, but which occasionally you might wish to check for;
2977 others warn about constructions that are necessary or hard to avoid in
2978 some cases, and there is no simple way to modify the code to suppress
2979 the warning. Some of them are enabled by @option{-Wextra} but many of
2980 them must be enabled individually.
2981
2982 @item -Wextra
2983 @opindex W
2984 @opindex Wextra
2985 @opindex Wno-extra
2986 This enables some extra warning flags that are not enabled by
2987 @option{-Wall}. (This option used to be called @option{-W}.  The older
2988 name is still supported, but the newer name is more descriptive.)
2989
2990 @gccoptlist{-Wclobbered  @gol
2991 -Wempty-body  @gol
2992 -Wignored-qualifiers @gol
2993 -Wmissing-field-initializers  @gol
2994 -Wmissing-parameter-type @r{(C only)}  @gol
2995 -Wold-style-declaration @r{(C only)}  @gol
2996 -Woverride-init  @gol
2997 -Wsign-compare  @gol
2998 -Wtype-limits  @gol
2999 -Wuninitialized  @gol
3000 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3001 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3002 }
3003
3004 The option @option{-Wextra} also prints warning messages for the
3005 following cases:
3006
3007 @itemize @bullet
3008
3009 @item
3010 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3011 @samp{>}, or @samp{>=}.
3012
3013 @item
3014 (C++ only) An enumerator and a non-enumerator both appear in a
3015 conditional expression.
3016
3017 @item
3018 (C++ only) Ambiguous virtual bases.
3019
3020 @item
3021 (C++ only) Subscripting an array which has been declared @samp{register}.
3022
3023 @item
3024 (C++ only) Taking the address of a variable which has been declared
3025 @samp{register}.
3026
3027 @item
3028 (C++ only) A base class is not initialized in a derived class' copy
3029 constructor.
3030
3031 @end itemize
3032
3033 @item -Wchar-subscripts
3034 @opindex Wchar-subscripts
3035 @opindex Wno-char-subscripts
3036 Warn if an array subscript has type @code{char}.  This is a common cause
3037 of error, as programmers often forget that this type is signed on some
3038 machines.
3039 This warning is enabled by @option{-Wall}.
3040
3041 @item -Wcomment
3042 @opindex Wcomment
3043 @opindex Wno-comment
3044 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3045 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3046 This warning is enabled by @option{-Wall}.
3047
3048 @item -Wno-cpp
3049 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3050
3051 Suppress warning messages emitted by @code{#warning} directives.
3052
3053 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3054 @opindex Wdouble-promotion
3055 @opindex Wno-double-promotion
3056 Give a warning when a value of type @code{float} is implicitly
3057 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3058 floating-point unit implement @code{float} in hardware, but emulate
3059 @code{double} in software.  On such a machine, doing computations
3060 using @code{double} values is much more expensive because of the
3061 overhead required for software emulation.  
3062
3063 It is easy to accidentally do computations with @code{double} because
3064 floating-point literals are implicitly of type @code{double}.  For
3065 example, in:
3066 @smallexample
3067 @group
3068 float area(float radius)
3069 @{
3070    return 3.14159 * radius * radius;        
3071 @}
3072 @end group
3073 @end smallexample
3074 the compiler will perform the entire computation with @code{double}
3075 because the floating-point literal is a @code{double}.
3076
3077 @item -Wformat
3078 @opindex Wformat
3079 @opindex Wno-format
3080 @opindex ffreestanding
3081 @opindex fno-builtin
3082 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3083 the arguments supplied have types appropriate to the format string
3084 specified, and that the conversions specified in the format string make
3085 sense.  This includes standard functions, and others specified by format
3086 attributes (@pxref{Function Attributes}), in the @code{printf},
3087 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3088 not in the C standard) families (or other target-specific families).
3089 Which functions are checked without format attributes having been
3090 specified depends on the standard version selected, and such checks of
3091 functions without the attribute specified are disabled by
3092 @option{-ffreestanding} or @option{-fno-builtin}.
3093
3094 The formats are checked against the format features supported by GNU
3095 libc version 2.2.  These include all ISO C90 and C99 features, as well
3096 as features from the Single Unix Specification and some BSD and GNU
3097 extensions.  Other library implementations may not support all these
3098 features; GCC does not support warning about features that go beyond a
3099 particular library's limitations.  However, if @option{-pedantic} is used
3100 with @option{-Wformat}, warnings will be given about format features not
3101 in the selected standard version (but not for @code{strfmon} formats,
3102 since those are not in any version of the C standard).  @xref{C Dialect
3103 Options,,Options Controlling C Dialect}.
3104
3105 Since @option{-Wformat} also checks for null format arguments for
3106 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3107
3108 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3109 aspects of format checking, the options @option{-Wformat-y2k},
3110 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3111 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3112 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3113
3114 @item -Wformat-y2k
3115 @opindex Wformat-y2k
3116 @opindex Wno-format-y2k
3117 If @option{-Wformat} is specified, also warn about @code{strftime}
3118 formats which may yield only a two-digit year.
3119
3120 @item -Wno-format-contains-nul
3121 @opindex Wno-format-contains-nul
3122 @opindex Wformat-contains-nul
3123 If @option{-Wformat} is specified, do not warn about format strings that
3124 contain NUL bytes.
3125
3126 @item -Wno-format-extra-args
3127 @opindex Wno-format-extra-args
3128 @opindex Wformat-extra-args
3129 If @option{-Wformat} is specified, do not warn about excess arguments to a
3130 @code{printf} or @code{scanf} format function.  The C standard specifies
3131 that such arguments are ignored.
3132
3133 Where the unused arguments lie between used arguments that are
3134 specified with @samp{$} operand number specifications, normally
3135 warnings are still given, since the implementation could not know what
3136 type to pass to @code{va_arg} to skip the unused arguments.  However,
3137 in the case of @code{scanf} formats, this option will suppress the
3138 warning if the unused arguments are all pointers, since the Single
3139 Unix Specification says that such unused arguments are allowed.
3140
3141 @item -Wno-format-zero-length @r{(C and Objective-C only)}
3142 @opindex Wno-format-zero-length
3143 @opindex Wformat-zero-length
3144 If @option{-Wformat} is specified, do not warn about zero-length formats.
3145 The C standard specifies that zero-length formats are allowed.
3146
3147 @item -Wformat-nonliteral
3148 @opindex Wformat-nonliteral
3149 @opindex Wno-format-nonliteral
3150 If @option{-Wformat} is specified, also warn if the format string is not a
3151 string literal and so cannot be checked, unless the format function
3152 takes its format arguments as a @code{va_list}.
3153
3154 @item -Wformat-security
3155 @opindex Wformat-security
3156 @opindex Wno-format-security
3157 If @option{-Wformat} is specified, also warn about uses of format
3158 functions that represent possible security problems.  At present, this
3159 warns about calls to @code{printf} and @code{scanf} functions where the
3160 format string is not a string literal and there are no format arguments,
3161 as in @code{printf (foo);}.  This may be a security hole if the format
3162 string came from untrusted input and contains @samp{%n}.  (This is
3163 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3164 in future warnings may be added to @option{-Wformat-security} that are not
3165 included in @option{-Wformat-nonliteral}.)
3166
3167 @item -Wformat=2
3168 @opindex Wformat=2
3169 @opindex Wno-format=2
3170 Enable @option{-Wformat} plus format checks not included in
3171 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
3172 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3173
3174 @item -Wnonnull @r{(C and Objective-C only)}
3175 @opindex Wnonnull
3176 @opindex Wno-nonnull
3177 Warn about passing a null pointer for arguments marked as
3178 requiring a non-null value by the @code{nonnull} function attribute.
3179
3180 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3181 can be disabled with the @option{-Wno-nonnull} option.
3182
3183 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3184 @opindex Winit-self
3185 @opindex Wno-init-self
3186 Warn about uninitialized variables which are initialized with themselves.
3187 Note this option can only be used with the @option{-Wuninitialized} option.
3188
3189 For example, GCC will warn about @code{i} being uninitialized in the
3190 following snippet only when @option{-Winit-self} has been specified:
3191 @smallexample
3192 @group
3193 int f()
3194 @{
3195   int i = i;
3196   return i;
3197 @}
3198 @end group
3199 @end smallexample
3200
3201 @item -Wimplicit-int @r{(C and Objective-C only)}
3202 @opindex Wimplicit-int
3203 @opindex Wno-implicit-int
3204 Warn when a declaration does not specify a type.
3205 This warning is enabled by @option{-Wall}.
3206
3207 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3208 @opindex Wimplicit-function-declaration
3209 @opindex Wno-implicit-function-declaration
3210 Give a warning whenever a function is used before being declared. In
3211 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3212 enabled by default and it is made into an error by
3213 @option{-pedantic-errors}. This warning is also enabled by
3214 @option{-Wall}.
3215
3216 @item -Wimplicit @r{(C and Objective-C only)}
3217 @opindex Wimplicit
3218 @opindex Wno-implicit
3219 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3220 This warning is enabled by @option{-Wall}.
3221
3222 @item -Wignored-qualifiers @r{(C and C++ only)}
3223 @opindex Wignored-qualifiers
3224 @opindex Wno-ignored-qualifiers
3225 Warn if the return type of a function has a type qualifier
3226 such as @code{const}.  For ISO C such a type qualifier has no effect,
3227 since the value returned by a function is not an lvalue.
3228 For C++, the warning is only emitted for scalar types or @code{void}.
3229 ISO C prohibits qualified @code{void} return types on function
3230 definitions, so such return types always receive a warning
3231 even without this option.
3232
3233 This warning is also enabled by @option{-Wextra}.
3234
3235 @item -Wmain
3236 @opindex Wmain
3237 @opindex Wno-main
3238 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3239 a function with external linkage, returning int, taking either zero
3240 arguments, two, or three arguments of appropriate types.  This warning
3241 is enabled by default in C++ and is enabled by either @option{-Wall}
3242 or @option{-pedantic}.
3243
3244 @item -Wmissing-braces
3245 @opindex Wmissing-braces
3246 @opindex Wno-missing-braces
3247 Warn if an aggregate or union initializer is not fully bracketed.  In
3248 the following example, the initializer for @samp{a} is not fully
3249 bracketed, but that for @samp{b} is fully bracketed.
3250
3251 @smallexample
3252 int a[2][2] = @{ 0, 1, 2, 3 @};
3253 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3254 @end smallexample
3255
3256 This warning is enabled by @option{-Wall}.
3257
3258 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3259 @opindex Wmissing-include-dirs
3260 @opindex Wno-missing-include-dirs
3261 Warn if a user-supplied include directory does not exist.
3262
3263 @item -Wparentheses
3264 @opindex Wparentheses
3265 @opindex Wno-parentheses
3266 Warn if parentheses are omitted in certain contexts, such
3267 as when there is an assignment in a context where a truth value
3268 is expected, or when operators are nested whose precedence people
3269 often get confused about.
3270
3271 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3272 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3273 interpretation from that of ordinary mathematical notation.
3274
3275 Also warn about constructions where there may be confusion to which
3276 @code{if} statement an @code{else} branch belongs.  Here is an example of
3277 such a case:
3278
3279 @smallexample
3280 @group
3281 @{
3282   if (a)
3283     if (b)
3284       foo ();
3285   else
3286     bar ();
3287 @}
3288 @end group
3289 @end smallexample
3290
3291 In C/C++, every @code{else} branch belongs to the innermost possible
3292 @code{if} statement, which in this example is @code{if (b)}.  This is
3293 often not what the programmer expected, as illustrated in the above
3294 example by indentation the programmer chose.  When there is the
3295 potential for this confusion, GCC will issue a warning when this flag
3296 is specified.  To eliminate the warning, add explicit braces around
3297 the innermost @code{if} statement so there is no way the @code{else}
3298 could belong to the enclosing @code{if}.  The resulting code would
3299 look like this:
3300
3301 @smallexample
3302 @group
3303 @{
3304   if (a)
3305     @{
3306       if (b)
3307         foo ();
3308       else
3309         bar ();
3310     @}
3311 @}
3312 @end group
3313 @end smallexample
3314
3315 Also warn for dangerous uses of the 
3316 ?: with omitted middle operand GNU extension. When the condition
3317 in the ?: operator is a boolean expression the omitted value will
3318 be always 1. Often the user expects it to be a value computed
3319 inside the conditional expression instead. 
3320
3321 This warning is enabled by @option{-Wall}.
3322
3323 @item -Wsequence-point
3324 @opindex Wsequence-point
3325 @opindex Wno-sequence-point
3326 Warn about code that may have undefined semantics because of violations
3327 of sequence point rules in the C and C++ standards.
3328
3329 The C and C++ standards defines the order in which expressions in a C/C++
3330 program are evaluated in terms of @dfn{sequence points}, which represent
3331 a partial ordering between the execution of parts of the program: those
3332 executed before the sequence point, and those executed after it.  These
3333 occur after the evaluation of a full expression (one which is not part
3334 of a larger expression), after the evaluation of the first operand of a
3335 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3336 function is called (but after the evaluation of its arguments and the
3337 expression denoting the called function), and in certain other places.
3338 Other than as expressed by the sequence point rules, the order of
3339 evaluation of subexpressions of an expression is not specified.  All
3340 these rules describe only a partial order rather than a total order,
3341 since, for example, if two functions are called within one expression
3342 with no sequence point between them, the order in which the functions
3343 are called is not specified.  However, the standards committee have
3344 ruled that function calls do not overlap.
3345
3346 It is not specified when between sequence points modifications to the
3347 values of objects take effect.  Programs whose behavior depends on this
3348 have undefined behavior; the C and C++ standards specify that ``Between
3349 the previous and next sequence point an object shall have its stored
3350 value modified at most once by the evaluation of an expression.
3351 Furthermore, the prior value shall be read only to determine the value
3352 to be stored.''.  If a program breaks these rules, the results on any
3353 particular implementation are entirely unpredictable.
3354
3355 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3356 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3357 diagnosed by this option, and it may give an occasional false positive
3358 result, but in general it has been found fairly effective at detecting
3359 this sort of problem in programs.
3360
3361 The standard is worded confusingly, therefore there is some debate
3362 over the precise meaning of the sequence point rules in subtle cases.
3363 Links to discussions of the problem, including proposed formal
3364 definitions, may be found on the GCC readings page, at
3365 @uref{http://gcc.gnu.org/@/readings.html}.
3366
3367 This warning is enabled by @option{-Wall} for C and C++.
3368
3369 @item -Wreturn-type
3370 @opindex Wreturn-type
3371 @opindex Wno-return-type
3372 Warn whenever a function is defined with a return-type that defaults
3373 to @code{int}.  Also warn about any @code{return} statement with no
3374 return-value in a function whose return-type is not @code{void}
3375 (falling off the end of the function body is considered returning
3376 without a value), and about a @code{return} statement with an
3377 expression in a function whose return-type is @code{void}.
3378
3379 For C++, a function without return type always produces a diagnostic
3380 message, even when @option{-Wno-return-type} is specified.  The only
3381 exceptions are @samp{main} and functions defined in system headers.
3382
3383 This warning is enabled by @option{-Wall}.
3384
3385 @item -Wswitch
3386 @opindex Wswitch
3387 @opindex Wno-switch
3388 Warn whenever a @code{switch} statement has an index of enumerated type
3389 and lacks a @code{case} for one or more of the named codes of that
3390 enumeration.  (The presence of a @code{default} label prevents this
3391 warning.)  @code{case} labels outside the enumeration range also
3392 provoke warnings when this option is used (even if there is a
3393 @code{default} label).
3394 This warning is enabled by @option{-Wall}.
3395
3396 @item -Wswitch-default
3397 @opindex Wswitch-default
3398 @opindex Wno-switch-default
3399 Warn whenever a @code{switch} statement does not have a @code{default}
3400 case.
3401
3402 @item -Wswitch-enum
3403 @opindex Wswitch-enum
3404 @opindex Wno-switch-enum
3405 Warn whenever a @code{switch} statement has an index of enumerated type
3406 and lacks a @code{case} for one or more of the named codes of that
3407 enumeration.  @code{case} labels outside the enumeration range also
3408 provoke warnings when this option is used.  The only difference
3409 between @option{-Wswitch} and this option is that this option gives a
3410 warning about an omitted enumeration code even if there is a
3411 @code{default} label.
3412
3413 @item -Wsync-nand @r{(C and C++ only)}
3414 @opindex Wsync-nand
3415 @opindex Wno-sync-nand
3416 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3417 built-in functions are used.  These functions changed semantics in GCC 4.4.
3418
3419 @item -Wtrigraphs
3420 @opindex Wtrigraphs
3421 @opindex Wno-trigraphs
3422 Warn if any trigraphs are encountered that might change the meaning of
3423 the program (trigraphs within comments are not warned about).
3424 This warning is enabled by @option{-Wall}.
3425
3426 @item -Wunused-but-set-parameter
3427 @opindex Wunused-but-set-parameter
3428 @opindex Wno-unused-but-set-parameter
3429 Warn whenever a function parameter is assigned to, but otherwise unused
3430 (aside from its declaration).
3431
3432 To suppress this warning use the @samp{unused} attribute
3433 (@pxref{Variable Attributes}).
3434
3435 This warning is also enabled by @option{-Wunused} together with
3436 @option{-Wextra}.
3437
3438 @item -Wunused-but-set-variable
3439 @opindex Wunused-but-set-variable
3440 @opindex Wno-unused-but-set-variable
3441 Warn whenever a local variable is assigned to, but otherwise unused
3442 (aside from its declaration).
3443 This warning is enabled by @option{-Wall}.
3444
3445 To suppress this warning use the @samp{unused} attribute
3446 (@pxref{Variable Attributes}).
3447
3448 This warning is also enabled by @option{-Wunused}, which is enabled
3449 by @option{-Wall}.
3450
3451 @item -Wunused-function
3452 @opindex Wunused-function
3453 @opindex Wno-unused-function
3454 Warn whenever a static function is declared but not defined or a
3455 non-inline static function is unused.
3456 This warning is enabled by @option{-Wall}.
3457
3458 @item -Wunused-label
3459 @opindex Wunused-label
3460 @opindex Wno-unused-label
3461 Warn whenever a label is declared but not used.
3462 This warning is enabled by @option{-Wall}.
3463
3464 To suppress this warning use the @samp{unused} attribute
3465 (@pxref{Variable Attributes}).
3466
3467 @item -Wunused-parameter
3468 @opindex Wunused-parameter
3469 @opindex Wno-unused-parameter
3470 Warn whenever a function parameter is unused aside from its declaration.
3471
3472 To suppress this warning use the @samp{unused} attribute
3473 (@pxref{Variable Attributes}).
3474
3475 @item -Wno-unused-result
3476 @opindex Wunused-result
3477 @opindex Wno-unused-result
3478 Do not warn if a caller of a function marked with attribute
3479 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3480 its return value. The default is @option{-Wunused-result}.
3481
3482 @item -Wunused-variable
3483 @opindex Wunused-variable
3484 @opindex Wno-unused-variable
3485 Warn whenever a local variable or non-constant static variable is unused
3486 aside from its declaration.
3487 This warning is enabled by @option{-Wall}.
3488
3489 To suppress this warning use the @samp{unused} attribute
3490 (@pxref{Variable Attributes}).
3491
3492 @item -Wunused-value
3493 @opindex Wunused-value
3494 @opindex Wno-unused-value
3495 Warn whenever a statement computes a result that is explicitly not
3496 used. To suppress this warning cast the unused expression to
3497 @samp{void}. This includes an expression-statement or the left-hand
3498 side of a comma expression that contains no side effects. For example,
3499 an expression such as @samp{x[i,j]} will cause a warning, while
3500 @samp{x[(void)i,j]} will not.
3501
3502 This warning is enabled by @option{-Wall}.
3503
3504 @item -Wunused
3505 @opindex Wunused
3506 @opindex Wno-unused
3507 All the above @option{-Wunused} options combined.
3508
3509 In order to get a warning about an unused function parameter, you must
3510 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3511 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3512
3513 @item -Wuninitialized
3514 @opindex Wuninitialized
3515 @opindex Wno-uninitialized
3516 Warn if an automatic variable is used without first being initialized
3517 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3518 warn if a non-static reference or non-static @samp{const} member
3519 appears in a class without constructors.
3520
3521 If you want to warn about code which uses the uninitialized value of the
3522 variable in its own initializer, use the @option{-Winit-self} option.
3523
3524 These warnings occur for individual uninitialized or clobbered
3525 elements of structure, union or array variables as well as for
3526 variables which are uninitialized or clobbered as a whole.  They do
3527 not occur for variables or elements declared @code{volatile}.  Because
3528 these warnings depend on optimization, the exact variables or elements
3529 for which there are warnings will depend on the precise optimization
3530 options and version of GCC used.
3531
3532 Note that there may be no warning about a variable that is used only
3533 to compute a value that itself is never used, because such
3534 computations may be deleted by data flow analysis before the warnings
3535 are printed.
3536
3537 These warnings are made optional because GCC is not smart
3538 enough to see all the reasons why the code might be correct
3539 despite appearing to have an error.  Here is one example of how
3540 this can happen:
3541
3542 @smallexample
3543 @group
3544 @{
3545   int x;
3546   switch (y)
3547     @{
3548     case 1: x = 1;
3549       break;
3550     case 2: x = 4;
3551       break;
3552     case 3: x = 5;
3553     @}
3554   foo (x);
3555 @}
3556 @end group
3557 @end smallexample
3558
3559 @noindent
3560 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3561 always initialized, but GCC doesn't know this.  Here is
3562 another common case:
3563
3564 @smallexample
3565 @{
3566   int save_y;
3567   if (change_y) save_y = y, y = new_y;
3568   @dots{}
3569   if (change_y) y = save_y;
3570 @}
3571 @end smallexample
3572
3573 @noindent
3574 This has no bug because @code{save_y} is used only if it is set.
3575
3576 @cindex @code{longjmp} warnings
3577 This option also warns when a non-volatile automatic variable might be
3578 changed by a call to @code{longjmp}.  These warnings as well are possible
3579 only in optimizing compilation.
3580
3581 The compiler sees only the calls to @code{setjmp}.  It cannot know
3582 where @code{longjmp} will be called; in fact, a signal handler could
3583 call it at any point in the code.  As a result, you may get a warning
3584 even when there is in fact no problem because @code{longjmp} cannot
3585 in fact be called at the place which would cause a problem.
3586
3587 Some spurious warnings can be avoided if you declare all the functions
3588 you use that never return as @code{noreturn}.  @xref{Function
3589 Attributes}.
3590
3591 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3592
3593 @item -Wunknown-pragmas
3594 @opindex Wunknown-pragmas
3595 @opindex Wno-unknown-pragmas
3596 @cindex warning for unknown pragmas
3597 @cindex unknown pragmas, warning
3598 @cindex pragmas, warning of unknown
3599 Warn when a #pragma directive is encountered which is not understood by
3600 GCC@.  If this command line option is used, warnings will even be issued
3601 for unknown pragmas in system header files.  This is not the case if
3602 the warnings were only enabled by the @option{-Wall} command line option.
3603
3604 @item -Wno-pragmas
3605 @opindex Wno-pragmas
3606 @opindex Wpragmas
3607 Do not warn about misuses of pragmas, such as incorrect parameters,
3608 invalid syntax, or conflicts between pragmas.  See also
3609 @samp{-Wunknown-pragmas}.
3610
3611 @item -Wstrict-aliasing
3612 @opindex Wstrict-aliasing
3613 @opindex Wno-strict-aliasing
3614 This option is only active when @option{-fstrict-aliasing} is active.
3615 It warns about code which might break the strict aliasing rules that the
3616 compiler is using for optimization.  The warning does not catch all
3617 cases, but does attempt to catch the more common pitfalls.  It is
3618 included in @option{-Wall}.
3619 It is equivalent to @option{-Wstrict-aliasing=3}
3620
3621 @item -Wstrict-aliasing=n
3622 @opindex Wstrict-aliasing=n
3623 @opindex Wno-strict-aliasing=n
3624 This option is only active when @option{-fstrict-aliasing} is active.
3625 It warns about code which might break the strict aliasing rules that the
3626 compiler is using for optimization.
3627 Higher levels correspond to higher accuracy (fewer false positives).
3628 Higher levels also correspond to more effort, similar to the way -O works.
3629 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3630 with n=3.
3631
3632 Level 1: Most aggressive, quick, least accurate.
3633 Possibly useful when higher levels
3634 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3635 false negatives.  However, it has many false positives.
3636 Warns for all pointer conversions between possibly incompatible types,
3637 even if never dereferenced.  Runs in the frontend only.
3638
3639 Level 2: Aggressive, quick, not too precise.
3640 May still have many false positives (not as many as level 1 though),
3641 and few false negatives (but possibly more than level 1).
3642 Unlike level 1, it only warns when an address is taken.  Warns about
3643 incomplete types.  Runs in the frontend only.
3644
3645 Level 3 (default for @option{-Wstrict-aliasing}):
3646 Should have very few false positives and few false
3647 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3648 Takes care of the common pun+dereference pattern in the frontend:
3649 @code{*(int*)&some_float}.
3650 If optimization is enabled, it also runs in the backend, where it deals
3651 with multiple statement cases using flow-sensitive points-to information.
3652 Only warns when the converted pointer is dereferenced.
3653 Does not warn about incomplete types.
3654
3655 @item -Wstrict-overflow
3656 @itemx -Wstrict-overflow=@var{n}
3657 @opindex Wstrict-overflow
3658 @opindex Wno-strict-overflow
3659 This option is only active when @option{-fstrict-overflow} is active.
3660 It warns about cases where the compiler optimizes based on the
3661 assumption that signed overflow does not occur.  Note that it does not
3662 warn about all cases where the code might overflow: it only warns
3663 about cases where the compiler implements some optimization.  Thus
3664 this warning depends on the optimization level.
3665
3666 An optimization which assumes that signed overflow does not occur is
3667 perfectly safe if the values of the variables involved are such that
3668 overflow never does, in fact, occur.  Therefore this warning can
3669 easily give a false positive: a warning about code which is not
3670 actually a problem.  To help focus on important issues, several
3671 warning levels are defined.  No warnings are issued for the use of
3672 undefined signed overflow when estimating how many iterations a loop
3673 will require, in particular when determining whether a loop will be
3674 executed at all.
3675
3676 @table @gcctabopt
3677 @item -Wstrict-overflow=1
3678 Warn about cases which are both questionable and easy to avoid.  For
3679 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3680 compiler will simplify this to @code{1}.  This level of
3681 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3682 are not, and must be explicitly requested.
3683
3684 @item -Wstrict-overflow=2
3685 Also warn about other cases where a comparison is simplified to a
3686 constant.  For example: @code{abs (x) >= 0}.  This can only be
3687 simplified when @option{-fstrict-overflow} is in effect, because
3688 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3689 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3690 @option{-Wstrict-overflow=2}.
3691
3692 @item -Wstrict-overflow=3
3693 Also warn about other cases where a comparison is simplified.  For
3694 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3695
3696 @item -Wstrict-overflow=4
3697 Also warn about other simplifications not covered by the above cases.
3698 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3699
3700 @item -Wstrict-overflow=5
3701 Also warn about cases where the compiler reduces the magnitude of a
3702 constant involved in a comparison.  For example: @code{x + 2 > y} will
3703 be simplified to @code{x + 1 >= y}.  This is reported only at the
3704 highest warning level because this simplification applies to many
3705 comparisons, so this warning level will give a very large number of
3706 false positives.
3707 @end table
3708
3709 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3710 @opindex Wsuggest-attribute=
3711 @opindex Wno-suggest-attribute=
3712 Warn for cases where adding an attribute may be beneficial. The
3713 attributes currently supported are listed below.
3714
3715 @table @gcctabopt
3716 @item -Wsuggest-attribute=pure
3717 @itemx -Wsuggest-attribute=const
3718 @itemx -Wsuggest-attribute=noreturn
3719 @opindex Wsuggest-attribute=pure
3720 @opindex Wno-suggest-attribute=pure
3721 @opindex Wsuggest-attribute=const
3722 @opindex Wno-suggest-attribute=const
3723 @opindex Wsuggest-attribute=noreturn
3724 @opindex Wno-suggest-attribute=noreturn
3725
3726 Warn about functions which might be candidates for attributes
3727 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3728 functions visible in other compilation units or (in the case of @code{pure} and
3729 @code{const}) if it cannot prove that the function returns normally. A function
3730 returns normally if it doesn't contain an infinite loop nor returns abnormally
3731 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3732 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3733 higher.  Higher optimization levels improve the accuracy of the analysis.
3734 @end table
3735
3736 @item -Warray-bounds
3737 @opindex Wno-array-bounds
3738 @opindex Warray-bounds
3739 This option is only active when @option{-ftree-vrp} is active
3740 (default for @option{-O2} and above). It warns about subscripts to arrays
3741 that are always out of bounds. This warning is enabled by @option{-Wall}.
3742
3743 @item -Wno-div-by-zero
3744 @opindex Wno-div-by-zero
3745 @opindex Wdiv-by-zero
3746 Do not warn about compile-time integer division by zero.  Floating point
3747 division by zero is not warned about, as it can be a legitimate way of
3748 obtaining infinities and NaNs.
3749
3750 @item -Wsystem-headers
3751 @opindex Wsystem-headers
3752 @opindex Wno-system-headers
3753 @cindex warnings from system headers
3754 @cindex system headers, warnings from
3755 Print warning messages for constructs found in system header files.
3756 Warnings from system headers are normally suppressed, on the assumption
3757 that they usually do not indicate real problems and would only make the
3758 compiler output harder to read.  Using this command line option tells
3759 GCC to emit warnings from system headers as if they occurred in user
3760 code.  However, note that using @option{-Wall} in conjunction with this
3761 option will @emph{not} warn about unknown pragmas in system
3762 headers---for that, @option{-Wunknown-pragmas} must also be used.
3763
3764 @item -Wtrampolines
3765 @opindex Wtrampolines
3766 @opindex Wno-trampolines
3767  Warn about trampolines generated for pointers to nested functions.
3768  
3769  A trampoline is a small piece of data or code that is created at run
3770  time on the stack when the address of a nested function is taken, and
3771  is used to call the nested function indirectly.  For some targets, it
3772  is made up of data only and thus requires no special treatment.  But,
3773  for most targets, it is made up of code and thus requires the stack
3774  to be made executable in order for the program to work properly.
3775
3776 @item -Wfloat-equal
3777 @opindex Wfloat-equal
3778 @opindex Wno-float-equal
3779 Warn if floating point values are used in equality comparisons.
3780
3781 The idea behind this is that sometimes it is convenient (for the
3782 programmer) to consider floating-point values as approximations to
3783 infinitely precise real numbers.  If you are doing this, then you need
3784 to compute (by analyzing the code, or in some other way) the maximum or
3785 likely maximum error that the computation introduces, and allow for it
3786 when performing comparisons (and when producing output, but that's a
3787 different problem).  In particular, instead of testing for equality, you
3788 would check to see whether the two values have ranges that overlap; and
3789 this is done with the relational operators, so equality comparisons are
3790 probably mistaken.
3791
3792 @item -Wtraditional @r{(C and Objective-C only)}
3793 @opindex Wtraditional
3794 @opindex Wno-traditional
3795 Warn about certain constructs that behave differently in traditional and
3796 ISO C@.  Also warn about ISO C constructs that have no traditional C
3797 equivalent, and/or problematic constructs which should be avoided.
3798
3799 @itemize @bullet
3800 @item
3801 Macro parameters that appear within string literals in the macro body.
3802 In traditional C macro replacement takes place within string literals,
3803 but does not in ISO C@.
3804
3805 @item
3806 In traditional C, some preprocessor directives did not exist.
3807 Traditional preprocessors would only consider a line to be a directive
3808 if the @samp{#} appeared in column 1 on the line.  Therefore
3809 @option{-Wtraditional} warns about directives that traditional C
3810 understands but would ignore because the @samp{#} does not appear as the
3811 first character on the line.  It also suggests you hide directives like
3812 @samp{#pragma} not understood by traditional C by indenting them.  Some
3813 traditional implementations would not recognize @samp{#elif}, so it
3814 suggests avoiding it altogether.
3815
3816 @item
3817 A function-like macro that appears without arguments.
3818
3819 @item
3820 The unary plus operator.
3821
3822 @item
3823 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3824 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3825 constants.)  Note, these suffixes appear in macros defined in the system
3826 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3827 Use of these macros in user code might normally lead to spurious
3828 warnings, however GCC's integrated preprocessor has enough context to
3829 avoid warning in these cases.
3830
3831 @item
3832 A function declared external in one block and then used after the end of
3833 the block.
3834
3835 @item
3836 A @code{switch} statement has an operand of type @code{long}.
3837
3838 @item
3839 A non-@code{static} function declaration follows a @code{static} one.
3840 This construct is not accepted by some traditional C compilers.
3841
3842 @item
3843 The ISO type of an integer constant has a different width or
3844 signedness from its traditional type.  This warning is only issued if
3845 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3846 typically represent bit patterns, are not warned about.
3847
3848 @item
3849 Usage of ISO string concatenation is detected.
3850
3851 @item
3852 Initialization of automatic aggregates.
3853
3854 @item
3855 Identifier conflicts with labels.  Traditional C lacks a separate
3856 namespace for labels.
3857
3858 @item
3859 Initialization of unions.  If the initializer is zero, the warning is
3860 omitted.  This is done under the assumption that the zero initializer in
3861 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3862 initializer warnings and relies on default initialization to zero in the
3863 traditional C case.
3864
3865 @item
3866 Conversions by prototypes between fixed/floating point values and vice
3867 versa.  The absence of these prototypes when compiling with traditional
3868 C would cause serious problems.  This is a subset of the possible
3869 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3870
3871 @item
3872 Use of ISO C style function definitions.  This warning intentionally is
3873 @emph{not} issued for prototype declarations or variadic functions
3874 because these ISO C features will appear in your code when using
3875 libiberty's traditional C compatibility macros, @code{PARAMS} and
3876 @code{VPARAMS}.  This warning is also bypassed for nested functions
3877 because that feature is already a GCC extension and thus not relevant to
3878 traditional C compatibility.
3879 @end itemize
3880
3881 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3882 @opindex Wtraditional-conversion
3883 @opindex Wno-traditional-conversion
3884 Warn if a prototype causes a type conversion that is different from what
3885 would happen to the same argument in the absence of a prototype.  This
3886 includes conversions of fixed point to floating and vice versa, and
3887 conversions changing the width or signedness of a fixed point argument
3888 except when the same as the default promotion.
3889
3890 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3891 @opindex Wdeclaration-after-statement
3892 @opindex Wno-declaration-after-statement
3893 Warn when a declaration is found after a statement in a block.  This
3894 construct, known from C++, was introduced with ISO C99 and is by default
3895 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3896 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3897
3898 @item -Wundef
3899 @opindex Wundef
3900 @opindex Wno-undef
3901 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3902
3903 @item -Wno-endif-labels
3904 @opindex Wno-endif-labels
3905 @opindex Wendif-labels
3906 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3907
3908 @item -Wshadow
3909 @opindex Wshadow
3910 @opindex Wno-shadow
3911 Warn whenever a local variable or type declaration shadows another variable,
3912 parameter, type, or class member (in C++), or whenever a built-in function
3913 is shadowed. Note that in C++, the compiler will not warn if a local variable
3914 shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
3915
3916 @item -Wlarger-than=@var{len}
3917 @opindex Wlarger-than=@var{len}
3918 @opindex Wlarger-than-@var{len}
3919 Warn whenever an object of larger than @var{len} bytes is defined.
3920
3921 @item -Wframe-larger-than=@var{len}
3922 @opindex Wframe-larger-than
3923 Warn if the size of a function frame is larger than @var{len} bytes.
3924 The computation done to determine the stack frame size is approximate
3925 and not conservative.
3926 The actual requirements may be somewhat greater than @var{len}
3927 even if you do not get a warning.  In addition, any space allocated
3928 via @code{alloca}, variable-length arrays, or related constructs
3929 is not included by the compiler when determining
3930 whether or not to issue a warning.
3931
3932 @item -Wunsafe-loop-optimizations
3933 @opindex Wunsafe-loop-optimizations
3934 @opindex Wno-unsafe-loop-optimizations
3935 Warn if the loop cannot be optimized because the compiler could not
3936 assume anything on the bounds of the loop indices.  With
3937 @option{-funsafe-loop-optimizations} warn if the compiler made
3938 such assumptions.
3939
3940 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3941 @opindex Wno-pedantic-ms-format
3942 @opindex Wpedantic-ms-format
3943 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3944 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3945 depending on the MS runtime, when you are using the options @option{-Wformat}
3946 and @option{-pedantic} without gnu-extensions.
3947
3948 @item -Wpointer-arith
3949 @opindex Wpointer-arith
3950 @opindex Wno-pointer-arith
3951 Warn about anything that depends on the ``size of'' a function type or
3952 of @code{void}.  GNU C assigns these types a size of 1, for
3953 convenience in calculations with @code{void *} pointers and pointers
3954 to functions.  In C++, warn also when an arithmetic operation involves
3955 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3956
3957 @item -Wtype-limits
3958 @opindex Wtype-limits
3959 @opindex Wno-type-limits
3960 Warn if a comparison is always true or always false due to the limited
3961 range of the data type, but do not warn for constant expressions.  For
3962 example, warn if an unsigned variable is compared against zero with
3963 @samp{<} or @samp{>=}.  This warning is also enabled by
3964 @option{-Wextra}.
3965
3966 @item -Wbad-function-cast @r{(C and Objective-C only)}
3967 @opindex Wbad-function-cast
3968 @opindex Wno-bad-function-cast
3969 Warn whenever a function call is cast to a non-matching type.
3970 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3971
3972 @item -Wc++-compat @r{(C and Objective-C only)}
3973 Warn about ISO C constructs that are outside of the common subset of
3974 ISO C and ISO C++, e.g.@: request for implicit conversion from
3975 @code{void *} to a pointer to non-@code{void} type.
3976
3977 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3978 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3979 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3980 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3981
3982 @item -Wcast-qual
3983 @opindex Wcast-qual
3984 @opindex Wno-cast-qual
3985 Warn whenever a pointer is cast so as to remove a type qualifier from
3986 the target type.  For example, warn if a @code{const char *} is cast
3987 to an ordinary @code{char *}.
3988
3989 Also warn when making a cast which introduces a type qualifier in an
3990 unsafe way.  For example, casting @code{char **} to @code{const char **}
3991 is unsafe, as in this example:
3992
3993 @smallexample
3994   /* p is char ** value.  */
3995   const char **q = (const char **) p;
3996   /* Assignment of readonly string to const char * is OK.  */
3997   *q = "string";
3998   /* Now char** pointer points to read-only memory.  */
3999   **p = 'b';
4000 @end smallexample
4001
4002 @item -Wcast-align
4003 @opindex Wcast-align
4004 @opindex Wno-cast-align
4005 Warn whenever a pointer is cast such that the required alignment of the
4006 target is increased.  For example, warn if a @code{char *} is cast to
4007 an @code{int *} on machines where integers can only be accessed at
4008 two- or four-byte boundaries.
4009
4010 @item -Wwrite-strings
4011 @opindex Wwrite-strings
4012 @opindex Wno-write-strings
4013 When compiling C, give string constants the type @code{const
4014 char[@var{length}]} so that copying the address of one into a
4015 non-@code{const} @code{char *} pointer will get a warning.  These
4016 warnings will help you find at compile time code that can try to write
4017 into a string constant, but only if you have been very careful about
4018 using @code{const} in declarations and prototypes.  Otherwise, it will
4019 just be a nuisance. This is why we did not make @option{-Wall} request
4020 these warnings.
4021
4022 When compiling C++, warn about the deprecated conversion from string
4023 literals to @code{char *}.  This warning is enabled by default for C++
4024 programs.
4025
4026 @item -Wclobbered
4027 @opindex Wclobbered
4028 @opindex Wno-clobbered
4029 Warn for variables that might be changed by @samp{longjmp} or
4030 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4031
4032 @item -Wconversion
4033 @opindex Wconversion
4034 @opindex Wno-conversion
4035 Warn for implicit conversions that may alter a value. This includes
4036 conversions between real and integer, like @code{abs (x)} when
4037 @code{x} is @code{double}; conversions between signed and unsigned,
4038 like @code{unsigned ui = -1}; and conversions to smaller types, like
4039 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4040 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4041 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4042 conversions between signed and unsigned integers can be disabled by
4043 using @option{-Wno-sign-conversion}.
4044
4045 For C++, also warn for confusing overload resolution for user-defined
4046 conversions; and conversions that will never use a type conversion
4047 operator: conversions to @code{void}, the same type, a base class or a
4048 reference to them. Warnings about conversions between signed and
4049 unsigned integers are disabled by default in C++ unless
4050 @option{-Wsign-conversion} is explicitly enabled.
4051
4052 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4053 @opindex Wconversion-null
4054 @opindex Wno-conversion-null
4055 Do not warn for conversions between @code{NULL} and non-pointer
4056 types. @option{-Wconversion-null} is enabled by default.
4057
4058 @item -Wempty-body
4059 @opindex Wempty-body
4060 @opindex Wno-empty-body
4061 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4062 while} statement.  This warning is also enabled by @option{-Wextra}.
4063
4064 @item -Wenum-compare
4065 @opindex Wenum-compare
4066 @opindex Wno-enum-compare
4067 Warn about a comparison between values of different enum types. In C++
4068 this warning is enabled by default.  In C this warning is enabled by
4069 @option{-Wall}.
4070
4071 @item -Wjump-misses-init @r{(C, Objective-C only)}
4072 @opindex Wjump-misses-init
4073 @opindex Wno-jump-misses-init
4074 Warn if a @code{goto} statement or a @code{switch} statement jumps
4075 forward across the initialization of a variable, or jumps backward to a
4076 label after the variable has been initialized.  This only warns about
4077 variables which are initialized when they are declared.  This warning is
4078 only supported for C and Objective C; in C++ this sort of branch is an
4079 error in any case.
4080
4081 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4082 can be disabled with the @option{-Wno-jump-misses-init} option.
4083
4084 @item -Wsign-compare
4085 @opindex Wsign-compare
4086 @opindex Wno-sign-compare
4087 @cindex warning for comparison of signed and unsigned values
4088 @cindex comparison of signed and unsigned values, warning
4089 @cindex signed and unsigned values, comparison warning
4090 Warn when a comparison between signed and unsigned values could produce
4091 an incorrect result when the signed value is converted to unsigned.
4092 This warning is also enabled by @option{-Wextra}; to get the other warnings
4093 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
4094
4095 @item -Wsign-conversion
4096 @opindex Wsign-conversion
4097 @opindex Wno-sign-conversion
4098 Warn for implicit conversions that may change the sign of an integer
4099 value, like assigning a signed integer expression to an unsigned
4100 integer variable. An explicit cast silences the warning. In C, this
4101 option is enabled also by @option{-Wconversion}.
4102
4103 @item -Waddress
4104 @opindex Waddress
4105 @opindex Wno-address
4106 Warn about suspicious uses of memory addresses. These include using
4107 the address of a function in a conditional expression, such as
4108 @code{void func(void); if (func)}, and comparisons against the memory
4109 address of a string literal, such as @code{if (x == "abc")}.  Such
4110 uses typically indicate a programmer error: the address of a function
4111 always evaluates to true, so their use in a conditional usually
4112 indicate that the programmer forgot the parentheses in a function
4113 call; and comparisons against string literals result in unspecified
4114 behavior and are not portable in C, so they usually indicate that the
4115 programmer intended to use @code{strcmp}.  This warning is enabled by
4116 @option{-Wall}.
4117
4118 @item -Wlogical-op
4119 @opindex Wlogical-op
4120 @opindex Wno-logical-op
4121 Warn about suspicious uses of logical operators in expressions.
4122 This includes using logical operators in contexts where a
4123 bit-wise operator is likely to be expected.
4124
4125 @item -Waggregate-return
4126 @opindex Waggregate-return
4127 @opindex Wno-aggregate-return
4128 Warn if any functions that return structures or unions are defined or
4129 called.  (In languages where you can return an array, this also elicits
4130 a warning.)
4131
4132 @item -Wno-attributes
4133 @opindex Wno-attributes
4134 @opindex Wattributes
4135 Do not warn if an unexpected @code{__attribute__} is used, such as
4136 unrecognized attributes, function attributes applied to variables,
4137 etc.  This will not stop errors for incorrect use of supported
4138 attributes.
4139
4140 @item -Wno-builtin-macro-redefined
4141 @opindex Wno-builtin-macro-redefined
4142 @opindex Wbuiltin-macro-redefined
4143 Do not warn if certain built-in macros are redefined.  This suppresses
4144 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4145 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4146
4147 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4148 @opindex Wstrict-prototypes
4149 @opindex Wno-strict-prototypes
4150 Warn if a function is declared or defined without specifying the
4151 argument types.  (An old-style function definition is permitted without
4152 a warning if preceded by a declaration which specifies the argument
4153 types.)
4154
4155 @item -Wold-style-declaration @r{(C and Objective-C only)}
4156 @opindex Wold-style-declaration
4157 @opindex Wno-old-style-declaration
4158 Warn for obsolescent usages, according to the C Standard, in a
4159 declaration. For example, warn if storage-class specifiers like
4160 @code{static} are not the first things in a declaration.  This warning
4161 is also enabled by @option{-Wextra}.
4162
4163 @item -Wold-style-definition @r{(C and Objective-C only)}
4164 @opindex Wold-style-definition
4165 @opindex Wno-old-style-definition
4166 Warn if an old-style function definition is used.  A warning is given
4167 even if there is a previous prototype.
4168
4169 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4170 @opindex Wmissing-parameter-type
4171 @opindex Wno-missing-parameter-type
4172 A function parameter is declared without a type specifier in K&R-style
4173 functions:
4174
4175 @smallexample
4176 void foo(bar) @{ @}
4177 @end smallexample
4178
4179 This warning is also enabled by @option{-Wextra}.
4180
4181 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4182 @opindex Wmissing-prototypes
4183 @opindex Wno-missing-prototypes
4184 Warn if a global function is defined without a previous prototype
4185 declaration.  This warning is issued even if the definition itself
4186 provides a prototype.  The aim is to detect global functions that fail
4187 to be declared in header files.
4188
4189 @item -Wmissing-declarations
4190 @opindex Wmissing-declarations
4191 @opindex Wno-missing-declarations
4192 Warn if a global function is defined without a previous declaration.
4193 Do so even if the definition itself provides a prototype.
4194 Use this option to detect global functions that are not declared in
4195 header files.  In C++, no warnings are issued for function templates,
4196 or for inline functions, or for functions in anonymous namespaces.
4197
4198 @item -Wmissing-field-initializers
4199 @opindex Wmissing-field-initializers
4200 @opindex Wno-missing-field-initializers
4201 @opindex W
4202 @opindex Wextra
4203 @opindex Wno-extra
4204 Warn if a structure's initializer has some fields missing.  For
4205 example, the following code would cause such a warning, because
4206 @code{x.h} is implicitly zero:
4207
4208 @smallexample
4209 struct s @{ int f, g, h; @};
4210 struct s x = @{ 3, 4 @};
4211 @end smallexample
4212
4213 This option does not warn about designated initializers, so the following
4214 modification would not trigger a warning:
4215
4216 @smallexample
4217 struct s @{ int f, g, h; @};
4218 struct s x = @{ .f = 3, .g = 4 @};
4219 @end smallexample
4220
4221 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4222 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
4223
4224 @item -Wmissing-format-attribute
4225 @opindex Wmissing-format-attribute
4226 @opindex Wno-missing-format-attribute
4227 @opindex Wformat
4228 @opindex Wno-format
4229 Warn about function pointers which might be candidates for @code{format}
4230 attributes.  Note these are only possible candidates, not absolute ones.
4231 GCC will guess that function pointers with @code{format} attributes that
4232 are used in assignment, initialization, parameter passing or return
4233 statements should have a corresponding @code{format} attribute in the
4234 resulting type.  I.e.@: the left-hand side of the assignment or
4235 initialization, the type of the parameter variable, or the return type
4236 of the containing function respectively should also have a @code{format}
4237 attribute to avoid the warning.
4238
4239 GCC will also warn about function definitions which might be
4240 candidates for @code{format} attributes.  Again, these are only
4241 possible candidates.  GCC will guess that @code{format} attributes
4242 might be appropriate for any function that calls a function like
4243 @code{vprintf} or @code{vscanf}, but this might not always be the
4244 case, and some functions for which @code{format} attributes are
4245 appropriate may not be detected.
4246
4247 @item -Wno-multichar
4248 @opindex Wno-multichar
4249 @opindex Wmultichar
4250 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4251 Usually they indicate a typo in the user's code, as they have
4252 implementation-defined values, and should not be used in portable code.
4253
4254 @item -Wnormalized=<none|id|nfc|nfkc>
4255 @opindex Wnormalized=
4256 @cindex NFC
4257 @cindex NFKC
4258 @cindex character set, input normalization
4259 In ISO C and ISO C++, two identifiers are different if they are
4260 different sequences of characters.  However, sometimes when characters
4261 outside the basic ASCII character set are used, you can have two
4262 different character sequences that look the same.  To avoid confusion,
4263 the ISO 10646 standard sets out some @dfn{normalization rules} which
4264 when applied ensure that two sequences that look the same are turned into
4265 the same sequence.  GCC can warn you if you are using identifiers which
4266 have not been normalized; this option controls that warning.
4267
4268 There are four levels of warning that GCC supports.  The default is
4269 @option{-Wnormalized=nfc}, which warns about any identifier which is
4270 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4271 recommended form for most uses.
4272
4273 Unfortunately, there are some characters which ISO C and ISO C++ allow
4274 in identifiers that when turned into NFC aren't allowable as
4275 identifiers.  That is, there's no way to use these symbols in portable
4276 ISO C or C++ and have all your identifiers in NFC@.
4277 @option{-Wnormalized=id} suppresses the warning for these characters.
4278 It is hoped that future versions of the standards involved will correct
4279 this, which is why this option is not the default.
4280
4281 You can switch the warning off for all characters by writing
4282 @option{-Wnormalized=none}.  You would only want to do this if you
4283 were using some other normalization scheme (like ``D''), because
4284 otherwise you can easily create bugs that are literally impossible to see.
4285
4286 Some characters in ISO 10646 have distinct meanings but look identical
4287 in some fonts or display methodologies, especially once formatting has
4288 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4289 LETTER N'', will display just like a regular @code{n} which has been
4290 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4291 normalization scheme to convert all these into a standard form as
4292 well, and GCC will warn if your code is not in NFKC if you use
4293 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4294 about every identifier that contains the letter O because it might be
4295 confused with the digit 0, and so is not the default, but may be
4296 useful as a local coding convention if the programming environment is
4297 unable to be fixed to display these characters distinctly.
4298
4299 @item -Wno-deprecated
4300 @opindex Wno-deprecated
4301 @opindex Wdeprecated
4302 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4303
4304 @item -Wno-deprecated-declarations
4305 @opindex Wno-deprecated-declarations
4306 @opindex Wdeprecated-declarations
4307 Do not warn about uses of functions (@pxref{Function Attributes}),
4308 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4309 Attributes}) marked as deprecated by using the @code{deprecated}
4310 attribute.
4311
4312 @item -Wno-overflow
4313 @opindex Wno-overflow
4314 @opindex Woverflow
4315 Do not warn about compile-time overflow in constant expressions.
4316
4317 @item -Woverride-init @r{(C and Objective-C only)}
4318 @opindex Woverride-init
4319 @opindex Wno-override-init
4320 @opindex W
4321 @opindex Wextra
4322 @opindex Wno-extra
4323 Warn if an initialized field without side effects is overridden when
4324 using designated initializers (@pxref{Designated Inits, , Designated
4325 Initializers}).
4326
4327 This warning is included in @option{-Wextra}.  To get other
4328 @option{-Wextra} warnings without this one, use @samp{-Wextra
4329 -Wno-override-init}.
4330
4331 @item -Wpacked
4332 @opindex Wpacked
4333 @opindex Wno-packed
4334 Warn if a structure is given the packed attribute, but the packed
4335 attribute has no effect on the layout or size of the structure.
4336 Such structures may be mis-aligned for little benefit.  For
4337 instance, in this code, the variable @code{f.x} in @code{struct bar}
4338 will be misaligned even though @code{struct bar} does not itself
4339 have the packed attribute:
4340
4341 @smallexample
4342 @group
4343 struct foo @{
4344   int x;
4345   char a, b, c, d;
4346 @} __attribute__((packed));
4347 struct bar @{
4348   char z;
4349   struct foo f;
4350 @};
4351 @end group
4352 @end smallexample
4353
4354 @item -Wpacked-bitfield-compat
4355 @opindex Wpacked-bitfield-compat
4356 @opindex Wno-packed-bitfield-compat
4357 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4358 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4359 the change can lead to differences in the structure layout.  GCC
4360 informs you when the offset of such a field has changed in GCC 4.4.
4361 For example there is no longer a 4-bit padding between field @code{a}
4362 and @code{b} in this structure:
4363
4364 @smallexample
4365 struct foo
4366 @{
4367   char a:4;
4368   char b:8;
4369 @} __attribute__ ((packed));
4370 @end smallexample
4371
4372 This warning is enabled by default.  Use
4373 @option{-Wno-packed-bitfield-compat} to disable this warning.
4374
4375 @item -Wpadded
4376 @opindex Wpadded
4377 @opindex Wno-padded
4378 Warn if padding is included in a structure, either to align an element
4379 of the structure or to align the whole structure.  Sometimes when this
4380 happens it is possible to rearrange the fields of the structure to
4381 reduce the padding and so make the structure smaller.
4382
4383 @item -Wredundant-decls
4384 @opindex Wredundant-decls
4385 @opindex Wno-redundant-decls
4386 Warn if anything is declared more than once in the same scope, even in
4387 cases where multiple declaration is valid and changes nothing.
4388
4389 @item -Wnested-externs @r{(C and Objective-C only)}
4390 @opindex Wnested-externs
4391 @opindex Wno-nested-externs
4392 Warn if an @code{extern} declaration is encountered within a function.
4393
4394 @item -Winline
4395 @opindex Winline
4396 @opindex Wno-inline
4397 Warn if a function can not be inlined and it was declared as inline.
4398 Even with this option, the compiler will not warn about failures to
4399 inline functions declared in system headers.
4400
4401 The compiler uses a variety of heuristics to determine whether or not
4402 to inline a function.  For example, the compiler takes into account
4403 the size of the function being inlined and the amount of inlining
4404 that has already been done in the current function.  Therefore,
4405 seemingly insignificant changes in the source program can cause the
4406 warnings produced by @option{-Winline} to appear or disappear.
4407
4408 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4409 @opindex Wno-invalid-offsetof
4410 @opindex Winvalid-offsetof
4411 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4412 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4413 to a non-POD type is undefined.  In existing C++ implementations,
4414 however, @samp{offsetof} typically gives meaningful results even when
4415 applied to certain kinds of non-POD types. (Such as a simple
4416 @samp{struct} that fails to be a POD type only by virtue of having a
4417 constructor.)  This flag is for users who are aware that they are
4418 writing nonportable code and who have deliberately chosen to ignore the
4419 warning about it.
4420
4421 The restrictions on @samp{offsetof} may be relaxed in a future version
4422 of the C++ standard.
4423
4424 @item -Wno-int-to-pointer-cast
4425 @opindex Wno-int-to-pointer-cast
4426 @opindex Wint-to-pointer-cast
4427 Suppress warnings from casts to pointer type of an integer of a
4428 different size. In C++, casting to a pointer type of smaller size is
4429 an error. @option{Wint-to-pointer-cast} is enabled by default.
4430
4431
4432 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4433 @opindex Wno-pointer-to-int-cast
4434 @opindex Wpointer-to-int-cast
4435 Suppress warnings from casts from a pointer to an integer type of a
4436 different size.
4437
4438 @item -Winvalid-pch
4439 @opindex Winvalid-pch
4440 @opindex Wno-invalid-pch
4441 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4442 the search path but can't be used.
4443
4444 @item -Wlong-long
4445 @opindex Wlong-long
4446 @opindex Wno-long-long
4447 Warn if @samp{long long} type is used.  This is enabled by either
4448 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4449 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4450
4451 @item -Wvariadic-macros
4452 @opindex Wvariadic-macros
4453 @opindex Wno-variadic-macros
4454 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4455 alternate syntax when in pedantic ISO C99 mode.  This is default.
4456 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4457
4458 @item -Wvla
4459 @opindex Wvla
4460 @opindex Wno-vla
4461 Warn if variable length array is used in the code.
4462 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4463 the variable length array.
4464
4465 @item -Wvolatile-register-var
4466 @opindex Wvolatile-register-var
4467 @opindex Wno-volatile-register-var
4468 Warn if a register variable is declared volatile.  The volatile
4469 modifier does not inhibit all optimizations that may eliminate reads
4470 and/or writes to register variables.  This warning is enabled by
4471 @option{-Wall}.
4472
4473 @item -Wdisabled-optimization
4474 @opindex Wdisabled-optimization
4475 @opindex Wno-disabled-optimization
4476 Warn if a requested optimization pass is disabled.  This warning does
4477 not generally indicate that there is anything wrong with your code; it
4478 merely indicates that GCC's optimizers were unable to handle the code
4479 effectively.  Often, the problem is that your code is too big or too
4480 complex; GCC will refuse to optimize programs when the optimization
4481 itself is likely to take inordinate amounts of time.
4482
4483 @item -Wpointer-sign @r{(C and Objective-C only)}
4484 @opindex Wpointer-sign
4485 @opindex Wno-pointer-sign
4486 Warn for pointer argument passing or assignment with different signedness.
4487 This option is only supported for C and Objective-C@.  It is implied by
4488 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4489 @option{-Wno-pointer-sign}.
4490
4491 @item -Wstack-protector
4492 @opindex Wstack-protector
4493 @opindex Wno-stack-protector
4494 This option is only active when @option{-fstack-protector} is active.  It
4495 warns about functions that will not be protected against stack smashing.
4496
4497 @item -Wno-mudflap
4498 @opindex Wno-mudflap
4499 Suppress warnings about constructs that cannot be instrumented by
4500 @option{-fmudflap}.
4501
4502 @item -Woverlength-strings
4503 @opindex Woverlength-strings
4504 @opindex Wno-overlength-strings
4505 Warn about string constants which are longer than the ``minimum
4506 maximum'' length specified in the C standard.  Modern compilers
4507 generally allow string constants which are much longer than the
4508 standard's minimum limit, but very portable programs should avoid
4509 using longer strings.
4510
4511 The limit applies @emph{after} string constant concatenation, and does
4512 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4513 C99, it was raised to 4095.  C++98 does not specify a normative
4514 minimum maximum, so we do not diagnose overlength strings in C++@.
4515
4516 This option is implied by @option{-pedantic}, and can be disabled with
4517 @option{-Wno-overlength-strings}.
4518
4519 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4520 @opindex Wunsuffixed-float-constants
4521
4522 GCC will issue a warning for any floating constant that does not have
4523 a suffix.  When used together with @option{-Wsystem-headers} it will
4524 warn about such constants in system header files.  This can be useful
4525 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4526 from the decimal floating-point extension to C99.
4527 @end table
4528
4529 @node Debugging Options
4530 @section Options for Debugging Your Program or GCC
4531 @cindex options, debugging
4532 @cindex debugging information options
4533
4534 GCC has various special options that are used for debugging
4535 either your program or GCC:
4536
4537 @table @gcctabopt
4538 @item -g
4539 @opindex g
4540 Produce debugging information in the operating system's native format
4541 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4542 information.
4543
4544 On most systems that use stabs format, @option{-g} enables use of extra
4545 debugging information that only GDB can use; this extra information
4546 makes debugging work better in GDB but will probably make other debuggers
4547 crash or
4548 refuse to read the program.  If you want to control for certain whether
4549 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4550 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4551
4552 GCC allows you to use @option{-g} with
4553 @option{-O}.  The shortcuts taken by optimized code may occasionally
4554 produce surprising results: some variables you declared may not exist
4555 at all; flow of control may briefly move where you did not expect it;
4556 some statements may not be executed because they compute constant
4557 results or their values were already at hand; some statements may
4558 execute in different places because they were moved out of loops.
4559
4560 Nevertheless it proves possible to debug optimized output.  This makes
4561 it reasonable to use the optimizer for programs that might have bugs.
4562
4563 The following options are useful when GCC is generated with the
4564 capability for more than one debugging format.
4565
4566 @item -ggdb
4567 @opindex ggdb
4568 Produce debugging information for use by GDB@.  This means to use the
4569 most expressive format available (DWARF 2, stabs, or the native format
4570 if neither of those are supported), including GDB extensions if at all
4571 possible.
4572
4573 @item -gstabs
4574 @opindex gstabs
4575 Produce debugging information in stabs format (if that is supported),
4576 without GDB extensions.  This is the format used by DBX on most BSD
4577 systems.  On MIPS, Alpha and System V Release 4 systems this option
4578 produces stabs debugging output which is not understood by DBX or SDB@.
4579 On System V Release 4 systems this option requires the GNU assembler.
4580
4581 @item -feliminate-unused-debug-symbols
4582 @opindex feliminate-unused-debug-symbols
4583 Produce debugging information in stabs format (if that is supported),
4584 for only symbols that are actually used.
4585
4586 @item -femit-class-debug-always
4587 Instead of emitting debugging information for a C++ class in only one
4588 object file, emit it in all object files using the class.  This option
4589 should be used only with debuggers that are unable to handle the way GCC
4590 normally emits debugging information for classes because using this
4591 option will increase the size of debugging information by as much as a
4592 factor of two.
4593
4594 @item -gstabs+
4595 @opindex gstabs+
4596 Produce debugging information in stabs format (if that is supported),
4597 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4598 use of these extensions is likely to make other debuggers crash or
4599 refuse to read the program.
4600
4601 @item -gcoff
4602 @opindex gcoff
4603 Produce debugging information in COFF format (if that is supported).
4604 This is the format used by SDB on most System V systems prior to
4605 System V Release 4.
4606
4607 @item -gxcoff
4608 @opindex gxcoff
4609 Produce debugging information in XCOFF format (if that is supported).
4610 This is the format used by the DBX debugger on IBM RS/6000 systems.
4611
4612 @item -gxcoff+
4613 @opindex gxcoff+
4614 Produce debugging information in XCOFF format (if that is supported),
4615 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4616 use of these extensions is likely to make other debuggers crash or
4617 refuse to read the program, and may cause assemblers other than the GNU
4618 assembler (GAS) to fail with an error.
4619
4620 @item -gdwarf-@var{version}
4621 @opindex gdwarf-@var{version}
4622 Produce debugging information in DWARF format (if that is
4623 supported).  This is the format used by DBX on IRIX 6.  The value
4624 of @var{version} may be either 2, 3 or 4; the default version is 2.
4625
4626 Note that with DWARF version 2 some ports require, and will always
4627 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4628
4629 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4630 for maximum benefit.
4631
4632 @item -gstrict-dwarf
4633 @opindex gstrict-dwarf
4634 Disallow using extensions of later DWARF standard version than selected
4635 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4636 DWARF extensions from later standard versions is allowed.
4637
4638 @item -gno-strict-dwarf
4639 @opindex gno-strict-dwarf
4640 Allow using extensions of later DWARF standard version than selected with
4641 @option{-gdwarf-@var{version}}.
4642
4643 @item -gvms
4644 @opindex gvms
4645 Produce debugging information in VMS debug format (if that is
4646 supported).  This is the format used by DEBUG on VMS systems.
4647
4648 @item -g@var{level}
4649 @itemx -ggdb@var{level}
4650 @itemx -gstabs@var{level}
4651 @itemx -gcoff@var{level}
4652 @itemx -gxcoff@var{level}
4653 @itemx -gvms@var{level}
4654 Request debugging information and also use @var{level} to specify how
4655 much information.  The default level is 2.
4656
4657 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4658 @option{-g}.
4659
4660 Level 1 produces minimal information, enough for making backtraces in
4661 parts of the program that you don't plan to debug.  This includes
4662 descriptions of functions and external variables, but no information
4663 about local variables and no line numbers.
4664
4665 Level 3 includes extra information, such as all the macro definitions
4666 present in the program.  Some debuggers support macro expansion when
4667 you use @option{-g3}.
4668
4669 @option{-gdwarf-2} does not accept a concatenated debug level, because
4670 GCC used to support an option @option{-gdwarf} that meant to generate
4671 debug information in version 1 of the DWARF format (which is very
4672 different from version 2), and it would have been too confusing.  That
4673 debug format is long obsolete, but the option cannot be changed now.
4674 Instead use an additional @option{-g@var{level}} option to change the
4675 debug level for DWARF.
4676
4677 @item -gtoggle
4678 @opindex gtoggle
4679 Turn off generation of debug info, if leaving out this option would have
4680 generated it, or turn it on at level 2 otherwise.  The position of this
4681 argument in the command line does not matter, it takes effect after all
4682 other options are processed, and it does so only once, no matter how
4683 many times it is given.  This is mainly intended to be used with
4684 @option{-fcompare-debug}.
4685
4686 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4687 @opindex fdump-final-insns
4688 Dump the final internal representation (RTL) to @var{file}.  If the
4689 optional argument is omitted (or if @var{file} is @code{.}), the name
4690 of the dump file will be determined by appending @code{.gkd} to the
4691 compilation output file name.
4692
4693 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4694 @opindex fcompare-debug
4695 @opindex fno-compare-debug
4696 If no error occurs during compilation, run the compiler a second time,
4697 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4698 passed to the second compilation.  Dump the final internal
4699 representation in both compilations, and print an error if they differ.
4700
4701 If the equal sign is omitted, the default @option{-gtoggle} is used.
4702
4703 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4704 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4705 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4706 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4707 is used.
4708
4709 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4710 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4711 of the final representation and the second compilation, preventing even
4712 @env{GCC_COMPARE_DEBUG} from taking effect.
4713
4714 To verify full coverage during @option{-fcompare-debug} testing, set
4715 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4716 which GCC will reject as an invalid option in any actual compilation
4717 (rather than preprocessing, assembly or linking).  To get just a
4718 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4719 not overridden} will do.
4720
4721 @item -fcompare-debug-second
4722 @opindex fcompare-debug-second
4723 This option is implicitly passed to the compiler for the second
4724 compilation requested by @option{-fcompare-debug}, along with options to
4725 silence warnings, and omitting other options that would cause
4726 side-effect compiler outputs to files or to the standard output.  Dump
4727 files and preserved temporary files are renamed so as to contain the
4728 @code{.gk} additional extension during the second compilation, to avoid
4729 overwriting those generated by the first.
4730
4731 When this option is passed to the compiler driver, it causes the
4732 @emph{first} compilation to be skipped, which makes it useful for little
4733 other than debugging the compiler proper.
4734
4735 @item -feliminate-dwarf2-dups
4736 @opindex feliminate-dwarf2-dups
4737 Compress DWARF2 debugging information by eliminating duplicated
4738 information about each symbol.  This option only makes sense when
4739 generating DWARF2 debugging information with @option{-gdwarf-2}.
4740
4741 @item -femit-struct-debug-baseonly
4742 Emit debug information for struct-like types
4743 only when the base name of the compilation source file
4744 matches the base name of file in which the struct was defined.
4745
4746 This option substantially reduces the size of debugging information,
4747 but at significant potential loss in type information to the debugger.
4748 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4749 See @option{-femit-struct-debug-detailed} for more detailed control.
4750
4751 This option works only with DWARF 2.
4752
4753 @item -femit-struct-debug-reduced
4754 Emit debug information for struct-like types
4755 only when the base name of the compilation source file
4756 matches the base name of file in which the type was defined,
4757 unless the struct is a template or defined in a system header.
4758
4759 This option significantly reduces the size of debugging information,
4760 with some potential loss in type information to the debugger.
4761 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4762 See @option{-femit-struct-debug-detailed} for more detailed control.
4763
4764 This option works only with DWARF 2.
4765
4766 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4767 Specify the struct-like types
4768 for which the compiler will generate debug information.
4769 The intent is to reduce duplicate struct debug information
4770 between different object files within the same program.
4771
4772 This option is a detailed version of
4773 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4774 which will serve for most needs.
4775
4776 A specification has the syntax@*
4777 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4778
4779 The optional first word limits the specification to
4780 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4781 A struct type is used directly when it is the type of a variable, member.
4782 Indirect uses arise through pointers to structs.
4783 That is, when use of an incomplete struct would be legal, the use is indirect.
4784 An example is
4785 @samp{struct one direct; struct two * indirect;}.
4786
4787 The optional second word limits the specification to
4788 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4789 Generic structs are a bit complicated to explain.
4790 For C++, these are non-explicit specializations of template classes,
4791 or non-template classes within the above.
4792 Other programming languages have generics,
4793 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4794
4795 The third word specifies the source files for those
4796 structs for which the compiler will emit debug information.
4797 The values @samp{none} and @samp{any} have the normal meaning.
4798 The value @samp{base} means that
4799 the base of name of the file in which the type declaration appears
4800 must match the base of the name of the main compilation file.
4801 In practice, this means that
4802 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4803 but types declared in other header will not.
4804 The value @samp{sys} means those types satisfying @samp{base}
4805 or declared in system or compiler headers.
4806
4807 You may need to experiment to determine the best settings for your application.
4808
4809 The default is @samp{-femit-struct-debug-detailed=all}.
4810
4811 This option works only with DWARF 2.
4812
4813 @item -fenable-icf-debug
4814 @opindex fenable-icf-debug
4815 Generate additional debug information to support identical code folding (ICF).
4816 This option only works with DWARF version 2 or higher.
4817
4818 @item -fno-merge-debug-strings
4819 @opindex fmerge-debug-strings
4820 @opindex fno-merge-debug-strings
4821 Direct the linker to not merge together strings in the debugging
4822 information which are identical in different object files.  Merging is
4823 not supported by all assemblers or linkers.  Merging decreases the size
4824 of the debug information in the output file at the cost of increasing
4825 link processing time.  Merging is enabled by default.
4826
4827 @item -fdebug-prefix-map=@var{old}=@var{new}
4828 @opindex fdebug-prefix-map
4829 When compiling files in directory @file{@var{old}}, record debugging
4830 information describing them as in @file{@var{new}} instead.
4831
4832 @item -fno-dwarf2-cfi-asm
4833 @opindex fdwarf2-cfi-asm
4834 @opindex fno-dwarf2-cfi-asm
4835 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4836 instead of using GAS @code{.cfi_*} directives.
4837
4838 @cindex @command{prof}
4839 @item -p
4840 @opindex p
4841 Generate extra code to write profile information suitable for the
4842 analysis program @command{prof}.  You must use this option when compiling
4843 the source files you want data about, and you must also use it when
4844 linking.
4845
4846 @cindex @command{gprof}
4847 @item -pg
4848 @opindex pg
4849 Generate extra code to write profile information suitable for the
4850 analysis program @command{gprof}.  You must use this option when compiling
4851 the source files you want data about, and you must also use it when
4852 linking.
4853
4854 @item -Q
4855 @opindex Q
4856 Makes the compiler print out each function name as it is compiled, and
4857 print some statistics about each pass when it finishes.
4858
4859 @item -ftime-report
4860 @opindex ftime-report
4861 Makes the compiler print some statistics about the time consumed by each
4862 pass when it finishes.
4863
4864 @item -fmem-report
4865 @opindex fmem-report
4866 Makes the compiler print some statistics about permanent memory
4867 allocation when it finishes.
4868
4869 @item -fpre-ipa-mem-report
4870 @opindex fpre-ipa-mem-report
4871 @item -fpost-ipa-mem-report
4872 @opindex fpost-ipa-mem-report
4873 Makes the compiler print some statistics about permanent memory
4874 allocation before or after interprocedural optimization.
4875
4876 @item -fstack-usage
4877 @opindex fstack-usage
4878 Makes the compiler output stack usage information for the program, on a
4879 per-function basis.  The filename for the dump is made by appending
4880 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
4881 the output file, if explicitly specified and it is not an executable,
4882 otherwise it is the basename of the source file.  An entry is made up
4883 of three fields:
4884
4885 @itemize
4886 @item
4887 The name of the function.
4888 @item
4889 A number of bytes.
4890 @item
4891 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
4892 @end itemize
4893
4894 The qualifier @code{static} means that the function manipulates the stack
4895 statically: a fixed number of bytes are allocated for the frame on function
4896 entry and released on function exit; no stack adjustments are otherwise made
4897 in the function.  The second field is this fixed number of bytes.
4898
4899 The qualifier @code{dynamic} means that the function manipulates the stack
4900 dynamically: in addition to the static allocation described above, stack
4901 adjustments are made in the body of the function, for example to push/pop
4902 arguments around function calls.  If the qualifier @code{bounded} is also
4903 present, the amount of these adjustments is bounded at compile-time and
4904 the second field is an upper bound of the total amount of stack used by
4905 the function.  If it is not present, the amount of these adjustments is
4906 not bounded at compile-time and the second field only represents the
4907 bounded part.
4908
4909 @item -fprofile-arcs
4910 @opindex fprofile-arcs
4911 Add code so that program flow @dfn{arcs} are instrumented.  During
4912 execution the program records how many times each branch and call is
4913 executed and how many times it is taken or returns.  When the compiled
4914 program exits it saves this data to a file called
4915 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4916 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4917 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4918 @var{auxname} is generated from the name of the output file, if
4919 explicitly specified and it is not the final executable, otherwise it is
4920 the basename of the source file.  In both cases any suffix is removed
4921 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4922 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4923 @xref{Cross-profiling}.
4924
4925 @cindex @command{gcov}
4926 @item --coverage
4927 @opindex coverage
4928
4929 This option is used to compile and link code instrumented for coverage
4930 analysis.  The option is a synonym for @option{-fprofile-arcs}
4931 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4932 linking).  See the documentation for those options for more details.
4933
4934 @itemize
4935
4936 @item
4937 Compile the source files with @option{-fprofile-arcs} plus optimization
4938 and code generation options.  For test coverage analysis, use the
4939 additional @option{-ftest-coverage} option.  You do not need to profile
4940 every source file in a program.
4941
4942 @item
4943 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4944 (the latter implies the former).
4945
4946 @item
4947 Run the program on a representative workload to generate the arc profile
4948 information.  This may be repeated any number of times.  You can run
4949 concurrent instances of your program, and provided that the file system
4950 supports locking, the data files will be correctly updated.  Also
4951 @code{fork} calls are detected and correctly handled (double counting
4952 will not happen).
4953
4954 @item
4955 For profile-directed optimizations, compile the source files again with
4956 the same optimization and code generation options plus
4957 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4958 Control Optimization}).
4959
4960 @item
4961 For test coverage analysis, use @command{gcov} to produce human readable
4962 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4963 @command{gcov} documentation for further information.
4964
4965 @end itemize
4966
4967 With @option{-fprofile-arcs}, for each function of your program GCC
4968 creates a program flow graph, then finds a spanning tree for the graph.
4969 Only arcs that are not on the spanning tree have to be instrumented: the
4970 compiler adds code to count the number of times that these arcs are
4971 executed.  When an arc is the only exit or only entrance to a block, the
4972 instrumentation code can be added to the block; otherwise, a new basic
4973 block must be created to hold the instrumentation code.
4974
4975 @need 2000
4976 @item -ftest-coverage
4977 @opindex ftest-coverage
4978 Produce a notes file that the @command{gcov} code-coverage utility
4979 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4980 show program coverage.  Each source file's note file is called
4981 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4982 above for a description of @var{auxname} and instructions on how to
4983 generate test coverage data.  Coverage data will match the source files
4984 more closely, if you do not optimize.
4985
4986 @item -fdbg-cnt-list
4987 @opindex fdbg-cnt-list
4988 Print the name and the counter upper bound for all debug counters.
4989
4990 @item -fdbg-cnt=@var{counter-value-list}
4991 @opindex fdbg-cnt
4992 Set the internal debug counter upper bound.  @var{counter-value-list}
4993 is a comma-separated list of @var{name}:@var{value} pairs
4994 which sets the upper bound of each debug counter @var{name} to @var{value}.
4995 All debug counters have the initial upper bound of @var{UINT_MAX},
4996 thus dbg_cnt() returns true always unless the upper bound is set by this option.
4997 e.g. With -fdbg-cnt=dce:10,tail_call:0
4998 dbg_cnt(dce) will return true only for first 10 invocations
4999 and dbg_cnt(tail_call) will return false always.
5000
5001 @item -d@var{letters}
5002 @itemx -fdump-rtl-@var{pass}
5003 @opindex d
5004 Says to make debugging dumps during compilation at times specified by
5005 @var{letters}.  This is used for debugging the RTL-based passes of the
5006 compiler.  The file names for most of the dumps are made by appending
5007 a pass number and a word to the @var{dumpname}, and the files are
5008 created in the directory of the output file.  Note that the pass
5009 number is computed statically as passes get registered into the pass
5010 manager.  Thus the numbering is not related to the dynamic order of
5011 execution of passes.  In particular, a pass installed by a plugin
5012 could have a number over 200 even if it executed quite early.
5013 @var{dumpname} is generated from the name of the output file, if
5014 explicitly specified and it is not an executable, otherwise it is the
5015 basename of the source file. These switches may have different effects
5016 when @option{-E} is used for preprocessing.
5017
5018 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5019 @option{-d} option @var{letters}.  Here are the possible
5020 letters for use in @var{pass} and @var{letters}, and their meanings:
5021
5022 @table @gcctabopt
5023
5024 @item -fdump-rtl-alignments
5025 @opindex fdump-rtl-alignments
5026 Dump after branch alignments have been computed.
5027
5028 @item -fdump-rtl-asmcons
5029 @opindex fdump-rtl-asmcons
5030 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5031
5032 @item -fdump-rtl-auto_inc_dec
5033 @opindex fdump-rtl-auto_inc_dec
5034 Dump after auto-inc-dec discovery.  This pass is only run on
5035 architectures that have auto inc or auto dec instructions.
5036
5037 @item -fdump-rtl-barriers
5038 @opindex fdump-rtl-barriers
5039 Dump after cleaning up the barrier instructions.
5040
5041 @item -fdump-rtl-bbpart
5042 @opindex fdump-rtl-bbpart
5043 Dump after partitioning hot and cold basic blocks.
5044
5045 @item -fdump-rtl-bbro
5046 @opindex fdump-rtl-bbro
5047 Dump after block reordering.
5048
5049 @item -fdump-rtl-btl1
5050 @itemx -fdump-rtl-btl2
5051 @opindex fdump-rtl-btl2
5052 @opindex fdump-rtl-btl2
5053 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5054 after the two branch
5055 target load optimization passes.
5056
5057 @item -fdump-rtl-bypass
5058 @opindex fdump-rtl-bypass
5059 Dump after jump bypassing and control flow optimizations.
5060
5061 @item -fdump-rtl-combine
5062 @opindex fdump-rtl-combine
5063 Dump after the RTL instruction combination pass.
5064
5065 @item -fdump-rtl-compgotos
5066 @opindex fdump-rtl-compgotos
5067 Dump after duplicating the computed gotos.
5068
5069 @item -fdump-rtl-ce1
5070 @itemx -fdump-rtl-ce2
5071 @itemx -fdump-rtl-ce3
5072 @opindex fdump-rtl-ce1
5073 @opindex fdump-rtl-ce2
5074 @opindex fdump-rtl-ce3
5075 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5076 @option{-fdump-rtl-ce3} enable dumping after the three
5077 if conversion passes.
5078
5079 @itemx -fdump-rtl-cprop_hardreg
5080 @opindex fdump-rtl-cprop_hardreg
5081 Dump after hard register copy propagation.
5082
5083 @itemx -fdump-rtl-csa
5084 @opindex fdump-rtl-csa
5085 Dump after combining stack adjustments.
5086
5087 @item -fdump-rtl-cse1
5088 @itemx -fdump-rtl-cse2
5089 @opindex fdump-rtl-cse1
5090 @opindex fdump-rtl-cse2
5091 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5092 the two common sub-expression elimination passes.
5093
5094 @itemx -fdump-rtl-dce
5095 @opindex fdump-rtl-dce
5096 Dump after the standalone dead code elimination passes.
5097
5098 @itemx -fdump-rtl-dbr
5099 @opindex fdump-rtl-dbr
5100 Dump after delayed branch scheduling.
5101
5102 @item -fdump-rtl-dce1
5103 @itemx -fdump-rtl-dce2
5104 @opindex fdump-rtl-dce1
5105 @opindex fdump-rtl-dce2
5106 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5107 the two dead store elimination passes.
5108
5109 @item -fdump-rtl-eh
5110 @opindex fdump-rtl-eh
5111 Dump after finalization of EH handling code.
5112
5113 @item -fdump-rtl-eh_ranges
5114 @opindex fdump-rtl-eh_ranges
5115 Dump after conversion of EH handling range regions.
5116
5117 @item -fdump-rtl-expand
5118 @opindex fdump-rtl-expand
5119 Dump after RTL generation.
5120
5121 @item -fdump-rtl-fwprop1
5122 @itemx -fdump-rtl-fwprop2
5123 @opindex fdump-rtl-fwprop1
5124 @opindex fdump-rtl-fwprop2
5125 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5126 dumping after the two forward propagation passes.
5127
5128 @item -fdump-rtl-gcse1
5129 @itemx -fdump-rtl-gcse2
5130 @opindex fdump-rtl-gcse1
5131 @opindex fdump-rtl-gcse2
5132 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5133 after global common subexpression elimination.
5134
5135 @item -fdump-rtl-init-regs
5136 @opindex fdump-rtl-init-regs
5137 Dump after the initialization of the registers.
5138
5139 @item -fdump-rtl-initvals
5140 @opindex fdump-rtl-initvals
5141 Dump after the computation of the initial value sets.
5142
5143 @itemx -fdump-rtl-into_cfglayout
5144 @opindex fdump-rtl-into_cfglayout
5145 Dump after converting to cfglayout mode.
5146
5147 @item -fdump-rtl-ira
5148 @opindex fdump-rtl-ira
5149 Dump after iterated register allocation.
5150
5151 @item -fdump-rtl-jump
5152 @opindex fdump-rtl-jump
5153 Dump after the second jump optimization.
5154
5155 @item -fdump-rtl-loop2
5156 @opindex fdump-rtl-loop2
5157 @option{-fdump-rtl-loop2} enables dumping after the rtl
5158 loop optimization passes.
5159
5160 @item -fdump-rtl-mach
5161 @opindex fdump-rtl-mach
5162 Dump after performing the machine dependent reorganization pass, if that
5163 pass exists.
5164
5165 @item -fdump-rtl-mode_sw
5166 @opindex fdump-rtl-mode_sw
5167 Dump after removing redundant mode switches.
5168
5169 @item -fdump-rtl-rnreg
5170 @opindex fdump-rtl-rnreg
5171 Dump after register renumbering.
5172
5173 @itemx -fdump-rtl-outof_cfglayout
5174 @opindex fdump-rtl-outof_cfglayout
5175 Dump after converting from cfglayout mode.
5176
5177 @item -fdump-rtl-peephole2
5178 @opindex fdump-rtl-peephole2
5179 Dump after the peephole pass.
5180
5181 @item -fdump-rtl-postreload
5182 @opindex fdump-rtl-postreload
5183 Dump after post-reload optimizations.
5184
5185 @itemx -fdump-rtl-pro_and_epilogue
5186 @opindex fdump-rtl-pro_and_epilogue
5187 Dump after generating the function pro and epilogues.
5188
5189 @item -fdump-rtl-regmove
5190 @opindex fdump-rtl-regmove
5191 Dump after the register move pass.
5192
5193 @item -fdump-rtl-sched1
5194 @itemx -fdump-rtl-sched2
5195 @opindex fdump-rtl-sched1
5196 @opindex fdump-rtl-sched2
5197 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5198 after the basic block scheduling passes.
5199
5200 @item -fdump-rtl-see
5201 @opindex fdump-rtl-see
5202 Dump after sign extension elimination.
5203
5204 @item -fdump-rtl-seqabstr
5205 @opindex fdump-rtl-seqabstr
5206 Dump after common sequence discovery.
5207
5208 @item -fdump-rtl-shorten
5209 @opindex fdump-rtl-shorten
5210 Dump after shortening branches.
5211
5212 @item -fdump-rtl-sibling
5213 @opindex fdump-rtl-sibling
5214 Dump after sibling call optimizations.
5215
5216 @item -fdump-rtl-split1
5217 @itemx -fdump-rtl-split2
5218 @itemx -fdump-rtl-split3
5219 @itemx -fdump-rtl-split4
5220 @itemx -fdump-rtl-split5
5221 @opindex fdump-rtl-split1
5222 @opindex fdump-rtl-split2
5223 @opindex fdump-rtl-split3
5224 @opindex fdump-rtl-split4
5225 @opindex fdump-rtl-split5
5226 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5227 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5228 @option{-fdump-rtl-split5} enable dumping after five rounds of
5229 instruction splitting.
5230
5231 @item -fdump-rtl-sms
5232 @opindex fdump-rtl-sms
5233 Dump after modulo scheduling.  This pass is only run on some
5234 architectures.
5235
5236 @item -fdump-rtl-stack
5237 @opindex fdump-rtl-stack
5238 Dump after conversion from GCC's "flat register file" registers to the
5239 x87's stack-like registers.  This pass is only run on x86 variants.
5240
5241 @item -fdump-rtl-subreg1
5242 @itemx -fdump-rtl-subreg2
5243 @opindex fdump-rtl-subreg1
5244 @opindex fdump-rtl-subreg2
5245 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5246 the two subreg expansion passes.
5247
5248 @item -fdump-rtl-unshare
5249 @opindex fdump-rtl-unshare
5250 Dump after all rtl has been unshared.
5251
5252 @item -fdump-rtl-vartrack
5253 @opindex fdump-rtl-vartrack
5254 Dump after variable tracking.
5255
5256 @item -fdump-rtl-vregs
5257 @opindex fdump-rtl-vregs
5258 Dump after converting virtual registers to hard registers.
5259
5260 @item -fdump-rtl-web
5261 @opindex fdump-rtl-web
5262 Dump after live range splitting.
5263
5264 @item -fdump-rtl-regclass
5265 @itemx -fdump-rtl-subregs_of_mode_init
5266 @itemx -fdump-rtl-subregs_of_mode_finish
5267 @itemx -fdump-rtl-dfinit
5268 @itemx -fdump-rtl-dfinish
5269 @opindex fdump-rtl-regclass
5270 @opindex fdump-rtl-subregs_of_mode_init
5271 @opindex fdump-rtl-subregs_of_mode_finish
5272 @opindex fdump-rtl-dfinit
5273 @opindex fdump-rtl-dfinish
5274 These dumps are defined but always produce empty files.
5275
5276 @item -fdump-rtl-all
5277 @opindex fdump-rtl-all
5278 Produce all the dumps listed above.
5279
5280 @item -dA
5281 @opindex dA
5282 Annotate the assembler output with miscellaneous debugging information.
5283
5284 @item -dD
5285 @opindex dD
5286 Dump all macro definitions, at the end of preprocessing, in addition to
5287 normal output.
5288
5289 @item -dH
5290 @opindex dH
5291 Produce a core dump whenever an error occurs.
5292
5293 @item -dm
5294 @opindex dm
5295 Print statistics on memory usage, at the end of the run, to
5296 standard error.
5297
5298 @item -dp
5299 @opindex dp
5300 Annotate the assembler output with a comment indicating which
5301 pattern and alternative was used.  The length of each instruction is
5302 also printed.
5303
5304 @item -dP
5305 @opindex dP
5306 Dump the RTL in the assembler output as a comment before each instruction.
5307 Also turns on @option{-dp} annotation.
5308
5309 @item -dv
5310 @opindex dv
5311 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5312 dump a representation of the control flow graph suitable for viewing with VCG
5313 to @file{@var{file}.@var{pass}.vcg}.
5314
5315 @item -dx
5316 @opindex dx
5317 Just generate RTL for a function instead of compiling it.  Usually used
5318 with @option{-fdump-rtl-expand}.
5319 @end table
5320
5321 @item -fdump-noaddr
5322 @opindex fdump-noaddr
5323 When doing debugging dumps, suppress address output.  This makes it more
5324 feasible to use diff on debugging dumps for compiler invocations with
5325 different compiler binaries and/or different
5326 text / bss / data / heap / stack / dso start locations.
5327
5328 @item -fdump-unnumbered
5329 @opindex fdump-unnumbered
5330 When doing debugging dumps, suppress instruction numbers and address output.
5331 This makes it more feasible to use diff on debugging dumps for compiler
5332 invocations with different options, in particular with and without
5333 @option{-g}.
5334
5335 @item -fdump-unnumbered-links
5336 @opindex fdump-unnumbered-links
5337 When doing debugging dumps (see @option{-d} option above), suppress
5338 instruction numbers for the links to the previous and next instructions
5339 in a sequence.
5340
5341 @item -fdump-translation-unit @r{(C++ only)}
5342 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5343 @opindex fdump-translation-unit
5344 Dump a representation of the tree structure for the entire translation
5345 unit to a file.  The file name is made by appending @file{.tu} to the
5346 source file name, and the file is created in the same directory as the
5347 output file.  If the @samp{-@var{options}} form is used, @var{options}
5348 controls the details of the dump as described for the
5349 @option{-fdump-tree} options.
5350
5351 @item -fdump-class-hierarchy @r{(C++ only)}
5352 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5353 @opindex fdump-class-hierarchy
5354 Dump a representation of each class's hierarchy and virtual function
5355 table layout to a file.  The file name is made by appending
5356 @file{.class} to the source file name, and the file is created in the
5357 same directory as the output file.  If the @samp{-@var{options}} form
5358 is used, @var{options} controls the details of the dump as described
5359 for the @option{-fdump-tree} options.
5360
5361 @item -fdump-ipa-@var{switch}
5362 @opindex fdump-ipa
5363 Control the dumping at various stages of inter-procedural analysis
5364 language tree to a file.  The file name is generated by appending a
5365 switch specific suffix to the source file name, and the file is created
5366 in the same directory as the output file.  The following dumps are
5367 possible:
5368
5369 @table @samp
5370 @item all
5371 Enables all inter-procedural analysis dumps.
5372
5373 @item cgraph
5374 Dumps information about call-graph optimization, unused function removal,
5375 and inlining decisions.
5376
5377 @item inline
5378 Dump after function inlining.
5379
5380 @end table
5381
5382 @item -fdump-statistics-@var{option}
5383 @opindex fdump-statistics
5384 Enable and control dumping of pass statistics in a separate file.  The
5385 file name is generated by appending a suffix ending in
5386 @samp{.statistics} to the source file name, and the file is created in
5387 the same directory as the output file.  If the @samp{-@var{option}}
5388 form is used, @samp{-stats} will cause counters to be summed over the
5389 whole compilation unit while @samp{-details} will dump every event as
5390 the passes generate them.  The default with no option is to sum
5391 counters for each function compiled.
5392
5393 @item -fdump-tree-@var{switch}
5394 @itemx -fdump-tree-@var{switch}-@var{options}
5395 @opindex fdump-tree
5396 Control the dumping at various stages of processing the intermediate
5397 language tree to a file.  The file name is generated by appending a
5398 switch specific suffix to the source file name, and the file is
5399 created in the same directory as the output file.  If the
5400 @samp{-@var{options}} form is used, @var{options} is a list of
5401 @samp{-} separated options that control the details of the dump.  Not
5402 all options are applicable to all dumps, those which are not
5403 meaningful will be ignored.  The following options are available
5404
5405 @table @samp
5406 @item address
5407 Print the address of each node.  Usually this is not meaningful as it
5408 changes according to the environment and source file.  Its primary use
5409 is for tying up a dump file with a debug environment.
5410 @item asmname
5411 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5412 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5413 use working backward from mangled names in the assembly file.
5414 @item slim
5415 Inhibit dumping of members of a scope or body of a function merely
5416 because that scope has been reached.  Only dump such items when they
5417 are directly reachable by some other path.  When dumping pretty-printed
5418 trees, this option inhibits dumping the bodies of control structures.
5419 @item raw
5420 Print a raw representation of the tree.  By default, trees are
5421 pretty-printed into a C-like representation.
5422 @item details
5423 Enable more detailed dumps (not honored by every dump option).
5424 @item stats
5425 Enable dumping various statistics about the pass (not honored by every dump
5426 option).
5427 @item blocks
5428 Enable showing basic block boundaries (disabled in raw dumps).
5429 @item vops
5430 Enable showing virtual operands for every statement.
5431 @item lineno
5432 Enable showing line numbers for statements.
5433 @item uid
5434 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5435 @item verbose
5436 Enable showing the tree dump for each statement.
5437 @item eh
5438 Enable showing the EH region number holding each statement.
5439 @item all
5440 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5441 and @option{lineno}.
5442 @end table
5443
5444 The following tree dumps are possible:
5445 @table @samp
5446
5447 @item original
5448 @opindex fdump-tree-original
5449 Dump before any tree based optimization, to @file{@var{file}.original}.
5450
5451 @item optimized
5452 @opindex fdump-tree-optimized
5453 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5454
5455 @item gimple
5456 @opindex fdump-tree-gimple
5457 Dump each function before and after the gimplification pass to a file.  The
5458 file name is made by appending @file{.gimple} to the source file name.
5459
5460 @item cfg
5461 @opindex fdump-tree-cfg
5462 Dump the control flow graph of each function to a file.  The file name is
5463 made by appending @file{.cfg} to the source file name.
5464
5465 @item vcg
5466 @opindex fdump-tree-vcg
5467 Dump the control flow graph of each function to a file in VCG format.  The
5468 file name is made by appending @file{.vcg} to the source file name.  Note
5469 that if the file contains more than one function, the generated file cannot
5470 be used directly by VCG@.  You will need to cut and paste each function's
5471 graph into its own separate file first.
5472
5473 @item ch
5474 @opindex fdump-tree-ch
5475 Dump each function after copying loop headers.  The file name is made by
5476 appending @file{.ch} to the source file name.
5477
5478 @item ssa
5479 @opindex fdump-tree-ssa
5480 Dump SSA related information to a file.  The file name is made by appending
5481 @file{.ssa} to the source file name.
5482
5483 @item alias
5484 @opindex fdump-tree-alias
5485 Dump aliasing information for each function.  The file name is made by
5486 appending @file{.alias} to the source file name.
5487
5488 @item ccp
5489 @opindex fdump-tree-ccp
5490 Dump each function after CCP@.  The file name is made by appending
5491 @file{.ccp} to the source file name.
5492
5493 @item storeccp
5494 @opindex fdump-tree-storeccp
5495 Dump each function after STORE-CCP@.  The file name is made by appending
5496 @file{.storeccp} to the source file name.
5497
5498 @item pre
5499 @opindex fdump-tree-pre
5500 Dump trees after partial redundancy elimination.  The file name is made
5501 by appending @file{.pre} to the source file name.
5502
5503 @item fre
5504 @opindex fdump-tree-fre
5505 Dump trees after full redundancy elimination.  The file name is made
5506 by appending @file{.fre} to the source file name.
5507
5508 @item copyprop
5509 @opindex fdump-tree-copyprop
5510 Dump trees after copy propagation.  The file name is made
5511 by appending @file{.copyprop} to the source file name.
5512
5513 @item store_copyprop
5514 @opindex fdump-tree-store_copyprop
5515 Dump trees after store copy-propagation.  The file name is made
5516 by appending @file{.store_copyprop} to the source file name.
5517
5518 @item dce
5519 @opindex fdump-tree-dce
5520 Dump each function after dead code elimination.  The file name is made by
5521 appending @file{.dce} to the source file name.
5522
5523 @item mudflap
5524 @opindex fdump-tree-mudflap
5525 Dump each function after adding mudflap instrumentation.  The file name is
5526 made by appending @file{.mudflap} to the source file name.
5527
5528 @item sra
5529 @opindex fdump-tree-sra
5530 Dump each function after performing scalar replacement of aggregates.  The
5531 file name is made by appending @file{.sra} to the source file name.
5532
5533 @item sink
5534 @opindex fdump-tree-sink
5535 Dump each function after performing code sinking.  The file name is made
5536 by appending @file{.sink} to the source file name.
5537
5538 @item dom
5539 @opindex fdump-tree-dom
5540 Dump each function after applying dominator tree optimizations.  The file
5541 name is made by appending @file{.dom} to the source file name.
5542
5543 @item dse
5544 @opindex fdump-tree-dse
5545 Dump each function after applying dead store elimination.  The file
5546 name is made by appending @file{.dse} to the source file name.
5547
5548 @item phiopt
5549 @opindex fdump-tree-phiopt
5550 Dump each function after optimizing PHI nodes into straightline code.  The file
5551 name is made by appending @file{.phiopt} to the source file name.
5552
5553 @item forwprop
5554 @opindex fdump-tree-forwprop
5555 Dump each function after forward propagating single use variables.  The file
5556 name is made by appending @file{.forwprop} to the source file name.
5557
5558 @item copyrename
5559 @opindex fdump-tree-copyrename
5560 Dump each function after applying the copy rename optimization.  The file
5561 name is made by appending @file{.copyrename} to the source file name.
5562
5563 @item nrv
5564 @opindex fdump-tree-nrv
5565 Dump each function after applying the named return value optimization on
5566 generic trees.  The file name is made by appending @file{.nrv} to the source
5567 file name.
5568
5569 @item vect
5570 @opindex fdump-tree-vect
5571 Dump each function after applying vectorization of loops.  The file name is
5572 made by appending @file{.vect} to the source file name.
5573
5574 @item slp
5575 @opindex fdump-tree-slp
5576 Dump each function after applying vectorization of basic blocks.  The file name
5577 is made by appending @file{.slp} to the source file name.
5578
5579 @item vrp
5580 @opindex fdump-tree-vrp
5581 Dump each function after Value Range Propagation (VRP).  The file name
5582 is made by appending @file{.vrp} to the source file name.
5583
5584 @item all
5585 @opindex fdump-tree-all
5586 Enable all the available tree dumps with the flags provided in this option.
5587 @end table
5588
5589 @item -ftree-vectorizer-verbose=@var{n}
5590 @opindex ftree-vectorizer-verbose
5591 This option controls the amount of debugging output the vectorizer prints.
5592 This information is written to standard error, unless
5593 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5594 in which case it is output to the usual dump listing file, @file{.vect}.
5595 For @var{n}=0 no diagnostic information is reported.
5596 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5597 and the total number of loops that got vectorized.
5598 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5599 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5600 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5601 level that @option{-fdump-tree-vect-stats} uses.
5602 Higher verbosity levels mean either more information dumped for each
5603 reported loop, or same amount of information reported for more loops:
5604 if @var{n}=3, vectorizer cost model information is reported.
5605 If @var{n}=4, alignment related information is added to the reports.
5606 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5607 memory access-patterns) is added to the reports.
5608 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5609 that did not pass the first analysis phase (i.e., may not be countable, or
5610 may have complicated control-flow).
5611 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5612 If @var{n}=8, SLP related information is added to the reports.
5613 For @var{n}=9, all the information the vectorizer generates during its
5614 analysis and transformation is reported.  This is the same verbosity level
5615 that @option{-fdump-tree-vect-details} uses.
5616
5617 @item -frandom-seed=@var{string}
5618 @opindex frandom-seed
5619 This option provides a seed that GCC uses when it would otherwise use
5620 random numbers.  It is used to generate certain symbol names
5621 that have to be different in every compiled file.  It is also used to
5622 place unique stamps in coverage data files and the object files that
5623 produce them.  You can use the @option{-frandom-seed} option to produce
5624 reproducibly identical object files.
5625
5626 The @var{string} should be different for every file you compile.
5627
5628 @item -fsched-verbose=@var{n}
5629 @opindex fsched-verbose
5630 On targets that use instruction scheduling, this option controls the
5631 amount of debugging output the scheduler prints.  This information is
5632 written to standard error, unless @option{-fdump-rtl-sched1} or
5633 @option{-fdump-rtl-sched2} is specified, in which case it is output
5634 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5635 respectively.  However for @var{n} greater than nine, the output is
5636 always printed to standard error.
5637
5638 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5639 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5640 For @var{n} greater than one, it also output basic block probabilities,
5641 detailed ready list information and unit/insn info.  For @var{n} greater
5642 than two, it includes RTL at abort point, control-flow and regions info.
5643 And for @var{n} over four, @option{-fsched-verbose} also includes
5644 dependence info.
5645
5646 @item -save-temps
5647 @itemx -save-temps=cwd
5648 @opindex save-temps
5649 Store the usual ``temporary'' intermediate files permanently; place them
5650 in the current directory and name them based on the source file.  Thus,
5651 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5652 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5653 preprocessed @file{foo.i} output file even though the compiler now
5654 normally uses an integrated preprocessor.
5655
5656 When used in combination with the @option{-x} command line option,
5657 @option{-save-temps} is sensible enough to avoid over writing an
5658 input source file with the same extension as an intermediate file.
5659 The corresponding intermediate file may be obtained by renaming the
5660 source file before using @option{-save-temps}.
5661
5662 If you invoke GCC in parallel, compiling several different source
5663 files that share a common base name in different subdirectories or the
5664 same source file compiled for multiple output destinations, it is
5665 likely that the different parallel compilers will interfere with each
5666 other, and overwrite the temporary files.  For instance:
5667
5668 @smallexample
5669 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5670 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5671 @end smallexample
5672
5673 may result in @file{foo.i} and @file{foo.o} being written to
5674 simultaneously by both compilers.
5675
5676 @item -save-temps=obj
5677 @opindex save-temps=obj
5678 Store the usual ``temporary'' intermediate files permanently.  If the
5679 @option{-o} option is used, the temporary files are based on the
5680 object file.  If the @option{-o} option is not used, the
5681 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5682
5683 For example:
5684
5685 @smallexample
5686 gcc -save-temps=obj -c foo.c
5687 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5688 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5689 @end smallexample
5690
5691 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5692 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5693 @file{dir2/yfoobar.o}.
5694
5695 @item -time@r{[}=@var{file}@r{]}
5696 @opindex time
5697 Report the CPU time taken by each subprocess in the compilation
5698 sequence.  For C source files, this is the compiler proper and assembler
5699 (plus the linker if linking is done).
5700
5701 Without the specification of an output file, the output looks like this:
5702
5703 @smallexample
5704 # cc1 0.12 0.01
5705 # as 0.00 0.01
5706 @end smallexample
5707
5708 The first number on each line is the ``user time'', that is time spent
5709 executing the program itself.  The second number is ``system time'',
5710 time spent executing operating system routines on behalf of the program.
5711 Both numbers are in seconds.
5712
5713 With the specification of an output file, the output is appended to the
5714 named file, and it looks like this:
5715
5716 @smallexample
5717 0.12 0.01 cc1 @var{options}
5718 0.00 0.01 as @var{options}
5719 @end smallexample
5720
5721 The ``user time'' and the ``system time'' are moved before the program
5722 name, and the options passed to the program are displayed, so that one
5723 can later tell what file was being compiled, and with which options.
5724
5725 @item -fvar-tracking
5726 @opindex fvar-tracking
5727 Run variable tracking pass.  It computes where variables are stored at each
5728 position in code.  Better debugging information is then generated
5729 (if the debugging information format supports this information).
5730
5731 It is enabled by default when compiling with optimization (@option{-Os},
5732 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5733 the debug info format supports it.
5734
5735 @item -fvar-tracking-assignments
5736 @opindex fvar-tracking-assignments
5737 @opindex fno-var-tracking-assignments
5738 Annotate assignments to user variables early in the compilation and
5739 attempt to carry the annotations over throughout the compilation all the
5740 way to the end, in an attempt to improve debug information while
5741 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
5742
5743 It can be enabled even if var-tracking is disabled, in which case
5744 annotations will be created and maintained, but discarded at the end.
5745
5746 @item -fvar-tracking-assignments-toggle
5747 @opindex fvar-tracking-assignments-toggle
5748 @opindex fno-var-tracking-assignments-toggle
5749 Toggle @option{-fvar-tracking-assignments}, in the same way that
5750 @option{-gtoggle} toggles @option{-g}.
5751
5752 @item -print-file-name=@var{library}
5753 @opindex print-file-name
5754 Print the full absolute name of the library file @var{library} that
5755 would be used when linking---and don't do anything else.  With this
5756 option, GCC does not compile or link anything; it just prints the
5757 file name.
5758
5759 @item -print-multi-directory
5760 @opindex print-multi-directory
5761 Print the directory name corresponding to the multilib selected by any
5762 other switches present in the command line.  This directory is supposed
5763 to exist in @env{GCC_EXEC_PREFIX}.
5764
5765 @item -print-multi-lib
5766 @opindex print-multi-lib
5767 Print the mapping from multilib directory names to compiler switches
5768 that enable them.  The directory name is separated from the switches by
5769 @samp{;}, and each switch starts with an @samp{@@} instead of the
5770 @samp{-}, without spaces between multiple switches.  This is supposed to
5771 ease shell-processing.
5772
5773 @item -print-multi-os-directory
5774 @opindex print-multi-os-directory
5775 Print the path to OS libraries for the selected
5776 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
5777 present in the @file{lib} subdirectory and no multilibs are used, this is
5778 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
5779 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
5780 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
5781 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
5782
5783 @item -print-prog-name=@var{program}
5784 @opindex print-prog-name
5785 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5786
5787 @item -print-libgcc-file-name
5788 @opindex print-libgcc-file-name
5789 Same as @option{-print-file-name=libgcc.a}.
5790
5791 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5792 but you do want to link with @file{libgcc.a}.  You can do
5793
5794 @smallexample
5795 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5796 @end smallexample
5797
5798 @item -print-search-dirs
5799 @opindex print-search-dirs
5800 Print the name of the configured installation directory and a list of
5801 program and library directories @command{gcc} will search---and don't do anything else.
5802
5803 This is useful when @command{gcc} prints the error message
5804 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5805 To resolve this you either need to put @file{cpp0} and the other compiler
5806 components where @command{gcc} expects to find them, or you can set the environment
5807 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5808 Don't forget the trailing @samp{/}.
5809 @xref{Environment Variables}.
5810
5811 @item -print-sysroot
5812 @opindex print-sysroot
5813 Print the target sysroot directory that will be used during
5814 compilation.  This is the target sysroot specified either at configure
5815 time or using the @option{--sysroot} option, possibly with an extra
5816 suffix that depends on compilation options.  If no target sysroot is
5817 specified, the option prints nothing.
5818
5819 @item -print-sysroot-headers-suffix
5820 @opindex print-sysroot-headers-suffix
5821 Print the suffix added to the target sysroot when searching for
5822 headers, or give an error if the compiler is not configured with such
5823 a suffix---and don't do anything else.
5824
5825 @item -dumpmachine
5826 @opindex dumpmachine
5827 Print the compiler's target machine (for example,
5828 @samp{i686-pc-linux-gnu})---and don't do anything else.
5829
5830 @item -dumpversion
5831 @opindex dumpversion
5832 Print the compiler version (for example, @samp{3.0})---and don't do
5833 anything else.
5834
5835 @item -dumpspecs
5836 @opindex dumpspecs
5837 Print the compiler's built-in specs---and don't do anything else.  (This
5838 is used when GCC itself is being built.)  @xref{Spec Files}.
5839
5840 @item -feliminate-unused-debug-types
5841 @opindex feliminate-unused-debug-types
5842 Normally, when producing DWARF2 output, GCC will emit debugging
5843 information for all types declared in a compilation
5844 unit, regardless of whether or not they are actually used
5845 in that compilation unit.  Sometimes this is useful, such as
5846 if, in the debugger, you want to cast a value to a type that is
5847 not actually used in your program (but is declared).  More often,
5848 however, this results in a significant amount of wasted space.
5849 With this option, GCC will avoid producing debug symbol output
5850 for types that are nowhere used in the source file being compiled.
5851 @end table
5852
5853 @node Optimize Options
5854 @section Options That Control Optimization
5855 @cindex optimize options
5856 @cindex options, optimization
5857
5858 These options control various sorts of optimizations.
5859
5860 Without any optimization option, the compiler's goal is to reduce the
5861 cost of compilation and to make debugging produce the expected
5862 results.  Statements are independent: if you stop the program with a
5863 breakpoint between statements, you can then assign a new value to any
5864 variable or change the program counter to any other statement in the
5865 function and get exactly the results you would expect from the source
5866 code.
5867
5868 Turning on optimization flags makes the compiler attempt to improve
5869 the performance and/or code size at the expense of compilation time
5870 and possibly the ability to debug the program.
5871
5872 The compiler performs optimization based on the knowledge it has of the
5873 program.  Compiling multiple files at once to a single output file mode allows
5874 the compiler to use information gained from all of the files when compiling
5875 each of them.
5876
5877 Not all optimizations are controlled directly by a flag.  Only
5878 optimizations that have a flag are listed in this section.
5879
5880 Most optimizations are only enabled if an @option{-O} level is set on
5881 the command line.  Otherwise they are disabled, even if individual             
5882 optimization flags are specified.
5883
5884 Depending on the target and how GCC was configured, a slightly different
5885 set of optimizations may be enabled at each @option{-O} level than
5886 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
5887 to find out the exact set of optimizations that are enabled at each level.
5888 @xref{Overall Options}, for examples.
5889
5890 @table @gcctabopt
5891 @item -O
5892 @itemx -O1
5893 @opindex O
5894 @opindex O1
5895 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5896 more memory for a large function.
5897
5898 With @option{-O}, the compiler tries to reduce code size and execution
5899 time, without performing any optimizations that take a great deal of
5900 compilation time.
5901
5902 @option{-O} turns on the following optimization flags:
5903 @gccoptlist{
5904 -fauto-inc-dec @gol
5905 -fcompare-elim @gol
5906 -fcprop-registers @gol
5907 -fdce @gol
5908 -fdefer-pop @gol
5909 -fdelayed-branch @gol
5910 -fdse @gol
5911 -fguess-branch-probability @gol
5912 -fif-conversion2 @gol
5913 -fif-conversion @gol
5914 -fipa-pure-const @gol
5915 -fipa-profile @gol
5916 -fipa-reference @gol
5917 -fmerge-constants
5918 -fsplit-wide-types @gol
5919 -ftree-bit-ccp @gol
5920 -ftree-builtin-call-dce @gol
5921 -ftree-ccp @gol
5922 -ftree-ch @gol
5923 -ftree-copyrename @gol
5924 -ftree-dce @gol
5925 -ftree-dominator-opts @gol
5926 -ftree-dse @gol
5927 -ftree-forwprop @gol
5928 -ftree-fre @gol
5929 -ftree-phiprop @gol
5930 -ftree-sra @gol
5931 -ftree-pta @gol
5932 -ftree-ter @gol
5933 -funit-at-a-time}
5934
5935 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5936 where doing so does not interfere with debugging.
5937
5938 @item -O2
5939 @opindex O2
5940 Optimize even more.  GCC performs nearly all supported optimizations
5941 that do not involve a space-speed tradeoff.
5942 As compared to @option{-O}, this option increases both compilation time
5943 and the performance of the generated code.
5944
5945 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5946 also turns on the following optimization flags:
5947 @gccoptlist{-fthread-jumps @gol
5948 -falign-functions  -falign-jumps @gol
5949 -falign-loops  -falign-labels @gol
5950 -fcaller-saves @gol
5951 -fcrossjumping @gol
5952 -fcse-follow-jumps  -fcse-skip-blocks @gol
5953 -fdelete-null-pointer-checks @gol
5954 -fdevirtualize @gol
5955 -fexpensive-optimizations @gol
5956 -fgcse  -fgcse-lm  @gol
5957 -finline-small-functions @gol
5958 -findirect-inlining @gol
5959 -fipa-sra @gol
5960 -foptimize-sibling-calls @gol
5961 -fpartial-inlining @gol
5962 -fpeephole2 @gol
5963 -fregmove @gol
5964 -freorder-blocks  -freorder-functions @gol
5965 -frerun-cse-after-loop  @gol
5966 -fsched-interblock  -fsched-spec @gol
5967 -fschedule-insns  -fschedule-insns2 @gol
5968 -fstrict-aliasing -fstrict-overflow @gol
5969 -ftree-switch-conversion @gol
5970 -ftree-pre @gol
5971 -ftree-vrp}
5972
5973 Please note the warning under @option{-fgcse} about
5974 invoking @option{-O2} on programs that use computed gotos.
5975
5976 @item -O3
5977 @opindex O3
5978 Optimize yet more.  @option{-O3} turns on all optimizations specified
5979 by @option{-O2} and also turns on the @option{-finline-functions},
5980 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5981 @option{-fgcse-after-reload}, @option{-ftree-vectorize} and
5982 @option{-fipa-cp-clone} options.
5983
5984 @item -O0
5985 @opindex O0
5986 Reduce compilation time and make debugging produce the expected
5987 results.  This is the default.
5988
5989 @item -Os
5990 @opindex Os
5991 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5992 do not typically increase code size.  It also performs further
5993 optimizations designed to reduce code size.
5994
5995 @option{-Os} disables the following optimization flags:
5996 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5997 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5998 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5999
6000 @item -Ofast
6001 @opindex Ofast
6002 Disregard strict standards compliance.  @option{-Ofast} enables all
6003 @option{-O3} optimizations.  It also enables optimizations that are not
6004 valid for all standard compliant programs.
6005 It turns on @option{-ffast-math}.
6006
6007 If you use multiple @option{-O} options, with or without level numbers,
6008 the last such option is the one that is effective.
6009 @end table
6010
6011 Options of the form @option{-f@var{flag}} specify machine-independent
6012 flags.  Most flags have both positive and negative forms; the negative
6013 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
6014 below, only one of the forms is listed---the one you typically will
6015 use.  You can figure out the other form by either removing @samp{no-}
6016 or adding it.
6017
6018 The following options control specific optimizations.  They are either
6019 activated by @option{-O} options or are related to ones that are.  You
6020 can use the following flags in the rare cases when ``fine-tuning'' of
6021 optimizations to be performed is desired.
6022
6023 @table @gcctabopt
6024 @item -fno-default-inline
6025 @opindex fno-default-inline
6026 Do not make member functions inline by default merely because they are
6027 defined inside the class scope (C++ only).  Otherwise, when you specify
6028 @w{@option{-O}}, member functions defined inside class scope are compiled
6029 inline by default; i.e., you don't need to add @samp{inline} in front of
6030 the member function name.
6031
6032 @item -fno-defer-pop
6033 @opindex fno-defer-pop
6034 Always pop the arguments to each function call as soon as that function
6035 returns.  For machines which must pop arguments after a function call,
6036 the compiler normally lets arguments accumulate on the stack for several
6037 function calls and pops them all at once.
6038
6039 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6040
6041 @item -fforward-propagate
6042 @opindex fforward-propagate
6043 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6044 instructions and checks if the result can be simplified.  If loop unrolling
6045 is active, two passes are performed and the second is scheduled after
6046 loop unrolling.
6047
6048 This option is enabled by default at optimization levels @option{-O},
6049 @option{-O2}, @option{-O3}, @option{-Os}.
6050
6051 @item -ffp-contract=@var{style}
6052 @opindex ffp-contract
6053 @option{-ffp-contract=off} disables floating-point expression contraction.
6054 @option{-ffp-contract=fast} enables floating-point expression contraction
6055 such as forming of fused multiply-add operations if the target has
6056 native support for them.
6057 @option{-ffp-contract=on} enables floating-point expression contraction
6058 if allowed by the language standard.  This is currently not implemented
6059 and treated equal to @option{-ffp-contract=off}.
6060
6061 The default is @option{-ffp-contract=fast}.
6062
6063 @item -fomit-frame-pointer
6064 @opindex fomit-frame-pointer
6065 Don't keep the frame pointer in a register for functions that
6066 don't need one.  This avoids the instructions to save, set up and
6067 restore frame pointers; it also makes an extra register available
6068 in many functions.  @strong{It also makes debugging impossible on
6069 some machines.}
6070
6071 On some machines, such as the VAX, this flag has no effect, because
6072 the standard calling sequence automatically handles the frame pointer
6073 and nothing is saved by pretending it doesn't exist.  The
6074 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6075 whether a target machine supports this flag.  @xref{Registers,,Register
6076 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6077
6078 Starting with GCC version 4.6, the default setting (when not optimizing for
6079 size) for 32-bit Linux x86 and 32-bit Darwin x86 targets has been changed to
6080 @option{-fomit-frame-pointer}.  The default can be reverted to
6081 @option{-fno-omit-frame-pointer} by configuring GCC with the
6082 @option{--enable-frame-pointer} configure option.
6083
6084 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6085
6086 @item -foptimize-sibling-calls
6087 @opindex foptimize-sibling-calls
6088 Optimize sibling and tail recursive calls.
6089
6090 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6091
6092 @item -fno-inline
6093 @opindex fno-inline
6094 Don't pay attention to the @code{inline} keyword.  Normally this option
6095 is used to keep the compiler from expanding any functions inline.
6096 Note that if you are not optimizing, no functions can be expanded inline.
6097
6098 @item -finline-small-functions
6099 @opindex finline-small-functions
6100 Integrate functions into their callers when their body is smaller than expected
6101 function call code (so overall size of program gets smaller).  The compiler
6102 heuristically decides which functions are simple enough to be worth integrating
6103 in this way.
6104
6105 Enabled at level @option{-O2}.
6106
6107 @item -findirect-inlining
6108 @opindex findirect-inlining
6109 Inline also indirect calls that are discovered to be known at compile
6110 time thanks to previous inlining.  This option has any effect only
6111 when inlining itself is turned on by the @option{-finline-functions}
6112 or @option{-finline-small-functions} options.
6113
6114 Enabled at level @option{-O2}.
6115
6116 @item -finline-functions
6117 @opindex finline-functions
6118 Integrate all simple functions into their callers.  The compiler
6119 heuristically decides which functions are simple enough to be worth
6120 integrating in this way.
6121
6122 If all calls to a given function are integrated, and the function is
6123 declared @code{static}, then the function is normally not output as
6124 assembler code in its own right.
6125
6126 Enabled at level @option{-O3}.
6127
6128 @item -finline-functions-called-once
6129 @opindex finline-functions-called-once
6130 Consider all @code{static} functions called once for inlining into their
6131 caller even if they are not marked @code{inline}.  If a call to a given
6132 function is integrated, then the function is not output as assembler code
6133 in its own right.
6134
6135 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6136
6137 @item -fearly-inlining
6138 @opindex fearly-inlining
6139 Inline functions marked by @code{always_inline} and functions whose body seems
6140 smaller than the function call overhead early before doing
6141 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6142 makes profiling significantly cheaper and usually inlining faster on programs
6143 having large chains of nested wrapper functions.
6144
6145 Enabled by default.
6146
6147 @item -fipa-sra
6148 @opindex fipa-sra
6149 Perform interprocedural scalar replacement of aggregates, removal of
6150 unused parameters and replacement of parameters passed by reference
6151 by parameters passed by value.
6152
6153 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6154
6155 @item -finline-limit=@var{n}
6156 @opindex finline-limit
6157 By default, GCC limits the size of functions that can be inlined.  This flag
6158 allows coarse control of this limit.  @var{n} is the size of functions that
6159 can be inlined in number of pseudo instructions.
6160
6161 Inlining is actually controlled by a number of parameters, which may be
6162 specified individually by using @option{--param @var{name}=@var{value}}.
6163 The @option{-finline-limit=@var{n}} option sets some of these parameters
6164 as follows:
6165
6166 @table @gcctabopt
6167 @item max-inline-insns-single
6168 is set to @var{n}/2.
6169 @item max-inline-insns-auto
6170 is set to @var{n}/2.
6171 @end table
6172
6173 See below for a documentation of the individual
6174 parameters controlling inlining and for the defaults of these parameters.
6175
6176 @emph{Note:} there may be no value to @option{-finline-limit} that results
6177 in default behavior.
6178
6179 @emph{Note:} pseudo instruction represents, in this particular context, an
6180 abstract measurement of function's size.  In no way does it represent a count
6181 of assembly instructions and as such its exact meaning might change from one
6182 release to an another.
6183
6184 @item -fno-keep-inline-dllexport
6185 @opindex -fno-keep-inline-dllexport
6186 This is a more fine-grained version of @option{-fkeep-inline-functions},
6187 which applies only to functions that are declared using the @code{dllexport}
6188 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6189 Functions}.)
6190
6191 @item -fkeep-inline-functions
6192 @opindex fkeep-inline-functions
6193 In C, emit @code{static} functions that are declared @code{inline}
6194 into the object file, even if the function has been inlined into all
6195 of its callers.  This switch does not affect functions using the
6196 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6197 inline functions into the object file.
6198
6199 @item -fkeep-static-consts
6200 @opindex fkeep-static-consts
6201 Emit variables declared @code{static const} when optimization isn't turned
6202 on, even if the variables aren't referenced.
6203
6204 GCC enables this option by default.  If you want to force the compiler to
6205 check if the variable was referenced, regardless of whether or not
6206 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6207
6208 @item -fmerge-constants
6209 @opindex fmerge-constants
6210 Attempt to merge identical constants (string constants and floating point
6211 constants) across compilation units.
6212
6213 This option is the default for optimized compilation if the assembler and
6214 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6215 behavior.
6216
6217 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6218
6219 @item -fmerge-all-constants
6220 @opindex fmerge-all-constants
6221 Attempt to merge identical constants and identical variables.
6222
6223 This option implies @option{-fmerge-constants}.  In addition to
6224 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6225 arrays or initialized constant variables with integral or floating point
6226 types.  Languages like C or C++ require each variable, including multiple
6227 instances of the same variable in recursive calls, to have distinct locations,
6228 so using this option will result in non-conforming
6229 behavior.
6230
6231 @item -fmodulo-sched
6232 @opindex fmodulo-sched
6233 Perform swing modulo scheduling immediately before the first scheduling
6234 pass.  This pass looks at innermost loops and reorders their
6235 instructions by overlapping different iterations.
6236
6237 @item -fmodulo-sched-allow-regmoves
6238 @opindex fmodulo-sched-allow-regmoves
6239 Perform more aggressive SMS based modulo scheduling with register moves
6240 allowed.  By setting this flag certain anti-dependences edges will be
6241 deleted which will trigger the generation of reg-moves based on the
6242 life-range analysis.  This option is effective only with
6243 @option{-fmodulo-sched} enabled.
6244
6245 @item -fno-branch-count-reg
6246 @opindex fno-branch-count-reg
6247 Do not use ``decrement and branch'' instructions on a count register,
6248 but instead generate a sequence of instructions that decrement a
6249 register, compare it against zero, then branch based upon the result.
6250 This option is only meaningful on architectures that support such
6251 instructions, which include x86, PowerPC, IA-64 and S/390.
6252
6253 The default is @option{-fbranch-count-reg}.
6254
6255 @item -fno-function-cse
6256 @opindex fno-function-cse
6257 Do not put function addresses in registers; make each instruction that
6258 calls a constant function contain the function's address explicitly.
6259
6260 This option results in less efficient code, but some strange hacks
6261 that alter the assembler output may be confused by the optimizations
6262 performed when this option is not used.
6263
6264 The default is @option{-ffunction-cse}
6265
6266 @item -fno-zero-initialized-in-bss
6267 @opindex fno-zero-initialized-in-bss
6268 If the target supports a BSS section, GCC by default puts variables that
6269 are initialized to zero into BSS@.  This can save space in the resulting
6270 code.
6271
6272 This option turns off this behavior because some programs explicitly
6273 rely on variables going to the data section.  E.g., so that the
6274 resulting executable can find the beginning of that section and/or make
6275 assumptions based on that.
6276
6277 The default is @option{-fzero-initialized-in-bss}.
6278
6279 @item -fmudflap -fmudflapth -fmudflapir
6280 @opindex fmudflap
6281 @opindex fmudflapth
6282 @opindex fmudflapir
6283 @cindex bounds checking
6284 @cindex mudflap
6285 For front-ends that support it (C and C++), instrument all risky
6286 pointer/array dereferencing operations, some standard library
6287 string/heap functions, and some other associated constructs with
6288 range/validity tests.  Modules so instrumented should be immune to
6289 buffer overflows, invalid heap use, and some other classes of C/C++
6290 programming errors.  The instrumentation relies on a separate runtime
6291 library (@file{libmudflap}), which will be linked into a program if
6292 @option{-fmudflap} is given at link time.  Run-time behavior of the
6293 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6294 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6295 for its options.
6296
6297 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6298 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6299 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6300 instrumentation should ignore pointer reads.  This produces less
6301 instrumentation (and therefore faster execution) and still provides
6302 some protection against outright memory corrupting writes, but allows
6303 erroneously read data to propagate within a program.
6304
6305 @item -fthread-jumps
6306 @opindex fthread-jumps
6307 Perform optimizations where we check to see if a jump branches to a
6308 location where another comparison subsumed by the first is found.  If
6309 so, the first branch is redirected to either the destination of the
6310 second branch or a point immediately following it, depending on whether
6311 the condition is known to be true or false.
6312
6313 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6314
6315 @item -fsplit-wide-types
6316 @opindex fsplit-wide-types
6317 When using a type that occupies multiple registers, such as @code{long
6318 long} on a 32-bit system, split the registers apart and allocate them
6319 independently.  This normally generates better code for those types,
6320 but may make debugging more difficult.
6321
6322 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6323 @option{-Os}.
6324
6325 @item -fcse-follow-jumps
6326 @opindex fcse-follow-jumps
6327 In common subexpression elimination (CSE), scan through jump instructions
6328 when the target of the jump is not reached by any other path.  For
6329 example, when CSE encounters an @code{if} statement with an
6330 @code{else} clause, CSE will follow the jump when the condition
6331 tested is false.
6332
6333 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6334
6335 @item -fcse-skip-blocks
6336 @opindex fcse-skip-blocks
6337 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6338 follow jumps which conditionally skip over blocks.  When CSE
6339 encounters a simple @code{if} statement with no else clause,
6340 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6341 body of the @code{if}.
6342
6343 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6344
6345 @item -frerun-cse-after-loop
6346 @opindex frerun-cse-after-loop
6347 Re-run common subexpression elimination after loop optimizations has been
6348 performed.
6349
6350 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6351
6352 @item -fgcse
6353 @opindex fgcse
6354 Perform a global common subexpression elimination pass.
6355 This pass also performs global constant and copy propagation.
6356
6357 @emph{Note:} When compiling a program using computed gotos, a GCC
6358 extension, you may get better runtime performance if you disable
6359 the global common subexpression elimination pass by adding
6360 @option{-fno-gcse} to the command line.
6361
6362 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6363
6364 @item -fgcse-lm
6365 @opindex fgcse-lm
6366 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
6367 attempt to move loads which are only killed by stores into themselves.  This
6368 allows a loop containing a load/store sequence to be changed to a load outside
6369 the loop, and a copy/store within the loop.
6370
6371 Enabled by default when gcse is enabled.
6372
6373 @item -fgcse-sm
6374 @opindex fgcse-sm
6375 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6376 global common subexpression elimination.  This pass will attempt to move
6377 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6378 loops containing a load/store sequence can be changed to a load before
6379 the loop and a store after the loop.
6380
6381 Not enabled at any optimization level.
6382
6383 @item -fgcse-las
6384 @opindex fgcse-las
6385 When @option{-fgcse-las} is enabled, the global common subexpression
6386 elimination pass eliminates redundant loads that come after stores to the
6387 same memory location (both partial and full redundancies).
6388
6389 Not enabled at any optimization level.
6390
6391 @item -fgcse-after-reload
6392 @opindex fgcse-after-reload
6393 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6394 pass is performed after reload.  The purpose of this pass is to cleanup
6395 redundant spilling.
6396
6397 @item -funsafe-loop-optimizations
6398 @opindex funsafe-loop-optimizations
6399 If given, the loop optimizer will assume that loop indices do not
6400 overflow, and that the loops with nontrivial exit condition are not
6401 infinite.  This enables a wider range of loop optimizations even if
6402 the loop optimizer itself cannot prove that these assumptions are valid.
6403 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6404 if it finds this kind of loop.
6405
6406 @item -fcrossjumping
6407 @opindex fcrossjumping
6408 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6409 resulting code may or may not perform better than without cross-jumping.
6410
6411 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6412
6413 @item -fauto-inc-dec
6414 @opindex fauto-inc-dec
6415 Combine increments or decrements of addresses with memory accesses.
6416 This pass is always skipped on architectures that do not have
6417 instructions to support this.  Enabled by default at @option{-O} and
6418 higher on architectures that support this.
6419
6420 @item -fdce
6421 @opindex fdce
6422 Perform dead code elimination (DCE) on RTL@.
6423 Enabled by default at @option{-O} and higher.
6424
6425 @item -fdse
6426 @opindex fdse
6427 Perform dead store elimination (DSE) on RTL@.
6428 Enabled by default at @option{-O} and higher.
6429
6430 @item -fif-conversion
6431 @opindex fif-conversion
6432 Attempt to transform conditional jumps into branch-less equivalents.  This
6433 include use of conditional moves, min, max, set flags and abs instructions, and
6434 some tricks doable by standard arithmetics.  The use of conditional execution
6435 on chips where it is available is controlled by @code{if-conversion2}.
6436
6437 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6438
6439 @item -fif-conversion2
6440 @opindex fif-conversion2
6441 Use conditional execution (where available) to transform conditional jumps into
6442 branch-less equivalents.
6443
6444 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6445
6446 @item -fdelete-null-pointer-checks
6447 @opindex fdelete-null-pointer-checks
6448 Assume that programs cannot safely dereference null pointers, and that
6449 no code or data element resides there.  This enables simple constant
6450 folding optimizations at all optimization levels.  In addition, other
6451 optimization passes in GCC use this flag to control global dataflow
6452 analyses that eliminate useless checks for null pointers; these assume
6453 that if a pointer is checked after it has already been dereferenced,
6454 it cannot be null.
6455
6456 Note however that in some environments this assumption is not true.
6457 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6458 for programs which depend on that behavior.
6459
6460 Some targets, especially embedded ones, disable this option at all levels.
6461 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6462 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6463 are enabled independently at different optimization levels.
6464
6465 @item -fdevirtualize
6466 @opindex fdevirtualize
6467 Attempt to convert calls to virtual functions to direct calls.  This
6468 is done both within a procedure and interprocedurally as part of
6469 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
6470 propagation (@option{-fipa-cp}).
6471 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6472
6473 @item -fexpensive-optimizations
6474 @opindex fexpensive-optimizations
6475 Perform a number of minor optimizations that are relatively expensive.
6476
6477 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6478
6479 @item -foptimize-register-move
6480 @itemx -fregmove
6481 @opindex foptimize-register-move
6482 @opindex fregmove
6483 Attempt to reassign register numbers in move instructions and as
6484 operands of other simple instructions in order to maximize the amount of
6485 register tying.  This is especially helpful on machines with two-operand
6486 instructions.
6487
6488 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6489 optimization.
6490
6491 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6492
6493 @item -fira-algorithm=@var{algorithm}
6494 Use specified coloring algorithm for the integrated register
6495 allocator.  The @var{algorithm} argument should be @code{priority} or
6496 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6497 the second one specifies Chaitin-Briggs coloring.  The second
6498 algorithm can be unimplemented for some architectures.  If it is
6499 implemented, it is the default because Chaitin-Briggs coloring as a
6500 rule generates a better code.
6501
6502 @item -fira-region=@var{region}
6503 Use specified regions for the integrated register allocator.  The
6504 @var{region} argument should be one of @code{all}, @code{mixed}, or
6505 @code{one}.  The first value means using all loops as register
6506 allocation regions, the second value which is the default means using
6507 all loops except for loops with small register pressure as the
6508 regions, and third one means using all function as a single region.
6509 The first value can give best result for machines with small size and
6510 irregular register set, the third one results in faster and generates
6511 decent code and the smallest size code, and the default value usually
6512 give the best results in most cases and for most architectures.
6513
6514 @item -fira-loop-pressure
6515 @opindex fira-loop-pressure
6516 Use IRA to evaluate register pressure in loops for decision to move
6517 loop invariants.  Usage of this option usually results in generation
6518 of faster and smaller code on machines with big register files (>= 32
6519 registers) but it can slow compiler down.
6520
6521 This option is enabled at level @option{-O3} for some targets.
6522
6523 @item -fno-ira-share-save-slots
6524 @opindex fno-ira-share-save-slots
6525 Switch off sharing stack slots used for saving call used hard
6526 registers living through a call.  Each hard register will get a
6527 separate stack slot and as a result function stack frame will be
6528 bigger.
6529
6530 @item -fno-ira-share-spill-slots
6531 @opindex fno-ira-share-spill-slots
6532 Switch off sharing stack slots allocated for pseudo-registers.  Each
6533 pseudo-register which did not get a hard register will get a separate
6534 stack slot and as a result function stack frame will be bigger.
6535
6536 @item -fira-verbose=@var{n}
6537 @opindex fira-verbose
6538 Set up how verbose dump file for the integrated register allocator
6539 will be.  Default value is 5.  If the value is greater or equal to 10,
6540 the dump file will be stderr as if the value were @var{n} minus 10.
6541
6542 @item -fdelayed-branch
6543 @opindex fdelayed-branch
6544 If supported for the target machine, attempt to reorder instructions
6545 to exploit instruction slots available after delayed branch
6546 instructions.
6547
6548 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6549
6550 @item -fschedule-insns
6551 @opindex fschedule-insns
6552 If supported for the target machine, attempt to reorder instructions to
6553 eliminate execution stalls due to required data being unavailable.  This
6554 helps machines that have slow floating point or memory load instructions
6555 by allowing other instructions to be issued until the result of the load
6556 or floating point instruction is required.
6557
6558 Enabled at levels @option{-O2}, @option{-O3}.
6559
6560 @item -fschedule-insns2
6561 @opindex fschedule-insns2
6562 Similar to @option{-fschedule-insns}, but requests an additional pass of
6563 instruction scheduling after register allocation has been done.  This is
6564 especially useful on machines with a relatively small number of
6565 registers and where memory load instructions take more than one cycle.
6566
6567 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6568
6569 @item -fno-sched-interblock
6570 @opindex fno-sched-interblock
6571 Don't schedule instructions across basic blocks.  This is normally
6572 enabled by default when scheduling before register allocation, i.e.@:
6573 with @option{-fschedule-insns} or at @option{-O2} or higher.
6574
6575 @item -fno-sched-spec
6576 @opindex fno-sched-spec
6577 Don't allow speculative motion of non-load instructions.  This is normally
6578 enabled by default when scheduling before register allocation, i.e.@:
6579 with @option{-fschedule-insns} or at @option{-O2} or higher.
6580
6581 @item -fsched-pressure
6582 @opindex fsched-pressure
6583 Enable register pressure sensitive insn scheduling before the register
6584 allocation.  This only makes sense when scheduling before register
6585 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6586 @option{-O2} or higher.  Usage of this option can improve the
6587 generated code and decrease its size by preventing register pressure
6588 increase above the number of available hard registers and as a
6589 consequence register spills in the register allocation.
6590
6591 @item -fsched-spec-load
6592 @opindex fsched-spec-load
6593 Allow speculative motion of some load instructions.  This only makes
6594 sense when scheduling before register allocation, i.e.@: with
6595 @option{-fschedule-insns} or at @option{-O2} or higher.
6596
6597 @item -fsched-spec-load-dangerous
6598 @opindex fsched-spec-load-dangerous
6599 Allow speculative motion of more load instructions.  This only makes
6600 sense when scheduling before register allocation, i.e.@: with
6601 @option{-fschedule-insns} or at @option{-O2} or higher.
6602
6603 @item -fsched-stalled-insns
6604 @itemx -fsched-stalled-insns=@var{n}
6605 @opindex fsched-stalled-insns
6606 Define how many insns (if any) can be moved prematurely from the queue
6607 of stalled insns into the ready list, during the second scheduling pass.
6608 @option{-fno-sched-stalled-insns} means that no insns will be moved
6609 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6610 on how many queued insns can be moved prematurely.
6611 @option{-fsched-stalled-insns} without a value is equivalent to
6612 @option{-fsched-stalled-insns=1}.
6613
6614 @item -fsched-stalled-insns-dep
6615 @itemx -fsched-stalled-insns-dep=@var{n}
6616 @opindex fsched-stalled-insns-dep
6617 Define how many insn groups (cycles) will be examined for a dependency
6618 on a stalled insn that is candidate for premature removal from the queue
6619 of stalled insns.  This has an effect only during the second scheduling pass,
6620 and only if @option{-fsched-stalled-insns} is used.
6621 @option{-fno-sched-stalled-insns-dep} is equivalent to
6622 @option{-fsched-stalled-insns-dep=0}.
6623 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6624 @option{-fsched-stalled-insns-dep=1}.
6625
6626 @item -fsched2-use-superblocks
6627 @opindex fsched2-use-superblocks
6628 When scheduling after register allocation, do use superblock scheduling
6629 algorithm.  Superblock scheduling allows motion across basic block boundaries
6630 resulting on faster schedules.  This option is experimental, as not all machine
6631 descriptions used by GCC model the CPU closely enough to avoid unreliable
6632 results from the algorithm.
6633
6634 This only makes sense when scheduling after register allocation, i.e.@: with
6635 @option{-fschedule-insns2} or at @option{-O2} or higher.
6636
6637 @item -fsched-group-heuristic
6638 @opindex fsched-group-heuristic
6639 Enable the group heuristic in the scheduler.  This heuristic favors 
6640 the instruction that belongs to a schedule group.  This is enabled 
6641 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6642 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6643
6644 @item -fsched-critical-path-heuristic
6645 @opindex fsched-critical-path-heuristic
6646 Enable the critical-path heuristic in the scheduler.  This heuristic favors 
6647 instructions on the critical path.  This is enabled by default when 
6648 scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6649 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6650
6651 @item -fsched-spec-insn-heuristic
6652 @opindex fsched-spec-insn-heuristic
6653 Enable the speculative instruction heuristic in the scheduler.  This 
6654 heuristic favors speculative instructions with greater dependency weakness.  
6655 This is enabled by default when scheduling is enabled, i.e.@: 
6656 with @option{-fschedule-insns} or @option{-fschedule-insns2} 
6657 or at @option{-O2} or higher.
6658
6659 @item -fsched-rank-heuristic
6660 @opindex fsched-rank-heuristic
6661 Enable the rank heuristic in the scheduler.  This heuristic favors 
6662 the instruction belonging to a basic block with greater size or frequency.  
6663 This is enabled by default when scheduling is enabled, i.e.@: 
6664 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6665 at @option{-O2} or higher.
6666
6667 @item -fsched-last-insn-heuristic
6668 @opindex fsched-last-insn-heuristic
6669 Enable the last-instruction heuristic in the scheduler.  This heuristic 
6670 favors the instruction that is less dependent on the last instruction
6671 scheduled.  This is enabled by default when scheduling is enabled, 
6672 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6673 at @option{-O2} or higher.
6674
6675 @item -fsched-dep-count-heuristic
6676 @opindex fsched-dep-count-heuristic
6677 Enable the dependent-count heuristic in the scheduler.  This heuristic 
6678 favors the instruction that has more instructions depending on it.  
6679 This is enabled by default when scheduling is enabled, i.e.@: 
6680 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6681 at @option{-O2} or higher.
6682
6683 @item -freschedule-modulo-scheduled-loops
6684 @opindex freschedule-modulo-scheduled-loops
6685 The modulo scheduling comes before the traditional scheduling, if a loop
6686 was modulo scheduled we may want to prevent the later scheduling passes
6687 from changing its schedule, we use this option to control that.
6688
6689 @item -fselective-scheduling
6690 @opindex fselective-scheduling
6691 Schedule instructions using selective scheduling algorithm.  Selective
6692 scheduling runs instead of the first scheduler pass.
6693
6694 @item -fselective-scheduling2
6695 @opindex fselective-scheduling2
6696 Schedule instructions using selective scheduling algorithm.  Selective
6697 scheduling runs instead of the second scheduler pass.
6698
6699 @item -fsel-sched-pipelining
6700 @opindex fsel-sched-pipelining
6701 Enable software pipelining of innermost loops during selective scheduling.
6702 This option has no effect until one of @option{-fselective-scheduling} or
6703 @option{-fselective-scheduling2} is turned on.
6704
6705 @item -fsel-sched-pipelining-outer-loops
6706 @opindex fsel-sched-pipelining-outer-loops
6707 When pipelining loops during selective scheduling, also pipeline outer loops.
6708 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6709
6710 @item -fcaller-saves
6711 @opindex fcaller-saves
6712 Enable values to be allocated in registers that will be clobbered by
6713 function calls, by emitting extra instructions to save and restore the
6714 registers around such calls.  Such allocation is done only when it
6715 seems to result in better code than would otherwise be produced.
6716
6717 This option is always enabled by default on certain machines, usually
6718 those which have no call-preserved registers to use instead.
6719
6720 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6721
6722 @item -fcombine-stack-adjustments
6723 @opindex fcombine-stack-adjustments
6724 Tracks stack adjustments (pushes and pops) and stack memory references
6725 and then tries to find ways to combine them.
6726
6727 Enabled by default at @option{-O1} and higher.
6728
6729 @item -fconserve-stack
6730 @opindex fconserve-stack
6731 Attempt to minimize stack usage.  The compiler will attempt to use less
6732 stack space, even if that makes the program slower.  This option
6733 implies setting the @option{large-stack-frame} parameter to 100
6734 and the @option{large-stack-frame-growth} parameter to 400.
6735
6736 @item -ftree-reassoc
6737 @opindex ftree-reassoc
6738 Perform reassociation on trees.  This flag is enabled by default
6739 at @option{-O} and higher.
6740
6741 @item -ftree-pre
6742 @opindex ftree-pre
6743 Perform partial redundancy elimination (PRE) on trees.  This flag is
6744 enabled by default at @option{-O2} and @option{-O3}.
6745
6746 @item -ftree-forwprop
6747 @opindex ftree-forwprop
6748 Perform forward propagation on trees.  This flag is enabled by default
6749 at @option{-O} and higher.
6750
6751 @item -ftree-fre
6752 @opindex ftree-fre
6753 Perform full redundancy elimination (FRE) on trees.  The difference
6754 between FRE and PRE is that FRE only considers expressions
6755 that are computed on all paths leading to the redundant computation.
6756 This analysis is faster than PRE, though it exposes fewer redundancies.
6757 This flag is enabled by default at @option{-O} and higher.
6758
6759 @item -ftree-phiprop
6760 @opindex ftree-phiprop
6761 Perform hoisting of loads from conditional pointers on trees.  This
6762 pass is enabled by default at @option{-O} and higher.
6763
6764 @item -ftree-copy-prop
6765 @opindex ftree-copy-prop
6766 Perform copy propagation on trees.  This pass eliminates unnecessary
6767 copy operations.  This flag is enabled by default at @option{-O} and
6768 higher.
6769
6770 @item -fipa-pure-const
6771 @opindex fipa-pure-const
6772 Discover which functions are pure or constant.
6773 Enabled by default at @option{-O} and higher.
6774
6775 @item -fipa-reference
6776 @opindex fipa-reference
6777 Discover which static variables do not escape cannot escape the
6778 compilation unit.
6779 Enabled by default at @option{-O} and higher.
6780
6781 @item -fipa-struct-reorg
6782 @opindex fipa-struct-reorg
6783 Perform structure reorganization optimization, that change C-like structures
6784 layout in order to better utilize spatial locality.  This transformation is
6785 affective for programs containing arrays of structures.  Available in two
6786 compilation modes: profile-based (enabled with @option{-fprofile-generate})
6787 or static (which uses built-in heuristics).  It works only in whole program
6788 mode, so it requires @option{-fwhole-program} to be
6789 enabled.  Structures considered @samp{cold} by this transformation are not
6790 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
6791
6792 With this flag, the program debug info reflects a new structure layout.
6793
6794 @item -fipa-pta
6795 @opindex fipa-pta
6796 Perform interprocedural pointer analysis and interprocedural modification
6797 and reference analysis.  This option can cause excessive memory and
6798 compile-time usage on large compilation units.  It is not enabled by
6799 default at any optimization level.
6800
6801 @item -fipa-profile
6802 @opindex fipa-profile
6803 Perform interprocedural profile propagation.  The functions called only from
6804 cold functions are marked as cold. Also functions executed once (such as
6805 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
6806 functions and loop less parts of functions executed once are then optimized for
6807 size.
6808 Enabled by default at @option{-O} and higher.
6809
6810 @item -fipa-cp
6811 @opindex fipa-cp
6812 Perform interprocedural constant propagation.
6813 This optimization analyzes the program to determine when values passed
6814 to functions are constants and then optimizes accordingly.
6815 This optimization can substantially increase performance
6816 if the application has constants passed to functions.
6817 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6818
6819 @item -fipa-cp-clone
6820 @opindex fipa-cp-clone
6821 Perform function cloning to make interprocedural constant propagation stronger.
6822 When enabled, interprocedural constant propagation will perform function cloning
6823 when externally visible function can be called with constant arguments.
6824 Because this optimization can create multiple copies of functions,
6825 it may significantly increase code size
6826 (see @option{--param ipcp-unit-growth=@var{value}}).
6827 This flag is enabled by default at @option{-O3}.
6828
6829 @item -fipa-matrix-reorg
6830 @opindex fipa-matrix-reorg
6831 Perform matrix flattening and transposing.
6832 Matrix flattening tries to replace an @math{m}-dimensional matrix
6833 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
6834 This reduces the level of indirection needed for accessing the elements
6835 of the matrix. The second optimization is matrix transposing that
6836 attempts to change the order of the matrix's dimensions in order to
6837 improve cache locality.
6838 Both optimizations need the @option{-fwhole-program} flag.
6839 Transposing is enabled only if profiling information is available.
6840
6841 @item -ftree-sink
6842 @opindex ftree-sink
6843 Perform forward store motion  on trees.  This flag is
6844 enabled by default at @option{-O} and higher.
6845
6846 @item -ftree-bit-ccp
6847 @opindex ftree-bit-ccp
6848 Perform sparse conditional bit constant propagation on trees and propagate
6849 pointer alignment information.
6850 This pass only operates on local scalar variables and is enabled by default
6851 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
6852
6853 @item -ftree-ccp
6854 @opindex ftree-ccp
6855 Perform sparse conditional constant propagation (CCP) on trees.  This
6856 pass only operates on local scalar variables and is enabled by default
6857 at @option{-O} and higher.
6858
6859 @item -ftree-switch-conversion
6860 Perform conversion of simple initializations in a switch to
6861 initializations from a scalar array.  This flag is enabled by default
6862 at @option{-O2} and higher.
6863
6864 @item -ftree-dce
6865 @opindex ftree-dce
6866 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6867 default at @option{-O} and higher.
6868
6869 @item -ftree-builtin-call-dce
6870 @opindex ftree-builtin-call-dce
6871 Perform conditional dead code elimination (DCE) for calls to builtin functions
6872 that may set @code{errno} but are otherwise side-effect free.  This flag is
6873 enabled by default at @option{-O2} and higher if @option{-Os} is not also
6874 specified.
6875
6876 @item -ftree-dominator-opts
6877 @opindex ftree-dominator-opts
6878 Perform a variety of simple scalar cleanups (constant/copy
6879 propagation, redundancy elimination, range propagation and expression
6880 simplification) based on a dominator tree traversal.  This also
6881 performs jump threading (to reduce jumps to jumps). This flag is
6882 enabled by default at @option{-O} and higher.
6883
6884 @item -ftree-dse
6885 @opindex ftree-dse
6886 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6887 a memory location which will later be overwritten by another store without
6888 any intervening loads.  In this case the earlier store can be deleted.  This
6889 flag is enabled by default at @option{-O} and higher.
6890
6891 @item -ftree-ch
6892 @opindex ftree-ch
6893 Perform loop header copying on trees.  This is beneficial since it increases
6894 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6895 is enabled by default at @option{-O} and higher.  It is not enabled
6896 for @option{-Os}, since it usually increases code size.
6897
6898 @item -ftree-loop-optimize
6899 @opindex ftree-loop-optimize
6900 Perform loop optimizations on trees.  This flag is enabled by default
6901 at @option{-O} and higher.
6902
6903 @item -ftree-loop-linear
6904 @opindex ftree-loop-linear
6905 Perform loop interchange transformations on tree.  Same as
6906 @option{-floop-interchange}.  To use this code transformation, GCC has
6907 to be configured with @option{--with-ppl} and @option{--with-cloog} to
6908 enable the Graphite loop transformation infrastructure.
6909
6910 @item -floop-interchange
6911 @opindex floop-interchange
6912 Perform loop interchange transformations on loops.  Interchanging two
6913 nested loops switches the inner and outer loops.  For example, given a
6914 loop like:
6915 @smallexample
6916 DO J = 1, M
6917   DO I = 1, N
6918     A(J, I) = A(J, I) * C
6919   ENDDO
6920 ENDDO
6921 @end smallexample
6922 loop interchange will transform the loop as if the user had written:
6923 @smallexample
6924 DO I = 1, N
6925   DO J = 1, M
6926     A(J, I) = A(J, I) * C
6927   ENDDO
6928 ENDDO
6929 @end smallexample
6930 which can be beneficial when @code{N} is larger than the caches,
6931 because in Fortran, the elements of an array are stored in memory
6932 contiguously by column, and the original loop iterates over rows,
6933 potentially creating at each access a cache miss.  This optimization
6934 applies to all the languages supported by GCC and is not limited to
6935 Fortran.  To use this code transformation, GCC has to be configured
6936 with @option{--with-ppl} and @option{--with-cloog} to enable the
6937 Graphite loop transformation infrastructure.
6938
6939 @item -floop-strip-mine
6940 @opindex floop-strip-mine
6941 Perform loop strip mining transformations on loops.  Strip mining
6942 splits a loop into two nested loops.  The outer loop has strides
6943 equal to the strip size and the inner loop has strides of the
6944 original loop within a strip.  The strip length can be changed
6945 using the @option{loop-block-tile-size} parameter.  For example,
6946 given a loop like:
6947 @smallexample
6948 DO I = 1, N
6949   A(I) = A(I) + C
6950 ENDDO
6951 @end smallexample
6952 loop strip mining will transform the loop as if the user had written:
6953 @smallexample
6954 DO II = 1, N, 51
6955   DO I = II, min (II + 50, N)
6956     A(I) = A(I) + C
6957   ENDDO
6958 ENDDO
6959 @end smallexample
6960 This optimization applies to all the languages supported by GCC and is
6961 not limited to Fortran.  To use this code transformation, GCC has to
6962 be configured with @option{--with-ppl} and @option{--with-cloog} to
6963 enable the Graphite loop transformation infrastructure.
6964
6965 @item -floop-block
6966 @opindex floop-block
6967 Perform loop blocking transformations on loops.  Blocking strip mines
6968 each loop in the loop nest such that the memory accesses of the
6969 element loops fit inside caches.  The strip length can be changed
6970 using the @option{loop-block-tile-size} parameter.  For example, given
6971 a loop like:
6972 @smallexample
6973 DO I = 1, N
6974   DO J = 1, M
6975     A(J, I) = B(I) + C(J)
6976   ENDDO
6977 ENDDO
6978 @end smallexample
6979 loop blocking will transform the loop as if the user had written:
6980 @smallexample
6981 DO II = 1, N, 51
6982   DO JJ = 1, M, 51
6983     DO I = II, min (II + 50, N)
6984       DO J = JJ, min (JJ + 50, M)
6985         A(J, I) = B(I) + C(J)
6986       ENDDO
6987     ENDDO
6988   ENDDO
6989 ENDDO
6990 @end smallexample
6991 which can be beneficial when @code{M} is larger than the caches,
6992 because the innermost loop will iterate over a smaller amount of data
6993 that can be kept in the caches.  This optimization applies to all the
6994 languages supported by GCC and is not limited to Fortran.  To use this
6995 code transformation, GCC has to be configured with @option{--with-ppl}
6996 and @option{--with-cloog} to enable the Graphite loop transformation
6997 infrastructure.
6998
6999 @item -fgraphite-identity
7000 @opindex fgraphite-identity
7001 Enable the identity transformation for graphite.  For every SCoP we generate
7002 the polyhedral representation and transform it back to gimple.  Using
7003 @option{-fgraphite-identity} we can check the costs or benefits of the
7004 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7005 are also performed by the code generator CLooG, like index splitting and
7006 dead code elimination in loops.
7007
7008 @item -floop-flatten
7009 @opindex floop-flatten
7010 Removes the loop nesting structure: transforms the loop nest into a
7011 single loop.  This transformation can be useful to vectorize all the
7012 levels of the loop nest.
7013
7014 @item -floop-parallelize-all
7015 @opindex floop-parallelize-all
7016 Use the Graphite data dependence analysis to identify loops that can
7017 be parallelized.  Parallelize all the loops that can be analyzed to
7018 not contain loop carried dependences without checking that it is
7019 profitable to parallelize the loops.
7020
7021 @item -fcheck-data-deps
7022 @opindex fcheck-data-deps
7023 Compare the results of several data dependence analyzers.  This option
7024 is used for debugging the data dependence analyzers.
7025
7026 @item -ftree-loop-if-convert
7027 Attempt to transform conditional jumps in the innermost loops to
7028 branch-less equivalents.  The intent is to remove control-flow from
7029 the innermost loops in order to improve the ability of the
7030 vectorization pass to handle these loops.  This is enabled by default
7031 if vectorization is enabled.
7032
7033 @item -ftree-loop-if-convert-stores
7034 Attempt to also if-convert conditional jumps containing memory writes.
7035 This transformation can be unsafe for multi-threaded programs as it
7036 transforms conditional memory writes into unconditional memory writes.
7037 For example,
7038 @smallexample
7039 for (i = 0; i < N; i++)
7040   if (cond)
7041     A[i] = expr;
7042 @end smallexample
7043 would be transformed to
7044 @smallexample
7045 for (i = 0; i < N; i++)
7046   A[i] = cond ? expr : A[i];
7047 @end smallexample
7048 potentially producing data races.
7049
7050 @item -ftree-loop-distribution
7051 Perform loop distribution.  This flag can improve cache performance on
7052 big loop bodies and allow further loop optimizations, like
7053 parallelization or vectorization, to take place.  For example, the loop
7054 @smallexample
7055 DO I = 1, N
7056   A(I) = B(I) + C
7057   D(I) = E(I) * F
7058 ENDDO
7059 @end smallexample
7060 is transformed to
7061 @smallexample
7062 DO I = 1, N
7063    A(I) = B(I) + C
7064 ENDDO
7065 DO I = 1, N
7066    D(I) = E(I) * F
7067 ENDDO
7068 @end smallexample
7069
7070 @item -ftree-loop-distribute-patterns
7071 Perform loop distribution of patterns that can be code generated with
7072 calls to a library.  This flag is enabled by default at @option{-O3}.
7073
7074 This pass distributes the initialization loops and generates a call to
7075 memset zero.  For example, the loop
7076 @smallexample
7077 DO I = 1, N
7078   A(I) = 0
7079   B(I) = A(I) + I
7080 ENDDO
7081 @end smallexample
7082 is transformed to
7083 @smallexample
7084 DO I = 1, N
7085    A(I) = 0
7086 ENDDO
7087 DO I = 1, N
7088    B(I) = A(I) + I
7089 ENDDO
7090 @end smallexample
7091 and the initialization loop is transformed into a call to memset zero.
7092
7093 @item -ftree-loop-im
7094 @opindex ftree-loop-im
7095 Perform loop invariant motion on trees.  This pass moves only invariants that
7096 would be hard to handle at RTL level (function calls, operations that expand to
7097 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7098 operands of conditions that are invariant out of the loop, so that we can use
7099 just trivial invariantness analysis in loop unswitching.  The pass also includes
7100 store motion.
7101
7102 @item -ftree-loop-ivcanon
7103 @opindex ftree-loop-ivcanon
7104 Create a canonical counter for number of iterations in the loop for that
7105 determining number of iterations requires complicated analysis.  Later
7106 optimizations then may determine the number easily.  Useful especially
7107 in connection with unrolling.
7108
7109 @item -fivopts
7110 @opindex fivopts
7111 Perform induction variable optimizations (strength reduction, induction
7112 variable merging and induction variable elimination) on trees.
7113
7114 @item -ftree-parallelize-loops=n
7115 @opindex ftree-parallelize-loops
7116 Parallelize loops, i.e., split their iteration space to run in n threads.
7117 This is only possible for loops whose iterations are independent
7118 and can be arbitrarily reordered.  The optimization is only
7119 profitable on multiprocessor machines, for loops that are CPU-intensive,
7120 rather than constrained e.g.@: by memory bandwidth.  This option
7121 implies @option{-pthread}, and thus is only supported on targets
7122 that have support for @option{-pthread}.
7123
7124 @item -ftree-pta
7125 @opindex ftree-pta
7126 Perform function-local points-to analysis on trees.  This flag is
7127 enabled by default at @option{-O} and higher.
7128
7129 @item -ftree-sra
7130 @opindex ftree-sra
7131 Perform scalar replacement of aggregates.  This pass replaces structure
7132 references with scalars to prevent committing structures to memory too
7133 early.  This flag is enabled by default at @option{-O} and higher.
7134
7135 @item -ftree-copyrename
7136 @opindex ftree-copyrename
7137 Perform copy renaming on trees.  This pass attempts to rename compiler
7138 temporaries to other variables at copy locations, usually resulting in
7139 variable names which more closely resemble the original variables.  This flag
7140 is enabled by default at @option{-O} and higher.
7141
7142 @item -ftree-ter
7143 @opindex ftree-ter
7144 Perform temporary expression replacement during the SSA->normal phase.  Single
7145 use/single def temporaries are replaced at their use location with their
7146 defining expression.  This results in non-GIMPLE code, but gives the expanders
7147 much more complex trees to work on resulting in better RTL generation.  This is
7148 enabled by default at @option{-O} and higher.
7149
7150 @item -ftree-vectorize
7151 @opindex ftree-vectorize
7152 Perform loop vectorization on trees. This flag is enabled by default at
7153 @option{-O3}.
7154
7155 @item -ftree-slp-vectorize
7156 @opindex ftree-slp-vectorize
7157 Perform basic block vectorization on trees. This flag is enabled by default at
7158 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7159
7160 @item -ftree-vect-loop-version
7161 @opindex ftree-vect-loop-version
7162 Perform loop versioning when doing loop vectorization on trees.  When a loop
7163 appears to be vectorizable except that data alignment or data dependence cannot
7164 be determined at compile time then vectorized and non-vectorized versions of
7165 the loop are generated along with runtime checks for alignment or dependence
7166 to control which version is executed.  This option is enabled by default
7167 except at level @option{-Os} where it is disabled.
7168
7169 @item -fvect-cost-model
7170 @opindex fvect-cost-model
7171 Enable cost model for vectorization.
7172
7173 @item -ftree-vrp
7174 @opindex ftree-vrp
7175 Perform Value Range Propagation on trees.  This is similar to the
7176 constant propagation pass, but instead of values, ranges of values are
7177 propagated.  This allows the optimizers to remove unnecessary range
7178 checks like array bound checks and null pointer checks.  This is
7179 enabled by default at @option{-O2} and higher.  Null pointer check
7180 elimination is only done if @option{-fdelete-null-pointer-checks} is
7181 enabled.
7182
7183 @item -ftracer
7184 @opindex ftracer
7185 Perform tail duplication to enlarge superblock size.  This transformation
7186 simplifies the control flow of the function allowing other optimizations to do
7187 better job.
7188
7189 @item -funroll-loops
7190 @opindex funroll-loops
7191 Unroll loops whose number of iterations can be determined at compile
7192 time or upon entry to the loop.  @option{-funroll-loops} implies
7193 @option{-frerun-cse-after-loop}.  This option makes code larger,
7194 and may or may not make it run faster.
7195
7196 @item -funroll-all-loops
7197 @opindex funroll-all-loops
7198 Unroll all loops, even if their number of iterations is uncertain when
7199 the loop is entered.  This usually makes programs run more slowly.
7200 @option{-funroll-all-loops} implies the same options as
7201 @option{-funroll-loops},
7202
7203 @item -fsplit-ivs-in-unroller
7204 @opindex fsplit-ivs-in-unroller
7205 Enables expressing of values of induction variables in later iterations
7206 of the unrolled loop using the value in the first iteration.  This breaks
7207 long dependency chains, thus improving efficiency of the scheduling passes.
7208
7209 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7210 same effect.  However in cases the loop body is more complicated than
7211 a single basic block, this is not reliable.  It also does not work at all
7212 on some of the architectures due to restrictions in the CSE pass.
7213
7214 This optimization is enabled by default.
7215
7216 @item -fvariable-expansion-in-unroller
7217 @opindex fvariable-expansion-in-unroller
7218 With this option, the compiler will create multiple copies of some
7219 local variables when unrolling a loop which can result in superior code.
7220
7221 @item -fpartial-inlining
7222 @opindex fpartial-inlining
7223 Inline parts of functions.  This option has any effect only
7224 when inlining itself is turned on by the @option{-finline-functions}
7225 or @option{-finline-small-functions} options.
7226
7227 Enabled at level @option{-O2}.
7228
7229 @item -fpredictive-commoning
7230 @opindex fpredictive-commoning
7231 Perform predictive commoning optimization, i.e., reusing computations
7232 (especially memory loads and stores) performed in previous
7233 iterations of loops.
7234
7235 This option is enabled at level @option{-O3}.
7236
7237 @item -fprefetch-loop-arrays
7238 @opindex fprefetch-loop-arrays
7239 If supported by the target machine, generate instructions to prefetch
7240 memory to improve the performance of loops that access large arrays.
7241
7242 This option may generate better or worse code; results are highly
7243 dependent on the structure of loops within the source code.
7244
7245 Disabled at level @option{-Os}.
7246
7247 @item -fno-peephole
7248 @itemx -fno-peephole2
7249 @opindex fno-peephole
7250 @opindex fno-peephole2
7251 Disable any machine-specific peephole optimizations.  The difference
7252 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7253 are implemented in the compiler; some targets use one, some use the
7254 other, a few use both.
7255
7256 @option{-fpeephole} is enabled by default.
7257 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7258
7259 @item -fno-guess-branch-probability
7260 @opindex fno-guess-branch-probability
7261 Do not guess branch probabilities using heuristics.
7262
7263 GCC will use heuristics to guess branch probabilities if they are
7264 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7265 heuristics are based on the control flow graph.  If some branch probabilities
7266 are specified by @samp{__builtin_expect}, then the heuristics will be
7267 used to guess branch probabilities for the rest of the control flow graph,
7268 taking the @samp{__builtin_expect} info into account.  The interactions
7269 between the heuristics and @samp{__builtin_expect} can be complex, and in
7270 some cases, it may be useful to disable the heuristics so that the effects
7271 of @samp{__builtin_expect} are easier to understand.
7272
7273 The default is @option{-fguess-branch-probability} at levels
7274 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7275
7276 @item -freorder-blocks
7277 @opindex freorder-blocks
7278 Reorder basic blocks in the compiled function in order to reduce number of
7279 taken branches and improve code locality.
7280
7281 Enabled at levels @option{-O2}, @option{-O3}.
7282
7283 @item -freorder-blocks-and-partition
7284 @opindex freorder-blocks-and-partition
7285 In addition to reordering basic blocks in the compiled function, in order
7286 to reduce number of taken branches, partitions hot and cold basic blocks
7287 into separate sections of the assembly and .o files, to improve
7288 paging and cache locality performance.
7289
7290 This optimization is automatically turned off in the presence of
7291 exception handling, for linkonce sections, for functions with a user-defined
7292 section attribute and on any architecture that does not support named
7293 sections.
7294
7295 @item -freorder-functions
7296 @opindex freorder-functions
7297 Reorder functions in the object file in order to
7298 improve code locality.  This is implemented by using special
7299 subsections @code{.text.hot} for most frequently executed functions and
7300 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7301 the linker so object file format must support named sections and linker must
7302 place them in a reasonable way.
7303
7304 Also profile feedback must be available in to make this option effective.  See
7305 @option{-fprofile-arcs} for details.
7306
7307 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7308
7309 @item -fstrict-aliasing
7310 @opindex fstrict-aliasing
7311 Allow the compiler to assume the strictest aliasing rules applicable to
7312 the language being compiled.  For C (and C++), this activates
7313 optimizations based on the type of expressions.  In particular, an
7314 object of one type is assumed never to reside at the same address as an
7315 object of a different type, unless the types are almost the same.  For
7316 example, an @code{unsigned int} can alias an @code{int}, but not a
7317 @code{void*} or a @code{double}.  A character type may alias any other
7318 type.
7319
7320 @anchor{Type-punning}Pay special attention to code like this:
7321 @smallexample
7322 union a_union @{
7323   int i;
7324   double d;
7325 @};
7326
7327 int f() @{
7328   union a_union t;
7329   t.d = 3.0;
7330   return t.i;
7331 @}
7332 @end smallexample
7333 The practice of reading from a different union member than the one most
7334 recently written to (called ``type-punning'') is common.  Even with
7335 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7336 is accessed through the union type.  So, the code above will work as
7337 expected.  @xref{Structures unions enumerations and bit-fields
7338 implementation}.  However, this code might not:
7339 @smallexample
7340 int f() @{
7341   union a_union t;
7342   int* ip;
7343   t.d = 3.0;
7344   ip = &t.i;
7345   return *ip;
7346 @}
7347 @end smallexample
7348
7349 Similarly, access by taking the address, casting the resulting pointer
7350 and dereferencing the result has undefined behavior, even if the cast
7351 uses a union type, e.g.:
7352 @smallexample
7353 int f() @{
7354   double d = 3.0;
7355   return ((union a_union *) &d)->i;
7356 @}
7357 @end smallexample
7358
7359 The @option{-fstrict-aliasing} option is enabled at levels
7360 @option{-O2}, @option{-O3}, @option{-Os}.
7361
7362 @item -fstrict-overflow
7363 @opindex fstrict-overflow
7364 Allow the compiler to assume strict signed overflow rules, depending
7365 on the language being compiled.  For C (and C++) this means that
7366 overflow when doing arithmetic with signed numbers is undefined, which
7367 means that the compiler may assume that it will not happen.  This
7368 permits various optimizations.  For example, the compiler will assume
7369 that an expression like @code{i + 10 > i} will always be true for
7370 signed @code{i}.  This assumption is only valid if signed overflow is
7371 undefined, as the expression is false if @code{i + 10} overflows when
7372 using twos complement arithmetic.  When this option is in effect any
7373 attempt to determine whether an operation on signed numbers will
7374 overflow must be written carefully to not actually involve overflow.
7375
7376 This option also allows the compiler to assume strict pointer
7377 semantics: given a pointer to an object, if adding an offset to that
7378 pointer does not produce a pointer to the same object, the addition is
7379 undefined.  This permits the compiler to conclude that @code{p + u >
7380 p} is always true for a pointer @code{p} and unsigned integer
7381 @code{u}.  This assumption is only valid because pointer wraparound is
7382 undefined, as the expression is false if @code{p + u} overflows using
7383 twos complement arithmetic.
7384
7385 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7386 that integer signed overflow is fully defined: it wraps.  When
7387 @option{-fwrapv} is used, there is no difference between
7388 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7389 integers.  With @option{-fwrapv} certain types of overflow are
7390 permitted.  For example, if the compiler gets an overflow when doing
7391 arithmetic on constants, the overflowed value can still be used with
7392 @option{-fwrapv}, but not otherwise.
7393
7394 The @option{-fstrict-overflow} option is enabled at levels
7395 @option{-O2}, @option{-O3}, @option{-Os}.
7396
7397 @item -falign-functions
7398 @itemx -falign-functions=@var{n}
7399 @opindex falign-functions
7400 Align the start of functions to the next power-of-two greater than
7401 @var{n}, skipping up to @var{n} bytes.  For instance,
7402 @option{-falign-functions=32} aligns functions to the next 32-byte
7403 boundary, but @option{-falign-functions=24} would align to the next
7404 32-byte boundary only if this can be done by skipping 23 bytes or less.
7405
7406 @option{-fno-align-functions} and @option{-falign-functions=1} are
7407 equivalent and mean that functions will not be aligned.
7408
7409 Some assemblers only support this flag when @var{n} is a power of two;
7410 in that case, it is rounded up.
7411
7412 If @var{n} is not specified or is zero, use a machine-dependent default.
7413
7414 Enabled at levels @option{-O2}, @option{-O3}.
7415
7416 @item -falign-labels
7417 @itemx -falign-labels=@var{n}
7418 @opindex falign-labels
7419 Align all branch targets to a power-of-two boundary, skipping up to
7420 @var{n} bytes like @option{-falign-functions}.  This option can easily
7421 make code slower, because it must insert dummy operations for when the
7422 branch target is reached in the usual flow of the code.
7423
7424 @option{-fno-align-labels} and @option{-falign-labels=1} are
7425 equivalent and mean that labels will not be aligned.
7426
7427 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7428 are greater than this value, then their values are used instead.
7429
7430 If @var{n} is not specified or is zero, use a machine-dependent default
7431 which is very likely to be @samp{1}, meaning no alignment.
7432
7433 Enabled at levels @option{-O2}, @option{-O3}.
7434
7435 @item -falign-loops
7436 @itemx -falign-loops=@var{n}
7437 @opindex falign-loops
7438 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7439 like @option{-falign-functions}.  The hope is that the loop will be
7440 executed many times, which will make up for any execution of the dummy
7441 operations.
7442
7443 @option{-fno-align-loops} and @option{-falign-loops=1} are
7444 equivalent and mean that loops will not be aligned.
7445
7446 If @var{n} is not specified or is zero, use a machine-dependent default.
7447
7448 Enabled at levels @option{-O2}, @option{-O3}.
7449
7450 @item -falign-jumps
7451 @itemx -falign-jumps=@var{n}
7452 @opindex falign-jumps
7453 Align branch targets to a power-of-two boundary, for branch targets
7454 where the targets can only be reached by jumping, skipping up to @var{n}
7455 bytes like @option{-falign-functions}.  In this case, no dummy operations
7456 need be executed.
7457
7458 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7459 equivalent and mean that loops will not be aligned.
7460
7461 If @var{n} is not specified or is zero, use a machine-dependent default.
7462
7463 Enabled at levels @option{-O2}, @option{-O3}.
7464
7465 @item -funit-at-a-time
7466 @opindex funit-at-a-time
7467 This option is left for compatibility reasons. @option{-funit-at-a-time}
7468 has no effect, while @option{-fno-unit-at-a-time} implies
7469 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7470
7471 Enabled by default.
7472
7473 @item -fno-toplevel-reorder
7474 @opindex fno-toplevel-reorder
7475 Do not reorder top-level functions, variables, and @code{asm}
7476 statements.  Output them in the same order that they appear in the
7477 input file.  When this option is used, unreferenced static variables
7478 will not be removed.  This option is intended to support existing code
7479 which relies on a particular ordering.  For new code, it is better to
7480 use attributes.
7481
7482 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
7483 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
7484 targets.
7485
7486 @item -fweb
7487 @opindex fweb
7488 Constructs webs as commonly used for register allocation purposes and assign
7489 each web individual pseudo register.  This allows the register allocation pass
7490 to operate on pseudos directly, but also strengthens several other optimization
7491 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7492 however, make debugging impossible, since variables will no longer stay in a
7493 ``home register''.
7494
7495 Enabled by default with @option{-funroll-loops}.
7496
7497 @item -fwhole-program
7498 @opindex fwhole-program
7499 Assume that the current compilation unit represents the whole program being
7500 compiled.  All public functions and variables with the exception of @code{main}
7501 and those merged by attribute @code{externally_visible} become static functions
7502 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.
7503 While this option is equivalent to proper use of the @code{static} keyword for
7504 programs consisting of a single file, in combination with option
7505 @option{-flto} this flag can be used to
7506 compile many smaller scale programs since the functions and variables become
7507 local for the whole combined compilation unit, not for the single source file
7508 itself.
7509
7510 This option implies @option{-fwhole-file} for Fortran programs.
7511
7512 @item -flto[=@var{n}]
7513 @opindex flto
7514 This option runs the standard link-time optimizer.  When invoked
7515 with source code, it generates GIMPLE (one of GCC's internal
7516 representations) and writes it to special ELF sections in the object
7517 file.  When the object files are linked together, all the function
7518 bodies are read from these ELF sections and instantiated as if they
7519 had been part of the same translation unit.
7520
7521 To use the link-timer optimizer, @option{-flto} needs to be specified at
7522 compile time and during the final link.  For example,
7523
7524 @smallexample
7525 gcc -c -O2 -flto foo.c
7526 gcc -c -O2 -flto bar.c
7527 gcc -o myprog -flto -O2 foo.o bar.o
7528 @end smallexample
7529
7530 The first two invocations to GCC will save a bytecode representation
7531 of GIMPLE into special ELF sections inside @file{foo.o} and
7532 @file{bar.o}.  The final invocation will read the GIMPLE bytecode from
7533 @file{foo.o} and @file{bar.o}, merge the two files into a single
7534 internal image, and compile the result as usual.  Since both
7535 @file{foo.o} and @file{bar.o} are merged into a single image, this
7536 causes all the inter-procedural analyses and optimizations in GCC to
7537 work across the two files as if they were a single one.  This means,
7538 for example, that the inliner will be able to inline functions in
7539 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7540
7541 Another (simpler) way to enable link-time optimization is,
7542
7543 @smallexample
7544 gcc -o myprog -flto -O2 foo.c bar.c
7545 @end smallexample
7546
7547 The above will generate bytecode for @file{foo.c} and @file{bar.c},
7548 merge them together into a single GIMPLE representation and optimize
7549 them as usual to produce @file{myprog}.
7550
7551 The only important thing to keep in mind is that to enable link-time
7552 optimizations the @option{-flto} flag needs to be passed to both the
7553 compile and the link commands.
7554
7555 To make whole program optimization effective, it is necessary to make
7556 certain whole program assumptions.  The compiler needs to know
7557 what functions and variables can be accessed by libraries and runtime
7558 outside of the link time optimized unit.  When supported by the linker,
7559 the linker plugin (see @option{-fuse-linker-plugin}) passes to the
7560 compiler information about used and externally visible symbols.  When
7561 the linker plugin is not available, @option{-fwhole-program} should be
7562 used to allow the compiler to make these assumptions, which will lead
7563 to more aggressive optimization decisions.
7564
7565 Note that when a file is compiled with @option{-flto}, the generated
7566 object file will be larger than a regular object file because it will
7567 contain GIMPLE bytecodes and the usual final code.  This means that
7568 object files with LTO information can be linked as a normal object
7569 file.  So, in the previous example, if the final link is done with
7570
7571 @smallexample
7572 gcc -o myprog foo.o bar.o
7573 @end smallexample
7574
7575 The only difference will be that no inter-procedural optimizations
7576 will be applied to produce @file{myprog}.  The two object files
7577 @file{foo.o} and @file{bar.o} will be simply sent to the regular
7578 linker.
7579
7580 Additionally, the optimization flags used to compile individual files
7581 are not necessarily related to those used at link-time.  For instance,
7582
7583 @smallexample
7584 gcc -c -O0 -flto foo.c
7585 gcc -c -O0 -flto bar.c
7586 gcc -o myprog -flto -O3 foo.o bar.o
7587 @end smallexample
7588
7589 This will produce individual object files with unoptimized assembler
7590 code, but the resulting binary @file{myprog} will be optimized at
7591 @option{-O3}.  Now, if the final binary is generated without
7592 @option{-flto}, then @file{myprog} will not be optimized.
7593
7594 When producing the final binary with @option{-flto}, GCC will only
7595 apply link-time optimizations to those files that contain bytecode.
7596 Therefore, you can mix and match object files and libraries with
7597 GIMPLE bytecodes and final object code.  GCC will automatically select
7598 which files to optimize in LTO mode and which files to link without
7599 further processing.
7600
7601 There are some code generation flags that GCC will preserve when
7602 generating bytecodes, as they need to be used during the final link
7603 stage.  Currently, the following options are saved into the GIMPLE
7604 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7605 @option{-m} target flags.
7606
7607 At link time, these options are read-in and reapplied.  Note that the
7608 current implementation makes no attempt at recognizing conflicting
7609 values for these options.  If two or more files have a conflicting
7610 value (e.g., one file is compiled with @option{-fPIC} and another
7611 isn't), the compiler will simply use the last value read from the
7612 bytecode files.  It is recommended, then, that all the files
7613 participating in the same link be compiled with the same options.
7614
7615 Another feature of LTO is that it is possible to apply interprocedural
7616 optimizations on files written in different languages.  This requires
7617 some support in the language front end.  Currently, the C, C++ and
7618 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7619 something like this should work
7620
7621 @smallexample
7622 gcc -c -flto foo.c
7623 g++ -c -flto bar.cc
7624 gfortran -c -flto baz.f90
7625 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7626 @end smallexample
7627
7628 Notice that the final link is done with @command{g++} to get the C++
7629 runtime libraries and @option{-lgfortran} is added to get the Fortran
7630 runtime libraries.  In general, when mixing languages in LTO mode, you
7631 should use the same link command used when mixing languages in a
7632 regular (non-LTO) compilation.  This means that if your build process
7633 was mixing languages before, all you need to add is @option{-flto} to
7634 all the compile and link commands.
7635
7636 If LTO encounters objects with C linkage declared with incompatible
7637 types in separate translation units to be linked together (undefined
7638 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7639 issued.  The behavior is still undefined at runtime.
7640
7641 If object files containing GIMPLE bytecode are stored in a library archive, say
7642 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
7643 are using a linker with linker plugin support.  To enable this feature, use
7644 the flag @option{-fuse-linker-plugin} at link-time:
7645
7646 @smallexample
7647 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7648 @end smallexample
7649
7650 With the linker plugin enabled, the linker will extract the needed
7651 GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
7652 to make them part of the aggregated GIMPLE image to be optimized.
7653
7654 If you are not using a linker with linker plugin support and/or do not 
7655 enable linker plugin then the objects inside @file{libfoo.a}
7656 will be extracted and linked as usual, but they will not participate
7657 in the LTO optimization process.
7658
7659 Link time optimizations do not require the presence of the whole program to
7660 operate.  If the program does not require any symbols to be exported, it is
7661 possible to combine @option{-flto} and with @option{-fwhole-program} to allow
7662 the interprocedural optimizers to use more aggressive assumptions which may
7663 lead to improved optimization opportunities. 
7664 Use of @option{-fwhole-program} is not needed when linker plugin is
7665 active (see @option{-fuse-linker-plugin}).
7666
7667 Regarding portability: the current implementation of LTO makes no
7668 attempt at generating bytecode that can be ported between different
7669 types of hosts.  The bytecode files are versioned and there is a
7670 strict version check, so bytecode files generated in one version of
7671 GCC will not work with an older/newer version of GCC.
7672
7673 Link time optimization does not play well with generating debugging
7674 information.  Combining @option{-flto} with
7675 @option{-g} is currently experimental and expected to produce wrong
7676 results.
7677
7678 If you specify the optional @var{n}, the optimization and code
7679 generation done at link time is executed in parallel using @var{n}
7680 parallel jobs by utilizing an installed @command{make} program.  The
7681 environment variable @env{MAKE} may be used to override the program
7682 used.  The default value for @var{n} is 1.
7683
7684 You can also specify @option{-flto=jobserver} to use GNU make's 
7685 job server mode to determine the number of parallel jobs. This 
7686 is useful when the Makefile calling GCC is already executing in parallel.
7687 The parent Makefile will need a @samp{+} prepended to the command recipe
7688 for this to work. This will likely only work if @env{MAKE} is 
7689 GNU make.
7690
7691 This option is disabled by default.
7692
7693 @item -flto-partition=@var{alg}
7694 @opindex flto-partition
7695 Specify the partitioning algorithm used by the link time optimizer.
7696 The value is either @code{1to1} to specify a partitioning mirroring
7697 the original source files or @code{balanced} to specify partitioning
7698 into equally sized chunks (whenever possible).  Specifying @code{none}
7699 as an algorithm disables partitioning and streaming completely. The
7700 default value is @code{balanced}.
7701
7702 @item -flto-compression-level=@var{n}
7703 This option specifies the level of compression used for intermediate
7704 language written to LTO object files, and is only meaningful in
7705 conjunction with LTO mode (@option{-flto}).  Valid
7706 values are 0 (no compression) to 9 (maximum compression).  Values
7707 outside this range are clamped to either 0 or 9.  If the option is not
7708 given, a default balanced compression setting is used.
7709
7710 @item -flto-report
7711 Prints a report with internal details on the workings of the link-time
7712 optimizer.  The contents of this report vary from version to version,
7713 it is meant to be useful to GCC developers when processing object
7714 files in LTO mode (via @option{-flto}).
7715
7716 Disabled by default.
7717
7718 @item -fuse-linker-plugin
7719 Enables the use of linker plugin during link time optimization.  This option
7720 relies on the linker plugin support in linker that is available in gold
7721 or in GNU ld 2.21 or newer.
7722
7723 This option enables the extraction of object files with GIMPLE bytecode out of
7724 library archives. This improves the quality of optimization by exposing more
7725 code the the link time optimizer.  This information specify what symbols 
7726 can be accessed externally (by non-LTO object or during dynamic linking).
7727 Resulting code quality improvements on binaries (and shared libraries that do
7728 use hidden visibility) is similar to @code{-fwhole-program}.  See
7729 @option{-flto} for a description on the effect of this flag and how to use it.
7730
7731 Enabled by default when LTO support in GCC is enabled and GCC was compiled
7732 with a linker supporting plugins (GNU ld 2.21 or newer or gold).
7733
7734 @item -fcompare-elim
7735 @opindex fcompare-elim
7736 After register allocation and post-register allocation instruction splitting,
7737 identify arithmetic instructions that compute processor flags similar to a
7738 comparison operation based on that arithmetic.  If possible, eliminate the
7739 explicit comparison operation.
7740
7741 This pass only applies to certain targets that cannot explicitly represent
7742 the comparison operation before register allocation is complete.
7743
7744 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7745
7746 @item -fcprop-registers
7747 @opindex fcprop-registers
7748 After register allocation and post-register allocation instruction splitting,
7749 we perform a copy-propagation pass to try to reduce scheduling dependencies
7750 and occasionally eliminate the copy.
7751
7752 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7753
7754 @item -fprofile-correction
7755 @opindex fprofile-correction
7756 Profiles collected using an instrumented binary for multi-threaded programs may
7757 be inconsistent due to missed counter updates. When this option is specified,
7758 GCC will use heuristics to correct or smooth out such inconsistencies. By
7759 default, GCC will emit an error message when an inconsistent profile is detected.
7760
7761 @item -fprofile-dir=@var{path}
7762 @opindex fprofile-dir
7763
7764 Set the directory to search for the profile data files in to @var{path}.
7765 This option affects only the profile data generated by
7766 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
7767 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
7768 and its related options.
7769 By default, GCC will use the current directory as @var{path}, thus the
7770 profile data file will appear in the same directory as the object file.
7771
7772 @item -fprofile-generate
7773 @itemx -fprofile-generate=@var{path}
7774 @opindex fprofile-generate
7775
7776 Enable options usually used for instrumenting application to produce
7777 profile useful for later recompilation with profile feedback based
7778 optimization.  You must use @option{-fprofile-generate} both when
7779 compiling and when linking your program.
7780
7781 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
7782
7783 If @var{path} is specified, GCC will look at the @var{path} to find
7784 the profile feedback data files. See @option{-fprofile-dir}.
7785
7786 @item -fprofile-use
7787 @itemx -fprofile-use=@var{path}
7788 @opindex fprofile-use
7789 Enable profile feedback directed optimizations, and optimizations
7790 generally profitable only with profile feedback available.
7791
7792 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
7793 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
7794
7795 By default, GCC emits an error message if the feedback profiles do not
7796 match the source code.  This error can be turned into a warning by using
7797 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
7798 code.
7799
7800 If @var{path} is specified, GCC will look at the @var{path} to find
7801 the profile feedback data files. See @option{-fprofile-dir}.
7802 @end table
7803
7804 The following options control compiler behavior regarding floating
7805 point arithmetic.  These options trade off between speed and
7806 correctness.  All must be specifically enabled.
7807
7808 @table @gcctabopt
7809 @item -ffloat-store
7810 @opindex ffloat-store
7811 Do not store floating point variables in registers, and inhibit other
7812 options that might change whether a floating point value is taken from a
7813 register or memory.
7814
7815 @cindex floating point precision
7816 This option prevents undesirable excess precision on machines such as
7817 the 68000 where the floating registers (of the 68881) keep more
7818 precision than a @code{double} is supposed to have.  Similarly for the
7819 x86 architecture.  For most programs, the excess precision does only
7820 good, but a few programs rely on the precise definition of IEEE floating
7821 point.  Use @option{-ffloat-store} for such programs, after modifying
7822 them to store all pertinent intermediate computations into variables.
7823
7824 @item -fexcess-precision=@var{style}
7825 @opindex fexcess-precision
7826 This option allows further control over excess precision on machines
7827 where floating-point registers have more precision than the IEEE
7828 @code{float} and @code{double} types and the processor does not
7829 support operations rounding to those types.  By default,
7830 @option{-fexcess-precision=fast} is in effect; this means that
7831 operations are carried out in the precision of the registers and that
7832 it is unpredictable when rounding to the types specified in the source
7833 code takes place.  When compiling C, if
7834 @option{-fexcess-precision=standard} is specified then excess
7835 precision will follow the rules specified in ISO C99; in particular,
7836 both casts and assignments cause values to be rounded to their
7837 semantic types (whereas @option{-ffloat-store} only affects
7838 assignments).  This option is enabled by default for C if a strict
7839 conformance option such as @option{-std=c99} is used.
7840
7841 @opindex mfpmath
7842 @option{-fexcess-precision=standard} is not implemented for languages
7843 other than C, and has no effect if
7844 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
7845 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
7846 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
7847 semantics apply without excess precision, and in the latter, rounding
7848 is unpredictable.
7849
7850 @item -ffast-math
7851 @opindex ffast-math
7852 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
7853 @option{-ffinite-math-only}, @option{-fno-rounding-math},
7854 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
7855
7856 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
7857
7858 This option is not turned on by any @option{-O} option besides
7859 @option{-Ofast} since it can result in incorrect output for programs
7860 which depend on an exact implementation of IEEE or ISO rules/specifications
7861 for math functions. It may, however, yield faster code for programs
7862 that do not require the guarantees of these specifications.
7863
7864 @item -fno-math-errno
7865 @opindex fno-math-errno
7866 Do not set ERRNO after calling math functions that are executed
7867 with a single instruction, e.g., sqrt.  A program that relies on
7868 IEEE exceptions for math error handling may want to use this flag
7869 for speed while maintaining IEEE arithmetic compatibility.
7870
7871 This option is not turned on by any @option{-O} option since
7872 it can result in incorrect output for programs which depend on
7873 an exact implementation of IEEE or ISO rules/specifications for
7874 math functions. It may, however, yield faster code for programs
7875 that do not require the guarantees of these specifications.
7876
7877 The default is @option{-fmath-errno}.
7878
7879 On Darwin systems, the math library never sets @code{errno}.  There is
7880 therefore no reason for the compiler to consider the possibility that
7881 it might, and @option{-fno-math-errno} is the default.
7882
7883 @item -funsafe-math-optimizations
7884 @opindex funsafe-math-optimizations
7885
7886 Allow optimizations for floating-point arithmetic that (a) assume
7887 that arguments and results are valid and (b) may violate IEEE or
7888 ANSI standards.  When used at link-time, it may include libraries
7889 or startup files that change the default FPU control word or other
7890 similar optimizations.
7891
7892 This option is not turned on by any @option{-O} option since
7893 it can result in incorrect output for programs which depend on
7894 an exact implementation of IEEE or ISO rules/specifications for
7895 math functions. It may, however, yield faster code for programs
7896 that do not require the guarantees of these specifications.
7897 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
7898 @option{-fassociative-math} and @option{-freciprocal-math}.
7899
7900 The default is @option{-fno-unsafe-math-optimizations}.
7901
7902 @item -fassociative-math
7903 @opindex fassociative-math
7904
7905 Allow re-association of operands in series of floating-point operations.
7906 This violates the ISO C and C++ language standard by possibly changing
7907 computation result.  NOTE: re-ordering may change the sign of zero as
7908 well as ignore NaNs and inhibit or create underflow or overflow (and
7909 thus cannot be used on a code which relies on rounding behavior like
7910 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
7911 and thus may not be used when ordered comparisons are required.
7912 This option requires that both @option{-fno-signed-zeros} and
7913 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
7914 much sense with @option{-frounding-math}. For Fortran the option
7915 is automatically enabled when both @option{-fno-signed-zeros} and
7916 @option{-fno-trapping-math} are in effect.
7917
7918 The default is @option{-fno-associative-math}.
7919
7920 @item -freciprocal-math
7921 @opindex freciprocal-math
7922
7923 Allow the reciprocal of a value to be used instead of dividing by
7924 the value if this enables optimizations.  For example @code{x / y}
7925 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
7926 is subject to common subexpression elimination.  Note that this loses
7927 precision and increases the number of flops operating on the value.
7928
7929 The default is @option{-fno-reciprocal-math}.
7930
7931 @item -ffinite-math-only
7932 @opindex ffinite-math-only
7933 Allow optimizations for floating-point arithmetic that assume
7934 that arguments and results are not NaNs or +-Infs.
7935
7936 This option is not turned on by any @option{-O} option since
7937 it can result in incorrect output for programs which depend on
7938 an exact implementation of IEEE or ISO rules/specifications for
7939 math functions. It may, however, yield faster code for programs
7940 that do not require the guarantees of these specifications.
7941
7942 The default is @option{-fno-finite-math-only}.
7943
7944 @item -fno-signed-zeros
7945 @opindex fno-signed-zeros
7946 Allow optimizations for floating point arithmetic that ignore the
7947 signedness of zero.  IEEE arithmetic specifies the behavior of
7948 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
7949 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
7950 This option implies that the sign of a zero result isn't significant.
7951
7952 The default is @option{-fsigned-zeros}.
7953
7954 @item -fno-trapping-math
7955 @opindex fno-trapping-math
7956 Compile code assuming that floating-point operations cannot generate
7957 user-visible traps.  These traps include division by zero, overflow,
7958 underflow, inexact result and invalid operation.  This option requires
7959 that @option{-fno-signaling-nans} be in effect.  Setting this option may
7960 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
7961
7962 This option should never be turned on by any @option{-O} option since
7963 it can result in incorrect output for programs which depend on
7964 an exact implementation of IEEE or ISO rules/specifications for
7965 math functions.
7966
7967 The default is @option{-ftrapping-math}.
7968
7969 @item -frounding-math
7970 @opindex frounding-math
7971 Disable transformations and optimizations that assume default floating
7972 point rounding behavior.  This is round-to-zero for all floating point
7973 to integer conversions, and round-to-nearest for all other arithmetic
7974 truncations.  This option should be specified for programs that change
7975 the FP rounding mode dynamically, or that may be executed with a
7976 non-default rounding mode.  This option disables constant folding of
7977 floating point expressions at compile-time (which may be affected by
7978 rounding mode) and arithmetic transformations that are unsafe in the
7979 presence of sign-dependent rounding modes.
7980
7981 The default is @option{-fno-rounding-math}.
7982
7983 This option is experimental and does not currently guarantee to
7984 disable all GCC optimizations that are affected by rounding mode.
7985 Future versions of GCC may provide finer control of this setting
7986 using C99's @code{FENV_ACCESS} pragma.  This command line option
7987 will be used to specify the default state for @code{FENV_ACCESS}.
7988
7989 @item -fsignaling-nans
7990 @opindex fsignaling-nans
7991 Compile code assuming that IEEE signaling NaNs may generate user-visible
7992 traps during floating-point operations.  Setting this option disables
7993 optimizations that may change the number of exceptions visible with
7994 signaling NaNs.  This option implies @option{-ftrapping-math}.
7995
7996 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
7997 be defined.
7998
7999 The default is @option{-fno-signaling-nans}.
8000
8001 This option is experimental and does not currently guarantee to
8002 disable all GCC optimizations that affect signaling NaN behavior.
8003
8004 @item -fsingle-precision-constant
8005 @opindex fsingle-precision-constant
8006 Treat floating point constant as single precision constant instead of
8007 implicitly converting it to double precision constant.
8008
8009 @item -fcx-limited-range
8010 @opindex fcx-limited-range
8011 When enabled, this option states that a range reduction step is not
8012 needed when performing complex division.  Also, there is no checking
8013 whether the result of a complex multiplication or division is @code{NaN
8014 + I*NaN}, with an attempt to rescue the situation in that case.  The
8015 default is @option{-fno-cx-limited-range}, but is enabled by
8016 @option{-ffast-math}.
8017
8018 This option controls the default setting of the ISO C99
8019 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8020 all languages.
8021
8022 @item -fcx-fortran-rules
8023 @opindex fcx-fortran-rules
8024 Complex multiplication and division follow Fortran rules.  Range
8025 reduction is done as part of complex division, but there is no checking
8026 whether the result of a complex multiplication or division is @code{NaN
8027 + I*NaN}, with an attempt to rescue the situation in that case.
8028
8029 The default is @option{-fno-cx-fortran-rules}.
8030
8031 @end table
8032
8033 The following options control optimizations that may improve
8034 performance, but are not enabled by any @option{-O} options.  This
8035 section includes experimental options that may produce broken code.
8036
8037 @table @gcctabopt
8038 @item -fbranch-probabilities
8039 @opindex fbranch-probabilities
8040 After running a program compiled with @option{-fprofile-arcs}
8041 (@pxref{Debugging Options,, Options for Debugging Your Program or
8042 @command{gcc}}), you can compile it a second time using
8043 @option{-fbranch-probabilities}, to improve optimizations based on
8044 the number of times each branch was taken.  When the program
8045 compiled with @option{-fprofile-arcs} exits it saves arc execution
8046 counts to a file called @file{@var{sourcename}.gcda} for each source
8047 file.  The information in this data file is very dependent on the
8048 structure of the generated code, so you must use the same source code
8049 and the same optimization options for both compilations.
8050
8051 With @option{-fbranch-probabilities}, GCC puts a
8052 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8053 These can be used to improve optimization.  Currently, they are only
8054 used in one place: in @file{reorg.c}, instead of guessing which path a
8055 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8056 exactly determine which path is taken more often.
8057
8058 @item -fprofile-values
8059 @opindex fprofile-values
8060 If combined with @option{-fprofile-arcs}, it adds code so that some
8061 data about values of expressions in the program is gathered.
8062
8063 With @option{-fbranch-probabilities}, it reads back the data gathered
8064 from profiling values of expressions for usage in optimizations.
8065
8066 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8067
8068 @item -fvpt
8069 @opindex fvpt
8070 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
8071 a code to gather information about values of expressions.
8072
8073 With @option{-fbranch-probabilities}, it reads back the data gathered
8074 and actually performs the optimizations based on them.
8075 Currently the optimizations include specialization of division operation
8076 using the knowledge about the value of the denominator.
8077
8078 @item -frename-registers
8079 @opindex frename-registers
8080 Attempt to avoid false dependencies in scheduled code by making use
8081 of registers left over after register allocation.  This optimization
8082 will most benefit processors with lots of registers.  Depending on the
8083 debug information format adopted by the target, however, it can
8084 make debugging impossible, since variables will no longer stay in
8085 a ``home register''.
8086
8087 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8088
8089 @item -ftracer
8090 @opindex ftracer
8091 Perform tail duplication to enlarge superblock size.  This transformation
8092 simplifies the control flow of the function allowing other optimizations to do
8093 better job.
8094
8095 Enabled with @option{-fprofile-use}.
8096
8097 @item -funroll-loops
8098 @opindex funroll-loops
8099 Unroll loops whose number of iterations can be determined at compile time or
8100 upon entry to the loop.  @option{-funroll-loops} implies
8101 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8102 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8103 small constant number of iterations).  This option makes code larger, and may
8104 or may not make it run faster.
8105
8106 Enabled with @option{-fprofile-use}.
8107
8108 @item -funroll-all-loops
8109 @opindex funroll-all-loops
8110 Unroll all loops, even if their number of iterations is uncertain when
8111 the loop is entered.  This usually makes programs run more slowly.
8112 @option{-funroll-all-loops} implies the same options as
8113 @option{-funroll-loops}.
8114
8115 @item -fpeel-loops
8116 @opindex fpeel-loops
8117 Peels the loops for that there is enough information that they do not
8118 roll much (from profile feedback).  It also turns on complete loop peeling
8119 (i.e.@: complete removal of loops with small constant number of iterations).
8120
8121 Enabled with @option{-fprofile-use}.
8122
8123 @item -fmove-loop-invariants
8124 @opindex fmove-loop-invariants
8125 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8126 at level @option{-O1}
8127
8128 @item -funswitch-loops
8129 @opindex funswitch-loops
8130 Move branches with loop invariant conditions out of the loop, with duplicates
8131 of the loop on both branches (modified according to result of the condition).
8132
8133 @item -ffunction-sections
8134 @itemx -fdata-sections
8135 @opindex ffunction-sections
8136 @opindex fdata-sections
8137 Place each function or data item into its own section in the output
8138 file if the target supports arbitrary sections.  The name of the
8139 function or the name of the data item determines the section's name
8140 in the output file.
8141
8142 Use these options on systems where the linker can perform optimizations
8143 to improve locality of reference in the instruction space.  Most systems
8144 using the ELF object format and SPARC processors running Solaris 2 have
8145 linkers with such optimizations.  AIX may have these optimizations in
8146 the future.
8147
8148 Only use these options when there are significant benefits from doing
8149 so.  When you specify these options, the assembler and linker will
8150 create larger object and executable files and will also be slower.
8151 You will not be able to use @code{gprof} on all systems if you
8152 specify this option and you may have problems with debugging if
8153 you specify both this option and @option{-g}.
8154
8155 @item -fbranch-target-load-optimize
8156 @opindex fbranch-target-load-optimize
8157 Perform branch target register load optimization before prologue / epilogue
8158 threading.
8159 The use of target registers can typically be exposed only during reload,
8160 thus hoisting loads out of loops and doing inter-block scheduling needs
8161 a separate optimization pass.
8162
8163 @item -fbranch-target-load-optimize2
8164 @opindex fbranch-target-load-optimize2
8165 Perform branch target register load optimization after prologue / epilogue
8166 threading.
8167
8168 @item -fbtr-bb-exclusive
8169 @opindex fbtr-bb-exclusive
8170 When performing branch target register load optimization, don't reuse
8171 branch target registers in within any basic block.
8172
8173 @item -fstack-protector
8174 @opindex fstack-protector
8175 Emit extra code to check for buffer overflows, such as stack smashing
8176 attacks.  This is done by adding a guard variable to functions with
8177 vulnerable objects.  This includes functions that call alloca, and
8178 functions with buffers larger than 8 bytes.  The guards are initialized
8179 when a function is entered and then checked when the function exits.
8180 If a guard check fails, an error message is printed and the program exits.
8181
8182 @item -fstack-protector-all
8183 @opindex fstack-protector-all
8184 Like @option{-fstack-protector} except that all functions are protected.
8185
8186 @item -fsection-anchors
8187 @opindex fsection-anchors
8188 Try to reduce the number of symbolic address calculations by using
8189 shared ``anchor'' symbols to address nearby objects.  This transformation
8190 can help to reduce the number of GOT entries and GOT accesses on some
8191 targets.
8192
8193 For example, the implementation of the following function @code{foo}:
8194
8195 @smallexample
8196 static int a, b, c;
8197 int foo (void) @{ return a + b + c; @}
8198 @end smallexample
8199
8200 would usually calculate the addresses of all three variables, but if you
8201 compile it with @option{-fsection-anchors}, it will access the variables
8202 from a common anchor point instead.  The effect is similar to the
8203 following pseudocode (which isn't valid C):
8204
8205 @smallexample
8206 int foo (void)
8207 @{
8208   register int *xr = &x;
8209   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8210 @}
8211 @end smallexample
8212
8213 Not all targets support this option.
8214
8215 @item --param @var{name}=@var{value}
8216 @opindex param
8217 In some places, GCC uses various constants to control the amount of
8218 optimization that is done.  For example, GCC will not inline functions
8219 that contain more that a certain number of instructions.  You can
8220 control some of these constants on the command-line using the
8221 @option{--param} option.
8222
8223 The names of specific parameters, and the meaning of the values, are
8224 tied to the internals of the compiler, and are subject to change
8225 without notice in future releases.
8226
8227 In each case, the @var{value} is an integer.  The allowable choices for
8228 @var{name} are given in the following table:
8229
8230 @table @gcctabopt
8231 @item struct-reorg-cold-struct-ratio
8232 The threshold ratio (as a percentage) between a structure frequency
8233 and the frequency of the hottest structure in the program.  This parameter
8234 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
8235 We say that if the ratio of a structure frequency, calculated by profiling,
8236 to the hottest structure frequency in the program is less than this
8237 parameter, then structure reorganization is not applied to this structure.
8238 The default is 10.
8239
8240 @item predictable-branch-outcome
8241 When branch is predicted to be taken with probability lower than this threshold
8242 (in percent), then it is considered well predictable. The default is 10.
8243
8244 @item max-crossjump-edges
8245 The maximum number of incoming edges to consider for crossjumping.
8246 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8247 the number of edges incoming to each block.  Increasing values mean
8248 more aggressive optimization, making the compile time increase with
8249 probably small improvement in executable size.
8250
8251 @item min-crossjump-insns
8252 The minimum number of instructions which must be matched at the end
8253 of two blocks before crossjumping will be performed on them.  This
8254 value is ignored in the case where all instructions in the block being
8255 crossjumped from are matched.  The default value is 5.
8256
8257 @item max-grow-copy-bb-insns
8258 The maximum code size expansion factor when copying basic blocks
8259 instead of jumping.  The expansion is relative to a jump instruction.
8260 The default value is 8.
8261
8262 @item max-goto-duplication-insns
8263 The maximum number of instructions to duplicate to a block that jumps
8264 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8265 passes, GCC factors computed gotos early in the compilation process,
8266 and unfactors them as late as possible.  Only computed jumps at the
8267 end of a basic blocks with no more than max-goto-duplication-insns are
8268 unfactored.  The default value is 8.
8269
8270 @item max-delay-slot-insn-search
8271 The maximum number of instructions to consider when looking for an
8272 instruction to fill a delay slot.  If more than this arbitrary number of
8273 instructions is searched, the time savings from filling the delay slot
8274 will be minimal so stop searching.  Increasing values mean more
8275 aggressive optimization, making the compile time increase with probably
8276 small improvement in executable run time.
8277
8278 @item max-delay-slot-live-search
8279 When trying to fill delay slots, the maximum number of instructions to
8280 consider when searching for a block with valid live register
8281 information.  Increasing this arbitrarily chosen value means more
8282 aggressive optimization, increasing the compile time.  This parameter
8283 should be removed when the delay slot code is rewritten to maintain the
8284 control-flow graph.
8285
8286 @item max-gcse-memory
8287 The approximate maximum amount of memory that will be allocated in
8288 order to perform the global common subexpression elimination
8289 optimization.  If more memory than specified is required, the
8290 optimization will not be done.
8291
8292 @item max-gcse-insertion-ratio
8293 If the ratio of expression insertions to deletions is larger than this value
8294 for any expression, then RTL PRE will insert or remove the expression and thus
8295 leave partially redundant computations in the instruction stream.  The default value is 20.
8296
8297 @item max-pending-list-length
8298 The maximum number of pending dependencies scheduling will allow
8299 before flushing the current state and starting over.  Large functions
8300 with few branches or calls can create excessively large lists which
8301 needlessly consume memory and resources.
8302
8303 @item max-inline-insns-single
8304 Several parameters control the tree inliner used in gcc.
8305 This number sets the maximum number of instructions (counted in GCC's
8306 internal representation) in a single function that the tree inliner
8307 will consider for inlining.  This only affects functions declared
8308 inline and methods implemented in a class declaration (C++).
8309 The default value is 400.
8310
8311 @item max-inline-insns-auto
8312 When you use @option{-finline-functions} (included in @option{-O3}),
8313 a lot of functions that would otherwise not be considered for inlining
8314 by the compiler will be investigated.  To those functions, a different
8315 (more restrictive) limit compared to functions declared inline can
8316 be applied.
8317 The default value is 40.
8318
8319 @item large-function-insns
8320 The limit specifying really large functions.  For functions larger than this
8321 limit after inlining, inlining is constrained by
8322 @option{--param large-function-growth}.  This parameter is useful primarily
8323 to avoid extreme compilation time caused by non-linear algorithms used by the
8324 backend.
8325 The default value is 2700.
8326
8327 @item large-function-growth
8328 Specifies maximal growth of large function caused by inlining in percents.
8329 The default value is 100 which limits large function growth to 2.0 times
8330 the original size.
8331
8332 @item large-unit-insns
8333 The limit specifying large translation unit.  Growth caused by inlining of
8334 units larger than this limit is limited by @option{--param inline-unit-growth}.
8335 For small units this might be too tight (consider unit consisting of function A
8336 that is inline and B that just calls A three time.  If B is small relative to
8337 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8338 large units consisting of small inlineable functions however the overall unit
8339 growth limit is needed to avoid exponential explosion of code size.  Thus for
8340 smaller units, the size is increased to @option{--param large-unit-insns}
8341 before applying @option{--param inline-unit-growth}.  The default is 10000
8342
8343 @item inline-unit-growth
8344 Specifies maximal overall growth of the compilation unit caused by inlining.
8345 The default value is 30 which limits unit growth to 1.3 times the original
8346 size.
8347
8348 @item ipcp-unit-growth
8349 Specifies maximal overall growth of the compilation unit caused by
8350 interprocedural constant propagation.  The default value is 10 which limits
8351 unit growth to 1.1 times the original size.
8352
8353 @item large-stack-frame
8354 The limit specifying large stack frames.  While inlining the algorithm is trying
8355 to not grow past this limit too much.  Default value is 256 bytes.
8356
8357 @item large-stack-frame-growth
8358 Specifies maximal growth of large stack frames caused by inlining in percents.
8359 The default value is 1000 which limits large stack frame growth to 11 times
8360 the original size.
8361
8362 @item max-inline-insns-recursive
8363 @itemx max-inline-insns-recursive-auto
8364 Specifies maximum number of instructions out-of-line copy of self recursive inline
8365 function can grow into by performing recursive inlining.
8366
8367 For functions declared inline @option{--param max-inline-insns-recursive} is
8368 taken into account.  For function not declared inline, recursive inlining
8369 happens only when @option{-finline-functions} (included in @option{-O3}) is
8370 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8371 default value is 450.
8372
8373 @item max-inline-recursive-depth
8374 @itemx max-inline-recursive-depth-auto
8375 Specifies maximum recursion depth used by the recursive inlining.
8376
8377 For functions declared inline @option{--param max-inline-recursive-depth} is
8378 taken into account.  For function not declared inline, recursive inlining
8379 happens only when @option{-finline-functions} (included in @option{-O3}) is
8380 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8381 default value is 8.
8382
8383 @item min-inline-recursive-probability
8384 Recursive inlining is profitable only for function having deep recursion
8385 in average and can hurt for function having little recursion depth by
8386 increasing the prologue size or complexity of function body to other
8387 optimizers.
8388
8389 When profile feedback is available (see @option{-fprofile-generate}) the actual
8390 recursion depth can be guessed from probability that function will recurse via
8391 given call expression.  This parameter limits inlining only to call expression
8392 whose probability exceeds given threshold (in percents).  The default value is
8393 10.
8394
8395 @item early-inlining-insns
8396 Specify growth that early inliner can make.  In effect it increases amount of
8397 inlining for code having large abstraction penalty.  The default value is 10.
8398
8399 @item max-early-inliner-iterations
8400 @itemx max-early-inliner-iterations
8401 Limit of iterations of early inliner.  This basically bounds number of nested
8402 indirect calls early inliner can resolve.  Deeper chains are still handled by
8403 late inlining.
8404
8405 @item comdat-sharing-probability
8406 @itemx comdat-sharing-probability
8407 Probability (in percent) that C++ inline function with comdat visibility
8408 will be shared across multiple compilation units.  The default value is 20.
8409
8410 @item min-vect-loop-bound
8411 The minimum number of iterations under which a loop will not get vectorized
8412 when @option{-ftree-vectorize} is used.  The number of iterations after
8413 vectorization needs to be greater than the value specified by this option
8414 to allow vectorization.  The default value is 0.
8415
8416 @item gcse-cost-distance-ratio
8417 Scaling factor in calculation of maximum distance an expression
8418 can be moved by GCSE optimizations.  This is currently supported only in the
8419 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
8420 will be with simple expressions, i.e., the expressions which have cost
8421 less than @option{gcse-unrestricted-cost}.  Specifying 0 will disable
8422 hoisting of simple expressions.  The default value is 10.
8423
8424 @item gcse-unrestricted-cost
8425 Cost, roughly measured as the cost of a single typical machine
8426 instruction, at which GCSE optimizations will not constrain
8427 the distance an expression can travel.  This is currently
8428 supported only in the code hoisting pass.  The lesser the cost,
8429 the more aggressive code hoisting will be.  Specifying 0 will
8430 allow all expressions to travel unrestricted distances.
8431 The default value is 3.
8432
8433 @item max-hoist-depth
8434 The depth of search in the dominator tree for expressions to hoist.
8435 This is used to avoid quadratic behavior in hoisting algorithm.
8436 The value of 0 will avoid limiting the search, but may slow down compilation
8437 of huge functions.  The default value is 30.
8438
8439 @item max-unrolled-insns
8440 The maximum number of instructions that a loop should have if that loop
8441 is unrolled, and if the loop is unrolled, it determines how many times
8442 the loop code is unrolled.
8443
8444 @item max-average-unrolled-insns
8445 The maximum number of instructions biased by probabilities of their execution
8446 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8447 it determines how many times the loop code is unrolled.
8448
8449 @item max-unroll-times
8450 The maximum number of unrollings of a single loop.
8451
8452 @item max-peeled-insns
8453 The maximum number of instructions that a loop should have if that loop
8454 is peeled, and if the loop is peeled, it determines how many times
8455 the loop code is peeled.
8456
8457 @item max-peel-times
8458 The maximum number of peelings of a single loop.
8459
8460 @item max-completely-peeled-insns
8461 The maximum number of insns of a completely peeled loop.
8462
8463 @item max-completely-peel-times
8464 The maximum number of iterations of a loop to be suitable for complete peeling.
8465
8466 @item max-completely-peel-loop-nest-depth
8467 The maximum depth of a loop nest suitable for complete peeling.
8468
8469 @item max-unswitch-insns
8470 The maximum number of insns of an unswitched loop.
8471
8472 @item max-unswitch-level
8473 The maximum number of branches unswitched in a single loop.
8474
8475 @item lim-expensive
8476 The minimum cost of an expensive expression in the loop invariant motion.
8477
8478 @item iv-consider-all-candidates-bound
8479 Bound on number of candidates for induction variables below that
8480 all candidates are considered for each use in induction variable
8481 optimizations.  Only the most relevant candidates are considered
8482 if there are more candidates, to avoid quadratic time complexity.
8483
8484 @item iv-max-considered-uses
8485 The induction variable optimizations give up on loops that contain more
8486 induction variable uses.
8487
8488 @item iv-always-prune-cand-set-bound
8489 If number of candidates in the set is smaller than this value,
8490 we always try to remove unnecessary ivs from the set during its
8491 optimization when a new iv is added to the set.
8492
8493 @item scev-max-expr-size
8494 Bound on size of expressions used in the scalar evolutions analyzer.
8495 Large expressions slow the analyzer.
8496
8497 @item scev-max-expr-complexity
8498 Bound on the complexity of the expressions in the scalar evolutions analyzer.
8499 Complex expressions slow the analyzer.
8500
8501 @item omega-max-vars
8502 The maximum number of variables in an Omega constraint system.
8503 The default value is 128.
8504
8505 @item omega-max-geqs
8506 The maximum number of inequalities in an Omega constraint system.
8507 The default value is 256.
8508
8509 @item omega-max-eqs
8510 The maximum number of equalities in an Omega constraint system.
8511 The default value is 128.
8512
8513 @item omega-max-wild-cards
8514 The maximum number of wildcard variables that the Omega solver will
8515 be able to insert.  The default value is 18.
8516
8517 @item omega-hash-table-size
8518 The size of the hash table in the Omega solver.  The default value is
8519 550.
8520
8521 @item omega-max-keys
8522 The maximal number of keys used by the Omega solver.  The default
8523 value is 500.
8524
8525 @item omega-eliminate-redundant-constraints
8526 When set to 1, use expensive methods to eliminate all redundant
8527 constraints.  The default value is 0.
8528
8529 @item vect-max-version-for-alignment-checks
8530 The maximum number of runtime checks that can be performed when
8531 doing loop versioning for alignment in the vectorizer.  See option
8532 ftree-vect-loop-version for more information.
8533
8534 @item vect-max-version-for-alias-checks
8535 The maximum number of runtime checks that can be performed when
8536 doing loop versioning for alias in the vectorizer.  See option
8537 ftree-vect-loop-version for more information.
8538
8539 @item max-iterations-to-track
8540
8541 The maximum number of iterations of a loop the brute force algorithm
8542 for analysis of # of iterations of the loop tries to evaluate.
8543
8544 @item hot-bb-count-fraction
8545 Select fraction of the maximal count of repetitions of basic block in program
8546 given basic block needs to have to be considered hot.
8547
8548 @item hot-bb-frequency-fraction
8549 Select fraction of the entry block frequency of executions of basic block in
8550 function given basic block needs to have to be considered hot
8551
8552 @item max-predicted-iterations
8553 The maximum number of loop iterations we predict statically.  This is useful
8554 in cases where function contain single loop with known bound and other loop
8555 with unknown.  We predict the known number of iterations correctly, while
8556 the unknown number of iterations average to roughly 10.  This means that the
8557 loop without bounds would appear artificially cold relative to the other one.
8558
8559 @item align-threshold
8560
8561 Select fraction of the maximal frequency of executions of basic block in
8562 function given basic block will get aligned.
8563
8564 @item align-loop-iterations
8565
8566 A loop expected to iterate at lest the selected number of iterations will get
8567 aligned.
8568
8569 @item tracer-dynamic-coverage
8570 @itemx tracer-dynamic-coverage-feedback
8571
8572 This value is used to limit superblock formation once the given percentage of
8573 executed instructions is covered.  This limits unnecessary code size
8574 expansion.
8575
8576 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8577 feedback is available.  The real profiles (as opposed to statically estimated
8578 ones) are much less balanced allowing the threshold to be larger value.
8579
8580 @item tracer-max-code-growth
8581 Stop tail duplication once code growth has reached given percentage.  This is
8582 rather hokey argument, as most of the duplicates will be eliminated later in
8583 cross jumping, so it may be set to much higher values than is the desired code
8584 growth.
8585
8586 @item tracer-min-branch-ratio
8587
8588 Stop reverse growth when the reverse probability of best edge is less than this
8589 threshold (in percent).
8590
8591 @item tracer-min-branch-ratio
8592 @itemx tracer-min-branch-ratio-feedback
8593
8594 Stop forward growth if the best edge do have probability lower than this
8595 threshold.
8596
8597 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8598 compilation for profile feedback and one for compilation without.  The value
8599 for compilation with profile feedback needs to be more conservative (higher) in
8600 order to make tracer effective.
8601
8602 @item max-cse-path-length
8603
8604 Maximum number of basic blocks on path that cse considers.  The default is 10.
8605
8606 @item max-cse-insns
8607 The maximum instructions CSE process before flushing. The default is 1000.
8608
8609 @item ggc-min-expand
8610
8611 GCC uses a garbage collector to manage its own memory allocation.  This
8612 parameter specifies the minimum percentage by which the garbage
8613 collector's heap should be allowed to expand between collections.
8614 Tuning this may improve compilation speed; it has no effect on code
8615 generation.
8616
8617 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8618 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
8619 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8620 GCC is not able to calculate RAM on a particular platform, the lower
8621 bound of 30% is used.  Setting this parameter and
8622 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8623 every opportunity.  This is extremely slow, but can be useful for
8624 debugging.
8625
8626 @item ggc-min-heapsize
8627
8628 Minimum size of the garbage collector's heap before it begins bothering
8629 to collect garbage.  The first collection occurs after the heap expands
8630 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8631 tuning this may improve compilation speed, and has no effect on code
8632 generation.
8633
8634 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
8635 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8636 with a lower bound of 4096 (four megabytes) and an upper bound of
8637 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8638 particular platform, the lower bound is used.  Setting this parameter
8639 very large effectively disables garbage collection.  Setting this
8640 parameter and @option{ggc-min-expand} to zero causes a full collection
8641 to occur at every opportunity.
8642
8643 @item max-reload-search-insns
8644 The maximum number of instruction reload should look backward for equivalent
8645 register.  Increasing values mean more aggressive optimization, making the
8646 compile time increase with probably slightly better performance.  The default
8647 value is 100.
8648
8649 @item max-cselib-memory-locations
8650 The maximum number of memory locations cselib should take into account.
8651 Increasing values mean more aggressive optimization, making the compile time
8652 increase with probably slightly better performance.  The default value is 500.
8653
8654 @item reorder-blocks-duplicate
8655 @itemx reorder-blocks-duplicate-feedback
8656
8657 Used by basic block reordering pass to decide whether to use unconditional
8658 branch or duplicate the code on its destination.  Code is duplicated when its
8659 estimated size is smaller than this value multiplied by the estimated size of
8660 unconditional jump in the hot spots of the program.
8661
8662 The @option{reorder-block-duplicate-feedback} is used only when profile
8663 feedback is available and may be set to higher values than
8664 @option{reorder-block-duplicate} since information about the hot spots is more
8665 accurate.
8666
8667 @item max-sched-ready-insns
8668 The maximum number of instructions ready to be issued the scheduler should
8669 consider at any given time during the first scheduling pass.  Increasing
8670 values mean more thorough searches, making the compilation time increase
8671 with probably little benefit.  The default value is 100.
8672
8673 @item max-sched-region-blocks
8674 The maximum number of blocks in a region to be considered for
8675 interblock scheduling.  The default value is 10.
8676
8677 @item max-pipeline-region-blocks
8678 The maximum number of blocks in a region to be considered for
8679 pipelining in the selective scheduler.  The default value is 15.
8680
8681 @item max-sched-region-insns
8682 The maximum number of insns in a region to be considered for
8683 interblock scheduling.  The default value is 100.
8684
8685 @item max-pipeline-region-insns
8686 The maximum number of insns in a region to be considered for
8687 pipelining in the selective scheduler.  The default value is 200.
8688
8689 @item min-spec-prob
8690 The minimum probability (in percents) of reaching a source block
8691 for interblock speculative scheduling.  The default value is 40.
8692
8693 @item max-sched-extend-regions-iters
8694 The maximum number of iterations through CFG to extend regions.
8695 0 - disable region extension,
8696 N - do at most N iterations.
8697 The default value is 0.
8698
8699 @item max-sched-insn-conflict-delay
8700 The maximum conflict delay for an insn to be considered for speculative motion.
8701 The default value is 3.
8702
8703 @item sched-spec-prob-cutoff
8704 The minimal probability of speculation success (in percents), so that
8705 speculative insn will be scheduled.
8706 The default value is 40.
8707
8708 @item sched-mem-true-dep-cost
8709 Minimal distance (in CPU cycles) between store and load targeting same
8710 memory locations.  The default value is 1.
8711
8712 @item selsched-max-lookahead
8713 The maximum size of the lookahead window of selective scheduling.  It is a
8714 depth of search for available instructions.
8715 The default value is 50.
8716
8717 @item selsched-max-sched-times
8718 The maximum number of times that an instruction will be scheduled during
8719 selective scheduling.  This is the limit on the number of iterations
8720 through which the instruction may be pipelined.  The default value is 2.
8721
8722 @item selsched-max-insns-to-rename
8723 The maximum number of best instructions in the ready list that are considered
8724 for renaming in the selective scheduler.  The default value is 2.
8725
8726 @item max-last-value-rtl
8727 The maximum size measured as number of RTLs that can be recorded in an expression
8728 in combiner for a pseudo register as last known value of that register.  The default
8729 is 10000.
8730
8731 @item integer-share-limit
8732 Small integer constants can use a shared data structure, reducing the
8733 compiler's memory usage and increasing its speed.  This sets the maximum
8734 value of a shared integer constant.  The default value is 256.
8735
8736 @item min-virtual-mappings
8737 Specifies the minimum number of virtual mappings in the incremental
8738 SSA updater that should be registered to trigger the virtual mappings
8739 heuristic defined by virtual-mappings-ratio.  The default value is
8740 100.
8741
8742 @item virtual-mappings-ratio
8743 If the number of virtual mappings is virtual-mappings-ratio bigger
8744 than the number of virtual symbols to be updated, then the incremental
8745 SSA updater switches to a full update for those symbols.  The default
8746 ratio is 3.
8747
8748 @item ssp-buffer-size
8749 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
8750 protection when @option{-fstack-protection} is used.
8751
8752 @item max-jump-thread-duplication-stmts
8753 Maximum number of statements allowed in a block that needs to be
8754 duplicated when threading jumps.
8755
8756 @item max-fields-for-field-sensitive
8757 Maximum number of fields in a structure we will treat in
8758 a field sensitive manner during pointer analysis.  The default is zero
8759 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
8760
8761 @item prefetch-latency
8762 Estimate on average number of instructions that are executed before
8763 prefetch finishes.  The distance we prefetch ahead is proportional
8764 to this constant.  Increasing this number may also lead to less
8765 streams being prefetched (see @option{simultaneous-prefetches}).
8766
8767 @item simultaneous-prefetches
8768 Maximum number of prefetches that can run at the same time.
8769
8770 @item l1-cache-line-size
8771 The size of cache line in L1 cache, in bytes.
8772
8773 @item l1-cache-size
8774 The size of L1 cache, in kilobytes.
8775
8776 @item l2-cache-size
8777 The size of L2 cache, in kilobytes.
8778
8779 @item min-insn-to-prefetch-ratio
8780 The minimum ratio between the number of instructions and the
8781 number of prefetches to enable prefetching in a loop.
8782
8783 @item prefetch-min-insn-to-mem-ratio
8784 The minimum ratio between the number of instructions and the
8785 number of memory references to enable prefetching in a loop.
8786
8787 @item use-canonical-types
8788 Whether the compiler should use the ``canonical'' type system.  By
8789 default, this should always be 1, which uses a more efficient internal
8790 mechanism for comparing types in C++ and Objective-C++.  However, if
8791 bugs in the canonical type system are causing compilation failures,
8792 set this value to 0 to disable canonical types.
8793
8794 @item switch-conversion-max-branch-ratio
8795 Switch initialization conversion will refuse to create arrays that are
8796 bigger than @option{switch-conversion-max-branch-ratio} times the number of
8797 branches in the switch.
8798
8799 @item max-partial-antic-length
8800 Maximum length of the partial antic set computed during the tree
8801 partial redundancy elimination optimization (@option{-ftree-pre}) when
8802 optimizing at @option{-O3} and above.  For some sorts of source code
8803 the enhanced partial redundancy elimination optimization can run away,
8804 consuming all of the memory available on the host machine.  This
8805 parameter sets a limit on the length of the sets that are computed,
8806 which prevents the runaway behavior.  Setting a value of 0 for
8807 this parameter will allow an unlimited set length.
8808
8809 @item sccvn-max-scc-size
8810 Maximum size of a strongly connected component (SCC) during SCCVN
8811 processing.  If this limit is hit, SCCVN processing for the whole
8812 function will not be done and optimizations depending on it will
8813 be disabled.  The default maximum SCC size is 10000.
8814
8815 @item ira-max-loops-num
8816 IRA uses a regional register allocation by default.  If a function
8817 contains loops more than number given by the parameter, only at most
8818 given number of the most frequently executed loops will form regions
8819 for the regional register allocation.  The default value of the
8820 parameter is 100.
8821
8822 @item ira-max-conflict-table-size
8823 Although IRA uses a sophisticated algorithm of compression conflict
8824 table, the table can be still big for huge functions.  If the conflict
8825 table for a function could be more than size in MB given by the
8826 parameter, the conflict table is not built and faster, simpler, and
8827 lower quality register allocation algorithm will be used.  The
8828 algorithm do not use pseudo-register conflicts.  The default value of
8829 the parameter is 2000.
8830
8831 @item ira-loop-reserved-regs
8832 IRA can be used to evaluate more accurate register pressure in loops
8833 for decision to move loop invariants (see @option{-O3}).  The number
8834 of available registers reserved for some other purposes is described
8835 by this parameter.  The default value of the parameter is 2 which is
8836 minimal number of registers needed for execution of typical
8837 instruction.  This value is the best found from numerous experiments.
8838
8839 @item loop-invariant-max-bbs-in-loop
8840 Loop invariant motion can be very expensive, both in compile time and
8841 in amount of needed compile time memory, with very large loops.  Loops
8842 with more basic blocks than this parameter won't have loop invariant
8843 motion optimization performed on them.  The default value of the
8844 parameter is 1000 for -O1 and 10000 for -O2 and above.
8845
8846 @item max-vartrack-size
8847 Sets a maximum number of hash table slots to use during variable
8848 tracking dataflow analysis of any function.  If this limit is exceeded
8849 with variable tracking at assignments enabled, analysis for that
8850 function is retried without it, after removing all debug insns from
8851 the function.  If the limit is exceeded even without debug insns, var
8852 tracking analysis is completely disabled for the function.  Setting
8853 the parameter to zero makes it unlimited.
8854
8855 @item min-nondebug-insn-uid
8856 Use uids starting at this parameter for nondebug insns.  The range below
8857 the parameter is reserved exclusively for debug insns created by
8858 @option{-fvar-tracking-assignments}, but debug insns may get
8859 (non-overlapping) uids above it if the reserved range is exhausted.
8860
8861 @item ipa-sra-ptr-growth-factor
8862 IPA-SRA will replace a pointer to an aggregate with one or more new
8863 parameters only when their cumulative size is less or equal to
8864 @option{ipa-sra-ptr-growth-factor} times the size of the original
8865 pointer parameter.
8866
8867 @item graphite-max-nb-scop-params
8868 To avoid exponential effects in the Graphite loop transforms, the
8869 number of parameters in a Static Control Part (SCoP) is bounded.  The
8870 default value is 10 parameters.  A variable whose value is unknown at
8871 compile time and defined outside a SCoP is a parameter of the SCoP.
8872
8873 @item graphite-max-bbs-per-function
8874 To avoid exponential effects in the detection of SCoPs, the size of
8875 the functions analyzed by Graphite is bounded.  The default value is
8876 100 basic blocks.
8877
8878 @item loop-block-tile-size
8879 Loop blocking or strip mining transforms, enabled with
8880 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
8881 loop in the loop nest by a given number of iterations.  The strip
8882 length can be changed using the @option{loop-block-tile-size}
8883 parameter.  The default value is 51 iterations.
8884
8885 @item devirt-type-list-size
8886 IPA-CP attempts to track all possible types passed to a function's
8887 parameter in order to perform devirtualization.
8888 @option{devirt-type-list-size} is the maximum number of types it
8889 stores per a single formal parameter of a function.
8890
8891 @item lto-partitions
8892 Specify desired number of partitions produced during WHOPR compilation.
8893 The number of partitions should exceed the number of CPUs used for compilation.
8894 The default value is 32.
8895
8896 @item lto-minpartition
8897 Size of minimal partition for WHOPR (in estimated instructions).
8898 This prevents expenses of splitting very small programs into too many
8899 partitions.
8900
8901 @item cxx-max-namespaces-for-diagnostic-help
8902 The maximum number of namespaces to consult for suggestions when C++
8903 name lookup fails for an identifier.  The default is 1000.
8904
8905 @end table
8906 @end table
8907
8908 @node Preprocessor Options
8909 @section Options Controlling the Preprocessor
8910 @cindex preprocessor options
8911 @cindex options, preprocessor
8912
8913 These options control the C preprocessor, which is run on each C source
8914 file before actual compilation.
8915
8916 If you use the @option{-E} option, nothing is done except preprocessing.
8917 Some of these options make sense only together with @option{-E} because
8918 they cause the preprocessor output to be unsuitable for actual
8919 compilation.
8920
8921 @table @gcctabopt
8922 @item -Wp,@var{option}
8923 @opindex Wp
8924 You can use @option{-Wp,@var{option}} to bypass the compiler driver
8925 and pass @var{option} directly through to the preprocessor.  If
8926 @var{option} contains commas, it is split into multiple options at the
8927 commas.  However, many options are modified, translated or interpreted
8928 by the compiler driver before being passed to the preprocessor, and
8929 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
8930 interface is undocumented and subject to change, so whenever possible
8931 you should avoid using @option{-Wp} and let the driver handle the
8932 options instead.
8933
8934 @item -Xpreprocessor @var{option}
8935 @opindex Xpreprocessor
8936 Pass @var{option} as an option to the preprocessor.  You can use this to
8937 supply system-specific preprocessor options which GCC does not know how to
8938 recognize.
8939
8940 If you want to pass an option that takes an argument, you must use
8941 @option{-Xpreprocessor} twice, once for the option and once for the argument.
8942 @end table
8943
8944 @include cppopts.texi
8945
8946 @node Assembler Options
8947 @section Passing Options to the Assembler
8948
8949 @c prevent bad page break with this line
8950 You can pass options to the assembler.
8951
8952 @table @gcctabopt
8953 @item -Wa,@var{option}
8954 @opindex Wa
8955 Pass @var{option} as an option to the assembler.  If @var{option}
8956 contains commas, it is split into multiple options at the commas.
8957
8958 @item -Xassembler @var{option}
8959 @opindex Xassembler
8960 Pass @var{option} as an option to the assembler.  You can use this to
8961 supply system-specific assembler options which GCC does not know how to
8962 recognize.
8963
8964 If you want to pass an option that takes an argument, you must use
8965 @option{-Xassembler} twice, once for the option and once for the argument.
8966
8967 @end table
8968
8969 @node Link Options
8970 @section Options for Linking
8971 @cindex link options
8972 @cindex options, linking
8973
8974 These options come into play when the compiler links object files into
8975 an executable output file.  They are meaningless if the compiler is
8976 not doing a link step.
8977
8978 @table @gcctabopt
8979 @cindex file names
8980 @item @var{object-file-name}
8981 A file name that does not end in a special recognized suffix is
8982 considered to name an object file or library.  (Object files are
8983 distinguished from libraries by the linker according to the file
8984 contents.)  If linking is done, these object files are used as input
8985 to the linker.
8986
8987 @item -c
8988 @itemx -S
8989 @itemx -E
8990 @opindex c
8991 @opindex S
8992 @opindex E
8993 If any of these options is used, then the linker is not run, and
8994 object file names should not be used as arguments.  @xref{Overall
8995 Options}.
8996
8997 @cindex Libraries
8998 @item -l@var{library}
8999 @itemx -l @var{library}
9000 @opindex l
9001 Search the library named @var{library} when linking.  (The second
9002 alternative with the library as a separate argument is only for
9003 POSIX compliance and is not recommended.)
9004
9005 It makes a difference where in the command you write this option; the
9006 linker searches and processes libraries and object files in the order they
9007 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9008 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9009 to functions in @samp{z}, those functions may not be loaded.
9010
9011 The linker searches a standard list of directories for the library,
9012 which is actually a file named @file{lib@var{library}.a}.  The linker
9013 then uses this file as if it had been specified precisely by name.
9014
9015 The directories searched include several standard system directories
9016 plus any that you specify with @option{-L}.
9017
9018 Normally the files found this way are library files---archive files
9019 whose members are object files.  The linker handles an archive file by
9020 scanning through it for members which define symbols that have so far
9021 been referenced but not defined.  But if the file that is found is an
9022 ordinary object file, it is linked in the usual fashion.  The only
9023 difference between using an @option{-l} option and specifying a file name
9024 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9025 and searches several directories.
9026
9027 @item -lobjc
9028 @opindex lobjc
9029 You need this special case of the @option{-l} option in order to
9030 link an Objective-C or Objective-C++ program.
9031
9032 @item -nostartfiles
9033 @opindex nostartfiles
9034 Do not use the standard system startup files when linking.
9035 The standard system libraries are used normally, unless @option{-nostdlib}
9036 or @option{-nodefaultlibs} is used.
9037
9038 @item -nodefaultlibs
9039 @opindex nodefaultlibs
9040 Do not use the standard system libraries when linking.
9041 Only the libraries you specify will be passed to the linker, options
9042 specifying linkage of the system libraries, such as @code{-static-libgcc}
9043 or @code{-shared-libgcc}, will be ignored.
9044 The standard startup files are used normally, unless @option{-nostartfiles}
9045 is used.  The compiler may generate calls to @code{memcmp},
9046 @code{memset}, @code{memcpy} and @code{memmove}.
9047 These entries are usually resolved by entries in
9048 libc.  These entry points should be supplied through some other
9049 mechanism when this option is specified.
9050
9051 @item -nostdlib
9052 @opindex nostdlib
9053 Do not use the standard system startup files or libraries when linking.
9054 No startup files and only the libraries you specify will be passed to
9055 the linker, options specifying linkage of the system libraries, such as
9056 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
9057 The compiler may generate calls to @code{memcmp}, @code{memset},
9058 @code{memcpy} and @code{memmove}.
9059 These entries are usually resolved by entries in
9060 libc.  These entry points should be supplied through some other
9061 mechanism when this option is specified.
9062
9063 @cindex @option{-lgcc}, use with @option{-nostdlib}
9064 @cindex @option{-nostdlib} and unresolved references
9065 @cindex unresolved references and @option{-nostdlib}
9066 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9067 @cindex @option{-nodefaultlibs} and unresolved references
9068 @cindex unresolved references and @option{-nodefaultlibs}
9069 One of the standard libraries bypassed by @option{-nostdlib} and
9070 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9071 that GCC uses to overcome shortcomings of particular machines, or special
9072 needs for some languages.
9073 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9074 Collection (GCC) Internals},
9075 for more discussion of @file{libgcc.a}.)
9076 In most cases, you need @file{libgcc.a} even when you want to avoid
9077 other standard libraries.  In other words, when you specify @option{-nostdlib}
9078 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9079 This ensures that you have no unresolved references to internal GCC
9080 library subroutines.  (For example, @samp{__main}, used to ensure C++
9081 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
9082 GNU Compiler Collection (GCC) Internals}.)
9083
9084 @item -pie
9085 @opindex pie
9086 Produce a position independent executable on targets which support it.
9087 For predictable results, you must also specify the same set of options
9088 that were used to generate code (@option{-fpie}, @option{-fPIE},
9089 or model suboptions) when you specify this option.
9090
9091 @item -rdynamic
9092 @opindex rdynamic
9093 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9094 that support it. This instructs the linker to add all symbols, not
9095 only used ones, to the dynamic symbol table. This option is needed
9096 for some uses of @code{dlopen} or to allow obtaining backtraces
9097 from within a program.
9098
9099 @item -s
9100 @opindex s
9101 Remove all symbol table and relocation information from the executable.
9102
9103 @item -static
9104 @opindex static
9105 On systems that support dynamic linking, this prevents linking with the shared
9106 libraries.  On other systems, this option has no effect.
9107
9108 @item -shared
9109 @opindex shared
9110 Produce a shared object which can then be linked with other objects to
9111 form an executable.  Not all systems support this option.  For predictable
9112 results, you must also specify the same set of options that were used to
9113 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
9114 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
9115 needs to build supplementary stub code for constructors to work.  On
9116 multi-libbed systems, @samp{gcc -shared} must select the correct support
9117 libraries to link against.  Failing to supply the correct flags may lead
9118 to subtle defects.  Supplying them in cases where they are not necessary
9119 is innocuous.}
9120
9121 @item -shared-libgcc
9122 @itemx -static-libgcc
9123 @opindex shared-libgcc
9124 @opindex static-libgcc
9125 On systems that provide @file{libgcc} as a shared library, these options
9126 force the use of either the shared or static version respectively.
9127 If no shared version of @file{libgcc} was built when the compiler was
9128 configured, these options have no effect.
9129
9130 There are several situations in which an application should use the
9131 shared @file{libgcc} instead of the static version.  The most common
9132 of these is when the application wishes to throw and catch exceptions
9133 across different shared libraries.  In that case, each of the libraries
9134 as well as the application itself should use the shared @file{libgcc}.
9135
9136 Therefore, the G++ and GCJ drivers automatically add
9137 @option{-shared-libgcc} whenever you build a shared library or a main
9138 executable, because C++ and Java programs typically use exceptions, so
9139 this is the right thing to do.
9140
9141 If, instead, you use the GCC driver to create shared libraries, you may
9142 find that they will not always be linked with the shared @file{libgcc}.
9143 If GCC finds, at its configuration time, that you have a non-GNU linker
9144 or a GNU linker that does not support option @option{--eh-frame-hdr},
9145 it will link the shared version of @file{libgcc} into shared libraries
9146 by default.  Otherwise, it will take advantage of the linker and optimize
9147 away the linking with the shared version of @file{libgcc}, linking with
9148 the static version of libgcc by default.  This allows exceptions to
9149 propagate through such shared libraries, without incurring relocation
9150 costs at library load time.
9151
9152 However, if a library or main executable is supposed to throw or catch
9153 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9154 for the languages used in the program, or using the option
9155 @option{-shared-libgcc}, such that it is linked with the shared
9156 @file{libgcc}.
9157
9158 @item -static-libstdc++
9159 When the @command{g++} program is used to link a C++ program, it will
9160 normally automatically link against @option{libstdc++}.  If
9161 @file{libstdc++} is available as a shared library, and the
9162 @option{-static} option is not used, then this will link against the
9163 shared version of @file{libstdc++}.  That is normally fine.  However, it
9164 is sometimes useful to freeze the version of @file{libstdc++} used by
9165 the program without going all the way to a fully static link.  The
9166 @option{-static-libstdc++} option directs the @command{g++} driver to
9167 link @file{libstdc++} statically, without necessarily linking other
9168 libraries statically.
9169
9170 @item -symbolic
9171 @opindex symbolic
9172 Bind references to global symbols when building a shared object.  Warn
9173 about any unresolved references (unless overridden by the link editor
9174 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
9175 this option.
9176
9177 @item -T @var{script}
9178 @opindex T
9179 @cindex linker script
9180 Use @var{script} as the linker script.  This option is supported by most
9181 systems using the GNU linker.  On some targets, such as bare-board
9182 targets without an operating system, the @option{-T} option may be required
9183 when linking to avoid references to undefined symbols.
9184
9185 @item -Xlinker @var{option}
9186 @opindex Xlinker
9187 Pass @var{option} as an option to the linker.  You can use this to
9188 supply system-specific linker options which GCC does not know how to
9189 recognize.
9190
9191 If you want to pass an option that takes a separate argument, you must use
9192 @option{-Xlinker} twice, once for the option and once for the argument.
9193 For example, to pass @option{-assert definitions}, you must write
9194 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9195 @option{-Xlinker "-assert definitions"}, because this passes the entire
9196 string as a single argument, which is not what the linker expects.
9197
9198 When using the GNU linker, it is usually more convenient to pass
9199 arguments to linker options using the @option{@var{option}=@var{value}}
9200 syntax than as separate arguments.  For example, you can specify
9201 @samp{-Xlinker -Map=output.map} rather than
9202 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9203 this syntax for command-line options.
9204
9205 @item -Wl,@var{option}
9206 @opindex Wl
9207 Pass @var{option} as an option to the linker.  If @var{option} contains
9208 commas, it is split into multiple options at the commas.  You can use this
9209 syntax to pass an argument to the option.
9210 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
9211 linker.  When using the GNU linker, you can also get the same effect with
9212 @samp{-Wl,-Map=output.map}.
9213
9214 @item -u @var{symbol}
9215 @opindex u
9216 Pretend the symbol @var{symbol} is undefined, to force linking of
9217 library modules to define it.  You can use @option{-u} multiple times with
9218 different symbols to force loading of additional library modules.
9219 @end table
9220
9221 @node Directory Options
9222 @section Options for Directory Search
9223 @cindex directory options
9224 @cindex options, directory search
9225 @cindex search path
9226
9227 These options specify directories to search for header files, for
9228 libraries and for parts of the compiler:
9229
9230 @table @gcctabopt
9231 @item -I@var{dir}
9232 @opindex I
9233 Add the directory @var{dir} to the head of the list of directories to be
9234 searched for header files.  This can be used to override a system header
9235 file, substituting your own version, since these directories are
9236 searched before the system header file directories.  However, you should
9237 not use this option to add directories that contain vendor-supplied
9238 system header files (use @option{-isystem} for that).  If you use more than
9239 one @option{-I} option, the directories are scanned in left-to-right
9240 order; the standard system directories come after.
9241
9242 If a standard system include directory, or a directory specified with
9243 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9244 option will be ignored.  The directory will still be searched but as a
9245 system directory at its normal position in the system include chain.
9246 This is to ensure that GCC's procedure to fix buggy system headers and
9247 the ordering for the include_next directive are not inadvertently changed.
9248 If you really need to change the search order for system directories,
9249 use the @option{-nostdinc} and/or @option{-isystem} options.
9250
9251 @item -iplugindir=@var{dir}
9252 Set the directory to search for plugins which are passed
9253 by @option{-fplugin=@var{name}} instead of
9254 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9255 to be used by the user, but only passed by the driver.
9256
9257 @item -iquote@var{dir}
9258 @opindex iquote
9259 Add the directory @var{dir} to the head of the list of directories to
9260 be searched for header files only for the case of @samp{#include
9261 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9262 otherwise just like @option{-I}.
9263
9264 @item -L@var{dir}
9265 @opindex L
9266 Add directory @var{dir} to the list of directories to be searched
9267 for @option{-l}.
9268
9269 @item -B@var{prefix}
9270 @opindex B
9271 This option specifies where to find the executables, libraries,
9272 include files, and data files of the compiler itself.
9273
9274 The compiler driver program runs one or more of the subprograms
9275 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
9276 @var{prefix} as a prefix for each program it tries to run, both with and
9277 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9278
9279 For each subprogram to be run, the compiler driver first tries the
9280 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9281 was not specified, the driver tries two standard prefixes, which are
9282 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9283 those results in a file name that is found, the unmodified program
9284 name is searched for using the directories specified in your
9285 @env{PATH} environment variable.
9286
9287 The compiler will check to see if the path provided by the @option{-B}
9288 refers to a directory, and if necessary it will add a directory
9289 separator character at the end of the path.
9290
9291 @option{-B} prefixes that effectively specify directory names also apply
9292 to libraries in the linker, because the compiler translates these
9293 options into @option{-L} options for the linker.  They also apply to
9294 includes files in the preprocessor, because the compiler translates these
9295 options into @option{-isystem} options for the preprocessor.  In this case,
9296 the compiler appends @samp{include} to the prefix.
9297
9298 The run-time support file @file{libgcc.a} can also be searched for using
9299 the @option{-B} prefix, if needed.  If it is not found there, the two
9300 standard prefixes above are tried, and that is all.  The file is left
9301 out of the link if it is not found by those means.
9302
9303 Another way to specify a prefix much like the @option{-B} prefix is to use
9304 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9305 Variables}.
9306
9307 As a special kludge, if the path provided by @option{-B} is
9308 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9309 9, then it will be replaced by @file{[dir/]include}.  This is to help
9310 with boot-strapping the compiler.
9311
9312 @item -specs=@var{file}
9313 @opindex specs
9314 Process @var{file} after the compiler reads in the standard @file{specs}
9315 file, in order to override the defaults that the @file{gcc} driver
9316 program uses when determining what switches to pass to @file{cc1},
9317 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
9318 @option{-specs=@var{file}} can be specified on the command line, and they
9319 are processed in order, from left to right.
9320
9321 @item --sysroot=@var{dir}
9322 @opindex sysroot
9323 Use @var{dir} as the logical root directory for headers and libraries.
9324 For example, if the compiler would normally search for headers in
9325 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
9326 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9327
9328 If you use both this option and the @option{-isysroot} option, then
9329 the @option{--sysroot} option will apply to libraries, but the
9330 @option{-isysroot} option will apply to header files.
9331
9332 The GNU linker (beginning with version 2.16) has the necessary support
9333 for this option.  If your linker does not support this option, the
9334 header file aspect of @option{--sysroot} will still work, but the
9335 library aspect will not.
9336
9337 @item -I-
9338 @opindex I-
9339 This option has been deprecated.  Please use @option{-iquote} instead for
9340 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9341 Any directories you specify with @option{-I} options before the @option{-I-}
9342 option are searched only for the case of @samp{#include "@var{file}"};
9343 they are not searched for @samp{#include <@var{file}>}.
9344
9345 If additional directories are specified with @option{-I} options after
9346 the @option{-I-}, these directories are searched for all @samp{#include}
9347 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9348 this way.)
9349
9350 In addition, the @option{-I-} option inhibits the use of the current
9351 directory (where the current input file came from) as the first search
9352 directory for @samp{#include "@var{file}"}.  There is no way to
9353 override this effect of @option{-I-}.  With @option{-I.} you can specify
9354 searching the directory which was current when the compiler was
9355 invoked.  That is not exactly the same as what the preprocessor does
9356 by default, but it is often satisfactory.
9357
9358 @option{-I-} does not inhibit the use of the standard system directories
9359 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9360 independent.
9361 @end table
9362
9363 @c man end
9364
9365 @node Spec Files
9366 @section Specifying subprocesses and the switches to pass to them
9367 @cindex Spec Files
9368
9369 @command{gcc} is a driver program.  It performs its job by invoking a
9370 sequence of other programs to do the work of compiling, assembling and
9371 linking.  GCC interprets its command-line parameters and uses these to
9372 deduce which programs it should invoke, and which command-line options
9373 it ought to place on their command lines.  This behavior is controlled
9374 by @dfn{spec strings}.  In most cases there is one spec string for each
9375 program that GCC can invoke, but a few programs have multiple spec
9376 strings to control their behavior.  The spec strings built into GCC can
9377 be overridden by using the @option{-specs=} command-line switch to specify
9378 a spec file.
9379
9380 @dfn{Spec files} are plaintext files that are used to construct spec
9381 strings.  They consist of a sequence of directives separated by blank
9382 lines.  The type of directive is determined by the first non-whitespace
9383 character on the line and it can be one of the following:
9384
9385 @table @code
9386 @item %@var{command}
9387 Issues a @var{command} to the spec file processor.  The commands that can
9388 appear here are:
9389
9390 @table @code
9391 @item %include <@var{file}>
9392 @cindex @code{%include}
9393 Search for @var{file} and insert its text at the current point in the
9394 specs file.
9395
9396 @item %include_noerr <@var{file}>
9397 @cindex @code{%include_noerr}
9398 Just like @samp{%include}, but do not generate an error message if the include
9399 file cannot be found.
9400
9401 @item %rename @var{old_name} @var{new_name}
9402 @cindex @code{%rename}
9403 Rename the spec string @var{old_name} to @var{new_name}.
9404
9405 @end table
9406
9407 @item *[@var{spec_name}]:
9408 This tells the compiler to create, override or delete the named spec
9409 string.  All lines after this directive up to the next directive or
9410 blank line are considered to be the text for the spec string.  If this
9411 results in an empty string then the spec will be deleted.  (Or, if the
9412 spec did not exist, then nothing will happened.)  Otherwise, if the spec
9413 does not currently exist a new spec will be created.  If the spec does
9414 exist then its contents will be overridden by the text of this
9415 directive, unless the first character of that text is the @samp{+}
9416 character, in which case the text will be appended to the spec.
9417
9418 @item [@var{suffix}]:
9419 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9420 and up to the next directive or blank line are considered to make up the
9421 spec string for the indicated suffix.  When the compiler encounters an
9422 input file with the named suffix, it will processes the spec string in
9423 order to work out how to compile that file.  For example:
9424
9425 @smallexample
9426 .ZZ:
9427 z-compile -input %i
9428 @end smallexample
9429
9430 This says that any input file whose name ends in @samp{.ZZ} should be
9431 passed to the program @samp{z-compile}, which should be invoked with the
9432 command-line switch @option{-input} and with the result of performing the
9433 @samp{%i} substitution.  (See below.)
9434
9435 As an alternative to providing a spec string, the text that follows a
9436 suffix directive can be one of the following:
9437
9438 @table @code
9439 @item @@@var{language}
9440 This says that the suffix is an alias for a known @var{language}.  This is
9441 similar to using the @option{-x} command-line switch to GCC to specify a
9442 language explicitly.  For example:
9443
9444 @smallexample
9445 .ZZ:
9446 @@c++
9447 @end smallexample
9448
9449 Says that .ZZ files are, in fact, C++ source files.
9450
9451 @item #@var{name}
9452 This causes an error messages saying:
9453
9454 @smallexample
9455 @var{name} compiler not installed on this system.
9456 @end smallexample
9457 @end table
9458
9459 GCC already has an extensive list of suffixes built into it.
9460 This directive will add an entry to the end of the list of suffixes, but
9461 since the list is searched from the end backwards, it is effectively
9462 possible to override earlier entries using this technique.
9463
9464 @end table
9465
9466 GCC has the following spec strings built into it.  Spec files can
9467 override these strings or create their own.  Note that individual
9468 targets can also add their own spec strings to this list.
9469
9470 @smallexample
9471 asm          Options to pass to the assembler
9472 asm_final    Options to pass to the assembler post-processor
9473 cpp          Options to pass to the C preprocessor
9474 cc1          Options to pass to the C compiler
9475 cc1plus      Options to pass to the C++ compiler
9476 endfile      Object files to include at the end of the link
9477 link         Options to pass to the linker
9478 lib          Libraries to include on the command line to the linker
9479 libgcc       Decides which GCC support library to pass to the linker
9480 linker       Sets the name of the linker
9481 predefines   Defines to be passed to the C preprocessor
9482 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9483              by default
9484 startfile    Object files to include at the start of the link
9485 @end smallexample
9486
9487 Here is a small example of a spec file:
9488
9489 @smallexample
9490 %rename lib                 old_lib
9491
9492 *lib:
9493 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9494 @end smallexample
9495
9496 This example renames the spec called @samp{lib} to @samp{old_lib} and
9497 then overrides the previous definition of @samp{lib} with a new one.
9498 The new definition adds in some extra command-line options before
9499 including the text of the old definition.
9500
9501 @dfn{Spec strings} are a list of command-line options to be passed to their
9502 corresponding program.  In addition, the spec strings can contain
9503 @samp{%}-prefixed sequences to substitute variable text or to
9504 conditionally insert text into the command line.  Using these constructs
9505 it is possible to generate quite complex command lines.
9506
9507 Here is a table of all defined @samp{%}-sequences for spec
9508 strings.  Note that spaces are not generated automatically around the
9509 results of expanding these sequences.  Therefore you can concatenate them
9510 together or combine them with constant text in a single argument.
9511
9512 @table @code
9513 @item %%
9514 Substitute one @samp{%} into the program name or argument.
9515
9516 @item %i
9517 Substitute the name of the input file being processed.
9518
9519 @item %b
9520 Substitute the basename of the input file being processed.
9521 This is the substring up to (and not including) the last period
9522 and not including the directory.
9523
9524 @item %B
9525 This is the same as @samp{%b}, but include the file suffix (text after
9526 the last period).
9527
9528 @item %d
9529 Marks the argument containing or following the @samp{%d} as a
9530 temporary file name, so that that file will be deleted if GCC exits
9531 successfully.  Unlike @samp{%g}, this contributes no text to the
9532 argument.
9533
9534 @item %g@var{suffix}
9535 Substitute a file name that has suffix @var{suffix} and is chosen
9536 once per compilation, and mark the argument in the same way as
9537 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9538 name is now chosen in a way that is hard to predict even when previously
9539 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9540 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9541 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9542 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9543 was simply substituted with a file name chosen once per compilation,
9544 without regard to any appended suffix (which was therefore treated
9545 just like ordinary text), making such attacks more likely to succeed.
9546
9547 @item %u@var{suffix}
9548 Like @samp{%g}, but generates a new temporary file name even if
9549 @samp{%u@var{suffix}} was already seen.
9550
9551 @item %U@var{suffix}
9552 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9553 new one if there is no such last file name.  In the absence of any
9554 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9555 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9556 would involve the generation of two distinct file names, one
9557 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9558 simply substituted with a file name chosen for the previous @samp{%u},
9559 without regard to any appended suffix.
9560
9561 @item %j@var{suffix}
9562 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9563 writable, and if save-temps is off; otherwise, substitute the name
9564 of a temporary file, just like @samp{%u}.  This temporary file is not
9565 meant for communication between processes, but rather as a junk
9566 disposal mechanism.
9567
9568 @item %|@var{suffix}
9569 @itemx %m@var{suffix}
9570 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9571 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9572 all.  These are the two most common ways to instruct a program that it
9573 should read from standard input or write to standard output.  If you
9574 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9575 construct: see for example @file{f/lang-specs.h}.
9576
9577 @item %.@var{SUFFIX}
9578 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9579 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9580 terminated by the next space or %.
9581
9582 @item %w
9583 Marks the argument containing or following the @samp{%w} as the
9584 designated output file of this compilation.  This puts the argument
9585 into the sequence of arguments that @samp{%o} will substitute later.
9586
9587 @item %o
9588 Substitutes the names of all the output files, with spaces
9589 automatically placed around them.  You should write spaces
9590 around the @samp{%o} as well or the results are undefined.
9591 @samp{%o} is for use in the specs for running the linker.
9592 Input files whose names have no recognized suffix are not compiled
9593 at all, but they are included among the output files, so they will
9594 be linked.
9595
9596 @item %O
9597 Substitutes the suffix for object files.  Note that this is
9598 handled specially when it immediately follows @samp{%g, %u, or %U},
9599 because of the need for those to form complete file names.  The
9600 handling is such that @samp{%O} is treated exactly as if it had already
9601 been substituted, except that @samp{%g, %u, and %U} do not currently
9602 support additional @var{suffix} characters following @samp{%O} as they would
9603 following, for example, @samp{.o}.
9604
9605 @item %p
9606 Substitutes the standard macro predefinitions for the
9607 current target machine.  Use this when running @code{cpp}.
9608
9609 @item %P
9610 Like @samp{%p}, but puts @samp{__} before and after the name of each
9611 predefined macro, except for macros that start with @samp{__} or with
9612 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
9613 C@.
9614
9615 @item %I
9616 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
9617 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
9618 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
9619 and @option{-imultilib} as necessary.
9620
9621 @item %s
9622 Current argument is the name of a library or startup file of some sort.
9623 Search for that file in a standard list of directories and substitute
9624 the full name found.  The current working directory is included in the
9625 list of directories scanned.
9626
9627 @item %T
9628 Current argument is the name of a linker script.  Search for that file
9629 in the current list of directories to scan for libraries. If the file
9630 is located insert a @option{--script} option into the command line
9631 followed by the full path name found.  If the file is not found then
9632 generate an error message.  Note: the current working directory is not
9633 searched.
9634
9635 @item %e@var{str}
9636 Print @var{str} as an error message.  @var{str} is terminated by a newline.
9637 Use this when inconsistent options are detected.
9638
9639 @item %(@var{name})
9640 Substitute the contents of spec string @var{name} at this point.
9641
9642 @item %[@var{name}]
9643 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
9644
9645 @item %x@{@var{option}@}
9646 Accumulate an option for @samp{%X}.
9647
9648 @item %X
9649 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
9650 spec string.
9651
9652 @item %Y
9653 Output the accumulated assembler options specified by @option{-Wa}.
9654
9655 @item %Z
9656 Output the accumulated preprocessor options specified by @option{-Wp}.
9657
9658 @item %a
9659 Process the @code{asm} spec.  This is used to compute the
9660 switches to be passed to the assembler.
9661
9662 @item %A
9663 Process the @code{asm_final} spec.  This is a spec string for
9664 passing switches to an assembler post-processor, if such a program is
9665 needed.
9666
9667 @item %l
9668 Process the @code{link} spec.  This is the spec for computing the
9669 command line passed to the linker.  Typically it will make use of the
9670 @samp{%L %G %S %D and %E} sequences.
9671
9672 @item %D
9673 Dump out a @option{-L} option for each directory that GCC believes might
9674 contain startup files.  If the target supports multilibs then the
9675 current multilib directory will be prepended to each of these paths.
9676
9677 @item %L
9678 Process the @code{lib} spec.  This is a spec string for deciding which
9679 libraries should be included on the command line to the linker.
9680
9681 @item %G
9682 Process the @code{libgcc} spec.  This is a spec string for deciding
9683 which GCC support library should be included on the command line to the linker.
9684
9685 @item %S
9686 Process the @code{startfile} spec.  This is a spec for deciding which
9687 object files should be the first ones passed to the linker.  Typically
9688 this might be a file named @file{crt0.o}.
9689
9690 @item %E
9691 Process the @code{endfile} spec.  This is a spec string that specifies
9692 the last object files that will be passed to the linker.
9693
9694 @item %C
9695 Process the @code{cpp} spec.  This is used to construct the arguments
9696 to be passed to the C preprocessor.
9697
9698 @item %1
9699 Process the @code{cc1} spec.  This is used to construct the options to be
9700 passed to the actual C compiler (@samp{cc1}).
9701
9702 @item %2
9703 Process the @code{cc1plus} spec.  This is used to construct the options to be
9704 passed to the actual C++ compiler (@samp{cc1plus}).
9705
9706 @item %*
9707 Substitute the variable part of a matched option.  See below.
9708 Note that each comma in the substituted string is replaced by
9709 a single space.
9710
9711 @item %<@code{S}
9712 Remove all occurrences of @code{-S} from the command line.  Note---this
9713 command is position dependent.  @samp{%} commands in the spec string
9714 before this one will see @code{-S}, @samp{%} commands in the spec string
9715 after this one will not.
9716
9717 @item %:@var{function}(@var{args})
9718 Call the named function @var{function}, passing it @var{args}.
9719 @var{args} is first processed as a nested spec string, then split
9720 into an argument vector in the usual fashion.  The function returns
9721 a string which is processed as if it had appeared literally as part
9722 of the current spec.
9723
9724 The following built-in spec functions are provided:
9725
9726 @table @code
9727 @item @code{getenv}
9728 The @code{getenv} spec function takes two arguments: an environment
9729 variable name and a string.  If the environment variable is not
9730 defined, a fatal error is issued.  Otherwise, the return value is the
9731 value of the environment variable concatenated with the string.  For
9732 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
9733
9734 @smallexample
9735 %:getenv(TOPDIR /include)
9736 @end smallexample
9737
9738 expands to @file{/path/to/top/include}.
9739
9740 @item @code{if-exists}
9741 The @code{if-exists} spec function takes one argument, an absolute
9742 pathname to a file.  If the file exists, @code{if-exists} returns the
9743 pathname.  Here is a small example of its usage:
9744
9745 @smallexample
9746 *startfile:
9747 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
9748 @end smallexample
9749
9750 @item @code{if-exists-else}
9751 The @code{if-exists-else} spec function is similar to the @code{if-exists}
9752 spec function, except that it takes two arguments.  The first argument is
9753 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
9754 returns the pathname.  If it does not exist, it returns the second argument.
9755 This way, @code{if-exists-else} can be used to select one file or another,
9756 based on the existence of the first.  Here is a small example of its usage:
9757
9758 @smallexample
9759 *startfile:
9760 crt0%O%s %:if-exists(crti%O%s) \
9761 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
9762 @end smallexample
9763
9764 @item @code{replace-outfile}
9765 The @code{replace-outfile} spec function takes two arguments.  It looks for the
9766 first argument in the outfiles array and replaces it with the second argument.  Here
9767 is a small example of its usage:
9768
9769 @smallexample
9770 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
9771 @end smallexample
9772
9773 @item @code{remove-outfile}
9774 The @code{remove-outfile} spec function takes one argument.  It looks for the
9775 first argument in the outfiles array and removes it.  Here is a small example
9776 its usage:
9777
9778 @smallexample
9779 %:remove-outfile(-lm)
9780 @end smallexample
9781
9782 @item @code{pass-through-libs}
9783 The @code{pass-through-libs} spec function takes any number of arguments.  It
9784 finds any @option{-l} options and any non-options ending in ".a" (which it
9785 assumes are the names of linker input library archive files) and returns a
9786 result containing all the found arguments each prepended by
9787 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
9788 intended to be passed to the LTO linker plugin.
9789
9790 @smallexample
9791 %:pass-through-libs(%G %L %G)
9792 @end smallexample
9793
9794 @item @code{print-asm-header}
9795 The @code{print-asm-header} function takes no arguments and simply
9796 prints a banner like:
9797
9798 @smallexample
9799 Assembler options
9800 =================
9801
9802 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
9803 @end smallexample
9804
9805 It is used to separate compiler options from assembler options
9806 in the @option{--target-help} output.
9807 @end table
9808
9809 @item %@{@code{S}@}
9810 Substitutes the @code{-S} switch, if that switch was given to GCC@.
9811 If that switch was not specified, this substitutes nothing.  Note that
9812 the leading dash is omitted when specifying this option, and it is
9813 automatically inserted if the substitution is performed.  Thus the spec
9814 string @samp{%@{foo@}} would match the command-line option @option{-foo}
9815 and would output the command line option @option{-foo}.
9816
9817 @item %W@{@code{S}@}
9818 Like %@{@code{S}@} but mark last argument supplied within as a file to be
9819 deleted on failure.
9820
9821 @item %@{@code{S}*@}
9822 Substitutes all the switches specified to GCC whose names start
9823 with @code{-S}, but which also take an argument.  This is used for
9824 switches like @option{-o}, @option{-D}, @option{-I}, etc.
9825 GCC considers @option{-o foo} as being
9826 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
9827 text, including the space.  Thus two arguments would be generated.
9828
9829 @item %@{@code{S}*&@code{T}*@}
9830 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
9831 (the order of @code{S} and @code{T} in the spec is not significant).
9832 There can be any number of ampersand-separated variables; for each the
9833 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
9834
9835 @item %@{@code{S}:@code{X}@}
9836 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
9837
9838 @item %@{!@code{S}:@code{X}@}
9839 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
9840
9841 @item %@{@code{S}*:@code{X}@}
9842 Substitutes @code{X} if one or more switches whose names start with
9843 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
9844 once, no matter how many such switches appeared.  However, if @code{%*}
9845 appears somewhere in @code{X}, then @code{X} will be substituted once
9846 for each matching switch, with the @code{%*} replaced by the part of
9847 that switch that matched the @code{*}.
9848
9849 @item %@{.@code{S}:@code{X}@}
9850 Substitutes @code{X}, if processing a file with suffix @code{S}.
9851
9852 @item %@{!.@code{S}:@code{X}@}
9853 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
9854
9855 @item %@{,@code{S}:@code{X}@}
9856 Substitutes @code{X}, if processing a file for language @code{S}.
9857
9858 @item %@{!,@code{S}:@code{X}@}
9859 Substitutes @code{X}, if not processing a file for language @code{S}.
9860
9861 @item %@{@code{S}|@code{P}:@code{X}@}
9862 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
9863 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
9864 @code{*} sequences as well, although they have a stronger binding than
9865 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
9866 alternatives must be starred, and only the first matching alternative
9867 is substituted.
9868
9869 For example, a spec string like this:
9870
9871 @smallexample
9872 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
9873 @end smallexample
9874
9875 will output the following command-line options from the following input
9876 command-line options:
9877
9878 @smallexample
9879 fred.c        -foo -baz
9880 jim.d         -bar -boggle
9881 -d fred.c     -foo -baz -boggle
9882 -d jim.d      -bar -baz -boggle
9883 @end smallexample
9884
9885 @item %@{S:X; T:Y; :D@}
9886
9887 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
9888 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
9889 be as many clauses as you need.  This may be combined with @code{.},
9890 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
9891
9892
9893 @end table
9894
9895 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
9896 construct may contain other nested @samp{%} constructs or spaces, or
9897 even newlines.  They are processed as usual, as described above.
9898 Trailing white space in @code{X} is ignored.  White space may also
9899 appear anywhere on the left side of the colon in these constructs,
9900 except between @code{.} or @code{*} and the corresponding word.
9901
9902 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
9903 handled specifically in these constructs.  If another value of
9904 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
9905 @option{-W} switch is found later in the command line, the earlier
9906 switch value is ignored, except with @{@code{S}*@} where @code{S} is
9907 just one letter, which passes all matching options.
9908
9909 The character @samp{|} at the beginning of the predicate text is used to
9910 indicate that a command should be piped to the following command, but
9911 only if @option{-pipe} is specified.
9912
9913 It is built into GCC which switches take arguments and which do not.
9914 (You might think it would be useful to generalize this to allow each
9915 compiler's spec to say which switches take arguments.  But this cannot
9916 be done in a consistent fashion.  GCC cannot even decide which input
9917 files have been specified without knowing which switches take arguments,
9918 and it must know which input files to compile in order to tell which
9919 compilers to run).
9920
9921 GCC also knows implicitly that arguments starting in @option{-l} are to be
9922 treated as compiler output files, and passed to the linker in their
9923 proper position among the other output files.
9924
9925 @c man begin OPTIONS
9926
9927 @node Target Options
9928 @section Specifying Target Machine and Compiler Version
9929 @cindex target options
9930 @cindex cross compiling
9931 @cindex specifying machine version
9932 @cindex specifying compiler version and target machine
9933 @cindex compiler version, specifying
9934 @cindex target machine, specifying
9935
9936 The usual way to run GCC is to run the executable called @command{gcc}, or
9937 @command{@var{machine}-gcc} when cross-compiling, or
9938 @command{@var{machine}-gcc-@var{version}} to run a version other than the
9939 one that was installed last.
9940
9941 @node Submodel Options
9942 @section Hardware Models and Configurations
9943 @cindex submodel options
9944 @cindex specifying hardware config
9945 @cindex hardware models and configurations, specifying
9946 @cindex machine dependent options
9947
9948 Each target machine types can have its own
9949 special options, starting with @samp{-m}, to choose among various
9950 hardware models or configurations---for example, 68010 vs 68020,
9951 floating coprocessor or none.  A single installed version of the
9952 compiler can compile for any model or configuration, according to the
9953 options specified.
9954
9955 Some configurations of the compiler also support additional special
9956 options, usually for compatibility with other compilers on the same
9957 platform.
9958
9959 @c This list is ordered alphanumerically by subsection name.
9960 @c It should be the same order and spelling as these options are listed
9961 @c in Machine Dependent Options
9962
9963 @menu
9964 * ARC Options::
9965 * ARM Options::
9966 * AVR Options::
9967 * Blackfin Options::
9968 * CRIS Options::
9969 * CRX Options::
9970 * Darwin Options::
9971 * DEC Alpha Options::
9972 * DEC Alpha/VMS Options::
9973 * FR30 Options::
9974 * FRV Options::
9975 * GNU/Linux Options::
9976 * H8/300 Options::
9977 * HPPA Options::
9978 * i386 and x86-64 Options::
9979 * i386 and x86-64 Windows Options::
9980 * IA-64 Options::
9981 * IA-64/VMS Options::
9982 * LM32 Options::
9983 * M32C Options::
9984 * M32R/D Options::
9985 * M680x0 Options::
9986 * M68hc1x Options::
9987 * MCore Options::
9988 * MeP Options::
9989 * MicroBlaze Options::
9990 * MIPS Options::
9991 * MMIX Options::
9992 * MN10300 Options::
9993 * PDP-11 Options::
9994 * picoChip Options::
9995 * PowerPC Options::
9996 * RS/6000 and PowerPC Options::
9997 * RX Options::
9998 * S/390 and zSeries Options::
9999 * Score Options::
10000 * SH Options::
10001 * Solaris 2 Options::
10002 * SPARC Options::
10003 * SPU Options::
10004 * System V Options::
10005 * V850 Options::
10006 * VAX Options::
10007 * VxWorks Options::
10008 * x86-64 Options::
10009 * Xstormy16 Options::
10010 * Xtensa Options::
10011 * zSeries Options::
10012 @end menu
10013
10014 @node ARC Options
10015 @subsection ARC Options
10016 @cindex ARC Options
10017
10018 These options are defined for ARC implementations:
10019
10020 @table @gcctabopt
10021 @item -EL
10022 @opindex EL
10023 Compile code for little endian mode.  This is the default.
10024
10025 @item -EB
10026 @opindex EB
10027 Compile code for big endian mode.
10028
10029 @item -mmangle-cpu
10030 @opindex mmangle-cpu
10031 Prepend the name of the CPU to all public symbol names.
10032 In multiple-processor systems, there are many ARC variants with different
10033 instruction and register set characteristics.  This flag prevents code
10034 compiled for one CPU to be linked with code compiled for another.
10035 No facility exists for handling variants that are ``almost identical''.
10036 This is an all or nothing option.
10037
10038 @item -mcpu=@var{cpu}
10039 @opindex mcpu
10040 Compile code for ARC variant @var{cpu}.
10041 Which variants are supported depend on the configuration.
10042 All variants support @option{-mcpu=base}, this is the default.
10043
10044 @item -mtext=@var{text-section}
10045 @itemx -mdata=@var{data-section}
10046 @itemx -mrodata=@var{readonly-data-section}
10047 @opindex mtext
10048 @opindex mdata
10049 @opindex mrodata
10050 Put functions, data, and readonly data in @var{text-section},
10051 @var{data-section}, and @var{readonly-data-section} respectively
10052 by default.  This can be overridden with the @code{section} attribute.
10053 @xref{Variable Attributes}.
10054
10055 @end table
10056
10057 @node ARM Options
10058 @subsection ARM Options
10059 @cindex ARM options
10060
10061 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
10062 architectures:
10063
10064 @table @gcctabopt
10065 @item -mabi=@var{name}
10066 @opindex mabi
10067 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
10068 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
10069
10070 @item -mapcs-frame
10071 @opindex mapcs-frame
10072 Generate a stack frame that is compliant with the ARM Procedure Call
10073 Standard for all functions, even if this is not strictly necessary for
10074 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
10075 with this option will cause the stack frames not to be generated for
10076 leaf functions.  The default is @option{-mno-apcs-frame}.
10077
10078 @item -mapcs
10079 @opindex mapcs
10080 This is a synonym for @option{-mapcs-frame}.
10081
10082 @ignore
10083 @c not currently implemented
10084 @item -mapcs-stack-check
10085 @opindex mapcs-stack-check
10086 Generate code to check the amount of stack space available upon entry to
10087 every function (that actually uses some stack space).  If there is
10088 insufficient space available then either the function
10089 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
10090 called, depending upon the amount of stack space required.  The run time
10091 system is required to provide these functions.  The default is
10092 @option{-mno-apcs-stack-check}, since this produces smaller code.
10093
10094 @c not currently implemented
10095 @item -mapcs-float
10096 @opindex mapcs-float
10097 Pass floating point arguments using the float point registers.  This is
10098 one of the variants of the APCS@.  This option is recommended if the
10099 target hardware has a floating point unit or if a lot of floating point
10100 arithmetic is going to be performed by the code.  The default is
10101 @option{-mno-apcs-float}, since integer only code is slightly increased in
10102 size if @option{-mapcs-float} is used.
10103
10104 @c not currently implemented
10105 @item -mapcs-reentrant
10106 @opindex mapcs-reentrant
10107 Generate reentrant, position independent code.  The default is
10108 @option{-mno-apcs-reentrant}.
10109 @end ignore
10110
10111 @item -mthumb-interwork
10112 @opindex mthumb-interwork
10113 Generate code which supports calling between the ARM and Thumb
10114 instruction sets.  Without this option the two instruction sets cannot
10115 be reliably used inside one program.  The default is
10116 @option{-mno-thumb-interwork}, since slightly larger code is generated
10117 when @option{-mthumb-interwork} is specified.
10118
10119 @item -mno-sched-prolog
10120 @opindex mno-sched-prolog
10121 Prevent the reordering of instructions in the function prolog, or the
10122 merging of those instruction with the instructions in the function's
10123 body.  This means that all functions will start with a recognizable set
10124 of instructions (or in fact one of a choice from a small set of
10125 different function prologues), and this information can be used to
10126 locate the start if functions inside an executable piece of code.  The
10127 default is @option{-msched-prolog}.
10128
10129 @item -mfloat-abi=@var{name}
10130 @opindex mfloat-abi
10131 Specifies which floating-point ABI to use.  Permissible values
10132 are: @samp{soft}, @samp{softfp} and @samp{hard}.
10133
10134 Specifying @samp{soft} causes GCC to generate output containing
10135 library calls for floating-point operations.
10136 @samp{softfp} allows the generation of code using hardware floating-point
10137 instructions, but still uses the soft-float calling conventions.
10138 @samp{hard} allows generation of floating-point instructions
10139 and uses FPU-specific calling conventions.
10140
10141 The default depends on the specific target configuration.  Note that
10142 the hard-float and soft-float ABIs are not link-compatible; you must
10143 compile your entire program with the same ABI, and link with a
10144 compatible set of libraries.
10145
10146 @item -mhard-float
10147 @opindex mhard-float
10148 Equivalent to @option{-mfloat-abi=hard}.
10149
10150 @item -msoft-float
10151 @opindex msoft-float
10152 Equivalent to @option{-mfloat-abi=soft}.
10153
10154 @item -mlittle-endian
10155 @opindex mlittle-endian
10156 Generate code for a processor running in little-endian mode.  This is
10157 the default for all standard configurations.
10158
10159 @item -mbig-endian
10160 @opindex mbig-endian
10161 Generate code for a processor running in big-endian mode; the default is
10162 to compile code for a little-endian processor.
10163
10164 @item -mwords-little-endian
10165 @opindex mwords-little-endian
10166 This option only applies when generating code for big-endian processors.
10167 Generate code for a little-endian word order but a big-endian byte
10168 order.  That is, a byte order of the form @samp{32107654}.  Note: this
10169 option should only be used if you require compatibility with code for
10170 big-endian ARM processors generated by versions of the compiler prior to
10171 2.8.
10172
10173 @item -mcpu=@var{name}
10174 @opindex mcpu
10175 This specifies the name of the target ARM processor.  GCC uses this name
10176 to determine what kind of instructions it can emit when generating
10177 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
10178 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
10179 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
10180 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
10181 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
10182 @samp{arm720},
10183 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
10184 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
10185 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
10186 @samp{strongarm1110},
10187 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
10188 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
10189 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
10190 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
10191 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
10192 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
10193 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
10194 @samp{cortex-a5}, @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a15},
10195 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m4}, @samp{cortex-m3},
10196 @samp{cortex-m1},
10197 @samp{cortex-m0},
10198 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10199
10200 @item -mtune=@var{name}
10201 @opindex mtune
10202 This option is very similar to the @option{-mcpu=} option, except that
10203 instead of specifying the actual target processor type, and hence
10204 restricting which instructions can be used, it specifies that GCC should
10205 tune the performance of the code as if the target were of the type
10206 specified in this option, but still choosing the instructions that it
10207 will generate based on the CPU specified by a @option{-mcpu=} option.
10208 For some ARM implementations better performance can be obtained by using
10209 this option.
10210
10211 @item -march=@var{name}
10212 @opindex march
10213 This specifies the name of the target ARM architecture.  GCC uses this
10214 name to determine what kind of instructions it can emit when generating
10215 assembly code.  This option can be used in conjunction with or instead
10216 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
10217 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
10218 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
10219 @samp{armv6}, @samp{armv6j},
10220 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
10221 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
10222 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10223
10224 @item -mfpu=@var{name}
10225 @itemx -mfpe=@var{number}
10226 @itemx -mfp=@var{number}
10227 @opindex mfpu
10228 @opindex mfpe
10229 @opindex mfp
10230 This specifies what floating point hardware (or hardware emulation) is
10231 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
10232 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
10233 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
10234 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
10235 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
10236 @option{-mfp} and @option{-mfpe} are synonyms for
10237 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
10238 of GCC@.
10239
10240 If @option{-msoft-float} is specified this specifies the format of
10241 floating point values.
10242
10243 If the selected floating-point hardware includes the NEON extension
10244 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
10245 operations will not be used by GCC's auto-vectorization pass unless
10246 @option{-funsafe-math-optimizations} is also specified.  This is
10247 because NEON hardware does not fully implement the IEEE 754 standard for
10248 floating-point arithmetic (in particular denormal values are treated as
10249 zero), so the use of NEON instructions may lead to a loss of precision.
10250
10251 @item -mfp16-format=@var{name}
10252 @opindex mfp16-format
10253 Specify the format of the @code{__fp16} half-precision floating-point type.
10254 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
10255 the default is @samp{none}, in which case the @code{__fp16} type is not
10256 defined.  @xref{Half-Precision}, for more information.
10257
10258 @item -mstructure-size-boundary=@var{n}
10259 @opindex mstructure-size-boundary
10260 The size of all structures and unions will be rounded up to a multiple
10261 of the number of bits set by this option.  Permissible values are 8, 32
10262 and 64.  The default value varies for different toolchains.  For the COFF
10263 targeted toolchain the default value is 8.  A value of 64 is only allowed
10264 if the underlying ABI supports it.
10265
10266 Specifying the larger number can produce faster, more efficient code, but
10267 can also increase the size of the program.  Different values are potentially
10268 incompatible.  Code compiled with one value cannot necessarily expect to
10269 work with code or libraries compiled with another value, if they exchange
10270 information using structures or unions.
10271
10272 @item -mabort-on-noreturn
10273 @opindex mabort-on-noreturn
10274 Generate a call to the function @code{abort} at the end of a
10275 @code{noreturn} function.  It will be executed if the function tries to
10276 return.
10277
10278 @item -mlong-calls
10279 @itemx -mno-long-calls
10280 @opindex mlong-calls
10281 @opindex mno-long-calls
10282 Tells the compiler to perform function calls by first loading the
10283 address of the function into a register and then performing a subroutine
10284 call on this register.  This switch is needed if the target function
10285 will lie outside of the 64 megabyte addressing range of the offset based
10286 version of subroutine call instruction.
10287
10288 Even if this switch is enabled, not all function calls will be turned
10289 into long calls.  The heuristic is that static functions, functions
10290 which have the @samp{short-call} attribute, functions that are inside
10291 the scope of a @samp{#pragma no_long_calls} directive and functions whose
10292 definitions have already been compiled within the current compilation
10293 unit, will not be turned into long calls.  The exception to this rule is
10294 that weak function definitions, functions with the @samp{long-call}
10295 attribute or the @samp{section} attribute, and functions that are within
10296 the scope of a @samp{#pragma long_calls} directive, will always be
10297 turned into long calls.
10298
10299 This feature is not enabled by default.  Specifying
10300 @option{-mno-long-calls} will restore the default behavior, as will
10301 placing the function calls within the scope of a @samp{#pragma
10302 long_calls_off} directive.  Note these switches have no effect on how
10303 the compiler generates code to handle function calls via function
10304 pointers.
10305
10306 @item -msingle-pic-base
10307 @opindex msingle-pic-base
10308 Treat the register used for PIC addressing as read-only, rather than
10309 loading it in the prologue for each function.  The run-time system is
10310 responsible for initializing this register with an appropriate value
10311 before execution begins.
10312
10313 @item -mpic-register=@var{reg}
10314 @opindex mpic-register
10315 Specify the register to be used for PIC addressing.  The default is R10
10316 unless stack-checking is enabled, when R9 is used.
10317
10318 @item -mcirrus-fix-invalid-insns
10319 @opindex mcirrus-fix-invalid-insns
10320 @opindex mno-cirrus-fix-invalid-insns
10321 Insert NOPs into the instruction stream to in order to work around
10322 problems with invalid Maverick instruction combinations.  This option
10323 is only valid if the @option{-mcpu=ep9312} option has been used to
10324 enable generation of instructions for the Cirrus Maverick floating
10325 point co-processor.  This option is not enabled by default, since the
10326 problem is only present in older Maverick implementations.  The default
10327 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10328 switch.
10329
10330 @item -mpoke-function-name
10331 @opindex mpoke-function-name
10332 Write the name of each function into the text section, directly
10333 preceding the function prologue.  The generated code is similar to this:
10334
10335 @smallexample
10336      t0
10337          .ascii "arm_poke_function_name", 0
10338          .align
10339      t1
10340          .word 0xff000000 + (t1 - t0)
10341      arm_poke_function_name
10342          mov     ip, sp
10343          stmfd   sp!, @{fp, ip, lr, pc@}
10344          sub     fp, ip, #4
10345 @end smallexample
10346
10347 When performing a stack backtrace, code can inspect the value of
10348 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10349 location @code{pc - 12} and the top 8 bits are set, then we know that
10350 there is a function name embedded immediately preceding this location
10351 and has length @code{((pc[-3]) & 0xff000000)}.
10352
10353 @item -mthumb
10354 @opindex mthumb
10355 Generate code for the Thumb instruction set.  The default is to
10356 use the 32-bit ARM instruction set.
10357 This option automatically enables either 16-bit Thumb-1 or
10358 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
10359 and @option{-march=@var{name}} options.  This option is not passed to the
10360 assembler. If you want to force assembler files to be interpreted as Thumb code,
10361 either add a @samp{.thumb} directive to the source or pass the @option{-mthumb}
10362 option directly to the assembler by prefixing it with @option{-Wa}.
10363
10364 @item -mtpcs-frame
10365 @opindex mtpcs-frame
10366 Generate a stack frame that is compliant with the Thumb Procedure Call
10367 Standard for all non-leaf functions.  (A leaf function is one that does
10368 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10369
10370 @item -mtpcs-leaf-frame
10371 @opindex mtpcs-leaf-frame
10372 Generate a stack frame that is compliant with the Thumb Procedure Call
10373 Standard for all leaf functions.  (A leaf function is one that does
10374 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10375
10376 @item -mcallee-super-interworking
10377 @opindex mcallee-super-interworking
10378 Gives all externally visible functions in the file being compiled an ARM
10379 instruction set header which switches to Thumb mode before executing the
10380 rest of the function.  This allows these functions to be called from
10381 non-interworking code.  This option is not valid in AAPCS configurations
10382 because interworking is enabled by default.
10383
10384 @item -mcaller-super-interworking
10385 @opindex mcaller-super-interworking
10386 Allows calls via function pointers (including virtual functions) to
10387 execute correctly regardless of whether the target code has been
10388 compiled for interworking or not.  There is a small overhead in the cost
10389 of executing a function pointer if this option is enabled.  This option
10390 is not valid in AAPCS configurations because interworking is enabled
10391 by default.
10392
10393 @item -mtp=@var{name}
10394 @opindex mtp
10395 Specify the access model for the thread local storage pointer.  The valid
10396 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10397 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10398 (supported in the arm6k architecture), and @option{auto}, which uses the
10399 best available method for the selected processor.  The default setting is
10400 @option{auto}.
10401
10402 @item -mword-relocations
10403 @opindex mword-relocations
10404 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
10405 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10406 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10407 is specified.
10408
10409 @item -mfix-cortex-m3-ldrd
10410 @opindex mfix-cortex-m3-ldrd
10411 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10412 with overlapping destination and base registers are used.  This option avoids
10413 generating these instructions.  This option is enabled by default when
10414 @option{-mcpu=cortex-m3} is specified.
10415
10416 @end table
10417
10418 @node AVR Options
10419 @subsection AVR Options
10420 @cindex AVR Options
10421
10422 These options are defined for AVR implementations:
10423
10424 @table @gcctabopt
10425 @item -mmcu=@var{mcu}
10426 @opindex mmcu
10427 Specify ATMEL AVR instruction set or MCU type.
10428
10429 Instruction set avr1 is for the minimal AVR core, not supported by the C
10430 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
10431 attiny11, attiny12, attiny15, attiny28).
10432
10433 Instruction set avr2 (default) is for the classic AVR core with up to
10434 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
10435 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
10436 at90c8534, at90s8535).
10437
10438 Instruction set avr3 is for the classic AVR core with up to 128K program
10439 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
10440
10441 Instruction set avr4 is for the enhanced AVR core with up to 8K program
10442 memory space (MCU types: atmega8, atmega83, atmega85).
10443
10444 Instruction set avr5 is for the enhanced AVR core with up to 128K program
10445 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
10446 atmega64, atmega128, at43usb355, at94k).
10447
10448 @item -mno-interrupts
10449 @opindex mno-interrupts
10450 Generated code is not compatible with hardware interrupts.
10451 Code size will be smaller.
10452
10453 @item -mcall-prologues
10454 @opindex mcall-prologues
10455 Functions prologues/epilogues expanded as call to appropriate
10456 subroutines.  Code size will be smaller.
10457
10458 @item -mtiny-stack
10459 @opindex mtiny-stack
10460 Change only the low 8 bits of the stack pointer.
10461
10462 @item -mint8
10463 @opindex mint8
10464 Assume int to be 8 bit integer.  This affects the sizes of all types: A
10465 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
10466 and long long will be 4 bytes.  Please note that this option does not
10467 comply to the C standards, but it will provide you with smaller code
10468 size.
10469 @end table
10470
10471 @node Blackfin Options
10472 @subsection Blackfin Options
10473 @cindex Blackfin Options
10474
10475 @table @gcctabopt
10476 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
10477 @opindex mcpu=
10478 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
10479 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
10480 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
10481 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
10482 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
10483 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
10484 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
10485 @samp{bf561}.
10486 The optional @var{sirevision} specifies the silicon revision of the target
10487 Blackfin processor.  Any workarounds available for the targeted silicon revision
10488 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
10489 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
10490 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
10491 hexadecimal digits representing the major and minor numbers in the silicon
10492 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
10493 is not defined.  If @var{sirevision} is @samp{any}, the
10494 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
10495 If this optional @var{sirevision} is not used, GCC assumes the latest known
10496 silicon revision of the targeted Blackfin processor.
10497
10498 Support for @samp{bf561} is incomplete.  For @samp{bf561},
10499 Only the processor macro is defined.
10500 Without this option, @samp{bf532} is used as the processor by default.
10501 The corresponding predefined processor macros for @var{cpu} is to
10502 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
10503 provided by libgloss to be linked in if @option{-msim} is not given.
10504
10505 @item -msim
10506 @opindex msim
10507 Specifies that the program will be run on the simulator.  This causes
10508 the simulator BSP provided by libgloss to be linked in.  This option
10509 has effect only for @samp{bfin-elf} toolchain.
10510 Certain other options, such as @option{-mid-shared-library} and
10511 @option{-mfdpic}, imply @option{-msim}.
10512
10513 @item -momit-leaf-frame-pointer
10514 @opindex momit-leaf-frame-pointer
10515 Don't keep the frame pointer in a register for leaf functions.  This
10516 avoids the instructions to save, set up and restore frame pointers and
10517 makes an extra register available in leaf functions.  The option
10518 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10519 which might make debugging harder.
10520
10521 @item -mspecld-anomaly
10522 @opindex mspecld-anomaly
10523 When enabled, the compiler will ensure that the generated code does not
10524 contain speculative loads after jump instructions. If this option is used,
10525 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
10526
10527 @item -mno-specld-anomaly
10528 @opindex mno-specld-anomaly
10529 Don't generate extra code to prevent speculative loads from occurring.
10530
10531 @item -mcsync-anomaly
10532 @opindex mcsync-anomaly
10533 When enabled, the compiler will ensure that the generated code does not
10534 contain CSYNC or SSYNC instructions too soon after conditional branches.
10535 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
10536
10537 @item -mno-csync-anomaly
10538 @opindex mno-csync-anomaly
10539 Don't generate extra code to prevent CSYNC or SSYNC instructions from
10540 occurring too soon after a conditional branch.
10541
10542 @item -mlow-64k
10543 @opindex mlow-64k
10544 When enabled, the compiler is free to take advantage of the knowledge that
10545 the entire program fits into the low 64k of memory.
10546
10547 @item -mno-low-64k
10548 @opindex mno-low-64k
10549 Assume that the program is arbitrarily large.  This is the default.
10550
10551 @item -mstack-check-l1
10552 @opindex mstack-check-l1
10553 Do stack checking using information placed into L1 scratchpad memory by the
10554 uClinux kernel.
10555
10556 @item -mid-shared-library
10557 @opindex mid-shared-library
10558 Generate code that supports shared libraries via the library ID method.
10559 This allows for execute in place and shared libraries in an environment
10560 without virtual memory management.  This option implies @option{-fPIC}.
10561 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10562
10563 @item -mno-id-shared-library
10564 @opindex mno-id-shared-library
10565 Generate code that doesn't assume ID based shared libraries are being used.
10566 This is the default.
10567
10568 @item -mleaf-id-shared-library
10569 @opindex mleaf-id-shared-library
10570 Generate code that supports shared libraries via the library ID method,
10571 but assumes that this library or executable won't link against any other
10572 ID shared libraries.  That allows the compiler to use faster code for jumps
10573 and calls.
10574
10575 @item -mno-leaf-id-shared-library
10576 @opindex mno-leaf-id-shared-library
10577 Do not assume that the code being compiled won't link against any ID shared
10578 libraries.  Slower code will be generated for jump and call insns.
10579
10580 @item -mshared-library-id=n
10581 @opindex mshared-library-id
10582 Specified the identification number of the ID based shared library being
10583 compiled.  Specifying a value of 0 will generate more compact code, specifying
10584 other values will force the allocation of that number to the current
10585 library but is no more space or time efficient than omitting this option.
10586
10587 @item -msep-data
10588 @opindex msep-data
10589 Generate code that allows the data segment to be located in a different
10590 area of memory from the text segment.  This allows for execute in place in
10591 an environment without virtual memory management by eliminating relocations
10592 against the text section.
10593
10594 @item -mno-sep-data
10595 @opindex mno-sep-data
10596 Generate code that assumes that the data segment follows the text segment.
10597 This is the default.
10598
10599 @item -mlong-calls
10600 @itemx -mno-long-calls
10601 @opindex mlong-calls
10602 @opindex mno-long-calls
10603 Tells the compiler to perform function calls by first loading the
10604 address of the function into a register and then performing a subroutine
10605 call on this register.  This switch is needed if the target function
10606 will lie outside of the 24 bit addressing range of the offset based
10607 version of subroutine call instruction.
10608
10609 This feature is not enabled by default.  Specifying
10610 @option{-mno-long-calls} will restore the default behavior.  Note these
10611 switches have no effect on how the compiler generates code to handle
10612 function calls via function pointers.
10613
10614 @item -mfast-fp
10615 @opindex mfast-fp
10616 Link with the fast floating-point library. This library relaxes some of
10617 the IEEE floating-point standard's rules for checking inputs against
10618 Not-a-Number (NAN), in the interest of performance.
10619
10620 @item -minline-plt
10621 @opindex minline-plt
10622 Enable inlining of PLT entries in function calls to functions that are
10623 not known to bind locally.  It has no effect without @option{-mfdpic}.
10624
10625 @item -mmulticore
10626 @opindex mmulticore
10627 Build standalone application for multicore Blackfin processor. Proper
10628 start files and link scripts will be used to support multicore.
10629 This option defines @code{__BFIN_MULTICORE}. It can only be used with
10630 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
10631 @option{-mcorea} or @option{-mcoreb}. If it's used without
10632 @option{-mcorea} or @option{-mcoreb}, single application/dual core
10633 programming model is used. In this model, the main function of Core B
10634 should be named as coreb_main. If it's used with @option{-mcorea} or
10635 @option{-mcoreb}, one application per core programming model is used.
10636 If this option is not used, single core application programming
10637 model is used.
10638
10639 @item -mcorea
10640 @opindex mcorea
10641 Build standalone application for Core A of BF561 when using
10642 one application per core programming model. Proper start files
10643 and link scripts will be used to support Core A. This option
10644 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
10645
10646 @item -mcoreb
10647 @opindex mcoreb
10648 Build standalone application for Core B of BF561 when using
10649 one application per core programming model. Proper start files
10650 and link scripts will be used to support Core B. This option
10651 defines @code{__BFIN_COREB}. When this option is used, coreb_main
10652 should be used instead of main. It must be used with
10653 @option{-mmulticore}.
10654
10655 @item -msdram
10656 @opindex msdram
10657 Build standalone application for SDRAM. Proper start files and
10658 link scripts will be used to put the application into SDRAM.
10659 Loader should initialize SDRAM before loading the application
10660 into SDRAM. This option defines @code{__BFIN_SDRAM}.
10661
10662 @item -micplb
10663 @opindex micplb
10664 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
10665 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
10666 are enabled; for standalone applications the default is off.
10667 @end table
10668
10669 @node CRIS Options
10670 @subsection CRIS Options
10671 @cindex CRIS Options
10672
10673 These options are defined specifically for the CRIS ports.
10674
10675 @table @gcctabopt
10676 @item -march=@var{architecture-type}
10677 @itemx -mcpu=@var{architecture-type}
10678 @opindex march
10679 @opindex mcpu
10680 Generate code for the specified architecture.  The choices for
10681 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
10682 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
10683 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
10684 @samp{v10}.
10685
10686 @item -mtune=@var{architecture-type}
10687 @opindex mtune
10688 Tune to @var{architecture-type} everything applicable about the generated
10689 code, except for the ABI and the set of available instructions.  The
10690 choices for @var{architecture-type} are the same as for
10691 @option{-march=@var{architecture-type}}.
10692
10693 @item -mmax-stack-frame=@var{n}
10694 @opindex mmax-stack-frame
10695 Warn when the stack frame of a function exceeds @var{n} bytes.
10696
10697 @item -metrax4
10698 @itemx -metrax100
10699 @opindex metrax4
10700 @opindex metrax100
10701 The options @option{-metrax4} and @option{-metrax100} are synonyms for
10702 @option{-march=v3} and @option{-march=v8} respectively.
10703
10704 @item -mmul-bug-workaround
10705 @itemx -mno-mul-bug-workaround
10706 @opindex mmul-bug-workaround
10707 @opindex mno-mul-bug-workaround
10708 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
10709 models where it applies.  This option is active by default.
10710
10711 @item -mpdebug
10712 @opindex mpdebug
10713 Enable CRIS-specific verbose debug-related information in the assembly
10714 code.  This option also has the effect to turn off the @samp{#NO_APP}
10715 formatted-code indicator to the assembler at the beginning of the
10716 assembly file.
10717
10718 @item -mcc-init
10719 @opindex mcc-init
10720 Do not use condition-code results from previous instruction; always emit
10721 compare and test instructions before use of condition codes.
10722
10723 @item -mno-side-effects
10724 @opindex mno-side-effects
10725 Do not emit instructions with side-effects in addressing modes other than
10726 post-increment.
10727
10728 @item -mstack-align
10729 @itemx -mno-stack-align
10730 @itemx -mdata-align
10731 @itemx -mno-data-align
10732 @itemx -mconst-align
10733 @itemx -mno-const-align
10734 @opindex mstack-align
10735 @opindex mno-stack-align
10736 @opindex mdata-align
10737 @opindex mno-data-align
10738 @opindex mconst-align
10739 @opindex mno-const-align
10740 These options (no-options) arranges (eliminate arrangements) for the
10741 stack-frame, individual data and constants to be aligned for the maximum
10742 single data access size for the chosen CPU model.  The default is to
10743 arrange for 32-bit alignment.  ABI details such as structure layout are
10744 not affected by these options.
10745
10746 @item -m32-bit
10747 @itemx -m16-bit
10748 @itemx -m8-bit
10749 @opindex m32-bit
10750 @opindex m16-bit
10751 @opindex m8-bit
10752 Similar to the stack- data- and const-align options above, these options
10753 arrange for stack-frame, writable data and constants to all be 32-bit,
10754 16-bit or 8-bit aligned.  The default is 32-bit alignment.
10755
10756 @item -mno-prologue-epilogue
10757 @itemx -mprologue-epilogue
10758 @opindex mno-prologue-epilogue
10759 @opindex mprologue-epilogue
10760 With @option{-mno-prologue-epilogue}, the normal function prologue and
10761 epilogue that sets up the stack-frame are omitted and no return
10762 instructions or return sequences are generated in the code.  Use this
10763 option only together with visual inspection of the compiled code: no
10764 warnings or errors are generated when call-saved registers must be saved,
10765 or storage for local variable needs to be allocated.
10766
10767 @item -mno-gotplt
10768 @itemx -mgotplt
10769 @opindex mno-gotplt
10770 @opindex mgotplt
10771 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
10772 instruction sequences that load addresses for functions from the PLT part
10773 of the GOT rather than (traditional on other architectures) calls to the
10774 PLT@.  The default is @option{-mgotplt}.
10775
10776 @item -melf
10777 @opindex melf
10778 Legacy no-op option only recognized with the cris-axis-elf and
10779 cris-axis-linux-gnu targets.
10780
10781 @item -mlinux
10782 @opindex mlinux
10783 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
10784
10785 @item -sim
10786 @opindex sim
10787 This option, recognized for the cris-axis-elf arranges
10788 to link with input-output functions from a simulator library.  Code,
10789 initialized data and zero-initialized data are allocated consecutively.
10790
10791 @item -sim2
10792 @opindex sim2
10793 Like @option{-sim}, but pass linker options to locate initialized data at
10794 0x40000000 and zero-initialized data at 0x80000000.
10795 @end table
10796
10797 @node CRX Options
10798 @subsection CRX Options
10799 @cindex CRX Options
10800
10801 These options are defined specifically for the CRX ports.
10802
10803 @table @gcctabopt
10804
10805 @item -mmac
10806 @opindex mmac
10807 Enable the use of multiply-accumulate instructions. Disabled by default.
10808
10809 @item -mpush-args
10810 @opindex mpush-args
10811 Push instructions will be used to pass outgoing arguments when functions
10812 are called. Enabled by default.
10813 @end table
10814
10815 @node Darwin Options
10816 @subsection Darwin Options
10817 @cindex Darwin options
10818
10819 These options are defined for all architectures running the Darwin operating
10820 system.
10821
10822 FSF GCC on Darwin does not create ``fat'' object files; it will create
10823 an object file for the single architecture that it was built to
10824 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
10825 @option{-arch} options are used; it does so by running the compiler or
10826 linker multiple times and joining the results together with
10827 @file{lipo}.
10828
10829 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
10830 @samp{i686}) is determined by the flags that specify the ISA
10831 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
10832 @option{-force_cpusubtype_ALL} option can be used to override this.
10833
10834 The Darwin tools vary in their behavior when presented with an ISA
10835 mismatch.  The assembler, @file{as}, will only permit instructions to
10836 be used that are valid for the subtype of the file it is generating,
10837 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
10838 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
10839 and print an error if asked to create a shared library with a less
10840 restrictive subtype than its input files (for instance, trying to put
10841 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
10842 for executables, @file{ld}, will quietly give the executable the most
10843 restrictive subtype of any of its input files.
10844
10845 @table @gcctabopt
10846 @item -F@var{dir}
10847 @opindex F
10848 Add the framework directory @var{dir} to the head of the list of
10849 directories to be searched for header files.  These directories are
10850 interleaved with those specified by @option{-I} options and are
10851 scanned in a left-to-right order.
10852
10853 A framework directory is a directory with frameworks in it.  A
10854 framework is a directory with a @samp{"Headers"} and/or
10855 @samp{"PrivateHeaders"} directory contained directly in it that ends
10856 in @samp{".framework"}.  The name of a framework is the name of this
10857 directory excluding the @samp{".framework"}.  Headers associated with
10858 the framework are found in one of those two directories, with
10859 @samp{"Headers"} being searched first.  A subframework is a framework
10860 directory that is in a framework's @samp{"Frameworks"} directory.
10861 Includes of subframework headers can only appear in a header of a
10862 framework that contains the subframework, or in a sibling subframework
10863 header.  Two subframeworks are siblings if they occur in the same
10864 framework.  A subframework should not have the same name as a
10865 framework, a warning will be issued if this is violated.  Currently a
10866 subframework cannot have subframeworks, in the future, the mechanism
10867 may be extended to support this.  The standard frameworks can be found
10868 in @samp{"/System/Library/Frameworks"} and
10869 @samp{"/Library/Frameworks"}.  An example include looks like
10870 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
10871 the name of the framework and header.h is found in the
10872 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
10873
10874 @item -iframework@var{dir}
10875 @opindex iframework
10876 Like @option{-F} except the directory is a treated as a system
10877 directory.  The main difference between this @option{-iframework} and
10878 @option{-F} is that with @option{-iframework} the compiler does not
10879 warn about constructs contained within header files found via
10880 @var{dir}.  This option is valid only for the C family of languages.
10881
10882 @item -gused
10883 @opindex gused
10884 Emit debugging information for symbols that are used.  For STABS
10885 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
10886 This is by default ON@.
10887
10888 @item -gfull
10889 @opindex gfull
10890 Emit debugging information for all symbols and types.
10891
10892 @item -mmacosx-version-min=@var{version}
10893 The earliest version of MacOS X that this executable will run on
10894 is @var{version}.  Typical values of @var{version} include @code{10.1},
10895 @code{10.2}, and @code{10.3.9}.
10896
10897 If the compiler was built to use the system's headers by default,
10898 then the default for this option is the system version on which the
10899 compiler is running, otherwise the default is to make choices which
10900 are compatible with as many systems and code bases as possible.
10901
10902 @item -mkernel
10903 @opindex mkernel
10904 Enable kernel development mode.  The @option{-mkernel} option sets
10905 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
10906 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
10907 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
10908 applicable.  This mode also sets @option{-mno-altivec},
10909 @option{-msoft-float}, @option{-fno-builtin} and
10910 @option{-mlong-branch} for PowerPC targets.
10911
10912 @item -mone-byte-bool
10913 @opindex mone-byte-bool
10914 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
10915 By default @samp{sizeof(bool)} is @samp{4} when compiling for
10916 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
10917 option has no effect on x86.
10918
10919 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
10920 to generate code that is not binary compatible with code generated
10921 without that switch.  Using this switch may require recompiling all
10922 other modules in a program, including system libraries.  Use this
10923 switch to conform to a non-default data model.
10924
10925 @item -mfix-and-continue
10926 @itemx -ffix-and-continue
10927 @itemx -findirect-data
10928 @opindex mfix-and-continue
10929 @opindex ffix-and-continue
10930 @opindex findirect-data
10931 Generate code suitable for fast turn around development.  Needed to
10932 enable gdb to dynamically load @code{.o} files into already running
10933 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
10934 are provided for backwards compatibility.
10935
10936 @item -all_load
10937 @opindex all_load
10938 Loads all members of static archive libraries.
10939 See man ld(1) for more information.
10940
10941 @item -arch_errors_fatal
10942 @opindex arch_errors_fatal
10943 Cause the errors having to do with files that have the wrong architecture
10944 to be fatal.
10945
10946 @item -bind_at_load
10947 @opindex bind_at_load
10948 Causes the output file to be marked such that the dynamic linker will
10949 bind all undefined references when the file is loaded or launched.
10950
10951 @item -bundle
10952 @opindex bundle
10953 Produce a Mach-o bundle format file.
10954 See man ld(1) for more information.
10955
10956 @item -bundle_loader @var{executable}
10957 @opindex bundle_loader
10958 This option specifies the @var{executable} that will be loading the build
10959 output file being linked.  See man ld(1) for more information.
10960
10961 @item -dynamiclib
10962 @opindex dynamiclib
10963 When passed this option, GCC will produce a dynamic library instead of
10964 an executable when linking, using the Darwin @file{libtool} command.
10965
10966 @item -force_cpusubtype_ALL
10967 @opindex force_cpusubtype_ALL
10968 This causes GCC's output file to have the @var{ALL} subtype, instead of
10969 one controlled by the @option{-mcpu} or @option{-march} option.
10970
10971 @item -allowable_client  @var{client_name}
10972 @itemx -client_name
10973 @itemx -compatibility_version
10974 @itemx -current_version
10975 @itemx -dead_strip
10976 @itemx -dependency-file
10977 @itemx -dylib_file
10978 @itemx -dylinker_install_name
10979 @itemx -dynamic
10980 @itemx -exported_symbols_list
10981 @itemx -filelist
10982 @need 800
10983 @itemx -flat_namespace
10984 @itemx -force_flat_namespace
10985 @itemx -headerpad_max_install_names
10986 @itemx -image_base
10987 @itemx -init
10988 @itemx -install_name
10989 @itemx -keep_private_externs
10990 @itemx -multi_module
10991 @itemx -multiply_defined
10992 @itemx -multiply_defined_unused
10993 @need 800
10994 @itemx -noall_load
10995 @itemx -no_dead_strip_inits_and_terms
10996 @itemx -nofixprebinding
10997 @itemx -nomultidefs
10998 @itemx -noprebind
10999 @itemx -noseglinkedit
11000 @itemx -pagezero_size
11001 @itemx -prebind
11002 @itemx -prebind_all_twolevel_modules
11003 @itemx -private_bundle
11004 @need 800
11005 @itemx -read_only_relocs
11006 @itemx -sectalign
11007 @itemx -sectobjectsymbols
11008 @itemx -whyload
11009 @itemx -seg1addr
11010 @itemx -sectcreate
11011 @itemx -sectobjectsymbols
11012 @itemx -sectorder
11013 @itemx -segaddr
11014 @itemx -segs_read_only_addr
11015 @need 800
11016 @itemx -segs_read_write_addr
11017 @itemx -seg_addr_table
11018 @itemx -seg_addr_table_filename
11019 @itemx -seglinkedit
11020 @itemx -segprot
11021 @itemx -segs_read_only_addr
11022 @itemx -segs_read_write_addr
11023 @itemx -single_module
11024 @itemx -static
11025 @itemx -sub_library
11026 @need 800
11027 @itemx -sub_umbrella
11028 @itemx -twolevel_namespace
11029 @itemx -umbrella
11030 @itemx -undefined
11031 @itemx -unexported_symbols_list
11032 @itemx -weak_reference_mismatches
11033 @itemx -whatsloaded
11034 @opindex allowable_client
11035 @opindex client_name
11036 @opindex compatibility_version
11037 @opindex current_version
11038 @opindex dead_strip
11039 @opindex dependency-file
11040 @opindex dylib_file
11041 @opindex dylinker_install_name
11042 @opindex dynamic
11043 @opindex exported_symbols_list
11044 @opindex filelist
11045 @opindex flat_namespace
11046 @opindex force_flat_namespace
11047 @opindex headerpad_max_install_names
11048 @opindex image_base
11049 @opindex init
11050 @opindex install_name
11051 @opindex keep_private_externs
11052 @opindex multi_module
11053 @opindex multiply_defined
11054 @opindex multiply_defined_unused
11055 @opindex noall_load
11056 @opindex no_dead_strip_inits_and_terms
11057 @opindex nofixprebinding
11058 @opindex nomultidefs
11059 @opindex noprebind
11060 @opindex noseglinkedit
11061 @opindex pagezero_size
11062 @opindex prebind
11063 @opindex prebind_all_twolevel_modules
11064 @opindex private_bundle
11065 @opindex read_only_relocs
11066 @opindex sectalign
11067 @opindex sectobjectsymbols
11068 @opindex whyload
11069 @opindex seg1addr
11070 @opindex sectcreate
11071 @opindex sectobjectsymbols
11072 @opindex sectorder
11073 @opindex segaddr
11074 @opindex segs_read_only_addr
11075 @opindex segs_read_write_addr
11076 @opindex seg_addr_table
11077 @opindex seg_addr_table_filename
11078 @opindex seglinkedit
11079 @opindex segprot
11080 @opindex segs_read_only_addr
11081 @opindex segs_read_write_addr
11082 @opindex single_module
11083 @opindex static
11084 @opindex sub_library
11085 @opindex sub_umbrella
11086 @opindex twolevel_namespace
11087 @opindex umbrella
11088 @opindex undefined
11089 @opindex unexported_symbols_list
11090 @opindex weak_reference_mismatches
11091 @opindex whatsloaded
11092 These options are passed to the Darwin linker.  The Darwin linker man page
11093 describes them in detail.
11094 @end table
11095
11096 @node DEC Alpha Options
11097 @subsection DEC Alpha Options
11098
11099 These @samp{-m} options are defined for the DEC Alpha implementations:
11100
11101 @table @gcctabopt
11102 @item -mno-soft-float
11103 @itemx -msoft-float
11104 @opindex mno-soft-float
11105 @opindex msoft-float
11106 Use (do not use) the hardware floating-point instructions for
11107 floating-point operations.  When @option{-msoft-float} is specified,
11108 functions in @file{libgcc.a} will be used to perform floating-point
11109 operations.  Unless they are replaced by routines that emulate the
11110 floating-point operations, or compiled in such a way as to call such
11111 emulations routines, these routines will issue floating-point
11112 operations.   If you are compiling for an Alpha without floating-point
11113 operations, you must ensure that the library is built so as not to call
11114 them.
11115
11116 Note that Alpha implementations without floating-point operations are
11117 required to have floating-point registers.
11118
11119 @item -mfp-reg
11120 @itemx -mno-fp-regs
11121 @opindex mfp-reg
11122 @opindex mno-fp-regs
11123 Generate code that uses (does not use) the floating-point register set.
11124 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
11125 register set is not used, floating point operands are passed in integer
11126 registers as if they were integers and floating-point results are passed
11127 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
11128 so any function with a floating-point argument or return value called by code
11129 compiled with @option{-mno-fp-regs} must also be compiled with that
11130 option.
11131
11132 A typical use of this option is building a kernel that does not use,
11133 and hence need not save and restore, any floating-point registers.
11134
11135 @item -mieee
11136 @opindex mieee
11137 The Alpha architecture implements floating-point hardware optimized for
11138 maximum performance.  It is mostly compliant with the IEEE floating
11139 point standard.  However, for full compliance, software assistance is
11140 required.  This option generates code fully IEEE compliant code
11141 @emph{except} that the @var{inexact-flag} is not maintained (see below).
11142 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
11143 defined during compilation.  The resulting code is less efficient but is
11144 able to correctly support denormalized numbers and exceptional IEEE
11145 values such as not-a-number and plus/minus infinity.  Other Alpha
11146 compilers call this option @option{-ieee_with_no_inexact}.
11147
11148 @item -mieee-with-inexact
11149 @opindex mieee-with-inexact
11150 This is like @option{-mieee} except the generated code also maintains
11151 the IEEE @var{inexact-flag}.  Turning on this option causes the
11152 generated code to implement fully-compliant IEEE math.  In addition to
11153 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
11154 macro.  On some Alpha implementations the resulting code may execute
11155 significantly slower than the code generated by default.  Since there is
11156 very little code that depends on the @var{inexact-flag}, you should
11157 normally not specify this option.  Other Alpha compilers call this
11158 option @option{-ieee_with_inexact}.
11159
11160 @item -mfp-trap-mode=@var{trap-mode}
11161 @opindex mfp-trap-mode
11162 This option controls what floating-point related traps are enabled.
11163 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
11164 The trap mode can be set to one of four values:
11165
11166 @table @samp
11167 @item n
11168 This is the default (normal) setting.  The only traps that are enabled
11169 are the ones that cannot be disabled in software (e.g., division by zero
11170 trap).
11171
11172 @item u
11173 In addition to the traps enabled by @samp{n}, underflow traps are enabled
11174 as well.
11175
11176 @item su
11177 Like @samp{u}, but the instructions are marked to be safe for software
11178 completion (see Alpha architecture manual for details).
11179
11180 @item sui
11181 Like @samp{su}, but inexact traps are enabled as well.
11182 @end table
11183
11184 @item -mfp-rounding-mode=@var{rounding-mode}
11185 @opindex mfp-rounding-mode
11186 Selects the IEEE rounding mode.  Other Alpha compilers call this option
11187 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
11188 of:
11189
11190 @table @samp
11191 @item n
11192 Normal IEEE rounding mode.  Floating point numbers are rounded towards
11193 the nearest machine number or towards the even machine number in case
11194 of a tie.
11195
11196 @item m
11197 Round towards minus infinity.
11198
11199 @item c
11200 Chopped rounding mode.  Floating point numbers are rounded towards zero.
11201
11202 @item d
11203 Dynamic rounding mode.  A field in the floating point control register
11204 (@var{fpcr}, see Alpha architecture reference manual) controls the
11205 rounding mode in effect.  The C library initializes this register for
11206 rounding towards plus infinity.  Thus, unless your program modifies the
11207 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
11208 @end table
11209
11210 @item -mtrap-precision=@var{trap-precision}
11211 @opindex mtrap-precision
11212 In the Alpha architecture, floating point traps are imprecise.  This
11213 means without software assistance it is impossible to recover from a
11214 floating trap and program execution normally needs to be terminated.
11215 GCC can generate code that can assist operating system trap handlers
11216 in determining the exact location that caused a floating point trap.
11217 Depending on the requirements of an application, different levels of
11218 precisions can be selected:
11219
11220 @table @samp
11221 @item p
11222 Program precision.  This option is the default and means a trap handler
11223 can only identify which program caused a floating point exception.
11224
11225 @item f
11226 Function precision.  The trap handler can determine the function that
11227 caused a floating point exception.
11228
11229 @item i
11230 Instruction precision.  The trap handler can determine the exact
11231 instruction that caused a floating point exception.
11232 @end table
11233
11234 Other Alpha compilers provide the equivalent options called
11235 @option{-scope_safe} and @option{-resumption_safe}.
11236
11237 @item -mieee-conformant
11238 @opindex mieee-conformant
11239 This option marks the generated code as IEEE conformant.  You must not
11240 use this option unless you also specify @option{-mtrap-precision=i} and either
11241 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
11242 is to emit the line @samp{.eflag 48} in the function prologue of the
11243 generated assembly file.  Under DEC Unix, this has the effect that
11244 IEEE-conformant math library routines will be linked in.
11245
11246 @item -mbuild-constants
11247 @opindex mbuild-constants
11248 Normally GCC examines a 32- or 64-bit integer constant to
11249 see if it can construct it from smaller constants in two or three
11250 instructions.  If it cannot, it will output the constant as a literal and
11251 generate code to load it from the data segment at runtime.
11252
11253 Use this option to require GCC to construct @emph{all} integer constants
11254 using code, even if it takes more instructions (the maximum is six).
11255
11256 You would typically use this option to build a shared library dynamic
11257 loader.  Itself a shared library, it must relocate itself in memory
11258 before it can find the variables and constants in its own data segment.
11259
11260 @item -malpha-as
11261 @itemx -mgas
11262 @opindex malpha-as
11263 @opindex mgas
11264 Select whether to generate code to be assembled by the vendor-supplied
11265 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
11266
11267 @item -mbwx
11268 @itemx -mno-bwx
11269 @itemx -mcix
11270 @itemx -mno-cix
11271 @itemx -mfix
11272 @itemx -mno-fix
11273 @itemx -mmax
11274 @itemx -mno-max
11275 @opindex mbwx
11276 @opindex mno-bwx
11277 @opindex mcix
11278 @opindex mno-cix
11279 @opindex mfix
11280 @opindex mno-fix
11281 @opindex mmax
11282 @opindex mno-max
11283 Indicate whether GCC should generate code to use the optional BWX,
11284 CIX, FIX and MAX instruction sets.  The default is to use the instruction
11285 sets supported by the CPU type specified via @option{-mcpu=} option or that
11286 of the CPU on which GCC was built if none was specified.
11287
11288 @item -mfloat-vax
11289 @itemx -mfloat-ieee
11290 @opindex mfloat-vax
11291 @opindex mfloat-ieee
11292 Generate code that uses (does not use) VAX F and G floating point
11293 arithmetic instead of IEEE single and double precision.
11294
11295 @item -mexplicit-relocs
11296 @itemx -mno-explicit-relocs
11297 @opindex mexplicit-relocs
11298 @opindex mno-explicit-relocs
11299 Older Alpha assemblers provided no way to generate symbol relocations
11300 except via assembler macros.  Use of these macros does not allow
11301 optimal instruction scheduling.  GNU binutils as of version 2.12
11302 supports a new syntax that allows the compiler to explicitly mark
11303 which relocations should apply to which instructions.  This option
11304 is mostly useful for debugging, as GCC detects the capabilities of
11305 the assembler when it is built and sets the default accordingly.
11306
11307 @item -msmall-data
11308 @itemx -mlarge-data
11309 @opindex msmall-data
11310 @opindex mlarge-data
11311 When @option{-mexplicit-relocs} is in effect, static data is
11312 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
11313 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
11314 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
11315 16-bit relocations off of the @code{$gp} register.  This limits the
11316 size of the small data area to 64KB, but allows the variables to be
11317 directly accessed via a single instruction.
11318
11319 The default is @option{-mlarge-data}.  With this option the data area
11320 is limited to just below 2GB@.  Programs that require more than 2GB of
11321 data must use @code{malloc} or @code{mmap} to allocate the data in the
11322 heap instead of in the program's data segment.
11323
11324 When generating code for shared libraries, @option{-fpic} implies
11325 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
11326
11327 @item -msmall-text
11328 @itemx -mlarge-text
11329 @opindex msmall-text
11330 @opindex mlarge-text
11331 When @option{-msmall-text} is used, the compiler assumes that the
11332 code of the entire program (or shared library) fits in 4MB, and is
11333 thus reachable with a branch instruction.  When @option{-msmall-data}
11334 is used, the compiler can assume that all local symbols share the
11335 same @code{$gp} value, and thus reduce the number of instructions
11336 required for a function call from 4 to 1.
11337
11338 The default is @option{-mlarge-text}.
11339
11340 @item -mcpu=@var{cpu_type}
11341 @opindex mcpu
11342 Set the instruction set and instruction scheduling parameters for
11343 machine type @var{cpu_type}.  You can specify either the @samp{EV}
11344 style name or the corresponding chip number.  GCC supports scheduling
11345 parameters for the EV4, EV5 and EV6 family of processors and will
11346 choose the default values for the instruction set from the processor
11347 you specify.  If you do not specify a processor type, GCC will default
11348 to the processor on which the compiler was built.
11349
11350 Supported values for @var{cpu_type} are
11351
11352 @table @samp
11353 @item ev4
11354 @itemx ev45
11355 @itemx 21064
11356 Schedules as an EV4 and has no instruction set extensions.
11357
11358 @item ev5
11359 @itemx 21164
11360 Schedules as an EV5 and has no instruction set extensions.
11361
11362 @item ev56
11363 @itemx 21164a
11364 Schedules as an EV5 and supports the BWX extension.
11365
11366 @item pca56
11367 @itemx 21164pc
11368 @itemx 21164PC
11369 Schedules as an EV5 and supports the BWX and MAX extensions.
11370
11371 @item ev6
11372 @itemx 21264
11373 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
11374
11375 @item ev67
11376 @itemx 21264a
11377 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
11378 @end table
11379
11380 Native Linux/GNU toolchains also support the value @samp{native},
11381 which selects the best architecture option for the host processor.
11382 @option{-mcpu=native} has no effect if GCC does not recognize
11383 the processor.
11384
11385 @item -mtune=@var{cpu_type}
11386 @opindex mtune
11387 Set only the instruction scheduling parameters for machine type
11388 @var{cpu_type}.  The instruction set is not changed.
11389
11390 Native Linux/GNU toolchains also support the value @samp{native},
11391 which selects the best architecture option for the host processor.
11392 @option{-mtune=native} has no effect if GCC does not recognize
11393 the processor.
11394
11395 @item -mmemory-latency=@var{time}
11396 @opindex mmemory-latency
11397 Sets the latency the scheduler should assume for typical memory
11398 references as seen by the application.  This number is highly
11399 dependent on the memory access patterns used by the application
11400 and the size of the external cache on the machine.
11401
11402 Valid options for @var{time} are
11403
11404 @table @samp
11405 @item @var{number}
11406 A decimal number representing clock cycles.
11407
11408 @item L1
11409 @itemx L2
11410 @itemx L3
11411 @itemx main
11412 The compiler contains estimates of the number of clock cycles for
11413 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
11414 (also called Dcache, Scache, and Bcache), as well as to main memory.
11415 Note that L3 is only valid for EV5.
11416
11417 @end table
11418 @end table
11419
11420 @node DEC Alpha/VMS Options
11421 @subsection DEC Alpha/VMS Options
11422
11423 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
11424
11425 @table @gcctabopt
11426 @item -mvms-return-codes
11427 @opindex mvms-return-codes
11428 Return VMS condition codes from main.  The default is to return POSIX
11429 style condition (e.g.@: error) codes.
11430
11431 @item -mdebug-main=@var{prefix}
11432 @opindex mdebug-main=@var{prefix}
11433 Flag the first routine whose name starts with @var{prefix} as the main
11434 routine for the debugger.
11435
11436 @item -mmalloc64
11437 @opindex mmalloc64
11438 Default to 64bit memory allocation routines.
11439 @end table
11440
11441 @node FR30 Options
11442 @subsection FR30 Options
11443 @cindex FR30 Options
11444
11445 These options are defined specifically for the FR30 port.
11446
11447 @table @gcctabopt
11448
11449 @item -msmall-model
11450 @opindex msmall-model
11451 Use the small address space model.  This can produce smaller code, but
11452 it does assume that all symbolic values and addresses will fit into a
11453 20-bit range.
11454
11455 @item -mno-lsim
11456 @opindex mno-lsim
11457 Assume that run-time support has been provided and so there is no need
11458 to include the simulator library (@file{libsim.a}) on the linker
11459 command line.
11460
11461 @end table
11462
11463 @node FRV Options
11464 @subsection FRV Options
11465 @cindex FRV Options
11466
11467 @table @gcctabopt
11468 @item -mgpr-32
11469 @opindex mgpr-32
11470
11471 Only use the first 32 general purpose registers.
11472
11473 @item -mgpr-64
11474 @opindex mgpr-64
11475
11476 Use all 64 general purpose registers.
11477
11478 @item -mfpr-32
11479 @opindex mfpr-32
11480
11481 Use only the first 32 floating point registers.
11482
11483 @item -mfpr-64
11484 @opindex mfpr-64
11485
11486 Use all 64 floating point registers
11487
11488 @item -mhard-float
11489 @opindex mhard-float
11490
11491 Use hardware instructions for floating point operations.
11492
11493 @item -msoft-float
11494 @opindex msoft-float
11495
11496 Use library routines for floating point operations.
11497
11498 @item -malloc-cc
11499 @opindex malloc-cc
11500
11501 Dynamically allocate condition code registers.
11502
11503 @item -mfixed-cc
11504 @opindex mfixed-cc
11505
11506 Do not try to dynamically allocate condition code registers, only
11507 use @code{icc0} and @code{fcc0}.
11508
11509 @item -mdword
11510 @opindex mdword
11511
11512 Change ABI to use double word insns.
11513
11514 @item -mno-dword
11515 @opindex mno-dword
11516
11517 Do not use double word instructions.
11518
11519 @item -mdouble
11520 @opindex mdouble
11521
11522 Use floating point double instructions.
11523
11524 @item -mno-double
11525 @opindex mno-double
11526
11527 Do not use floating point double instructions.
11528
11529 @item -mmedia
11530 @opindex mmedia
11531
11532 Use media instructions.
11533
11534 @item -mno-media
11535 @opindex mno-media
11536
11537 Do not use media instructions.
11538
11539 @item -mmuladd
11540 @opindex mmuladd
11541
11542 Use multiply and add/subtract instructions.
11543
11544 @item -mno-muladd
11545 @opindex mno-muladd
11546
11547 Do not use multiply and add/subtract instructions.
11548
11549 @item -mfdpic
11550 @opindex mfdpic
11551
11552 Select the FDPIC ABI, that uses function descriptors to represent
11553 pointers to functions.  Without any PIC/PIE-related options, it
11554 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
11555 assumes GOT entries and small data are within a 12-bit range from the
11556 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
11557 are computed with 32 bits.
11558 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11559
11560 @item -minline-plt
11561 @opindex minline-plt
11562
11563 Enable inlining of PLT entries in function calls to functions that are
11564 not known to bind locally.  It has no effect without @option{-mfdpic}.
11565 It's enabled by default if optimizing for speed and compiling for
11566 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
11567 optimization option such as @option{-O3} or above is present in the
11568 command line.
11569
11570 @item -mTLS
11571 @opindex mTLS
11572
11573 Assume a large TLS segment when generating thread-local code.
11574
11575 @item -mtls
11576 @opindex mtls
11577
11578 Do not assume a large TLS segment when generating thread-local code.
11579
11580 @item -mgprel-ro
11581 @opindex mgprel-ro
11582
11583 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
11584 that is known to be in read-only sections.  It's enabled by default,
11585 except for @option{-fpic} or @option{-fpie}: even though it may help
11586 make the global offset table smaller, it trades 1 instruction for 4.
11587 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
11588 one of which may be shared by multiple symbols, and it avoids the need
11589 for a GOT entry for the referenced symbol, so it's more likely to be a
11590 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
11591
11592 @item -multilib-library-pic
11593 @opindex multilib-library-pic
11594
11595 Link with the (library, not FD) pic libraries.  It's implied by
11596 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
11597 @option{-fpic} without @option{-mfdpic}.  You should never have to use
11598 it explicitly.
11599
11600 @item -mlinked-fp
11601 @opindex mlinked-fp
11602
11603 Follow the EABI requirement of always creating a frame pointer whenever
11604 a stack frame is allocated.  This option is enabled by default and can
11605 be disabled with @option{-mno-linked-fp}.
11606
11607 @item -mlong-calls
11608 @opindex mlong-calls
11609
11610 Use indirect addressing to call functions outside the current
11611 compilation unit.  This allows the functions to be placed anywhere
11612 within the 32-bit address space.
11613
11614 @item -malign-labels
11615 @opindex malign-labels
11616
11617 Try to align labels to an 8-byte boundary by inserting nops into the
11618 previous packet.  This option only has an effect when VLIW packing
11619 is enabled.  It doesn't create new packets; it merely adds nops to
11620 existing ones.
11621
11622 @item -mlibrary-pic
11623 @opindex mlibrary-pic
11624
11625 Generate position-independent EABI code.
11626
11627 @item -macc-4
11628 @opindex macc-4
11629
11630 Use only the first four media accumulator registers.
11631
11632 @item -macc-8
11633 @opindex macc-8
11634
11635 Use all eight media accumulator registers.
11636
11637 @item -mpack
11638 @opindex mpack
11639
11640 Pack VLIW instructions.
11641
11642 @item -mno-pack
11643 @opindex mno-pack
11644
11645 Do not pack VLIW instructions.
11646
11647 @item -mno-eflags
11648 @opindex mno-eflags
11649
11650 Do not mark ABI switches in e_flags.
11651
11652 @item -mcond-move
11653 @opindex mcond-move
11654
11655 Enable the use of conditional-move instructions (default).
11656
11657 This switch is mainly for debugging the compiler and will likely be removed
11658 in a future version.
11659
11660 @item -mno-cond-move
11661 @opindex mno-cond-move
11662
11663 Disable the use of conditional-move instructions.
11664
11665 This switch is mainly for debugging the compiler and will likely be removed
11666 in a future version.
11667
11668 @item -mscc
11669 @opindex mscc
11670
11671 Enable the use of conditional set instructions (default).
11672
11673 This switch is mainly for debugging the compiler and will likely be removed
11674 in a future version.
11675
11676 @item -mno-scc
11677 @opindex mno-scc
11678
11679 Disable the use of conditional set instructions.
11680
11681 This switch is mainly for debugging the compiler and will likely be removed
11682 in a future version.
11683
11684 @item -mcond-exec
11685 @opindex mcond-exec
11686
11687 Enable the use of conditional execution (default).
11688
11689 This switch is mainly for debugging the compiler and will likely be removed
11690 in a future version.
11691
11692 @item -mno-cond-exec
11693 @opindex mno-cond-exec
11694
11695 Disable the use of conditional execution.
11696
11697 This switch is mainly for debugging the compiler and will likely be removed
11698 in a future version.
11699
11700 @item -mvliw-branch
11701 @opindex mvliw-branch
11702
11703 Run a pass to pack branches into VLIW instructions (default).
11704
11705 This switch is mainly for debugging the compiler and will likely be removed
11706 in a future version.
11707
11708 @item -mno-vliw-branch
11709 @opindex mno-vliw-branch
11710
11711 Do not run a pass to pack branches into VLIW instructions.
11712
11713 This switch is mainly for debugging the compiler and will likely be removed
11714 in a future version.
11715
11716 @item -mmulti-cond-exec
11717 @opindex mmulti-cond-exec
11718
11719 Enable optimization of @code{&&} and @code{||} in conditional execution
11720 (default).
11721
11722 This switch is mainly for debugging the compiler and will likely be removed
11723 in a future version.
11724
11725 @item -mno-multi-cond-exec
11726 @opindex mno-multi-cond-exec
11727
11728 Disable optimization of @code{&&} and @code{||} in conditional execution.
11729
11730 This switch is mainly for debugging the compiler and will likely be removed
11731 in a future version.
11732
11733 @item -mnested-cond-exec
11734 @opindex mnested-cond-exec
11735
11736 Enable nested conditional execution optimizations (default).
11737
11738 This switch is mainly for debugging the compiler and will likely be removed
11739 in a future version.
11740
11741 @item -mno-nested-cond-exec
11742 @opindex mno-nested-cond-exec
11743
11744 Disable nested conditional execution optimizations.
11745
11746 This switch is mainly for debugging the compiler and will likely be removed
11747 in a future version.
11748
11749 @item -moptimize-membar
11750 @opindex moptimize-membar
11751
11752 This switch removes redundant @code{membar} instructions from the
11753 compiler generated code.  It is enabled by default.
11754
11755 @item -mno-optimize-membar
11756 @opindex mno-optimize-membar
11757
11758 This switch disables the automatic removal of redundant @code{membar}
11759 instructions from the generated code.
11760
11761 @item -mtomcat-stats
11762 @opindex mtomcat-stats
11763
11764 Cause gas to print out tomcat statistics.
11765
11766 @item -mcpu=@var{cpu}
11767 @opindex mcpu
11768
11769 Select the processor type for which to generate code.  Possible values are
11770 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
11771 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
11772
11773 @end table
11774
11775 @node GNU/Linux Options
11776 @subsection GNU/Linux Options
11777
11778 These @samp{-m} options are defined for GNU/Linux targets:
11779
11780 @table @gcctabopt
11781 @item -mglibc
11782 @opindex mglibc
11783 Use the GNU C library.  This is the default except
11784 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
11785
11786 @item -muclibc
11787 @opindex muclibc
11788 Use uClibc C library.  This is the default on
11789 @samp{*-*-linux-*uclibc*} targets.
11790
11791 @item -mbionic
11792 @opindex mbionic
11793 Use Bionic C library.  This is the default on
11794 @samp{*-*-linux-*android*} targets.
11795
11796 @item -mandroid
11797 @opindex mandroid
11798 Compile code compatible with Android platform.  This is the default on
11799 @samp{*-*-linux-*android*} targets.
11800
11801 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
11802 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
11803 this option makes the GCC driver pass Android-specific options to the linker.
11804 Finally, this option causes the preprocessor macro @code{__ANDROID__}
11805 to be defined.
11806
11807 @item -tno-android-cc
11808 @opindex tno-android-cc
11809 Disable compilation effects of @option{-mandroid}, i.e., do not enable
11810 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
11811 @option{-fno-rtti} by default.
11812
11813 @item -tno-android-ld
11814 @opindex tno-android-ld
11815 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
11816 linking options to the linker.
11817
11818 @end table
11819
11820 @node H8/300 Options
11821 @subsection H8/300 Options
11822
11823 These @samp{-m} options are defined for the H8/300 implementations:
11824
11825 @table @gcctabopt
11826 @item -mrelax
11827 @opindex mrelax
11828 Shorten some address references at link time, when possible; uses the
11829 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
11830 ld, Using ld}, for a fuller description.
11831
11832 @item -mh
11833 @opindex mh
11834 Generate code for the H8/300H@.
11835
11836 @item -ms
11837 @opindex ms
11838 Generate code for the H8S@.
11839
11840 @item -mn
11841 @opindex mn
11842 Generate code for the H8S and H8/300H in the normal mode.  This switch
11843 must be used either with @option{-mh} or @option{-ms}.
11844
11845 @item -ms2600
11846 @opindex ms2600
11847 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
11848
11849 @item -mint32
11850 @opindex mint32
11851 Make @code{int} data 32 bits by default.
11852
11853 @item -malign-300
11854 @opindex malign-300
11855 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
11856 The default for the H8/300H and H8S is to align longs and floats on 4
11857 byte boundaries.
11858 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
11859 This option has no effect on the H8/300.
11860 @end table
11861
11862 @node HPPA Options
11863 @subsection HPPA Options
11864 @cindex HPPA Options
11865
11866 These @samp{-m} options are defined for the HPPA family of computers:
11867
11868 @table @gcctabopt
11869 @item -march=@var{architecture-type}
11870 @opindex march
11871 Generate code for the specified architecture.  The choices for
11872 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
11873 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
11874 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
11875 architecture option for your machine.  Code compiled for lower numbered
11876 architectures will run on higher numbered architectures, but not the
11877 other way around.
11878
11879 @item -mpa-risc-1-0
11880 @itemx -mpa-risc-1-1
11881 @itemx -mpa-risc-2-0
11882 @opindex mpa-risc-1-0
11883 @opindex mpa-risc-1-1
11884 @opindex mpa-risc-2-0
11885 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
11886
11887 @item -mbig-switch
11888 @opindex mbig-switch
11889 Generate code suitable for big switch tables.  Use this option only if
11890 the assembler/linker complain about out of range branches within a switch
11891 table.
11892
11893 @item -mjump-in-delay
11894 @opindex mjump-in-delay
11895 Fill delay slots of function calls with unconditional jump instructions
11896 by modifying the return pointer for the function call to be the target
11897 of the conditional jump.
11898
11899 @item -mdisable-fpregs
11900 @opindex mdisable-fpregs
11901 Prevent floating point registers from being used in any manner.  This is
11902 necessary for compiling kernels which perform lazy context switching of
11903 floating point registers.  If you use this option and attempt to perform
11904 floating point operations, the compiler will abort.
11905
11906 @item -mdisable-indexing
11907 @opindex mdisable-indexing
11908 Prevent the compiler from using indexing address modes.  This avoids some
11909 rather obscure problems when compiling MIG generated code under MACH@.
11910
11911 @item -mno-space-regs
11912 @opindex mno-space-regs
11913 Generate code that assumes the target has no space registers.  This allows
11914 GCC to generate faster indirect calls and use unscaled index address modes.
11915
11916 Such code is suitable for level 0 PA systems and kernels.
11917
11918 @item -mfast-indirect-calls
11919 @opindex mfast-indirect-calls
11920 Generate code that assumes calls never cross space boundaries.  This
11921 allows GCC to emit code which performs faster indirect calls.
11922
11923 This option will not work in the presence of shared libraries or nested
11924 functions.
11925
11926 @item -mfixed-range=@var{register-range}
11927 @opindex mfixed-range
11928 Generate code treating the given register range as fixed registers.
11929 A fixed register is one that the register allocator can not use.  This is
11930 useful when compiling kernel code.  A register range is specified as
11931 two registers separated by a dash.  Multiple register ranges can be
11932 specified separated by a comma.
11933
11934 @item -mlong-load-store
11935 @opindex mlong-load-store
11936 Generate 3-instruction load and store sequences as sometimes required by
11937 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
11938 the HP compilers.
11939
11940 @item -mportable-runtime
11941 @opindex mportable-runtime
11942 Use the portable calling conventions proposed by HP for ELF systems.
11943
11944 @item -mgas
11945 @opindex mgas
11946 Enable the use of assembler directives only GAS understands.
11947
11948 @item -mschedule=@var{cpu-type}
11949 @opindex mschedule
11950 Schedule code according to the constraints for the machine type
11951 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
11952 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
11953 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
11954 proper scheduling option for your machine.  The default scheduling is
11955 @samp{8000}.
11956
11957 @item -mlinker-opt
11958 @opindex mlinker-opt
11959 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
11960 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
11961 linkers in which they give bogus error messages when linking some programs.
11962
11963 @item -msoft-float
11964 @opindex msoft-float
11965 Generate output containing library calls for floating point.
11966 @strong{Warning:} the requisite libraries are not available for all HPPA
11967 targets.  Normally the facilities of the machine's usual C compiler are
11968 used, but this cannot be done directly in cross-compilation.  You must make
11969 your own arrangements to provide suitable library functions for
11970 cross-compilation.
11971
11972 @option{-msoft-float} changes the calling convention in the output file;
11973 therefore, it is only useful if you compile @emph{all} of a program with
11974 this option.  In particular, you need to compile @file{libgcc.a}, the
11975 library that comes with GCC, with @option{-msoft-float} in order for
11976 this to work.
11977
11978 @item -msio
11979 @opindex msio
11980 Generate the predefine, @code{_SIO}, for server IO@.  The default is
11981 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
11982 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
11983 options are available under HP-UX and HI-UX@.
11984
11985 @item -mgnu-ld
11986 @opindex mgnu-ld
11987 Use GNU ld specific options.  This passes @option{-shared} to ld when
11988 building a shared library.  It is the default when GCC is configured,
11989 explicitly or implicitly, with the GNU linker.  This option does not
11990 have any affect on which ld is called, it only changes what parameters
11991 are passed to that ld.  The ld that is called is determined by the
11992 @option{--with-ld} configure option, GCC's program search path, and
11993 finally by the user's @env{PATH}.  The linker used by GCC can be printed
11994 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
11995 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11996
11997 @item -mhp-ld
11998 @opindex mhp-ld
11999 Use HP ld specific options.  This passes @option{-b} to ld when building
12000 a shared library and passes @option{+Accept TypeMismatch} to ld on all
12001 links.  It is the default when GCC is configured, explicitly or
12002 implicitly, with the HP linker.  This option does not have any affect on
12003 which ld is called, it only changes what parameters are passed to that
12004 ld.  The ld that is called is determined by the @option{--with-ld}
12005 configure option, GCC's program search path, and finally by the user's
12006 @env{PATH}.  The linker used by GCC can be printed using @samp{which
12007 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
12008 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12009
12010 @item -mlong-calls
12011 @opindex mno-long-calls
12012 Generate code that uses long call sequences.  This ensures that a call
12013 is always able to reach linker generated stubs.  The default is to generate
12014 long calls only when the distance from the call site to the beginning
12015 of the function or translation unit, as the case may be, exceeds a
12016 predefined limit set by the branch type being used.  The limits for
12017 normal calls are 7,600,000 and 240,000 bytes, respectively for the
12018 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
12019 240,000 bytes.
12020
12021 Distances are measured from the beginning of functions when using the
12022 @option{-ffunction-sections} option, or when using the @option{-mgas}
12023 and @option{-mno-portable-runtime} options together under HP-UX with
12024 the SOM linker.
12025
12026 It is normally not desirable to use this option as it will degrade
12027 performance.  However, it may be useful in large applications,
12028 particularly when partial linking is used to build the application.
12029
12030 The types of long calls used depends on the capabilities of the
12031 assembler and linker, and the type of code being generated.  The
12032 impact on systems that support long absolute calls, and long pic
12033 symbol-difference or pc-relative calls should be relatively small.
12034 However, an indirect call is used on 32-bit ELF systems in pic code
12035 and it is quite long.
12036
12037 @item -munix=@var{unix-std}
12038 @opindex march
12039 Generate compiler predefines and select a startfile for the specified
12040 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
12041 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
12042 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
12043 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
12044 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
12045 and later.
12046
12047 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
12048 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
12049 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
12050 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
12051 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
12052 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
12053
12054 It is @emph{important} to note that this option changes the interfaces
12055 for various library routines.  It also affects the operational behavior
12056 of the C library.  Thus, @emph{extreme} care is needed in using this
12057 option.
12058
12059 Library code that is intended to operate with more than one UNIX
12060 standard must test, set and restore the variable @var{__xpg4_extended_mask}
12061 as appropriate.  Most GNU software doesn't provide this capability.
12062
12063 @item -nolibdld
12064 @opindex nolibdld
12065 Suppress the generation of link options to search libdld.sl when the
12066 @option{-static} option is specified on HP-UX 10 and later.
12067
12068 @item -static
12069 @opindex static
12070 The HP-UX implementation of setlocale in libc has a dependency on
12071 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
12072 when the @option{-static} option is specified, special link options
12073 are needed to resolve this dependency.
12074
12075 On HP-UX 10 and later, the GCC driver adds the necessary options to
12076 link with libdld.sl when the @option{-static} option is specified.
12077 This causes the resulting binary to be dynamic.  On the 64-bit port,
12078 the linkers generate dynamic binaries by default in any case.  The
12079 @option{-nolibdld} option can be used to prevent the GCC driver from
12080 adding these link options.
12081
12082 @item -threads
12083 @opindex threads
12084 Add support for multithreading with the @dfn{dce thread} library
12085 under HP-UX@.  This option sets flags for both the preprocessor and
12086 linker.
12087 @end table
12088
12089 @node i386 and x86-64 Options
12090 @subsection Intel 386 and AMD x86-64 Options
12091 @cindex i386 Options
12092 @cindex x86-64 Options
12093 @cindex Intel 386 Options
12094 @cindex AMD x86-64 Options
12095
12096 These @samp{-m} options are defined for the i386 and x86-64 family of
12097 computers:
12098
12099 @table @gcctabopt
12100 @item -mtune=@var{cpu-type}
12101 @opindex mtune
12102 Tune to @var{cpu-type} everything applicable about the generated code, except
12103 for the ABI and the set of available instructions.  The choices for
12104 @var{cpu-type} are:
12105 @table @emph
12106 @item generic
12107 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
12108 If you know the CPU on which your code will run, then you should use
12109 the corresponding @option{-mtune} option instead of
12110 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
12111 of your application will have, then you should use this option.
12112
12113 As new processors are deployed in the marketplace, the behavior of this
12114 option will change.  Therefore, if you upgrade to a newer version of
12115 GCC, the code generated option will change to reflect the processors
12116 that were most common when that version of GCC was released.
12117
12118 There is no @option{-march=generic} option because @option{-march}
12119 indicates the instruction set the compiler can use, and there is no
12120 generic instruction set applicable to all processors.  In contrast,
12121 @option{-mtune} indicates the processor (or, in this case, collection of
12122 processors) for which the code is optimized.
12123 @item native
12124 This selects the CPU to tune for at compilation time by determining
12125 the processor type of the compiling machine.  Using @option{-mtune=native}
12126 will produce code optimized for the local machine under the constraints
12127 of the selected instruction set.  Using @option{-march=native} will
12128 enable all instruction subsets supported by the local machine (hence
12129 the result might not run on different machines).
12130 @item i386
12131 Original Intel's i386 CPU@.
12132 @item i486
12133 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
12134 @item i586, pentium
12135 Intel Pentium CPU with no MMX support.
12136 @item pentium-mmx
12137 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
12138 @item pentiumpro
12139 Intel PentiumPro CPU@.
12140 @item i686
12141 Same as @code{generic}, but when used as @code{march} option, PentiumPro
12142 instruction set will be used, so the code will run on all i686 family chips.
12143 @item pentium2
12144 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
12145 @item pentium3, pentium3m
12146 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
12147 support.
12148 @item pentium-m
12149 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
12150 support.  Used by Centrino notebooks.
12151 @item pentium4, pentium4m
12152 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
12153 @item prescott
12154 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
12155 set support.
12156 @item nocona
12157 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
12158 SSE2 and SSE3 instruction set support.
12159 @item core2
12160 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12161 instruction set support.
12162 @item corei7
12163 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
12164 and SSE4.2 instruction set support.
12165 @item corei7-avx
12166 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
12167 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
12168 @item atom
12169 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12170 instruction set support.
12171 @item k6
12172 AMD K6 CPU with MMX instruction set support.
12173 @item k6-2, k6-3
12174 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
12175 @item athlon, athlon-tbird
12176 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
12177 support.
12178 @item athlon-4, athlon-xp, athlon-mp
12179 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
12180 instruction set support.
12181 @item k8, opteron, athlon64, athlon-fx
12182 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
12183 MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit instruction set extensions.)
12184 @item k8-sse3, opteron-sse3, athlon64-sse3
12185 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
12186 @item amdfam10, barcelona
12187 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
12188 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
12189 instruction set extensions.)
12190 @item winchip-c6
12191 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
12192 set support.
12193 @item winchip2
12194 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
12195 instruction set support.
12196 @item c3
12197 Via C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
12198 implemented for this chip.)
12199 @item c3-2
12200 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
12201 implemented for this chip.)
12202 @item geode
12203 Embedded AMD CPU with MMX and 3DNow!@: instruction set support.
12204 @end table
12205
12206 While picking a specific @var{cpu-type} will schedule things appropriately
12207 for that particular chip, the compiler will not generate any code that
12208 does not run on the i386 without the @option{-march=@var{cpu-type}} option
12209 being used.
12210
12211 @item -march=@var{cpu-type}
12212 @opindex march
12213 Generate instructions for the machine type @var{cpu-type}.  The choices
12214 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
12215 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
12216
12217 @item -mcpu=@var{cpu-type}
12218 @opindex mcpu
12219 A deprecated synonym for @option{-mtune}.
12220
12221 @item -mfpmath=@var{unit}
12222 @opindex mfpmath
12223 Generate floating point arithmetics for selected unit @var{unit}.  The choices
12224 for @var{unit} are:
12225
12226 @table @samp
12227 @item 387
12228 Use the standard 387 floating point coprocessor present majority of chips and
12229 emulated otherwise.  Code compiled with this option will run almost everywhere.
12230 The temporary results are computed in 80bit precision instead of precision
12231 specified by the type resulting in slightly different results compared to most
12232 of other chips.  See @option{-ffloat-store} for more detailed description.
12233
12234 This is the default choice for i386 compiler.
12235
12236 @item sse
12237 Use scalar floating point instructions present in the SSE instruction set.
12238 This instruction set is supported by Pentium3 and newer chips, in the AMD line
12239 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
12240 instruction set supports only single precision arithmetics, thus the double and
12241 extended precision arithmetics is still done using 387.  Later version, present
12242 only in Pentium4 and the future AMD x86-64 chips supports double precision
12243 arithmetics too.
12244
12245 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
12246 or @option{-msse2} switches to enable SSE extensions and make this option
12247 effective.  For the x86-64 compiler, these extensions are enabled by default.
12248
12249 The resulting code should be considerably faster in the majority of cases and avoid
12250 the numerical instability problems of 387 code, but may break some existing
12251 code that expects temporaries to be 80bit.
12252
12253 This is the default choice for the x86-64 compiler.
12254
12255 @item sse,387
12256 @itemx sse+387
12257 @itemx both
12258 Attempt to utilize both instruction sets at once.  This effectively double the
12259 amount of available registers and on chips with separate execution units for
12260 387 and SSE the execution resources too.  Use this option with care, as it is
12261 still experimental, because the GCC register allocator does not model separate
12262 functional units well resulting in instable performance.
12263 @end table
12264
12265 @item -masm=@var{dialect}
12266 @opindex masm=@var{dialect}
12267 Output asm instructions using selected @var{dialect}.  Supported
12268 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
12269 not support @samp{intel}.
12270
12271 @item -mieee-fp
12272 @itemx -mno-ieee-fp
12273 @opindex mieee-fp
12274 @opindex mno-ieee-fp
12275 Control whether or not the compiler uses IEEE floating point
12276 comparisons.  These handle correctly the case where the result of a
12277 comparison is unordered.
12278
12279 @item -msoft-float
12280 @opindex msoft-float
12281 Generate output containing library calls for floating point.
12282 @strong{Warning:} the requisite libraries are not part of GCC@.
12283 Normally the facilities of the machine's usual C compiler are used, but
12284 this can't be done directly in cross-compilation.  You must make your
12285 own arrangements to provide suitable library functions for
12286 cross-compilation.
12287
12288 On machines where a function returns floating point results in the 80387
12289 register stack, some floating point opcodes may be emitted even if
12290 @option{-msoft-float} is used.
12291
12292 @item -mno-fp-ret-in-387
12293 @opindex mno-fp-ret-in-387
12294 Do not use the FPU registers for return values of functions.
12295
12296 The usual calling convention has functions return values of types
12297 @code{float} and @code{double} in an FPU register, even if there
12298 is no FPU@.  The idea is that the operating system should emulate
12299 an FPU@.
12300
12301 The option @option{-mno-fp-ret-in-387} causes such values to be returned
12302 in ordinary CPU registers instead.
12303
12304 @item -mno-fancy-math-387
12305 @opindex mno-fancy-math-387
12306 Some 387 emulators do not support the @code{sin}, @code{cos} and
12307 @code{sqrt} instructions for the 387.  Specify this option to avoid
12308 generating those instructions.  This option is the default on FreeBSD,
12309 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
12310 indicates that the target CPU will always have an FPU and so the
12311 instruction will not need emulation.  As of revision 2.6.1, these
12312 instructions are not generated unless you also use the
12313 @option{-funsafe-math-optimizations} switch.
12314
12315 @item -malign-double
12316 @itemx -mno-align-double
12317 @opindex malign-double
12318 @opindex mno-align-double
12319 Control whether GCC aligns @code{double}, @code{long double}, and
12320 @code{long long} variables on a two word boundary or a one word
12321 boundary.  Aligning @code{double} variables on a two word boundary will
12322 produce code that runs somewhat faster on a @samp{Pentium} at the
12323 expense of more memory.
12324
12325 On x86-64, @option{-malign-double} is enabled by default.
12326
12327 @strong{Warning:} if you use the @option{-malign-double} switch,
12328 structures containing the above types will be aligned differently than
12329 the published application binary interface specifications for the 386
12330 and will not be binary compatible with structures in code compiled
12331 without that switch.
12332
12333 @item -m96bit-long-double
12334 @itemx -m128bit-long-double
12335 @opindex m96bit-long-double
12336 @opindex m128bit-long-double
12337 These switches control the size of @code{long double} type.  The i386
12338 application binary interface specifies the size to be 96 bits,
12339 so @option{-m96bit-long-double} is the default in 32 bit mode.
12340
12341 Modern architectures (Pentium and newer) would prefer @code{long double}
12342 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
12343 conforming to the ABI, this would not be possible.  So specifying a
12344 @option{-m128bit-long-double} will align @code{long double}
12345 to a 16 byte boundary by padding the @code{long double} with an additional
12346 32 bit zero.
12347
12348 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
12349 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
12350
12351 Notice that neither of these options enable any extra precision over the x87
12352 standard of 80 bits for a @code{long double}.
12353
12354 @strong{Warning:} if you override the default value for your target ABI, the
12355 structures and arrays containing @code{long double} variables will change
12356 their size as well as function calling convention for function taking
12357 @code{long double} will be modified.  Hence they will not be binary
12358 compatible with arrays or structures in code compiled without that switch.
12359
12360 @item -mlarge-data-threshold=@var{number}
12361 @opindex mlarge-data-threshold=@var{number}
12362 When @option{-mcmodel=medium} is specified, the data greater than
12363 @var{threshold} are placed in large data section.  This value must be the
12364 same across all object linked into the binary and defaults to 65535.
12365
12366 @item -mrtd
12367 @opindex mrtd
12368 Use a different function-calling convention, in which functions that
12369 take a fixed number of arguments return with the @code{ret} @var{num}
12370 instruction, which pops their arguments while returning.  This saves one
12371 instruction in the caller since there is no need to pop the arguments
12372 there.
12373
12374 You can specify that an individual function is called with this calling
12375 sequence with the function attribute @samp{stdcall}.  You can also
12376 override the @option{-mrtd} option by using the function attribute
12377 @samp{cdecl}.  @xref{Function Attributes}.
12378
12379 @strong{Warning:} this calling convention is incompatible with the one
12380 normally used on Unix, so you cannot use it if you need to call
12381 libraries compiled with the Unix compiler.
12382
12383 Also, you must provide function prototypes for all functions that
12384 take variable numbers of arguments (including @code{printf});
12385 otherwise incorrect code will be generated for calls to those
12386 functions.
12387
12388 In addition, seriously incorrect code will result if you call a
12389 function with too many arguments.  (Normally, extra arguments are
12390 harmlessly ignored.)
12391
12392 @item -mregparm=@var{num}
12393 @opindex mregparm
12394 Control how many registers are used to pass integer arguments.  By
12395 default, no registers are used to pass arguments, and at most 3
12396 registers can be used.  You can control this behavior for a specific
12397 function by using the function attribute @samp{regparm}.
12398 @xref{Function Attributes}.
12399
12400 @strong{Warning:} if you use this switch, and
12401 @var{num} is nonzero, then you must build all modules with the same
12402 value, including any libraries.  This includes the system libraries and
12403 startup modules.
12404
12405 @item -msseregparm
12406 @opindex msseregparm
12407 Use SSE register passing conventions for float and double arguments
12408 and return values.  You can control this behavior for a specific
12409 function by using the function attribute @samp{sseregparm}.
12410 @xref{Function Attributes}.
12411
12412 @strong{Warning:} if you use this switch then you must build all
12413 modules with the same value, including any libraries.  This includes
12414 the system libraries and startup modules.
12415
12416 @item -mvect8-ret-in-mem
12417 @opindex mvect8-ret-in-mem
12418 Return 8-byte vectors in memory instead of MMX registers.  This is the
12419 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
12420 Studio compilers until version 12.  Later compiler versions (starting
12421 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
12422 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
12423 you need to remain compatible with existing code produced by those
12424 previous compiler versions or older versions of GCC.
12425
12426 @item -mpc32
12427 @itemx -mpc64
12428 @itemx -mpc80
12429 @opindex mpc32
12430 @opindex mpc64
12431 @opindex mpc80
12432
12433 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
12434 is specified, the significands of results of floating-point operations are
12435 rounded to 24 bits (single precision); @option{-mpc64} rounds the
12436 significands of results of floating-point operations to 53 bits (double
12437 precision) and @option{-mpc80} rounds the significands of results of
12438 floating-point operations to 64 bits (extended double precision), which is
12439 the default.  When this option is used, floating-point operations in higher
12440 precisions are not available to the programmer without setting the FPU
12441 control word explicitly.
12442
12443 Setting the rounding of floating-point operations to less than the default
12444 80 bits can speed some programs by 2% or more.  Note that some mathematical
12445 libraries assume that extended precision (80 bit) floating-point operations
12446 are enabled by default; routines in such libraries could suffer significant
12447 loss of accuracy, typically through so-called "catastrophic cancellation",
12448 when this option is used to set the precision to less than extended precision.
12449
12450 @item -mstackrealign
12451 @opindex mstackrealign
12452 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
12453 option will generate an alternate prologue and epilogue that realigns the
12454 runtime stack if necessary.  This supports mixing legacy codes that keep
12455 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
12456 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
12457 applicable to individual functions.
12458
12459 @item -mpreferred-stack-boundary=@var{num}
12460 @opindex mpreferred-stack-boundary
12461 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
12462 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
12463 the default is 4 (16 bytes or 128 bits).
12464
12465 @item -mincoming-stack-boundary=@var{num}
12466 @opindex mincoming-stack-boundary
12467 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
12468 boundary.  If @option{-mincoming-stack-boundary} is not specified,
12469 the one specified by @option{-mpreferred-stack-boundary} will be used.
12470
12471 On Pentium and PentiumPro, @code{double} and @code{long double} values
12472 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
12473 suffer significant run time performance penalties.  On Pentium III, the
12474 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
12475 properly if it is not 16 byte aligned.
12476
12477 To ensure proper alignment of this values on the stack, the stack boundary
12478 must be as aligned as that required by any value stored on the stack.
12479 Further, every function must be generated such that it keeps the stack
12480 aligned.  Thus calling a function compiled with a higher preferred
12481 stack boundary from a function compiled with a lower preferred stack
12482 boundary will most likely misalign the stack.  It is recommended that
12483 libraries that use callbacks always use the default setting.
12484
12485 This extra alignment does consume extra stack space, and generally
12486 increases code size.  Code that is sensitive to stack space usage, such
12487 as embedded systems and operating system kernels, may want to reduce the
12488 preferred alignment to @option{-mpreferred-stack-boundary=2}.
12489
12490 @item -mmmx
12491 @itemx -mno-mmx
12492 @itemx -msse
12493 @itemx -mno-sse
12494 @itemx -msse2
12495 @itemx -mno-sse2
12496 @itemx -msse3
12497 @itemx -mno-sse3
12498 @itemx -mssse3
12499 @itemx -mno-ssse3
12500 @itemx -msse4.1
12501 @need 800
12502 @itemx -mno-sse4.1
12503 @itemx -msse4.2
12504 @itemx -mno-sse4.2
12505 @itemx -msse4
12506 @itemx -mno-sse4
12507 @itemx -mavx
12508 @itemx -mno-avx
12509 @itemx -maes
12510 @itemx -mno-aes
12511 @itemx -mpclmul
12512 @need 800
12513 @itemx -mno-pclmul
12514 @itemx -mfsgsbase
12515 @itemx -mno-fsgsbase
12516 @itemx -mrdrnd
12517 @itemx -mno-rdrnd
12518 @itemx -mf16c
12519 @itemx -mno-f16c
12520 @itemx -msse4a
12521 @itemx -mno-sse4a
12522 @itemx -mfma4
12523 @need 800
12524 @itemx -mno-fma4
12525 @itemx -mxop
12526 @itemx -mno-xop
12527 @itemx -mlwp
12528 @itemx -mno-lwp
12529 @itemx -m3dnow
12530 @itemx -mno-3dnow
12531 @itemx -mpopcnt
12532 @itemx -mno-popcnt
12533 @itemx -mabm
12534 @itemx -mno-abm
12535 @itemx -mbmi
12536 @itemx -mno-bmi
12537 @itemx -mtbm
12538 @itemx -mno-tbm
12539 @opindex mmmx
12540 @opindex mno-mmx
12541 @opindex msse
12542 @opindex mno-sse
12543 @opindex m3dnow
12544 @opindex mno-3dnow
12545 These switches enable or disable the use of instructions in the MMX,
12546 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, FSGSBASE, RDRND,
12547 F16C, SSE4A, FMA4, XOP, LWP, ABM, BMI, or 3DNow!@: extended instruction sets.
12548 These extensions are also available as built-in functions: see
12549 @ref{X86 Built-in Functions}, for details of the functions enabled and
12550 disabled by these switches.
12551
12552 To have SSE/SSE2 instructions generated automatically from floating-point
12553 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
12554
12555 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
12556 generates new AVX instructions or AVX equivalence for all SSEx instructions
12557 when needed.
12558
12559 These options will enable GCC to use these extended instructions in
12560 generated code, even without @option{-mfpmath=sse}.  Applications which
12561 perform runtime CPU detection must compile separate files for each
12562 supported architecture, using the appropriate flags.  In particular,
12563 the file containing the CPU detection code should be compiled without
12564 these options.
12565
12566 @item -mfused-madd
12567 @itemx -mno-fused-madd
12568 @opindex mfused-madd
12569 @opindex mno-fused-madd
12570 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12571 instructions.  The default is to use these instructions.
12572
12573 @item -mcld
12574 @opindex mcld
12575 This option instructs GCC to emit a @code{cld} instruction in the prologue
12576 of functions that use string instructions.  String instructions depend on
12577 the DF flag to select between autoincrement or autodecrement mode.  While the
12578 ABI specifies the DF flag to be cleared on function entry, some operating
12579 systems violate this specification by not clearing the DF flag in their
12580 exception dispatchers.  The exception handler can be invoked with the DF flag
12581 set which leads to wrong direction mode, when string instructions are used.
12582 This option can be enabled by default on 32-bit x86 targets by configuring
12583 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
12584 instructions can be suppressed with the @option{-mno-cld} compiler option
12585 in this case.
12586
12587 @item -mvzeroupper
12588 @opindex mvzeroupper
12589 This option instructs GCC to emit a @code{vzeroupper} instruction
12590 before a transfer of control flow out of the function to minimize
12591 AVX to SSE transition penalty as well as remove unnecessary zeroupper 
12592 intrinsics.
12593
12594 @item -mcx16
12595 @opindex mcx16
12596 This option will enable GCC to use CMPXCHG16B instruction in generated code.
12597 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
12598 data types.  This is useful for high resolution counters that could be updated
12599 by multiple processors (or cores).  This instruction is generated as part of
12600 atomic built-in functions: see @ref{Atomic Builtins} for details.
12601
12602 @item -msahf
12603 @opindex msahf
12604 This option will enable GCC to use SAHF instruction in generated 64-bit code.
12605 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
12606 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
12607 SAHF are load and store instructions, respectively, for certain status flags.
12608 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
12609 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
12610
12611 @item -mmovbe
12612 @opindex mmovbe
12613 This option will enable GCC to use movbe instruction to implement
12614 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
12615
12616 @item -mcrc32
12617 @opindex mcrc32
12618 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
12619 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
12620 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
12621
12622 @item -mrecip
12623 @opindex mrecip
12624 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
12625 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
12626 to increase precision instead of DIVSS and SQRTSS (and their vectorized
12627 variants) for single precision floating point arguments.  These instructions
12628 are generated only when @option{-funsafe-math-optimizations} is enabled
12629 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
12630 Note that while the throughput of the sequence is higher than the throughput
12631 of the non-reciprocal instruction, the precision of the sequence can be
12632 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
12633
12634 Note that GCC implements 1.0f/sqrtf(x) in terms of RSQRTSS (or RSQRTPS)
12635 already with @option{-ffast-math} (or the above option combination), and
12636 doesn't need @option{-mrecip}.
12637
12638 @item -mveclibabi=@var{type}
12639 @opindex mveclibabi
12640 Specifies the ABI type to use for vectorizing intrinsics using an
12641 external library.  Supported types are @code{svml} for the Intel short
12642 vector math library and @code{acml} for the AMD math core library style
12643 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
12644 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
12645 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
12646 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
12647 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
12648 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
12649 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
12650 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
12651 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
12652 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
12653 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
12654 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
12655 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
12656 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
12657 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
12658 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
12659 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
12660 compatible library will have to be specified at link time.
12661
12662 @item -mabi=@var{name}
12663 @opindex mabi
12664 Generate code for the specified calling convention.  Permissible values
12665 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
12666 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
12667 ABI when targeting Windows.  On all other systems, the default is the
12668 SYSV ABI.  You can control this behavior for a specific function by
12669 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
12670 @xref{Function Attributes}.
12671
12672 @item -mpush-args
12673 @itemx -mno-push-args
12674 @opindex mpush-args
12675 @opindex mno-push-args
12676 Use PUSH operations to store outgoing parameters.  This method is shorter
12677 and usually equally fast as method using SUB/MOV operations and is enabled
12678 by default.  In some cases disabling it may improve performance because of
12679 improved scheduling and reduced dependencies.
12680
12681 @item -maccumulate-outgoing-args
12682 @opindex maccumulate-outgoing-args
12683 If enabled, the maximum amount of space required for outgoing arguments will be
12684 computed in the function prologue.  This is faster on most modern CPUs
12685 because of reduced dependencies, improved scheduling and reduced stack usage
12686 when preferred stack boundary is not equal to 2.  The drawback is a notable
12687 increase in code size.  This switch implies @option{-mno-push-args}.
12688
12689 @item -mthreads
12690 @opindex mthreads
12691 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
12692 on thread-safe exception handling must compile and link all code with the
12693 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
12694 @option{-D_MT}; when linking, it links in a special thread helper library
12695 @option{-lmingwthrd} which cleans up per thread exception handling data.
12696
12697 @item -mno-align-stringops
12698 @opindex mno-align-stringops
12699 Do not align destination of inlined string operations.  This switch reduces
12700 code size and improves performance in case the destination is already aligned,
12701 but GCC doesn't know about it.
12702
12703 @item -minline-all-stringops
12704 @opindex minline-all-stringops
12705 By default GCC inlines string operations only when destination is known to be
12706 aligned at least to 4 byte boundary.  This enables more inlining, increase code
12707 size, but may improve performance of code that depends on fast memcpy, strlen
12708 and memset for short lengths.
12709
12710 @item -minline-stringops-dynamically
12711 @opindex minline-stringops-dynamically
12712 For string operation of unknown size, inline runtime checks so for small
12713 blocks inline code is used, while for large blocks library call is used.
12714
12715 @item -mstringop-strategy=@var{alg}
12716 @opindex mstringop-strategy=@var{alg}
12717 Overwrite internal decision heuristic about particular algorithm to inline
12718 string operation with.  The allowed values are @code{rep_byte},
12719 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
12720 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
12721 expanding inline loop, @code{libcall} for always expanding library call.
12722
12723 @item -momit-leaf-frame-pointer
12724 @opindex momit-leaf-frame-pointer
12725 Don't keep the frame pointer in a register for leaf functions.  This
12726 avoids the instructions to save, set up and restore frame pointers and
12727 makes an extra register available in leaf functions.  The option
12728 @option{-fomit-frame-pointer} removes the frame pointer for all functions
12729 which might make debugging harder.
12730
12731 @item -mtls-direct-seg-refs
12732 @itemx -mno-tls-direct-seg-refs
12733 @opindex mtls-direct-seg-refs
12734 Controls whether TLS variables may be accessed with offsets from the
12735 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
12736 or whether the thread base pointer must be added.  Whether or not this
12737 is legal depends on the operating system, and whether it maps the
12738 segment to cover the entire TLS area.
12739
12740 For systems that use GNU libc, the default is on.
12741
12742 @item -msse2avx
12743 @itemx -mno-sse2avx
12744 @opindex msse2avx
12745 Specify that the assembler should encode SSE instructions with VEX
12746 prefix.  The option @option{-mavx} turns this on by default.
12747
12748 @item -mfentry
12749 @itemx -mno-fentry
12750 @opindex mfentry
12751 If profiling is active @option{-pg} put the profiling
12752 counter call before prologue.
12753 Note: On x86 architectures the attribute @code{ms_hook_prologue}
12754 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
12755
12756 @item -m8bit-idiv
12757 @itemx -mno-8bit-idiv
12758 @opindex 8bit-idiv
12759 On some processors, like Intel Atom, 8bit unsigned integer divide is
12760 much faster than 32bit/64bit integer divide.  This option will generate a
12761 runt-time check.  If both dividend and divisor are within range of 0
12762 to 255, 8bit unsigned integer divide will be used instead of
12763 32bit/64bit integer divide.
12764
12765 @end table
12766
12767 These @samp{-m} switches are supported in addition to the above
12768 on AMD x86-64 processors in 64-bit environments.
12769
12770 @table @gcctabopt
12771 @item -m32
12772 @itemx -m64
12773 @opindex m32
12774 @opindex m64
12775 Generate code for a 32-bit or 64-bit environment.
12776 The 32-bit environment sets int, long and pointer to 32 bits and
12777 generates code that runs on any i386 system.
12778 The 64-bit environment sets int to 32 bits and long and pointer
12779 to 64 bits and generates code for AMD's x86-64 architecture. For
12780 darwin only the -m64 option turns off the @option{-fno-pic} and
12781 @option{-mdynamic-no-pic} options.
12782
12783 @item -mno-red-zone
12784 @opindex mno-red-zone
12785 Do not use a so called red zone for x86-64 code.  The red zone is mandated
12786 by the x86-64 ABI, it is a 128-byte area beyond the location of the
12787 stack pointer that will not be modified by signal or interrupt handlers
12788 and therefore can be used for temporary data without adjusting the stack
12789 pointer.  The flag @option{-mno-red-zone} disables this red zone.
12790
12791 @item -mcmodel=small
12792 @opindex mcmodel=small
12793 Generate code for the small code model: the program and its symbols must
12794 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
12795 Programs can be statically or dynamically linked.  This is the default
12796 code model.
12797
12798 @item -mcmodel=kernel
12799 @opindex mcmodel=kernel
12800 Generate code for the kernel code model.  The kernel runs in the
12801 negative 2 GB of the address space.
12802 This model has to be used for Linux kernel code.
12803
12804 @item -mcmodel=medium
12805 @opindex mcmodel=medium
12806 Generate code for the medium model: The program is linked in the lower 2
12807 GB of the address space.  Small symbols are also placed there.  Symbols
12808 with sizes larger than @option{-mlarge-data-threshold} are put into
12809 large data or bss sections and can be located above 2GB.  Programs can
12810 be statically or dynamically linked.
12811
12812 @item -mcmodel=large
12813 @opindex mcmodel=large
12814 Generate code for the large model: This model makes no assumptions
12815 about addresses and sizes of sections.
12816 @end table
12817
12818 @node i386 and x86-64 Windows Options
12819 @subsection i386 and x86-64 Windows Options
12820 @cindex i386 and x86-64 Windows Options
12821
12822 These additional options are available for Windows targets:
12823
12824 @table @gcctabopt
12825 @item -mconsole
12826 @opindex mconsole
12827 This option is available for Cygwin and MinGW targets.  It
12828 specifies that a console application is to be generated, by
12829 instructing the linker to set the PE header subsystem type
12830 required for console applications.
12831 This is the default behavior for Cygwin and MinGW targets.
12832
12833 @item -mdll
12834 @opindex mdll
12835 This option is available for Cygwin and MinGW targets.  It
12836 specifies that a DLL - a dynamic link library - is to be
12837 generated, enabling the selection of the required runtime
12838 startup object and entry point.
12839
12840 @item -mnop-fun-dllimport
12841 @opindex mnop-fun-dllimport
12842 This option is available for Cygwin and MinGW targets.  It
12843 specifies that the dllimport attribute should be ignored.
12844
12845 @item -mthread
12846 @opindex mthread
12847 This option is available for MinGW targets. It specifies
12848 that MinGW-specific thread support is to be used.
12849
12850 @item -municode
12851 @opindex municode
12852 This option is available for mingw-w64 targets.  It specifies
12853 that the UNICODE macro is getting pre-defined and that the
12854 unicode capable runtime startup code is chosen.
12855
12856 @item -mwin32
12857 @opindex mwin32
12858 This option is available for Cygwin and MinGW targets.  It
12859 specifies that the typical Windows pre-defined macros are to
12860 be set in the pre-processor, but does not influence the choice
12861 of runtime library/startup code.
12862
12863 @item -mwindows
12864 @opindex mwindows
12865 This option is available for Cygwin and MinGW targets.  It
12866 specifies that a GUI application is to be generated by
12867 instructing the linker to set the PE header subsystem type
12868 appropriately.
12869
12870 @item -fno-set-stack-executable
12871 @opindex fno-set-stack-executable
12872 This option is available for MinGW targets. It specifies that
12873 the executable flag for stack used by nested functions isn't
12874 set. This is necessary for binaries running in kernel mode of
12875 Windows, as there the user32 API, which is used to set executable
12876 privileges, isn't available.
12877
12878 @item -mpe-aligned-commons
12879 @opindex mpe-aligned-commons
12880 This option is available for Cygwin and MinGW targets.  It
12881 specifies that the GNU extension to the PE file format that
12882 permits the correct alignment of COMMON variables should be
12883 used when generating code.  It will be enabled by default if
12884 GCC detects that the target assembler found during configuration
12885 supports the feature.
12886 @end table
12887
12888 See also under @ref{i386 and x86-64 Options} for standard options.
12889
12890 @node IA-64 Options
12891 @subsection IA-64 Options
12892 @cindex IA-64 Options
12893
12894 These are the @samp{-m} options defined for the Intel IA-64 architecture.
12895
12896 @table @gcctabopt
12897 @item -mbig-endian
12898 @opindex mbig-endian
12899 Generate code for a big endian target.  This is the default for HP-UX@.
12900
12901 @item -mlittle-endian
12902 @opindex mlittle-endian
12903 Generate code for a little endian target.  This is the default for AIX5
12904 and GNU/Linux.
12905
12906 @item -mgnu-as
12907 @itemx -mno-gnu-as
12908 @opindex mgnu-as
12909 @opindex mno-gnu-as
12910 Generate (or don't) code for the GNU assembler.  This is the default.
12911 @c Also, this is the default if the configure option @option{--with-gnu-as}
12912 @c is used.
12913
12914 @item -mgnu-ld
12915 @itemx -mno-gnu-ld
12916 @opindex mgnu-ld
12917 @opindex mno-gnu-ld
12918 Generate (or don't) code for the GNU linker.  This is the default.
12919 @c Also, this is the default if the configure option @option{--with-gnu-ld}
12920 @c is used.
12921
12922 @item -mno-pic
12923 @opindex mno-pic
12924 Generate code that does not use a global pointer register.  The result
12925 is not position independent code, and violates the IA-64 ABI@.
12926
12927 @item -mvolatile-asm-stop
12928 @itemx -mno-volatile-asm-stop
12929 @opindex mvolatile-asm-stop
12930 @opindex mno-volatile-asm-stop
12931 Generate (or don't) a stop bit immediately before and after volatile asm
12932 statements.
12933
12934 @item -mregister-names
12935 @itemx -mno-register-names
12936 @opindex mregister-names
12937 @opindex mno-register-names
12938 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
12939 the stacked registers.  This may make assembler output more readable.
12940
12941 @item -mno-sdata
12942 @itemx -msdata
12943 @opindex mno-sdata
12944 @opindex msdata
12945 Disable (or enable) optimizations that use the small data section.  This may
12946 be useful for working around optimizer bugs.
12947
12948 @item -mconstant-gp
12949 @opindex mconstant-gp
12950 Generate code that uses a single constant global pointer value.  This is
12951 useful when compiling kernel code.
12952
12953 @item -mauto-pic
12954 @opindex mauto-pic
12955 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
12956 This is useful when compiling firmware code.
12957
12958 @item -minline-float-divide-min-latency
12959 @opindex minline-float-divide-min-latency
12960 Generate code for inline divides of floating point values
12961 using the minimum latency algorithm.
12962
12963 @item -minline-float-divide-max-throughput
12964 @opindex minline-float-divide-max-throughput
12965 Generate code for inline divides of floating point values
12966 using the maximum throughput algorithm.
12967
12968 @item -mno-inline-float-divide
12969 @opindex mno-inline-float-divide
12970 Do not generate inline code for divides of floating point values.
12971
12972 @item -minline-int-divide-min-latency
12973 @opindex minline-int-divide-min-latency
12974 Generate code for inline divides of integer values
12975 using the minimum latency algorithm.
12976
12977 @item -minline-int-divide-max-throughput
12978 @opindex minline-int-divide-max-throughput
12979 Generate code for inline divides of integer values
12980 using the maximum throughput algorithm.
12981
12982 @item -mno-inline-int-divide
12983 @opindex mno-inline-int-divide
12984 Do not generate inline code for divides of integer values.
12985
12986 @item -minline-sqrt-min-latency
12987 @opindex minline-sqrt-min-latency
12988 Generate code for inline square roots
12989 using the minimum latency algorithm.
12990
12991 @item -minline-sqrt-max-throughput
12992 @opindex minline-sqrt-max-throughput
12993 Generate code for inline square roots
12994 using the maximum throughput algorithm.
12995
12996 @item -mno-inline-sqrt
12997 @opindex mno-inline-sqrt
12998 Do not generate inline code for sqrt.
12999
13000 @item -mfused-madd
13001 @itemx -mno-fused-madd
13002 @opindex mfused-madd
13003 @opindex mno-fused-madd
13004 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
13005 instructions.  The default is to use these instructions.
13006
13007 @item -mno-dwarf2-asm
13008 @itemx -mdwarf2-asm
13009 @opindex mno-dwarf2-asm
13010 @opindex mdwarf2-asm
13011 Don't (or do) generate assembler code for the DWARF2 line number debugging
13012 info.  This may be useful when not using the GNU assembler.
13013
13014 @item -mearly-stop-bits
13015 @itemx -mno-early-stop-bits
13016 @opindex mearly-stop-bits
13017 @opindex mno-early-stop-bits
13018 Allow stop bits to be placed earlier than immediately preceding the
13019 instruction that triggered the stop bit.  This can improve instruction
13020 scheduling, but does not always do so.
13021
13022 @item -mfixed-range=@var{register-range}
13023 @opindex mfixed-range
13024 Generate code treating the given register range as fixed registers.
13025 A fixed register is one that the register allocator can not use.  This is
13026 useful when compiling kernel code.  A register range is specified as
13027 two registers separated by a dash.  Multiple register ranges can be
13028 specified separated by a comma.
13029
13030 @item -mtls-size=@var{tls-size}
13031 @opindex mtls-size
13032 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
13033 64.
13034
13035 @item -mtune=@var{cpu-type}
13036 @opindex mtune
13037 Tune the instruction scheduling for a particular CPU, Valid values are
13038 itanium, itanium1, merced, itanium2, and mckinley.
13039
13040 @item -milp32
13041 @itemx -mlp64
13042 @opindex milp32
13043 @opindex mlp64
13044 Generate code for a 32-bit or 64-bit environment.
13045 The 32-bit environment sets int, long and pointer to 32 bits.
13046 The 64-bit environment sets int to 32 bits and long and pointer
13047 to 64 bits.  These are HP-UX specific flags.
13048
13049 @item -mno-sched-br-data-spec
13050 @itemx -msched-br-data-spec
13051 @opindex mno-sched-br-data-spec
13052 @opindex msched-br-data-spec
13053 (Dis/En)able data speculative scheduling before reload.
13054 This will result in generation of the ld.a instructions and
13055 the corresponding check instructions (ld.c / chk.a).
13056 The default is 'disable'.
13057
13058 @item -msched-ar-data-spec
13059 @itemx -mno-sched-ar-data-spec
13060 @opindex msched-ar-data-spec
13061 @opindex mno-sched-ar-data-spec
13062 (En/Dis)able data speculative scheduling after reload.
13063 This will result in generation of the ld.a instructions and
13064 the corresponding check instructions (ld.c / chk.a).
13065 The default is 'enable'.
13066
13067 @item -mno-sched-control-spec
13068 @itemx -msched-control-spec
13069 @opindex mno-sched-control-spec
13070 @opindex msched-control-spec
13071 (Dis/En)able control speculative scheduling.  This feature is
13072 available only during region scheduling (i.e.@: before reload).
13073 This will result in generation of the ld.s instructions and
13074 the corresponding check instructions chk.s .
13075 The default is 'disable'.
13076
13077 @item -msched-br-in-data-spec
13078 @itemx -mno-sched-br-in-data-spec
13079 @opindex msched-br-in-data-spec
13080 @opindex mno-sched-br-in-data-spec
13081 (En/Dis)able speculative scheduling of the instructions that
13082 are dependent on the data speculative loads before reload.
13083 This is effective only with @option{-msched-br-data-spec} enabled.
13084 The default is 'enable'.
13085
13086 @item -msched-ar-in-data-spec
13087 @itemx -mno-sched-ar-in-data-spec
13088 @opindex msched-ar-in-data-spec
13089 @opindex mno-sched-ar-in-data-spec
13090 (En/Dis)able speculative scheduling of the instructions that
13091 are dependent on the data speculative loads after reload.
13092 This is effective only with @option{-msched-ar-data-spec} enabled.
13093 The default is 'enable'.
13094
13095 @item -msched-in-control-spec
13096 @itemx -mno-sched-in-control-spec
13097 @opindex msched-in-control-spec
13098 @opindex mno-sched-in-control-spec
13099 (En/Dis)able speculative scheduling of the instructions that
13100 are dependent on the control speculative loads.
13101 This is effective only with @option{-msched-control-spec} enabled.
13102 The default is 'enable'.
13103
13104 @item -mno-sched-prefer-non-data-spec-insns
13105 @itemx -msched-prefer-non-data-spec-insns
13106 @opindex mno-sched-prefer-non-data-spec-insns
13107 @opindex msched-prefer-non-data-spec-insns
13108 If enabled, data speculative instructions will be chosen for schedule
13109 only if there are no other choices at the moment.  This will make
13110 the use of the data speculation much more conservative.
13111 The default is 'disable'.
13112
13113 @item -mno-sched-prefer-non-control-spec-insns
13114 @itemx -msched-prefer-non-control-spec-insns
13115 @opindex mno-sched-prefer-non-control-spec-insns
13116 @opindex msched-prefer-non-control-spec-insns
13117 If enabled, control speculative instructions will be chosen for schedule
13118 only if there are no other choices at the moment.  This will make
13119 the use of the control speculation much more conservative.
13120 The default is 'disable'.
13121
13122 @item -mno-sched-count-spec-in-critical-path
13123 @itemx -msched-count-spec-in-critical-path
13124 @opindex mno-sched-count-spec-in-critical-path
13125 @opindex msched-count-spec-in-critical-path
13126 If enabled, speculative dependencies will be considered during
13127 computation of the instructions priorities.  This will make the use of the
13128 speculation a bit more conservative.
13129 The default is 'disable'.
13130
13131 @item -msched-spec-ldc
13132 @opindex msched-spec-ldc
13133 Use a simple data speculation check.  This option is on by default.
13134
13135 @item -msched-control-spec-ldc
13136 @opindex msched-spec-ldc
13137 Use a simple check for control speculation.  This option is on by default.
13138
13139 @item -msched-stop-bits-after-every-cycle
13140 @opindex msched-stop-bits-after-every-cycle
13141 Place a stop bit after every cycle when scheduling.  This option is on
13142 by default.
13143
13144 @item -msched-fp-mem-deps-zero-cost
13145 @opindex msched-fp-mem-deps-zero-cost
13146 Assume that floating-point stores and loads are not likely to cause a conflict
13147 when placed into the same instruction group.  This option is disabled by
13148 default.
13149
13150 @item -msel-sched-dont-check-control-spec
13151 @opindex msel-sched-dont-check-control-spec
13152 Generate checks for control speculation in selective scheduling.
13153 This flag is disabled by default.
13154
13155 @item -msched-max-memory-insns=@var{max-insns}
13156 @opindex msched-max-memory-insns
13157 Limit on the number of memory insns per instruction group, giving lower
13158 priority to subsequent memory insns attempting to schedule in the same
13159 instruction group. Frequently useful to prevent cache bank conflicts.
13160 The default value is 1.
13161
13162 @item -msched-max-memory-insns-hard-limit
13163 @opindex msched-max-memory-insns-hard-limit
13164 Disallow more than `msched-max-memory-insns' in instruction group.
13165 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
13166 when limit is reached but may still schedule memory operations.
13167
13168 @end table
13169
13170 @node IA-64/VMS Options
13171 @subsection IA-64/VMS Options
13172
13173 These @samp{-m} options are defined for the IA-64/VMS implementations:
13174
13175 @table @gcctabopt
13176 @item -mvms-return-codes
13177 @opindex mvms-return-codes
13178 Return VMS condition codes from main. The default is to return POSIX
13179 style condition (e.g.@ error) codes.
13180
13181 @item -mdebug-main=@var{prefix}
13182 @opindex mdebug-main=@var{prefix}
13183 Flag the first routine whose name starts with @var{prefix} as the main
13184 routine for the debugger.
13185
13186 @item -mmalloc64
13187 @opindex mmalloc64
13188 Default to 64bit memory allocation routines.
13189 @end table
13190
13191 @node LM32 Options
13192 @subsection LM32 Options
13193 @cindex LM32 options
13194
13195 These @option{-m} options are defined for the Lattice Mico32 architecture:
13196
13197 @table @gcctabopt
13198 @item -mbarrel-shift-enabled
13199 @opindex mbarrel-shift-enabled
13200 Enable barrel-shift instructions.
13201
13202 @item -mdivide-enabled
13203 @opindex mdivide-enabled
13204 Enable divide and modulus instructions.
13205
13206 @item -mmultiply-enabled
13207 @opindex multiply-enabled
13208 Enable multiply instructions.
13209
13210 @item -msign-extend-enabled
13211 @opindex msign-extend-enabled
13212 Enable sign extend instructions.
13213
13214 @item -muser-enabled
13215 @opindex muser-enabled
13216 Enable user-defined instructions.
13217
13218 @end table
13219
13220 @node M32C Options
13221 @subsection M32C Options
13222 @cindex M32C options
13223
13224 @table @gcctabopt
13225 @item -mcpu=@var{name}
13226 @opindex mcpu=
13227 Select the CPU for which code is generated.  @var{name} may be one of
13228 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
13229 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
13230 the M32C/80 series.
13231
13232 @item -msim
13233 @opindex msim
13234 Specifies that the program will be run on the simulator.  This causes
13235 an alternate runtime library to be linked in which supports, for
13236 example, file I/O@.  You must not use this option when generating
13237 programs that will run on real hardware; you must provide your own
13238 runtime library for whatever I/O functions are needed.
13239
13240 @item -memregs=@var{number}
13241 @opindex memregs=
13242 Specifies the number of memory-based pseudo-registers GCC will use
13243 during code generation.  These pseudo-registers will be used like real
13244 registers, so there is a tradeoff between GCC's ability to fit the
13245 code into available registers, and the performance penalty of using
13246 memory instead of registers.  Note that all modules in a program must
13247 be compiled with the same value for this option.  Because of that, you
13248 must not use this option with the default runtime libraries gcc
13249 builds.
13250
13251 @end table
13252
13253 @node M32R/D Options
13254 @subsection M32R/D Options
13255 @cindex M32R/D options
13256
13257 These @option{-m} options are defined for Renesas M32R/D architectures:
13258
13259 @table @gcctabopt
13260 @item -m32r2
13261 @opindex m32r2
13262 Generate code for the M32R/2@.
13263
13264 @item -m32rx
13265 @opindex m32rx
13266 Generate code for the M32R/X@.
13267
13268 @item -m32r
13269 @opindex m32r
13270 Generate code for the M32R@.  This is the default.
13271
13272 @item -mmodel=small
13273 @opindex mmodel=small
13274 Assume all objects live in the lower 16MB of memory (so that their addresses
13275 can be loaded with the @code{ld24} instruction), and assume all subroutines
13276 are reachable with the @code{bl} instruction.
13277 This is the default.
13278
13279 The addressability of a particular object can be set with the
13280 @code{model} attribute.
13281
13282 @item -mmodel=medium
13283 @opindex mmodel=medium
13284 Assume objects may be anywhere in the 32-bit address space (the compiler
13285 will generate @code{seth/add3} instructions to load their addresses), and
13286 assume all subroutines are reachable with the @code{bl} instruction.
13287
13288 @item -mmodel=large
13289 @opindex mmodel=large
13290 Assume objects may be anywhere in the 32-bit address space (the compiler
13291 will generate @code{seth/add3} instructions to load their addresses), and
13292 assume subroutines may not be reachable with the @code{bl} instruction
13293 (the compiler will generate the much slower @code{seth/add3/jl}
13294 instruction sequence).
13295
13296 @item -msdata=none
13297 @opindex msdata=none
13298 Disable use of the small data area.  Variables will be put into
13299 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
13300 @code{section} attribute has been specified).
13301 This is the default.
13302
13303 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
13304 Objects may be explicitly put in the small data area with the
13305 @code{section} attribute using one of these sections.
13306
13307 @item -msdata=sdata
13308 @opindex msdata=sdata
13309 Put small global and static data in the small data area, but do not
13310 generate special code to reference them.
13311
13312 @item -msdata=use
13313 @opindex msdata=use
13314 Put small global and static data in the small data area, and generate
13315 special instructions to reference them.
13316
13317 @item -G @var{num}
13318 @opindex G
13319 @cindex smaller data references
13320 Put global and static objects less than or equal to @var{num} bytes
13321 into the small data or bss sections instead of the normal data or bss
13322 sections.  The default value of @var{num} is 8.
13323 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
13324 for this option to have any effect.
13325
13326 All modules should be compiled with the same @option{-G @var{num}} value.
13327 Compiling with different values of @var{num} may or may not work; if it
13328 doesn't the linker will give an error message---incorrect code will not be
13329 generated.
13330
13331 @item -mdebug
13332 @opindex mdebug
13333 Makes the M32R specific code in the compiler display some statistics
13334 that might help in debugging programs.
13335
13336 @item -malign-loops
13337 @opindex malign-loops
13338 Align all loops to a 32-byte boundary.
13339
13340 @item -mno-align-loops
13341 @opindex mno-align-loops
13342 Do not enforce a 32-byte alignment for loops.  This is the default.
13343
13344 @item -missue-rate=@var{number}
13345 @opindex missue-rate=@var{number}
13346 Issue @var{number} instructions per cycle.  @var{number} can only be 1
13347 or 2.
13348
13349 @item -mbranch-cost=@var{number}
13350 @opindex mbranch-cost=@var{number}
13351 @var{number} can only be 1 or 2.  If it is 1 then branches will be
13352 preferred over conditional code, if it is 2, then the opposite will
13353 apply.
13354
13355 @item -mflush-trap=@var{number}
13356 @opindex mflush-trap=@var{number}
13357 Specifies the trap number to use to flush the cache.  The default is
13358 12.  Valid numbers are between 0 and 15 inclusive.
13359
13360 @item -mno-flush-trap
13361 @opindex mno-flush-trap
13362 Specifies that the cache cannot be flushed by using a trap.
13363
13364 @item -mflush-func=@var{name}
13365 @opindex mflush-func=@var{name}
13366 Specifies the name of the operating system function to call to flush
13367 the cache.  The default is @emph{_flush_cache}, but a function call
13368 will only be used if a trap is not available.
13369
13370 @item -mno-flush-func
13371 @opindex mno-flush-func
13372 Indicates that there is no OS function for flushing the cache.
13373
13374 @end table
13375
13376 @node M680x0 Options
13377 @subsection M680x0 Options
13378 @cindex M680x0 options
13379
13380 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
13381 The default settings depend on which architecture was selected when
13382 the compiler was configured; the defaults for the most common choices
13383 are given below.
13384
13385 @table @gcctabopt
13386 @item -march=@var{arch}
13387 @opindex march
13388 Generate code for a specific M680x0 or ColdFire instruction set
13389 architecture.  Permissible values of @var{arch} for M680x0
13390 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
13391 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
13392 architectures are selected according to Freescale's ISA classification
13393 and the permissible values are: @samp{isaa}, @samp{isaaplus},
13394 @samp{isab} and @samp{isac}.
13395
13396 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
13397 code for a ColdFire target.  The @var{arch} in this macro is one of the
13398 @option{-march} arguments given above.
13399
13400 When used together, @option{-march} and @option{-mtune} select code
13401 that runs on a family of similar processors but that is optimized
13402 for a particular microarchitecture.
13403
13404 @item -mcpu=@var{cpu}
13405 @opindex mcpu
13406 Generate code for a specific M680x0 or ColdFire processor.
13407 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
13408 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
13409 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
13410 below, which also classifies the CPUs into families:
13411
13412 @multitable @columnfractions 0.20 0.80
13413 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
13414 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
13415 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
13416 @item @samp{5206e} @tab @samp{5206e}
13417 @item @samp{5208} @tab @samp{5207} @samp{5208}
13418 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
13419 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
13420 @item @samp{5216} @tab @samp{5214} @samp{5216}
13421 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
13422 @item @samp{5225} @tab @samp{5224} @samp{5225}
13423 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
13424 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
13425 @item @samp{5249} @tab @samp{5249}
13426 @item @samp{5250} @tab @samp{5250}
13427 @item @samp{5271} @tab @samp{5270} @samp{5271}
13428 @item @samp{5272} @tab @samp{5272}
13429 @item @samp{5275} @tab @samp{5274} @samp{5275}
13430 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
13431 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
13432 @item @samp{5307} @tab @samp{5307}
13433 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
13434 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
13435 @item @samp{5407} @tab @samp{5407}
13436 @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}
13437 @end multitable
13438
13439 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
13440 @var{arch} is compatible with @var{cpu}.  Other combinations of
13441 @option{-mcpu} and @option{-march} are rejected.
13442
13443 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
13444 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
13445 where the value of @var{family} is given by the table above.
13446
13447 @item -mtune=@var{tune}
13448 @opindex mtune
13449 Tune the code for a particular microarchitecture, within the
13450 constraints set by @option{-march} and @option{-mcpu}.
13451 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
13452 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
13453 and @samp{cpu32}.  The ColdFire microarchitectures
13454 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
13455
13456 You can also use @option{-mtune=68020-40} for code that needs
13457 to run relatively well on 68020, 68030 and 68040 targets.
13458 @option{-mtune=68020-60} is similar but includes 68060 targets
13459 as well.  These two options select the same tuning decisions as
13460 @option{-m68020-40} and @option{-m68020-60} respectively.
13461
13462 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
13463 when tuning for 680x0 architecture @var{arch}.  It also defines
13464 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
13465 option is used.  If gcc is tuning for a range of architectures,
13466 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
13467 it defines the macros for every architecture in the range.
13468
13469 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
13470 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
13471 of the arguments given above.
13472
13473 @item -m68000
13474 @itemx -mc68000
13475 @opindex m68000
13476 @opindex mc68000
13477 Generate output for a 68000.  This is the default
13478 when the compiler is configured for 68000-based systems.
13479 It is equivalent to @option{-march=68000}.
13480
13481 Use this option for microcontrollers with a 68000 or EC000 core,
13482 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
13483
13484 @item -m68010
13485 @opindex m68010
13486 Generate output for a 68010.  This is the default
13487 when the compiler is configured for 68010-based systems.
13488 It is equivalent to @option{-march=68010}.
13489
13490 @item -m68020
13491 @itemx -mc68020
13492 @opindex m68020
13493 @opindex mc68020
13494 Generate output for a 68020.  This is the default
13495 when the compiler is configured for 68020-based systems.
13496 It is equivalent to @option{-march=68020}.
13497
13498 @item -m68030
13499 @opindex m68030
13500 Generate output for a 68030.  This is the default when the compiler is
13501 configured for 68030-based systems.  It is equivalent to
13502 @option{-march=68030}.
13503
13504 @item -m68040
13505 @opindex m68040
13506 Generate output for a 68040.  This is the default when the compiler is
13507 configured for 68040-based systems.  It is equivalent to
13508 @option{-march=68040}.
13509
13510 This option inhibits the use of 68881/68882 instructions that have to be
13511 emulated by software on the 68040.  Use this option if your 68040 does not
13512 have code to emulate those instructions.
13513
13514 @item -m68060
13515 @opindex m68060
13516 Generate output for a 68060.  This is the default when the compiler is
13517 configured for 68060-based systems.  It is equivalent to
13518 @option{-march=68060}.
13519
13520 This option inhibits the use of 68020 and 68881/68882 instructions that
13521 have to be emulated by software on the 68060.  Use this option if your 68060
13522 does not have code to emulate those instructions.
13523
13524 @item -mcpu32
13525 @opindex mcpu32
13526 Generate output for a CPU32.  This is the default
13527 when the compiler is configured for CPU32-based systems.
13528 It is equivalent to @option{-march=cpu32}.
13529
13530 Use this option for microcontrollers with a
13531 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
13532 68336, 68340, 68341, 68349 and 68360.
13533
13534 @item -m5200
13535 @opindex m5200
13536 Generate output for a 520X ColdFire CPU@.  This is the default
13537 when the compiler is configured for 520X-based systems.
13538 It is equivalent to @option{-mcpu=5206}, and is now deprecated
13539 in favor of that option.
13540
13541 Use this option for microcontroller with a 5200 core, including
13542 the MCF5202, MCF5203, MCF5204 and MCF5206.
13543
13544 @item -m5206e
13545 @opindex m5206e
13546 Generate output for a 5206e ColdFire CPU@.  The option is now
13547 deprecated in favor of the equivalent @option{-mcpu=5206e}.
13548
13549 @item -m528x
13550 @opindex m528x
13551 Generate output for a member of the ColdFire 528X family.
13552 The option is now deprecated in favor of the equivalent
13553 @option{-mcpu=528x}.
13554
13555 @item -m5307
13556 @opindex m5307
13557 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
13558 in favor of the equivalent @option{-mcpu=5307}.
13559
13560 @item -m5407
13561 @opindex m5407
13562 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
13563 in favor of the equivalent @option{-mcpu=5407}.
13564
13565 @item -mcfv4e
13566 @opindex mcfv4e
13567 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
13568 This includes use of hardware floating point instructions.
13569 The option is equivalent to @option{-mcpu=547x}, and is now
13570 deprecated in favor of that option.
13571
13572 @item -m68020-40
13573 @opindex m68020-40
13574 Generate output for a 68040, without using any of the new instructions.
13575 This results in code which can run relatively efficiently on either a
13576 68020/68881 or a 68030 or a 68040.  The generated code does use the
13577 68881 instructions that are emulated on the 68040.
13578
13579 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
13580
13581 @item -m68020-60
13582 @opindex m68020-60
13583 Generate output for a 68060, without using any of the new instructions.
13584 This results in code which can run relatively efficiently on either a
13585 68020/68881 or a 68030 or a 68040.  The generated code does use the
13586 68881 instructions that are emulated on the 68060.
13587
13588 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
13589
13590 @item -mhard-float
13591 @itemx -m68881
13592 @opindex mhard-float
13593 @opindex m68881
13594 Generate floating-point instructions.  This is the default for 68020
13595 and above, and for ColdFire devices that have an FPU@.  It defines the
13596 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
13597 on ColdFire targets.
13598
13599 @item -msoft-float
13600 @opindex msoft-float
13601 Do not generate floating-point instructions; use library calls instead.
13602 This is the default for 68000, 68010, and 68832 targets.  It is also
13603 the default for ColdFire devices that have no FPU.
13604
13605 @item -mdiv
13606 @itemx -mno-div
13607 @opindex mdiv
13608 @opindex mno-div
13609 Generate (do not generate) ColdFire hardware divide and remainder
13610 instructions.  If @option{-march} is used without @option{-mcpu},
13611 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
13612 architectures.  Otherwise, the default is taken from the target CPU
13613 (either the default CPU, or the one specified by @option{-mcpu}).  For
13614 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
13615 @option{-mcpu=5206e}.
13616
13617 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
13618
13619 @item -mshort
13620 @opindex mshort
13621 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13622 Additionally, parameters passed on the stack are also aligned to a
13623 16-bit boundary even on targets whose API mandates promotion to 32-bit.
13624
13625 @item -mno-short
13626 @opindex mno-short
13627 Do not consider type @code{int} to be 16 bits wide.  This is the default.
13628
13629 @item -mnobitfield
13630 @itemx -mno-bitfield
13631 @opindex mnobitfield
13632 @opindex mno-bitfield
13633 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
13634 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
13635
13636 @item -mbitfield
13637 @opindex mbitfield
13638 Do use the bit-field instructions.  The @option{-m68020} option implies
13639 @option{-mbitfield}.  This is the default if you use a configuration
13640 designed for a 68020.
13641
13642 @item -mrtd
13643 @opindex mrtd
13644 Use a different function-calling convention, in which functions
13645 that take a fixed number of arguments return with the @code{rtd}
13646 instruction, which pops their arguments while returning.  This
13647 saves one instruction in the caller since there is no need to pop
13648 the arguments there.
13649
13650 This calling convention is incompatible with the one normally
13651 used on Unix, so you cannot use it if you need to call libraries
13652 compiled with the Unix compiler.
13653
13654 Also, you must provide function prototypes for all functions that
13655 take variable numbers of arguments (including @code{printf});
13656 otherwise incorrect code will be generated for calls to those
13657 functions.
13658
13659 In addition, seriously incorrect code will result if you call a
13660 function with too many arguments.  (Normally, extra arguments are
13661 harmlessly ignored.)
13662
13663 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
13664 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
13665
13666 @item -mno-rtd
13667 @opindex mno-rtd
13668 Do not use the calling conventions selected by @option{-mrtd}.
13669 This is the default.
13670
13671 @item -malign-int
13672 @itemx -mno-align-int
13673 @opindex malign-int
13674 @opindex mno-align-int
13675 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
13676 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
13677 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
13678 Aligning variables on 32-bit boundaries produces code that runs somewhat
13679 faster on processors with 32-bit busses at the expense of more memory.
13680
13681 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
13682 align structures containing the above types  differently than
13683 most published application binary interface specifications for the m68k.
13684
13685 @item -mpcrel
13686 @opindex mpcrel
13687 Use the pc-relative addressing mode of the 68000 directly, instead of
13688 using a global offset table.  At present, this option implies @option{-fpic},
13689 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
13690 not presently supported with @option{-mpcrel}, though this could be supported for
13691 68020 and higher processors.
13692
13693 @item -mno-strict-align
13694 @itemx -mstrict-align
13695 @opindex mno-strict-align
13696 @opindex mstrict-align
13697 Do not (do) assume that unaligned memory references will be handled by
13698 the system.
13699
13700 @item -msep-data
13701 Generate code that allows the data segment to be located in a different
13702 area of memory from the text segment.  This allows for execute in place in
13703 an environment without virtual memory management.  This option implies
13704 @option{-fPIC}.
13705
13706 @item -mno-sep-data
13707 Generate code that assumes that the data segment follows the text segment.
13708 This is the default.
13709
13710 @item -mid-shared-library
13711 Generate code that supports shared libraries via the library ID method.
13712 This allows for execute in place and shared libraries in an environment
13713 without virtual memory management.  This option implies @option{-fPIC}.
13714
13715 @item -mno-id-shared-library
13716 Generate code that doesn't assume ID based shared libraries are being used.
13717 This is the default.
13718
13719 @item -mshared-library-id=n
13720 Specified the identification number of the ID based shared library being
13721 compiled.  Specifying a value of 0 will generate more compact code, specifying
13722 other values will force the allocation of that number to the current
13723 library but is no more space or time efficient than omitting this option.
13724
13725 @item -mxgot
13726 @itemx -mno-xgot
13727 @opindex mxgot
13728 @opindex mno-xgot
13729 When generating position-independent code for ColdFire, generate code
13730 that works if the GOT has more than 8192 entries.  This code is
13731 larger and slower than code generated without this option.  On M680x0
13732 processors, this option is not needed; @option{-fPIC} suffices.
13733
13734 GCC normally uses a single instruction to load values from the GOT@.
13735 While this is relatively efficient, it only works if the GOT
13736 is smaller than about 64k.  Anything larger causes the linker
13737 to report an error such as:
13738
13739 @cindex relocation truncated to fit (ColdFire)
13740 @smallexample
13741 relocation truncated to fit: R_68K_GOT16O foobar
13742 @end smallexample
13743
13744 If this happens, you should recompile your code with @option{-mxgot}.
13745 It should then work with very large GOTs.  However, code generated with
13746 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
13747 the value of a global symbol.
13748
13749 Note that some linkers, including newer versions of the GNU linker,
13750 can create multiple GOTs and sort GOT entries.  If you have such a linker,
13751 you should only need to use @option{-mxgot} when compiling a single
13752 object file that accesses more than 8192 GOT entries.  Very few do.
13753
13754 These options have no effect unless GCC is generating
13755 position-independent code.
13756
13757 @end table
13758
13759 @node M68hc1x Options
13760 @subsection M68hc1x Options
13761 @cindex M68hc1x options
13762
13763 These are the @samp{-m} options defined for the 68hc11 and 68hc12
13764 microcontrollers.  The default values for these options depends on
13765 which style of microcontroller was selected when the compiler was configured;
13766 the defaults for the most common choices are given below.
13767
13768 @table @gcctabopt
13769 @item -m6811
13770 @itemx -m68hc11
13771 @opindex m6811
13772 @opindex m68hc11
13773 Generate output for a 68HC11.  This is the default
13774 when the compiler is configured for 68HC11-based systems.
13775
13776 @item -m6812
13777 @itemx -m68hc12
13778 @opindex m6812
13779 @opindex m68hc12
13780 Generate output for a 68HC12.  This is the default
13781 when the compiler is configured for 68HC12-based systems.
13782
13783 @item -m68S12
13784 @itemx -m68hcs12
13785 @opindex m68S12
13786 @opindex m68hcs12
13787 Generate output for a 68HCS12.
13788
13789 @item -mauto-incdec
13790 @opindex mauto-incdec
13791 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
13792 addressing modes.
13793
13794 @item -minmax
13795 @itemx -mnominmax
13796 @opindex minmax
13797 @opindex mnominmax
13798 Enable the use of 68HC12 min and max instructions.
13799
13800 @item -mlong-calls
13801 @itemx -mno-long-calls
13802 @opindex mlong-calls
13803 @opindex mno-long-calls
13804 Treat all calls as being far away (near).  If calls are assumed to be
13805 far away, the compiler will use the @code{call} instruction to
13806 call a function and the @code{rtc} instruction for returning.
13807
13808 @item -mshort
13809 @opindex mshort
13810 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13811
13812 @item -msoft-reg-count=@var{count}
13813 @opindex msoft-reg-count
13814 Specify the number of pseudo-soft registers which are used for the
13815 code generation.  The maximum number is 32.  Using more pseudo-soft
13816 register may or may not result in better code depending on the program.
13817 The default is 4 for 68HC11 and 2 for 68HC12.
13818
13819 @end table
13820
13821 @node MCore Options
13822 @subsection MCore Options
13823 @cindex MCore options
13824
13825 These are the @samp{-m} options defined for the Motorola M*Core
13826 processors.
13827
13828 @table @gcctabopt
13829
13830 @item -mhardlit
13831 @itemx -mno-hardlit
13832 @opindex mhardlit
13833 @opindex mno-hardlit
13834 Inline constants into the code stream if it can be done in two
13835 instructions or less.
13836
13837 @item -mdiv
13838 @itemx -mno-div
13839 @opindex mdiv
13840 @opindex mno-div
13841 Use the divide instruction.  (Enabled by default).
13842
13843 @item -mrelax-immediate
13844 @itemx -mno-relax-immediate
13845 @opindex mrelax-immediate
13846 @opindex mno-relax-immediate
13847 Allow arbitrary sized immediates in bit operations.
13848
13849 @item -mwide-bitfields
13850 @itemx -mno-wide-bitfields
13851 @opindex mwide-bitfields
13852 @opindex mno-wide-bitfields
13853 Always treat bit-fields as int-sized.
13854
13855 @item -m4byte-functions
13856 @itemx -mno-4byte-functions
13857 @opindex m4byte-functions
13858 @opindex mno-4byte-functions
13859 Force all functions to be aligned to a four byte boundary.
13860
13861 @item -mcallgraph-data
13862 @itemx -mno-callgraph-data
13863 @opindex mcallgraph-data
13864 @opindex mno-callgraph-data
13865 Emit callgraph information.
13866
13867 @item -mslow-bytes
13868 @itemx -mno-slow-bytes
13869 @opindex mslow-bytes
13870 @opindex mno-slow-bytes
13871 Prefer word access when reading byte quantities.
13872
13873 @item -mlittle-endian
13874 @itemx -mbig-endian
13875 @opindex mlittle-endian
13876 @opindex mbig-endian
13877 Generate code for a little endian target.
13878
13879 @item -m210
13880 @itemx -m340
13881 @opindex m210
13882 @opindex m340
13883 Generate code for the 210 processor.
13884
13885 @item -mno-lsim
13886 @opindex mno-lsim
13887 Assume that run-time support has been provided and so omit the
13888 simulator library (@file{libsim.a)} from the linker command line.
13889
13890 @item -mstack-increment=@var{size}
13891 @opindex mstack-increment
13892 Set the maximum amount for a single stack increment operation.  Large
13893 values can increase the speed of programs which contain functions
13894 that need a large amount of stack space, but they can also trigger a
13895 segmentation fault if the stack is extended too much.  The default
13896 value is 0x1000.
13897
13898 @end table
13899
13900 @node MeP Options
13901 @subsection MeP Options
13902 @cindex MeP options
13903
13904 @table @gcctabopt
13905
13906 @item -mabsdiff
13907 @opindex mabsdiff
13908 Enables the @code{abs} instruction, which is the absolute difference
13909 between two registers.
13910
13911 @item -mall-opts
13912 @opindex mall-opts
13913 Enables all the optional instructions - average, multiply, divide, bit
13914 operations, leading zero, absolute difference, min/max, clip, and
13915 saturation.
13916
13917
13918 @item -maverage
13919 @opindex maverage
13920 Enables the @code{ave} instruction, which computes the average of two
13921 registers.
13922
13923 @item -mbased=@var{n}
13924 @opindex mbased=
13925 Variables of size @var{n} bytes or smaller will be placed in the
13926 @code{.based} section by default.  Based variables use the @code{$tp}
13927 register as a base register, and there is a 128 byte limit to the
13928 @code{.based} section.
13929
13930 @item -mbitops
13931 @opindex mbitops
13932 Enables the bit operation instructions - bit test (@code{btstm}), set
13933 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
13934 test-and-set (@code{tas}).
13935
13936 @item -mc=@var{name}
13937 @opindex mc=
13938 Selects which section constant data will be placed in.  @var{name} may
13939 be @code{tiny}, @code{near}, or @code{far}.
13940
13941 @item -mclip
13942 @opindex mclip
13943 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
13944 useful unless you also provide @code{-mminmax}.
13945
13946 @item -mconfig=@var{name}
13947 @opindex mconfig=
13948 Selects one of the build-in core configurations.  Each MeP chip has
13949 one or more modules in it; each module has a core CPU and a variety of
13950 coprocessors, optional instructions, and peripherals.  The
13951 @code{MeP-Integrator} tool, not part of GCC, provides these
13952 configurations through this option; using this option is the same as
13953 using all the corresponding command line options.  The default
13954 configuration is @code{default}.
13955
13956 @item -mcop
13957 @opindex mcop
13958 Enables the coprocessor instructions.  By default, this is a 32-bit
13959 coprocessor.  Note that the coprocessor is normally enabled via the
13960 @code{-mconfig=} option.
13961
13962 @item -mcop32
13963 @opindex mcop32
13964 Enables the 32-bit coprocessor's instructions.
13965
13966 @item -mcop64
13967 @opindex mcop64
13968 Enables the 64-bit coprocessor's instructions.
13969
13970 @item -mivc2
13971 @opindex mivc2
13972 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
13973
13974 @item -mdc
13975 @opindex mdc
13976 Causes constant variables to be placed in the @code{.near} section.
13977
13978 @item -mdiv
13979 @opindex mdiv
13980 Enables the @code{div} and @code{divu} instructions.
13981
13982 @item -meb
13983 @opindex meb
13984 Generate big-endian code.
13985
13986 @item -mel
13987 @opindex mel
13988 Generate little-endian code.
13989
13990 @item -mio-volatile
13991 @opindex mio-volatile
13992 Tells the compiler that any variable marked with the @code{io}
13993 attribute is to be considered volatile.
13994
13995 @item -ml
13996 @opindex ml
13997 Causes variables to be assigned to the @code{.far} section by default.
13998
13999 @item -mleadz
14000 @opindex mleadz
14001 Enables the @code{leadz} (leading zero) instruction.
14002
14003 @item -mm
14004 @opindex mm
14005 Causes variables to be assigned to the @code{.near} section by default.
14006
14007 @item -mminmax
14008 @opindex mminmax
14009 Enables the @code{min} and @code{max} instructions.
14010
14011 @item -mmult
14012 @opindex mmult
14013 Enables the multiplication and multiply-accumulate instructions.
14014
14015 @item -mno-opts
14016 @opindex mno-opts
14017 Disables all the optional instructions enabled by @code{-mall-opts}.
14018
14019 @item -mrepeat
14020 @opindex mrepeat
14021 Enables the @code{repeat} and @code{erepeat} instructions, used for
14022 low-overhead looping.
14023
14024 @item -ms
14025 @opindex ms
14026 Causes all variables to default to the @code{.tiny} section.  Note
14027 that there is a 65536 byte limit to this section.  Accesses to these
14028 variables use the @code{%gp} base register.
14029
14030 @item -msatur
14031 @opindex msatur
14032 Enables the saturation instructions.  Note that the compiler does not
14033 currently generate these itself, but this option is included for
14034 compatibility with other tools, like @code{as}.
14035
14036 @item -msdram
14037 @opindex msdram
14038 Link the SDRAM-based runtime instead of the default ROM-based runtime.
14039
14040 @item -msim
14041 @opindex msim
14042 Link the simulator runtime libraries.
14043
14044 @item -msimnovec
14045 @opindex msimnovec
14046 Link the simulator runtime libraries, excluding built-in support
14047 for reset and exception vectors and tables.
14048
14049 @item -mtf
14050 @opindex mtf
14051 Causes all functions to default to the @code{.far} section.  Without
14052 this option, functions default to the @code{.near} section.
14053
14054 @item -mtiny=@var{n}
14055 @opindex mtiny=
14056 Variables that are @var{n} bytes or smaller will be allocated to the
14057 @code{.tiny} section.  These variables use the @code{$gp} base
14058 register.  The default for this option is 4, but note that there's a
14059 65536 byte limit to the @code{.tiny} section.
14060
14061 @end table
14062
14063 @node MicroBlaze Options
14064 @subsection MicroBlaze Options
14065 @cindex MicroBlaze Options
14066
14067 @table @gcctabopt
14068
14069 @item -msoft-float
14070 @opindex msoft-float
14071 Use software emulation for floating point (default).
14072
14073 @item -mhard-float
14074 @opindex mhard-float
14075 Use hardware floating point instructions.
14076
14077 @item -mmemcpy
14078 @opindex mmemcpy
14079 Do not optimize block moves, use @code{memcpy}.
14080
14081 @item -mno-clearbss
14082 @opindex mno-clearbss
14083 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
14084
14085 @item -mcpu=@var{cpu-type}
14086 @opindex mcpu=
14087 Use features of and schedule code for given CPU.
14088 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}}, 
14089 where @var{X} is a major version, @var{YY} is the minor version, and 
14090 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
14091 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}. 
14092
14093 @item -mxl-soft-mul
14094 @opindex mxl-soft-mul
14095 Use software multiply emulation (default).
14096
14097 @item -mxl-soft-div
14098 @opindex mxl-soft-div
14099 Use software emulation for divides (default).
14100
14101 @item -mxl-barrel-shift
14102 @opindex mxl-barrel-shift
14103 Use the hardware barrel shifter.
14104
14105 @item -mxl-pattern-compare
14106 @opindex mxl-pattern-compare
14107 Use pattern compare instructions.
14108
14109 @item -msmall-divides
14110 @opindex msmall-divides
14111 Use table lookup optimization for small signed integer divisions.
14112
14113 @item -mxl-stack-check
14114 @opindex mxl-stack-check
14115 This option is deprecated.  Use -fstack-check instead.
14116
14117 @item -mxl-gp-opt
14118 @opindex mxl-gp-opt
14119 Use GP relative sdata/sbss sections.
14120
14121 @item -mxl-multiply-high
14122 @opindex mxl-multiply-high
14123 Use multiply high instructions for high part of 32x32 multiply.
14124
14125 @item -mxl-float-convert
14126 @opindex mxl-float-convert
14127 Use hardware floating point conversion instructions.
14128
14129 @item -mxl-float-sqrt
14130 @opindex mxl-float-sqrt
14131 Use hardware floating point square root instruction.
14132
14133 @item -mxl-mode-@var{app-model}
14134 Select application model @var{app-model}.  Valid models are 
14135 @table @samp
14136 @item executable
14137 normal executable (default), uses startup code @file{crt0.o}.
14138
14139 @item xmdstub
14140 for use with Xilinx Microprocessor Debugger (XMD) based 
14141 software intrusive debug agent called xmdstub. This uses startup file 
14142 @file{crt1.o} and sets the start address of the program to be 0x800.
14143
14144 @item bootstrap
14145 for applications that are loaded using a bootloader.
14146 This model uses startup file @file{crt2.o} which does not contain a processor 
14147 reset vector handler. This is suitable for transferring control on a 
14148 processor reset to the bootloader rather than the application.
14149
14150 @item novectors
14151 for applications that do not require any of the 
14152 MicroBlaze vectors. This option may be useful for applications running
14153 within a monitoring application. This model uses @file{crt3.o} as a startup file.
14154 @end table
14155
14156 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for 
14157 @option{-mxl-mode-@var{app-model}}.
14158
14159 @end table
14160
14161 @node MIPS Options
14162 @subsection MIPS Options
14163 @cindex MIPS options
14164
14165 @table @gcctabopt
14166
14167 @item -EB
14168 @opindex EB
14169 Generate big-endian code.
14170
14171 @item -EL
14172 @opindex EL
14173 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
14174 configurations.
14175
14176 @item -march=@var{arch}
14177 @opindex march
14178 Generate code that will run on @var{arch}, which can be the name of a
14179 generic MIPS ISA, or the name of a particular processor.
14180 The ISA names are:
14181 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
14182 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
14183 The processor names are:
14184 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
14185 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
14186 @samp{5kc}, @samp{5kf},
14187 @samp{20kc},
14188 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
14189 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
14190 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
14191 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
14192 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
14193 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
14194 @samp{m4k},
14195 @samp{octeon},
14196 @samp{orion},
14197 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
14198 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
14199 @samp{rm7000}, @samp{rm9000},
14200 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
14201 @samp{sb1},
14202 @samp{sr71000},
14203 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
14204 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
14205 and @samp{xlr}.
14206 The special value @samp{from-abi} selects the
14207 most compatible architecture for the selected ABI (that is,
14208 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
14209
14210 Native Linux/GNU toolchains also support the value @samp{native},
14211 which selects the best architecture option for the host processor.
14212 @option{-march=native} has no effect if GCC does not recognize
14213 the processor.
14214
14215 In processor names, a final @samp{000} can be abbreviated as @samp{k}
14216 (for example, @samp{-march=r2k}).  Prefixes are optional, and
14217 @samp{vr} may be written @samp{r}.
14218
14219 Names of the form @samp{@var{n}f2_1} refer to processors with
14220 FPUs clocked at half the rate of the core, names of the form
14221 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
14222 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
14223 processors with FPUs clocked a ratio of 3:2 with respect to the core.
14224 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
14225 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
14226 accepted as synonyms for @samp{@var{n}f1_1}.
14227
14228 GCC defines two macros based on the value of this option.  The first
14229 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
14230 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
14231 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
14232 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
14233 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
14234
14235 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
14236 above.  In other words, it will have the full prefix and will not
14237 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
14238 the macro names the resolved architecture (either @samp{"mips1"} or
14239 @samp{"mips3"}).  It names the default architecture when no
14240 @option{-march} option is given.
14241
14242 @item -mtune=@var{arch}
14243 @opindex mtune
14244 Optimize for @var{arch}.  Among other things, this option controls
14245 the way instructions are scheduled, and the perceived cost of arithmetic
14246 operations.  The list of @var{arch} values is the same as for
14247 @option{-march}.
14248
14249 When this option is not used, GCC will optimize for the processor
14250 specified by @option{-march}.  By using @option{-march} and
14251 @option{-mtune} together, it is possible to generate code that will
14252 run on a family of processors, but optimize the code for one
14253 particular member of that family.
14254
14255 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
14256 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
14257 @samp{-march} ones described above.
14258
14259 @item -mips1
14260 @opindex mips1
14261 Equivalent to @samp{-march=mips1}.
14262
14263 @item -mips2
14264 @opindex mips2
14265 Equivalent to @samp{-march=mips2}.
14266
14267 @item -mips3
14268 @opindex mips3
14269 Equivalent to @samp{-march=mips3}.
14270
14271 @item -mips4
14272 @opindex mips4
14273 Equivalent to @samp{-march=mips4}.
14274
14275 @item -mips32
14276 @opindex mips32
14277 Equivalent to @samp{-march=mips32}.
14278
14279 @item -mips32r2
14280 @opindex mips32r2
14281 Equivalent to @samp{-march=mips32r2}.
14282
14283 @item -mips64
14284 @opindex mips64
14285 Equivalent to @samp{-march=mips64}.
14286
14287 @item -mips64r2
14288 @opindex mips64r2
14289 Equivalent to @samp{-march=mips64r2}.
14290
14291 @item -mips16
14292 @itemx -mno-mips16
14293 @opindex mips16
14294 @opindex mno-mips16
14295 Generate (do not generate) MIPS16 code.  If GCC is targetting a
14296 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
14297
14298 MIPS16 code generation can also be controlled on a per-function basis
14299 by means of @code{mips16} and @code{nomips16} attributes.
14300 @xref{Function Attributes}, for more information.
14301
14302 @item -mflip-mips16
14303 @opindex mflip-mips16
14304 Generate MIPS16 code on alternating functions.  This option is provided
14305 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
14306 not intended for ordinary use in compiling user code.
14307
14308 @item -minterlink-mips16
14309 @itemx -mno-interlink-mips16
14310 @opindex minterlink-mips16
14311 @opindex mno-interlink-mips16
14312 Require (do not require) that non-MIPS16 code be link-compatible with
14313 MIPS16 code.
14314
14315 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
14316 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
14317 therefore disables direct jumps unless GCC knows that the target of the
14318 jump is not MIPS16.
14319
14320 @item -mabi=32
14321 @itemx -mabi=o64
14322 @itemx -mabi=n32
14323 @itemx -mabi=64
14324 @itemx -mabi=eabi
14325 @opindex mabi=32
14326 @opindex mabi=o64
14327 @opindex mabi=n32
14328 @opindex mabi=64
14329 @opindex mabi=eabi
14330 Generate code for the given ABI@.
14331
14332 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
14333 generates 64-bit code when you select a 64-bit architecture, but you
14334 can use @option{-mgp32} to get 32-bit code instead.
14335
14336 For information about the O64 ABI, see
14337 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
14338
14339 GCC supports a variant of the o32 ABI in which floating-point registers
14340 are 64 rather than 32 bits wide.  You can select this combination with
14341 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
14342 and @samp{mfhc1} instructions and is therefore only supported for
14343 MIPS32R2 processors.
14344
14345 The register assignments for arguments and return values remain the
14346 same, but each scalar value is passed in a single 64-bit register
14347 rather than a pair of 32-bit registers.  For example, scalar
14348 floating-point values are returned in @samp{$f0} only, not a
14349 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
14350 remains the same, but all 64 bits are saved.
14351
14352 @item -mabicalls
14353 @itemx -mno-abicalls
14354 @opindex mabicalls
14355 @opindex mno-abicalls
14356 Generate (do not generate) code that is suitable for SVR4-style
14357 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
14358 systems.
14359
14360 @item -mshared
14361 @itemx -mno-shared
14362 Generate (do not generate) code that is fully position-independent,
14363 and that can therefore be linked into shared libraries.  This option
14364 only affects @option{-mabicalls}.
14365
14366 All @option{-mabicalls} code has traditionally been position-independent,
14367 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
14368 as an extension, the GNU toolchain allows executables to use absolute
14369 accesses for locally-binding symbols.  It can also use shorter GP
14370 initialization sequences and generate direct calls to locally-defined
14371 functions.  This mode is selected by @option{-mno-shared}.
14372
14373 @option{-mno-shared} depends on binutils 2.16 or higher and generates
14374 objects that can only be linked by the GNU linker.  However, the option
14375 does not affect the ABI of the final executable; it only affects the ABI
14376 of relocatable objects.  Using @option{-mno-shared} will generally make
14377 executables both smaller and quicker.
14378
14379 @option{-mshared} is the default.
14380
14381 @item -mplt
14382 @itemx -mno-plt
14383 @opindex mplt
14384 @opindex mno-plt
14385 Assume (do not assume) that the static and dynamic linkers
14386 support PLTs and copy relocations.  This option only affects
14387 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
14388 has no effect without @samp{-msym32}.
14389
14390 You can make @option{-mplt} the default by configuring
14391 GCC with @option{--with-mips-plt}.  The default is
14392 @option{-mno-plt} otherwise.
14393
14394 @item -mxgot
14395 @itemx -mno-xgot
14396 @opindex mxgot
14397 @opindex mno-xgot
14398 Lift (do not lift) the usual restrictions on the size of the global
14399 offset table.
14400
14401 GCC normally uses a single instruction to load values from the GOT@.
14402 While this is relatively efficient, it will only work if the GOT
14403 is smaller than about 64k.  Anything larger will cause the linker
14404 to report an error such as:
14405
14406 @cindex relocation truncated to fit (MIPS)
14407 @smallexample
14408 relocation truncated to fit: R_MIPS_GOT16 foobar
14409 @end smallexample
14410
14411 If this happens, you should recompile your code with @option{-mxgot}.
14412 It should then work with very large GOTs, although it will also be
14413 less efficient, since it will take three instructions to fetch the
14414 value of a global symbol.
14415
14416 Note that some linkers can create multiple GOTs.  If you have such a
14417 linker, you should only need to use @option{-mxgot} when a single object
14418 file accesses more than 64k's worth of GOT entries.  Very few do.
14419
14420 These options have no effect unless GCC is generating position
14421 independent code.
14422
14423 @item -mgp32
14424 @opindex mgp32
14425 Assume that general-purpose registers are 32 bits wide.
14426
14427 @item -mgp64
14428 @opindex mgp64
14429 Assume that general-purpose registers are 64 bits wide.
14430
14431 @item -mfp32
14432 @opindex mfp32
14433 Assume that floating-point registers are 32 bits wide.
14434
14435 @item -mfp64
14436 @opindex mfp64
14437 Assume that floating-point registers are 64 bits wide.
14438
14439 @item -mhard-float
14440 @opindex mhard-float
14441 Use floating-point coprocessor instructions.
14442
14443 @item -msoft-float
14444 @opindex msoft-float
14445 Do not use floating-point coprocessor instructions.  Implement
14446 floating-point calculations using library calls instead.
14447
14448 @item -msingle-float
14449 @opindex msingle-float
14450 Assume that the floating-point coprocessor only supports single-precision
14451 operations.
14452
14453 @item -mdouble-float
14454 @opindex mdouble-float
14455 Assume that the floating-point coprocessor supports double-precision
14456 operations.  This is the default.
14457
14458 @item -mllsc
14459 @itemx -mno-llsc
14460 @opindex mllsc
14461 @opindex mno-llsc
14462 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
14463 implement atomic memory built-in functions.  When neither option is
14464 specified, GCC will use the instructions if the target architecture
14465 supports them.
14466
14467 @option{-mllsc} is useful if the runtime environment can emulate the
14468 instructions and @option{-mno-llsc} can be useful when compiling for
14469 nonstandard ISAs.  You can make either option the default by
14470 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
14471 respectively.  @option{--with-llsc} is the default for some
14472 configurations; see the installation documentation for details.
14473
14474 @item -mdsp
14475 @itemx -mno-dsp
14476 @opindex mdsp
14477 @opindex mno-dsp
14478 Use (do not use) revision 1 of the MIPS DSP ASE@.
14479 @xref{MIPS DSP Built-in Functions}.  This option defines the
14480 preprocessor macro @samp{__mips_dsp}.  It also defines
14481 @samp{__mips_dsp_rev} to 1.
14482
14483 @item -mdspr2
14484 @itemx -mno-dspr2
14485 @opindex mdspr2
14486 @opindex mno-dspr2
14487 Use (do not use) revision 2 of the MIPS DSP ASE@.
14488 @xref{MIPS DSP Built-in Functions}.  This option defines the
14489 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
14490 It also defines @samp{__mips_dsp_rev} to 2.
14491
14492 @item -msmartmips
14493 @itemx -mno-smartmips
14494 @opindex msmartmips
14495 @opindex mno-smartmips
14496 Use (do not use) the MIPS SmartMIPS ASE.
14497
14498 @item -mpaired-single
14499 @itemx -mno-paired-single
14500 @opindex mpaired-single
14501 @opindex mno-paired-single
14502 Use (do not use) paired-single floating-point instructions.
14503 @xref{MIPS Paired-Single Support}.  This option requires
14504 hardware floating-point support to be enabled.
14505
14506 @item -mdmx
14507 @itemx -mno-mdmx
14508 @opindex mdmx
14509 @opindex mno-mdmx
14510 Use (do not use) MIPS Digital Media Extension instructions.
14511 This option can only be used when generating 64-bit code and requires
14512 hardware floating-point support to be enabled.
14513
14514 @item -mips3d
14515 @itemx -mno-mips3d
14516 @opindex mips3d
14517 @opindex mno-mips3d
14518 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
14519 The option @option{-mips3d} implies @option{-mpaired-single}.
14520
14521 @item -mmt
14522 @itemx -mno-mt
14523 @opindex mmt
14524 @opindex mno-mt
14525 Use (do not use) MT Multithreading instructions.
14526
14527 @item -mlong64
14528 @opindex mlong64
14529 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
14530 an explanation of the default and the way that the pointer size is
14531 determined.
14532
14533 @item -mlong32
14534 @opindex mlong32
14535 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
14536
14537 The default size of @code{int}s, @code{long}s and pointers depends on
14538 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
14539 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
14540 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
14541 or the same size as integer registers, whichever is smaller.
14542
14543 @item -msym32
14544 @itemx -mno-sym32
14545 @opindex msym32
14546 @opindex mno-sym32
14547 Assume (do not assume) that all symbols have 32-bit values, regardless
14548 of the selected ABI@.  This option is useful in combination with
14549 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
14550 to generate shorter and faster references to symbolic addresses.
14551
14552 @item -G @var{num}
14553 @opindex G
14554 Put definitions of externally-visible data in a small data section
14555 if that data is no bigger than @var{num} bytes.  GCC can then access
14556 the data more efficiently; see @option{-mgpopt} for details.
14557
14558 The default @option{-G} option depends on the configuration.
14559
14560 @item -mlocal-sdata
14561 @itemx -mno-local-sdata
14562 @opindex mlocal-sdata
14563 @opindex mno-local-sdata
14564 Extend (do not extend) the @option{-G} behavior to local data too,
14565 such as to static variables in C@.  @option{-mlocal-sdata} is the
14566 default for all configurations.
14567
14568 If the linker complains that an application is using too much small data,
14569 you might want to try rebuilding the less performance-critical parts with
14570 @option{-mno-local-sdata}.  You might also want to build large
14571 libraries with @option{-mno-local-sdata}, so that the libraries leave
14572 more room for the main program.
14573
14574 @item -mextern-sdata
14575 @itemx -mno-extern-sdata
14576 @opindex mextern-sdata
14577 @opindex mno-extern-sdata
14578 Assume (do not assume) that externally-defined data will be in
14579 a small data section if that data is within the @option{-G} limit.
14580 @option{-mextern-sdata} is the default for all configurations.
14581
14582 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
14583 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
14584 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
14585 is placed in a small data section.  If @var{Var} is defined by another
14586 module, you must either compile that module with a high-enough
14587 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
14588 definition.  If @var{Var} is common, you must link the application
14589 with a high-enough @option{-G} setting.
14590
14591 The easiest way of satisfying these restrictions is to compile
14592 and link every module with the same @option{-G} option.  However,
14593 you may wish to build a library that supports several different
14594 small data limits.  You can do this by compiling the library with
14595 the highest supported @option{-G} setting and additionally using
14596 @option{-mno-extern-sdata} to stop the library from making assumptions
14597 about externally-defined data.
14598
14599 @item -mgpopt
14600 @itemx -mno-gpopt
14601 @opindex mgpopt
14602 @opindex mno-gpopt
14603 Use (do not use) GP-relative accesses for symbols that are known to be
14604 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
14605 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
14606 configurations.
14607
14608 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
14609 might not hold the value of @code{_gp}.  For example, if the code is
14610 part of a library that might be used in a boot monitor, programs that
14611 call boot monitor routines will pass an unknown value in @code{$gp}.
14612 (In such situations, the boot monitor itself would usually be compiled
14613 with @option{-G0}.)
14614
14615 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
14616 @option{-mno-extern-sdata}.
14617
14618 @item -membedded-data
14619 @itemx -mno-embedded-data
14620 @opindex membedded-data
14621 @opindex mno-embedded-data
14622 Allocate variables to the read-only data section first if possible, then
14623 next in the small data section if possible, otherwise in data.  This gives
14624 slightly slower code than the default, but reduces the amount of RAM required
14625 when executing, and thus may be preferred for some embedded systems.
14626
14627 @item -muninit-const-in-rodata
14628 @itemx -mno-uninit-const-in-rodata
14629 @opindex muninit-const-in-rodata
14630 @opindex mno-uninit-const-in-rodata
14631 Put uninitialized @code{const} variables in the read-only data section.
14632 This option is only meaningful in conjunction with @option{-membedded-data}.
14633
14634 @item -mcode-readable=@var{setting}
14635 @opindex mcode-readable
14636 Specify whether GCC may generate code that reads from executable sections.
14637 There are three possible settings:
14638
14639 @table @gcctabopt
14640 @item -mcode-readable=yes
14641 Instructions may freely access executable sections.  This is the
14642 default setting.
14643
14644 @item -mcode-readable=pcrel
14645 MIPS16 PC-relative load instructions can access executable sections,
14646 but other instructions must not do so.  This option is useful on 4KSc
14647 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
14648 It is also useful on processors that can be configured to have a dual
14649 instruction/data SRAM interface and that, like the M4K, automatically
14650 redirect PC-relative loads to the instruction RAM.
14651
14652 @item -mcode-readable=no
14653 Instructions must not access executable sections.  This option can be
14654 useful on targets that are configured to have a dual instruction/data
14655 SRAM interface but that (unlike the M4K) do not automatically redirect
14656 PC-relative loads to the instruction RAM.
14657 @end table
14658
14659 @item -msplit-addresses
14660 @itemx -mno-split-addresses
14661 @opindex msplit-addresses
14662 @opindex mno-split-addresses
14663 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
14664 relocation operators.  This option has been superseded by
14665 @option{-mexplicit-relocs} but is retained for backwards compatibility.
14666
14667 @item -mexplicit-relocs
14668 @itemx -mno-explicit-relocs
14669 @opindex mexplicit-relocs
14670 @opindex mno-explicit-relocs
14671 Use (do not use) assembler relocation operators when dealing with symbolic
14672 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
14673 is to use assembler macros instead.
14674
14675 @option{-mexplicit-relocs} is the default if GCC was configured
14676 to use an assembler that supports relocation operators.
14677
14678 @item -mcheck-zero-division
14679 @itemx -mno-check-zero-division
14680 @opindex mcheck-zero-division
14681 @opindex mno-check-zero-division
14682 Trap (do not trap) on integer division by zero.
14683
14684 The default is @option{-mcheck-zero-division}.
14685
14686 @item -mdivide-traps
14687 @itemx -mdivide-breaks
14688 @opindex mdivide-traps
14689 @opindex mdivide-breaks
14690 MIPS systems check for division by zero by generating either a
14691 conditional trap or a break instruction.  Using traps results in
14692 smaller code, but is only supported on MIPS II and later.  Also, some
14693 versions of the Linux kernel have a bug that prevents trap from
14694 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
14695 allow conditional traps on architectures that support them and
14696 @option{-mdivide-breaks} to force the use of breaks.
14697
14698 The default is usually @option{-mdivide-traps}, but this can be
14699 overridden at configure time using @option{--with-divide=breaks}.
14700 Divide-by-zero checks can be completely disabled using
14701 @option{-mno-check-zero-division}.
14702
14703 @item -mmemcpy
14704 @itemx -mno-memcpy
14705 @opindex mmemcpy
14706 @opindex mno-memcpy
14707 Force (do not force) the use of @code{memcpy()} for non-trivial block
14708 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
14709 most constant-sized copies.
14710
14711 @item -mlong-calls
14712 @itemx -mno-long-calls
14713 @opindex mlong-calls
14714 @opindex mno-long-calls
14715 Disable (do not disable) use of the @code{jal} instruction.  Calling
14716 functions using @code{jal} is more efficient but requires the caller
14717 and callee to be in the same 256 megabyte segment.
14718
14719 This option has no effect on abicalls code.  The default is
14720 @option{-mno-long-calls}.
14721
14722 @item -mmad
14723 @itemx -mno-mad
14724 @opindex mmad
14725 @opindex mno-mad
14726 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
14727 instructions, as provided by the R4650 ISA@.
14728
14729 @item -mfused-madd
14730 @itemx -mno-fused-madd
14731 @opindex mfused-madd
14732 @opindex mno-fused-madd
14733 Enable (disable) use of the floating point multiply-accumulate
14734 instructions, when they are available.  The default is
14735 @option{-mfused-madd}.
14736
14737 When multiply-accumulate instructions are used, the intermediate
14738 product is calculated to infinite precision and is not subject to
14739 the FCSR Flush to Zero bit.  This may be undesirable in some
14740 circumstances.
14741
14742 @item -nocpp
14743 @opindex nocpp
14744 Tell the MIPS assembler to not run its preprocessor over user
14745 assembler files (with a @samp{.s} suffix) when assembling them.
14746
14747 @item -mfix-r4000
14748 @itemx -mno-fix-r4000
14749 @opindex mfix-r4000
14750 @opindex mno-fix-r4000
14751 Work around certain R4000 CPU errata:
14752 @itemize @minus
14753 @item
14754 A double-word or a variable shift may give an incorrect result if executed
14755 immediately after starting an integer division.
14756 @item
14757 A double-word or a variable shift may give an incorrect result if executed
14758 while an integer multiplication is in progress.
14759 @item
14760 An integer division may give an incorrect result if started in a delay slot
14761 of a taken branch or a jump.
14762 @end itemize
14763
14764 @item -mfix-r4400
14765 @itemx -mno-fix-r4400
14766 @opindex mfix-r4400
14767 @opindex mno-fix-r4400
14768 Work around certain R4400 CPU errata:
14769 @itemize @minus
14770 @item
14771 A double-word or a variable shift may give an incorrect result if executed
14772 immediately after starting an integer division.
14773 @end itemize
14774
14775 @item -mfix-r10000
14776 @itemx -mno-fix-r10000
14777 @opindex mfix-r10000
14778 @opindex mno-fix-r10000
14779 Work around certain R10000 errata:
14780 @itemize @minus
14781 @item
14782 @code{ll}/@code{sc} sequences may not behave atomically on revisions
14783 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
14784 @end itemize
14785
14786 This option can only be used if the target architecture supports
14787 branch-likely instructions.  @option{-mfix-r10000} is the default when
14788 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
14789 otherwise.
14790
14791 @item -mfix-vr4120
14792 @itemx -mno-fix-vr4120
14793 @opindex mfix-vr4120
14794 Work around certain VR4120 errata:
14795 @itemize @minus
14796 @item
14797 @code{dmultu} does not always produce the correct result.
14798 @item
14799 @code{div} and @code{ddiv} do not always produce the correct result if one
14800 of the operands is negative.
14801 @end itemize
14802 The workarounds for the division errata rely on special functions in
14803 @file{libgcc.a}.  At present, these functions are only provided by
14804 the @code{mips64vr*-elf} configurations.
14805
14806 Other VR4120 errata require a nop to be inserted between certain pairs of
14807 instructions.  These errata are handled by the assembler, not by GCC itself.
14808
14809 @item -mfix-vr4130
14810 @opindex mfix-vr4130
14811 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
14812 workarounds are implemented by the assembler rather than by GCC,
14813 although GCC will avoid using @code{mflo} and @code{mfhi} if the
14814 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
14815 instructions are available instead.
14816
14817 @item -mfix-sb1
14818 @itemx -mno-fix-sb1
14819 @opindex mfix-sb1
14820 Work around certain SB-1 CPU core errata.
14821 (This flag currently works around the SB-1 revision 2
14822 ``F1'' and ``F2'' floating point errata.)
14823
14824 @item -mr10k-cache-barrier=@var{setting}
14825 @opindex mr10k-cache-barrier
14826 Specify whether GCC should insert cache barriers to avoid the
14827 side-effects of speculation on R10K processors.
14828
14829 In common with many processors, the R10K tries to predict the outcome
14830 of a conditional branch and speculatively executes instructions from
14831 the ``taken'' branch.  It later aborts these instructions if the
14832 predicted outcome was wrong.  However, on the R10K, even aborted
14833 instructions can have side effects.
14834
14835 This problem only affects kernel stores and, depending on the system,
14836 kernel loads.  As an example, a speculatively-executed store may load
14837 the target memory into cache and mark the cache line as dirty, even if
14838 the store itself is later aborted.  If a DMA operation writes to the
14839 same area of memory before the ``dirty'' line is flushed, the cached
14840 data will overwrite the DMA-ed data.  See the R10K processor manual
14841 for a full description, including other potential problems.
14842
14843 One workaround is to insert cache barrier instructions before every memory
14844 access that might be speculatively executed and that might have side
14845 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
14846 controls GCC's implementation of this workaround.  It assumes that
14847 aborted accesses to any byte in the following regions will not have
14848 side effects:
14849
14850 @enumerate
14851 @item
14852 the memory occupied by the current function's stack frame;
14853
14854 @item
14855 the memory occupied by an incoming stack argument;
14856
14857 @item
14858 the memory occupied by an object with a link-time-constant address.
14859 @end enumerate
14860
14861 It is the kernel's responsibility to ensure that speculative
14862 accesses to these regions are indeed safe.
14863
14864 If the input program contains a function declaration such as:
14865
14866 @smallexample
14867 void foo (void);
14868 @end smallexample
14869
14870 then the implementation of @code{foo} must allow @code{j foo} and
14871 @code{jal foo} to be executed speculatively.  GCC honors this
14872 restriction for functions it compiles itself.  It expects non-GCC
14873 functions (such as hand-written assembly code) to do the same.
14874
14875 The option has three forms:
14876
14877 @table @gcctabopt
14878 @item -mr10k-cache-barrier=load-store
14879 Insert a cache barrier before a load or store that might be
14880 speculatively executed and that might have side effects even
14881 if aborted.
14882
14883 @item -mr10k-cache-barrier=store
14884 Insert a cache barrier before a store that might be speculatively
14885 executed and that might have side effects even if aborted.
14886
14887 @item -mr10k-cache-barrier=none
14888 Disable the insertion of cache barriers.  This is the default setting.
14889 @end table
14890
14891 @item -mflush-func=@var{func}
14892 @itemx -mno-flush-func
14893 @opindex mflush-func
14894 Specifies the function to call to flush the I and D caches, or to not
14895 call any such function.  If called, the function must take the same
14896 arguments as the common @code{_flush_func()}, that is, the address of the
14897 memory range for which the cache is being flushed, the size of the
14898 memory range, and the number 3 (to flush both caches).  The default
14899 depends on the target GCC was configured for, but commonly is either
14900 @samp{_flush_func} or @samp{__cpu_flush}.
14901
14902 @item mbranch-cost=@var{num}
14903 @opindex mbranch-cost
14904 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14905 This cost is only a heuristic and is not guaranteed to produce
14906 consistent results across releases.  A zero cost redundantly selects
14907 the default, which is based on the @option{-mtune} setting.
14908
14909 @item -mbranch-likely
14910 @itemx -mno-branch-likely
14911 @opindex mbranch-likely
14912 @opindex mno-branch-likely
14913 Enable or disable use of Branch Likely instructions, regardless of the
14914 default for the selected architecture.  By default, Branch Likely
14915 instructions may be generated if they are supported by the selected
14916 architecture.  An exception is for the MIPS32 and MIPS64 architectures
14917 and processors which implement those architectures; for those, Branch
14918 Likely instructions will not be generated by default because the MIPS32
14919 and MIPS64 architectures specifically deprecate their use.
14920
14921 @item -mfp-exceptions
14922 @itemx -mno-fp-exceptions
14923 @opindex mfp-exceptions
14924 Specifies whether FP exceptions are enabled.  This affects how we schedule
14925 FP instructions for some processors.  The default is that FP exceptions are
14926 enabled.
14927
14928 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
14929 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
14930 FP pipe.
14931
14932 @item -mvr4130-align
14933 @itemx -mno-vr4130-align
14934 @opindex mvr4130-align
14935 The VR4130 pipeline is two-way superscalar, but can only issue two
14936 instructions together if the first one is 8-byte aligned.  When this
14937 option is enabled, GCC will align pairs of instructions that it
14938 thinks should execute in parallel.
14939
14940 This option only has an effect when optimizing for the VR4130.
14941 It normally makes code faster, but at the expense of making it bigger.
14942 It is enabled by default at optimization level @option{-O3}.
14943
14944 @item -msynci
14945 @itemx -mno-synci
14946 @opindex msynci
14947 Enable (disable) generation of @code{synci} instructions on
14948 architectures that support it.  The @code{synci} instructions (if
14949 enabled) will be generated when @code{__builtin___clear_cache()} is
14950 compiled.
14951
14952 This option defaults to @code{-mno-synci}, but the default can be
14953 overridden by configuring with @code{--with-synci}.
14954
14955 When compiling code for single processor systems, it is generally safe
14956 to use @code{synci}.  However, on many multi-core (SMP) systems, it
14957 will not invalidate the instruction caches on all cores and may lead
14958 to undefined behavior.
14959
14960 @item -mrelax-pic-calls
14961 @itemx -mno-relax-pic-calls
14962 @opindex mrelax-pic-calls
14963 Try to turn PIC calls that are normally dispatched via register
14964 @code{$25} into direct calls.  This is only possible if the linker can
14965 resolve the destination at link-time and if the destination is within
14966 range for a direct call.
14967
14968 @option{-mrelax-pic-calls} is the default if GCC was configured to use
14969 an assembler and a linker that supports the @code{.reloc} assembly
14970 directive and @code{-mexplicit-relocs} is in effect.  With
14971 @code{-mno-explicit-relocs}, this optimization can be performed by the
14972 assembler and the linker alone without help from the compiler.
14973
14974 @item -mmcount-ra-address
14975 @itemx -mno-mcount-ra-address
14976 @opindex mmcount-ra-address
14977 @opindex mno-mcount-ra-address
14978 Emit (do not emit) code that allows @code{_mcount} to modify the
14979 calling function's return address.  When enabled, this option extends
14980 the usual @code{_mcount} interface with a new @var{ra-address}
14981 parameter, which has type @code{intptr_t *} and is passed in register
14982 @code{$12}.  @code{_mcount} can then modify the return address by
14983 doing both of the following:
14984 @itemize
14985 @item
14986 Returning the new address in register @code{$31}.
14987 @item
14988 Storing the new address in @code{*@var{ra-address}},
14989 if @var{ra-address} is nonnull.
14990 @end itemize
14991
14992 The default is @option{-mno-mcount-ra-address}.
14993
14994 @end table
14995
14996 @node MMIX Options
14997 @subsection MMIX Options
14998 @cindex MMIX Options
14999
15000 These options are defined for the MMIX:
15001
15002 @table @gcctabopt
15003 @item -mlibfuncs
15004 @itemx -mno-libfuncs
15005 @opindex mlibfuncs
15006 @opindex mno-libfuncs
15007 Specify that intrinsic library functions are being compiled, passing all
15008 values in registers, no matter the size.
15009
15010 @item -mepsilon
15011 @itemx -mno-epsilon
15012 @opindex mepsilon
15013 @opindex mno-epsilon
15014 Generate floating-point comparison instructions that compare with respect
15015 to the @code{rE} epsilon register.
15016
15017 @item -mabi=mmixware
15018 @itemx -mabi=gnu
15019 @opindex mabi=mmixware
15020 @opindex mabi=gnu
15021 Generate code that passes function parameters and return values that (in
15022 the called function) are seen as registers @code{$0} and up, as opposed to
15023 the GNU ABI which uses global registers @code{$231} and up.
15024
15025 @item -mzero-extend
15026 @itemx -mno-zero-extend
15027 @opindex mzero-extend
15028 @opindex mno-zero-extend
15029 When reading data from memory in sizes shorter than 64 bits, use (do not
15030 use) zero-extending load instructions by default, rather than
15031 sign-extending ones.
15032
15033 @item -mknuthdiv
15034 @itemx -mno-knuthdiv
15035 @opindex mknuthdiv
15036 @opindex mno-knuthdiv
15037 Make the result of a division yielding a remainder have the same sign as
15038 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
15039 remainder follows the sign of the dividend.  Both methods are
15040 arithmetically valid, the latter being almost exclusively used.
15041
15042 @item -mtoplevel-symbols
15043 @itemx -mno-toplevel-symbols
15044 @opindex mtoplevel-symbols
15045 @opindex mno-toplevel-symbols
15046 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
15047 code can be used with the @code{PREFIX} assembly directive.
15048
15049 @item -melf
15050 @opindex melf
15051 Generate an executable in the ELF format, rather than the default
15052 @samp{mmo} format used by the @command{mmix} simulator.
15053
15054 @item -mbranch-predict
15055 @itemx -mno-branch-predict
15056 @opindex mbranch-predict
15057 @opindex mno-branch-predict
15058 Use (do not use) the probable-branch instructions, when static branch
15059 prediction indicates a probable branch.
15060
15061 @item -mbase-addresses
15062 @itemx -mno-base-addresses
15063 @opindex mbase-addresses
15064 @opindex mno-base-addresses
15065 Generate (do not generate) code that uses @emph{base addresses}.  Using a
15066 base address automatically generates a request (handled by the assembler
15067 and the linker) for a constant to be set up in a global register.  The
15068 register is used for one or more base address requests within the range 0
15069 to 255 from the value held in the register.  The generally leads to short
15070 and fast code, but the number of different data items that can be
15071 addressed is limited.  This means that a program that uses lots of static
15072 data may require @option{-mno-base-addresses}.
15073
15074 @item -msingle-exit
15075 @itemx -mno-single-exit
15076 @opindex msingle-exit
15077 @opindex mno-single-exit
15078 Force (do not force) generated code to have a single exit point in each
15079 function.
15080 @end table
15081
15082 @node MN10300 Options
15083 @subsection MN10300 Options
15084 @cindex MN10300 options
15085
15086 These @option{-m} options are defined for Matsushita MN10300 architectures:
15087
15088 @table @gcctabopt
15089 @item -mmult-bug
15090 @opindex mmult-bug
15091 Generate code to avoid bugs in the multiply instructions for the MN10300
15092 processors.  This is the default.
15093
15094 @item -mno-mult-bug
15095 @opindex mno-mult-bug
15096 Do not generate code to avoid bugs in the multiply instructions for the
15097 MN10300 processors.
15098
15099 @item -mam33
15100 @opindex mam33
15101 Generate code which uses features specific to the AM33 processor.
15102
15103 @item -mno-am33
15104 @opindex mno-am33
15105 Do not generate code which uses features specific to the AM33 processor.  This
15106 is the default.
15107
15108 @item -mam33-2
15109 @opindex mam33-2
15110 Generate code which uses features specific to the AM33/2.0 processor.
15111
15112 @item -mam34
15113 @opindex mam34
15114 Generate code which uses features specific to the AM34 processor.
15115
15116 @item -mtune=@var{cpu-type}
15117 @opindex mtune
15118 Use the timing characteristics of the indicated CPU type when
15119 scheduling instructions.  This does not change the targeted processor
15120 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
15121 @samp{am33-2} or @samp{am34}.
15122
15123 @item -mreturn-pointer-on-d0
15124 @opindex mreturn-pointer-on-d0
15125 When generating a function which returns a pointer, return the pointer
15126 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
15127 only in a0, and attempts to call such functions without a prototype
15128 would result in errors.  Note that this option is on by default; use
15129 @option{-mno-return-pointer-on-d0} to disable it.
15130
15131 @item -mno-crt0
15132 @opindex mno-crt0
15133 Do not link in the C run-time initialization object file.
15134
15135 @item -mrelax
15136 @opindex mrelax
15137 Indicate to the linker that it should perform a relaxation optimization pass
15138 to shorten branches, calls and absolute memory addresses.  This option only
15139 has an effect when used on the command line for the final link step.
15140
15141 This option makes symbolic debugging impossible.
15142
15143 @item -mliw
15144 @opindex mliw
15145 Allow the compiler to generate @emph{Long Instruction Word}
15146 instructions if the target is the @samp{AM33} or later.  This is the
15147 default.  This option defines the preprocessor macro @samp{__LIW__}.
15148
15149 @item -mnoliw
15150 @opindex mnoliw
15151 Do not allow the compiler to generate @emph{Long Instruction Word}
15152 instructions.  This option defines the preprocessor macro
15153 @samp{__NO_LIW__}.
15154
15155 @end table
15156
15157 @node PDP-11 Options
15158 @subsection PDP-11 Options
15159 @cindex PDP-11 Options
15160
15161 These options are defined for the PDP-11:
15162
15163 @table @gcctabopt
15164 @item -mfpu
15165 @opindex mfpu
15166 Use hardware FPP floating point.  This is the default.  (FIS floating
15167 point on the PDP-11/40 is not supported.)
15168
15169 @item -msoft-float
15170 @opindex msoft-float
15171 Do not use hardware floating point.
15172
15173 @item -mac0
15174 @opindex mac0
15175 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
15176
15177 @item -mno-ac0
15178 @opindex mno-ac0
15179 Return floating-point results in memory.  This is the default.
15180
15181 @item -m40
15182 @opindex m40
15183 Generate code for a PDP-11/40.
15184
15185 @item -m45
15186 @opindex m45
15187 Generate code for a PDP-11/45.  This is the default.
15188
15189 @item -m10
15190 @opindex m10
15191 Generate code for a PDP-11/10.
15192
15193 @item -mbcopy-builtin
15194 @opindex mbcopy-builtin
15195 Use inline @code{movmemhi} patterns for copying memory.  This is the
15196 default.
15197
15198 @item -mbcopy
15199 @opindex mbcopy
15200 Do not use inline @code{movmemhi} patterns for copying memory.
15201
15202 @item -mint16
15203 @itemx -mno-int32
15204 @opindex mint16
15205 @opindex mno-int32
15206 Use 16-bit @code{int}.  This is the default.
15207
15208 @item -mint32
15209 @itemx -mno-int16
15210 @opindex mint32
15211 @opindex mno-int16
15212 Use 32-bit @code{int}.
15213
15214 @item -mfloat64
15215 @itemx -mno-float32
15216 @opindex mfloat64
15217 @opindex mno-float32
15218 Use 64-bit @code{float}.  This is the default.
15219
15220 @item -mfloat32
15221 @itemx -mno-float64
15222 @opindex mfloat32
15223 @opindex mno-float64
15224 Use 32-bit @code{float}.
15225
15226 @item -mabshi
15227 @opindex mabshi
15228 Use @code{abshi2} pattern.  This is the default.
15229
15230 @item -mno-abshi
15231 @opindex mno-abshi
15232 Do not use @code{abshi2} pattern.
15233
15234 @item -mbranch-expensive
15235 @opindex mbranch-expensive
15236 Pretend that branches are expensive.  This is for experimenting with
15237 code generation only.
15238
15239 @item -mbranch-cheap
15240 @opindex mbranch-cheap
15241 Do not pretend that branches are expensive.  This is the default.
15242
15243 @item -munix-asm
15244 @opindex munix-asm
15245 Use Unix assembler syntax.  This is the default when configured for
15246 @samp{pdp11-*-bsd}.
15247
15248 @item -mdec-asm
15249 @opindex mdec-asm
15250 Use DEC assembler syntax.  This is the default when configured for any
15251 PDP-11 target other than @samp{pdp11-*-bsd}.
15252 @end table
15253
15254 @node picoChip Options
15255 @subsection picoChip Options
15256 @cindex picoChip options
15257
15258 These @samp{-m} options are defined for picoChip implementations:
15259
15260 @table @gcctabopt
15261
15262 @item -mae=@var{ae_type}
15263 @opindex mcpu
15264 Set the instruction set, register set, and instruction scheduling
15265 parameters for array element type @var{ae_type}.  Supported values
15266 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
15267
15268 @option{-mae=ANY} selects a completely generic AE type.  Code
15269 generated with this option will run on any of the other AE types.  The
15270 code will not be as efficient as it would be if compiled for a specific
15271 AE type, and some types of operation (e.g., multiplication) will not
15272 work properly on all types of AE.
15273
15274 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
15275 for compiled code, and is the default.
15276
15277 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
15278 option may suffer from poor performance of byte (char) manipulation,
15279 since the DSP AE does not provide hardware support for byte load/stores.
15280
15281 @item -msymbol-as-address
15282 Enable the compiler to directly use a symbol name as an address in a
15283 load/store instruction, without first loading it into a
15284 register.  Typically, the use of this option will generate larger
15285 programs, which run faster than when the option isn't used.  However, the
15286 results vary from program to program, so it is left as a user option,
15287 rather than being permanently enabled.
15288
15289 @item -mno-inefficient-warnings
15290 Disables warnings about the generation of inefficient code.  These
15291 warnings can be generated, for example, when compiling code which
15292 performs byte-level memory operations on the MAC AE type.  The MAC AE has
15293 no hardware support for byte-level memory operations, so all byte
15294 load/stores must be synthesized from word load/store operations.  This is
15295 inefficient and a warning will be generated indicating to the programmer
15296 that they should rewrite the code to avoid byte operations, or to target
15297 an AE type which has the necessary hardware support.  This option enables
15298 the warning to be turned off.
15299
15300 @end table
15301
15302 @node PowerPC Options
15303 @subsection PowerPC Options
15304 @cindex PowerPC options
15305
15306 These are listed under @xref{RS/6000 and PowerPC Options}.
15307
15308 @node RS/6000 and PowerPC Options
15309 @subsection IBM RS/6000 and PowerPC Options
15310 @cindex RS/6000 and PowerPC Options
15311 @cindex IBM RS/6000 and PowerPC Options
15312
15313 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
15314 @table @gcctabopt
15315 @item -mpower
15316 @itemx -mno-power
15317 @itemx -mpower2
15318 @itemx -mno-power2
15319 @itemx -mpowerpc
15320 @itemx -mno-powerpc
15321 @itemx -mpowerpc-gpopt
15322 @itemx -mno-powerpc-gpopt
15323 @itemx -mpowerpc-gfxopt
15324 @itemx -mno-powerpc-gfxopt
15325 @need 800
15326 @itemx -mpowerpc64
15327 @itemx -mno-powerpc64
15328 @itemx -mmfcrf
15329 @itemx -mno-mfcrf
15330 @itemx -mpopcntb
15331 @itemx -mno-popcntb
15332 @itemx -mpopcntd
15333 @itemx -mno-popcntd
15334 @itemx -mfprnd
15335 @itemx -mno-fprnd
15336 @need 800
15337 @itemx -mcmpb
15338 @itemx -mno-cmpb
15339 @itemx -mmfpgpr
15340 @itemx -mno-mfpgpr
15341 @itemx -mhard-dfp
15342 @itemx -mno-hard-dfp
15343 @opindex mpower
15344 @opindex mno-power
15345 @opindex mpower2
15346 @opindex mno-power2
15347 @opindex mpowerpc
15348 @opindex mno-powerpc
15349 @opindex mpowerpc-gpopt
15350 @opindex mno-powerpc-gpopt
15351 @opindex mpowerpc-gfxopt
15352 @opindex mno-powerpc-gfxopt
15353 @opindex mpowerpc64
15354 @opindex mno-powerpc64
15355 @opindex mmfcrf
15356 @opindex mno-mfcrf
15357 @opindex mpopcntb
15358 @opindex mno-popcntb
15359 @opindex mpopcntd
15360 @opindex mno-popcntd
15361 @opindex mfprnd
15362 @opindex mno-fprnd
15363 @opindex mcmpb
15364 @opindex mno-cmpb
15365 @opindex mmfpgpr
15366 @opindex mno-mfpgpr
15367 @opindex mhard-dfp
15368 @opindex mno-hard-dfp
15369 GCC supports two related instruction set architectures for the
15370 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
15371 instructions supported by the @samp{rios} chip set used in the original
15372 RS/6000 systems and the @dfn{PowerPC} instruction set is the
15373 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
15374 the IBM 4xx, 6xx, and follow-on microprocessors.
15375
15376 Neither architecture is a subset of the other.  However there is a
15377 large common subset of instructions supported by both.  An MQ
15378 register is included in processors supporting the POWER architecture.
15379
15380 You use these options to specify which instructions are available on the
15381 processor you are using.  The default value of these options is
15382 determined when configuring GCC@.  Specifying the
15383 @option{-mcpu=@var{cpu_type}} overrides the specification of these
15384 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
15385 rather than the options listed above.
15386
15387 The @option{-mpower} option allows GCC to generate instructions that
15388 are found only in the POWER architecture and to use the MQ register.
15389 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
15390 to generate instructions that are present in the POWER2 architecture but
15391 not the original POWER architecture.
15392
15393 The @option{-mpowerpc} option allows GCC to generate instructions that
15394 are found only in the 32-bit subset of the PowerPC architecture.
15395 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
15396 GCC to use the optional PowerPC architecture instructions in the
15397 General Purpose group, including floating-point square root.  Specifying
15398 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
15399 use the optional PowerPC architecture instructions in the Graphics
15400 group, including floating-point select.
15401
15402 The @option{-mmfcrf} option allows GCC to generate the move from
15403 condition register field instruction implemented on the POWER4
15404 processor and other processors that support the PowerPC V2.01
15405 architecture.
15406 The @option{-mpopcntb} option allows GCC to generate the popcount and
15407 double precision FP reciprocal estimate instruction implemented on the
15408 POWER5 processor and other processors that support the PowerPC V2.02
15409 architecture.
15410 The @option{-mpopcntd} option allows GCC to generate the popcount
15411 instruction implemented on the POWER7 processor and other processors
15412 that support the PowerPC V2.06 architecture.
15413 The @option{-mfprnd} option allows GCC to generate the FP round to
15414 integer instructions implemented on the POWER5+ processor and other
15415 processors that support the PowerPC V2.03 architecture.
15416 The @option{-mcmpb} option allows GCC to generate the compare bytes
15417 instruction implemented on the POWER6 processor and other processors
15418 that support the PowerPC V2.05 architecture.
15419 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
15420 general purpose register instructions implemented on the POWER6X
15421 processor and other processors that support the extended PowerPC V2.05
15422 architecture.
15423 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
15424 point instructions implemented on some POWER processors.
15425
15426 The @option{-mpowerpc64} option allows GCC to generate the additional
15427 64-bit instructions that are found in the full PowerPC64 architecture
15428 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
15429 @option{-mno-powerpc64}.
15430
15431 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
15432 will use only the instructions in the common subset of both
15433 architectures plus some special AIX common-mode calls, and will not use
15434 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
15435 permits GCC to use any instruction from either architecture and to
15436 allow use of the MQ register; specify this for the Motorola MPC601.
15437
15438 @item -mnew-mnemonics
15439 @itemx -mold-mnemonics
15440 @opindex mnew-mnemonics
15441 @opindex mold-mnemonics
15442 Select which mnemonics to use in the generated assembler code.  With
15443 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
15444 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
15445 assembler mnemonics defined for the POWER architecture.  Instructions
15446 defined in only one architecture have only one mnemonic; GCC uses that
15447 mnemonic irrespective of which of these options is specified.
15448
15449 GCC defaults to the mnemonics appropriate for the architecture in
15450 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
15451 value of these option.  Unless you are building a cross-compiler, you
15452 should normally not specify either @option{-mnew-mnemonics} or
15453 @option{-mold-mnemonics}, but should instead accept the default.
15454
15455 @item -mcpu=@var{cpu_type}
15456 @opindex mcpu
15457 Set architecture type, register usage, choice of mnemonics, and
15458 instruction scheduling parameters for machine type @var{cpu_type}.
15459 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
15460 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
15461 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
15462 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
15463 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
15464 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
15465 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
15466 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
15467 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
15468 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
15469 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
15470
15471 @option{-mcpu=common} selects a completely generic processor.  Code
15472 generated under this option will run on any POWER or PowerPC processor.
15473 GCC will use only the instructions in the common subset of both
15474 architectures, and will not use the MQ register.  GCC assumes a generic
15475 processor model for scheduling purposes.
15476
15477 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
15478 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
15479 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
15480 types, with an appropriate, generic processor model assumed for
15481 scheduling purposes.
15482
15483 The other options specify a specific processor.  Code generated under
15484 those options will run best on that processor, and may not run at all on
15485 others.
15486
15487 The @option{-mcpu} options automatically enable or disable the
15488 following options:
15489
15490 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
15491 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
15492 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
15493 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
15494
15495 The particular options set for any particular CPU will vary between
15496 compiler versions, depending on what setting seems to produce optimal
15497 code for that CPU; it doesn't necessarily reflect the actual hardware's
15498 capabilities.  If you wish to set an individual option to a particular
15499 value, you may specify it after the @option{-mcpu} option, like
15500 @samp{-mcpu=970 -mno-altivec}.
15501
15502 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
15503 not enabled or disabled by the @option{-mcpu} option at present because
15504 AIX does not have full support for these options.  You may still
15505 enable or disable them individually if you're sure it'll work in your
15506 environment.
15507
15508 @item -mtune=@var{cpu_type}
15509 @opindex mtune
15510 Set the instruction scheduling parameters for machine type
15511 @var{cpu_type}, but do not set the architecture type, register usage, or
15512 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
15513 values for @var{cpu_type} are used for @option{-mtune} as for
15514 @option{-mcpu}.  If both are specified, the code generated will use the
15515 architecture, registers, and mnemonics set by @option{-mcpu}, but the
15516 scheduling parameters set by @option{-mtune}.
15517
15518 @item -mcmodel=small
15519 @opindex mcmodel=small
15520 Generate PowerPC64 code for the small model: The TOC is limited to
15521 64k.
15522
15523 @item -mcmodel=medium
15524 @opindex mcmodel=medium
15525 Generate PowerPC64 code for the medium model: The TOC and other static
15526 data may be up to a total of 4G in size.
15527
15528 @item -mcmodel=large
15529 @opindex mcmodel=large
15530 Generate PowerPC64 code for the large model: The TOC may be up to 4G
15531 in size.  Other data and code is only limited by the 64-bit address
15532 space.
15533
15534 @item -maltivec
15535 @itemx -mno-altivec
15536 @opindex maltivec
15537 @opindex mno-altivec
15538 Generate code that uses (does not use) AltiVec instructions, and also
15539 enable the use of built-in functions that allow more direct access to
15540 the AltiVec instruction set.  You may also need to set
15541 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
15542 enhancements.
15543
15544 @item -mvrsave
15545 @itemx -mno-vrsave
15546 @opindex mvrsave
15547 @opindex mno-vrsave
15548 Generate VRSAVE instructions when generating AltiVec code.
15549
15550 @item -mgen-cell-microcode
15551 @opindex mgen-cell-microcode
15552 Generate Cell microcode instructions
15553
15554 @item -mwarn-cell-microcode
15555 @opindex mwarn-cell-microcode
15556 Warning when a Cell microcode instruction is going to emitted.  An example
15557 of a Cell microcode instruction is a variable shift.
15558
15559 @item -msecure-plt
15560 @opindex msecure-plt
15561 Generate code that allows ld and ld.so to build executables and shared
15562 libraries with non-exec .plt and .got sections.  This is a PowerPC
15563 32-bit SYSV ABI option.
15564
15565 @item -mbss-plt
15566 @opindex mbss-plt
15567 Generate code that uses a BSS .plt section that ld.so fills in, and
15568 requires .plt and .got sections that are both writable and executable.
15569 This is a PowerPC 32-bit SYSV ABI option.
15570
15571 @item -misel
15572 @itemx -mno-isel
15573 @opindex misel
15574 @opindex mno-isel
15575 This switch enables or disables the generation of ISEL instructions.
15576
15577 @item -misel=@var{yes/no}
15578 This switch has been deprecated.  Use @option{-misel} and
15579 @option{-mno-isel} instead.
15580
15581 @item -mspe
15582 @itemx -mno-spe
15583 @opindex mspe
15584 @opindex mno-spe
15585 This switch enables or disables the generation of SPE simd
15586 instructions.
15587
15588 @item -mpaired
15589 @itemx -mno-paired
15590 @opindex mpaired
15591 @opindex mno-paired
15592 This switch enables or disables the generation of PAIRED simd
15593 instructions.
15594
15595 @item -mspe=@var{yes/no}
15596 This option has been deprecated.  Use @option{-mspe} and
15597 @option{-mno-spe} instead.
15598
15599 @item -mvsx
15600 @itemx -mno-vsx
15601 @opindex mvsx
15602 @opindex mno-vsx
15603 Generate code that uses (does not use) vector/scalar (VSX)
15604 instructions, and also enable the use of built-in functions that allow
15605 more direct access to the VSX instruction set.
15606
15607 @item -mfloat-gprs=@var{yes/single/double/no}
15608 @itemx -mfloat-gprs
15609 @opindex mfloat-gprs
15610 This switch enables or disables the generation of floating point
15611 operations on the general purpose registers for architectures that
15612 support it.
15613
15614 The argument @var{yes} or @var{single} enables the use of
15615 single-precision floating point operations.
15616
15617 The argument @var{double} enables the use of single and
15618 double-precision floating point operations.
15619
15620 The argument @var{no} disables floating point operations on the
15621 general purpose registers.
15622
15623 This option is currently only available on the MPC854x.
15624
15625 @item -m32
15626 @itemx -m64
15627 @opindex m32
15628 @opindex m64
15629 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
15630 targets (including GNU/Linux).  The 32-bit environment sets int, long
15631 and pointer to 32 bits and generates code that runs on any PowerPC
15632 variant.  The 64-bit environment sets int to 32 bits and long and
15633 pointer to 64 bits, and generates code for PowerPC64, as for
15634 @option{-mpowerpc64}.
15635
15636 @item -mfull-toc
15637 @itemx -mno-fp-in-toc
15638 @itemx -mno-sum-in-toc
15639 @itemx -mminimal-toc
15640 @opindex mfull-toc
15641 @opindex mno-fp-in-toc
15642 @opindex mno-sum-in-toc
15643 @opindex mminimal-toc
15644 Modify generation of the TOC (Table Of Contents), which is created for
15645 every executable file.  The @option{-mfull-toc} option is selected by
15646 default.  In that case, GCC will allocate at least one TOC entry for
15647 each unique non-automatic variable reference in your program.  GCC
15648 will also place floating-point constants in the TOC@.  However, only
15649 16,384 entries are available in the TOC@.
15650
15651 If you receive a linker error message that saying you have overflowed
15652 the available TOC space, you can reduce the amount of TOC space used
15653 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
15654 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
15655 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
15656 generate code to calculate the sum of an address and a constant at
15657 run-time instead of putting that sum into the TOC@.  You may specify one
15658 or both of these options.  Each causes GCC to produce very slightly
15659 slower and larger code at the expense of conserving TOC space.
15660
15661 If you still run out of space in the TOC even when you specify both of
15662 these options, specify @option{-mminimal-toc} instead.  This option causes
15663 GCC to make only one TOC entry for every file.  When you specify this
15664 option, GCC will produce code that is slower and larger but which
15665 uses extremely little TOC space.  You may wish to use this option
15666 only on files that contain less frequently executed code.
15667
15668 @item -maix64
15669 @itemx -maix32
15670 @opindex maix64
15671 @opindex maix32
15672 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
15673 @code{long} type, and the infrastructure needed to support them.
15674 Specifying @option{-maix64} implies @option{-mpowerpc64} and
15675 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
15676 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
15677
15678 @item -mxl-compat
15679 @itemx -mno-xl-compat
15680 @opindex mxl-compat
15681 @opindex mno-xl-compat
15682 Produce code that conforms more closely to IBM XL compiler semantics
15683 when using AIX-compatible ABI@.  Pass floating-point arguments to
15684 prototyped functions beyond the register save area (RSA) on the stack
15685 in addition to argument FPRs.  Do not assume that most significant
15686 double in 128-bit long double value is properly rounded when comparing
15687 values and converting to double.  Use XL symbol names for long double
15688 support routines.
15689
15690 The AIX calling convention was extended but not initially documented to
15691 handle an obscure K&R C case of calling a function that takes the
15692 address of its arguments with fewer arguments than declared.  IBM XL
15693 compilers access floating point arguments which do not fit in the
15694 RSA from the stack when a subroutine is compiled without
15695 optimization.  Because always storing floating-point arguments on the
15696 stack is inefficient and rarely needed, this option is not enabled by
15697 default and only is necessary when calling subroutines compiled by IBM
15698 XL compilers without optimization.
15699
15700 @item -mpe
15701 @opindex mpe
15702 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
15703 application written to use message passing with special startup code to
15704 enable the application to run.  The system must have PE installed in the
15705 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
15706 must be overridden with the @option{-specs=} option to specify the
15707 appropriate directory location.  The Parallel Environment does not
15708 support threads, so the @option{-mpe} option and the @option{-pthread}
15709 option are incompatible.
15710
15711 @item -malign-natural
15712 @itemx -malign-power
15713 @opindex malign-natural
15714 @opindex malign-power
15715 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
15716 @option{-malign-natural} overrides the ABI-defined alignment of larger
15717 types, such as floating-point doubles, on their natural size-based boundary.
15718 The option @option{-malign-power} instructs GCC to follow the ABI-specified
15719 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
15720
15721 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
15722 is not supported.
15723
15724 @item -msoft-float
15725 @itemx -mhard-float
15726 @opindex msoft-float
15727 @opindex mhard-float
15728 Generate code that does not use (uses) the floating-point register set.
15729 Software floating point emulation is provided if you use the
15730 @option{-msoft-float} option, and pass the option to GCC when linking.
15731
15732 @item -msingle-float
15733 @itemx -mdouble-float
15734 @opindex msingle-float
15735 @opindex mdouble-float
15736 Generate code for single or double-precision floating point operations.
15737 @option{-mdouble-float} implies @option{-msingle-float}.
15738
15739 @item -msimple-fpu
15740 @opindex msimple-fpu
15741 Do not generate sqrt and div instructions for hardware floating point unit.
15742
15743 @item -mfpu
15744 @opindex mfpu
15745 Specify type of floating point unit.  Valid values are @var{sp_lite}
15746 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
15747 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
15748 and @var{dp_full} (equivalent to -mdouble-float).
15749
15750 @item -mxilinx-fpu
15751 @opindex mxilinx-fpu
15752 Perform optimizations for floating point unit on Xilinx PPC 405/440.
15753
15754 @item -mmultiple
15755 @itemx -mno-multiple
15756 @opindex mmultiple
15757 @opindex mno-multiple
15758 Generate code that uses (does not use) the load multiple word
15759 instructions and the store multiple word instructions.  These
15760 instructions are generated by default on POWER systems, and not
15761 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
15762 endian PowerPC systems, since those instructions do not work when the
15763 processor is in little endian mode.  The exceptions are PPC740 and
15764 PPC750 which permit the instructions usage in little endian mode.
15765
15766 @item -mstring
15767 @itemx -mno-string
15768 @opindex mstring
15769 @opindex mno-string
15770 Generate code that uses (does not use) the load string instructions
15771 and the store string word instructions to save multiple registers and
15772 do small block moves.  These instructions are generated by default on
15773 POWER systems, and not generated on PowerPC systems.  Do not use
15774 @option{-mstring} on little endian PowerPC systems, since those
15775 instructions do not work when the processor is in little endian mode.
15776 The exceptions are PPC740 and PPC750 which permit the instructions
15777 usage in little endian mode.
15778
15779 @item -mupdate
15780 @itemx -mno-update
15781 @opindex mupdate
15782 @opindex mno-update
15783 Generate code that uses (does not use) the load or store instructions
15784 that update the base register to the address of the calculated memory
15785 location.  These instructions are generated by default.  If you use
15786 @option{-mno-update}, there is a small window between the time that the
15787 stack pointer is updated and the address of the previous frame is
15788 stored, which means code that walks the stack frame across interrupts or
15789 signals may get corrupted data.
15790
15791 @item -mavoid-indexed-addresses
15792 @itemx -mno-avoid-indexed-addresses
15793 @opindex mavoid-indexed-addresses
15794 @opindex mno-avoid-indexed-addresses
15795 Generate code that tries to avoid (not avoid) the use of indexed load
15796 or store instructions. These instructions can incur a performance
15797 penalty on Power6 processors in certain situations, such as when
15798 stepping through large arrays that cross a 16M boundary.  This option
15799 is enabled by default when targetting Power6 and disabled otherwise.
15800
15801 @item -mfused-madd
15802 @itemx -mno-fused-madd
15803 @opindex mfused-madd
15804 @opindex mno-fused-madd
15805 Generate code that uses (does not use) the floating point multiply and
15806 accumulate instructions.  These instructions are generated by default
15807 if hardware floating point is used.  The machine dependent
15808 @option{-mfused-madd} option is now mapped to the machine independent
15809 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
15810 mapped to @option{-ffp-contract=off}.
15811
15812 @item -mmulhw
15813 @itemx -mno-mulhw
15814 @opindex mmulhw
15815 @opindex mno-mulhw
15816 Generate code that uses (does not use) the half-word multiply and
15817 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
15818 These instructions are generated by default when targetting those
15819 processors.
15820
15821 @item -mdlmzb
15822 @itemx -mno-dlmzb
15823 @opindex mdlmzb
15824 @opindex mno-dlmzb
15825 Generate code that uses (does not use) the string-search @samp{dlmzb}
15826 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
15827 generated by default when targetting those processors.
15828
15829 @item -mno-bit-align
15830 @itemx -mbit-align
15831 @opindex mno-bit-align
15832 @opindex mbit-align
15833 On System V.4 and embedded PowerPC systems do not (do) force structures
15834 and unions that contain bit-fields to be aligned to the base type of the
15835 bit-field.
15836
15837 For example, by default a structure containing nothing but 8
15838 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
15839 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
15840 the structure would be aligned to a 1 byte boundary and be one byte in
15841 size.
15842
15843 @item -mno-strict-align
15844 @itemx -mstrict-align
15845 @opindex mno-strict-align
15846 @opindex mstrict-align
15847 On System V.4 and embedded PowerPC systems do not (do) assume that
15848 unaligned memory references will be handled by the system.
15849
15850 @item -mrelocatable
15851 @itemx -mno-relocatable
15852 @opindex mrelocatable
15853 @opindex mno-relocatable
15854 Generate code that allows (does not allow) a static executable to be
15855 relocated to a different address at runtime.  A simple embedded
15856 PowerPC system loader should relocate the entire contents of
15857 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
15858 a table of 32-bit addresses generated by this option.  For this to
15859 work, all objects linked together must be compiled with
15860 @option{-mrelocatable} or @option{-mrelocatable-lib}.
15861 @option{-mrelocatable} code aligns the stack to an 8 byte boundary.
15862
15863 @item -mrelocatable-lib
15864 @itemx -mno-relocatable-lib
15865 @opindex mrelocatable-lib
15866 @opindex mno-relocatable-lib
15867 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
15868 @code{.fixup} section to allow static executables to be relocated at
15869 runtime, but @option{-mrelocatable-lib} does not use the smaller stack
15870 alignment of @option{-mrelocatable}.  Objects compiled with
15871 @option{-mrelocatable-lib} may be linked with objects compiled with
15872 any combination of the @option{-mrelocatable} options.
15873
15874 @item -mno-toc
15875 @itemx -mtoc
15876 @opindex mno-toc
15877 @opindex mtoc
15878 On System V.4 and embedded PowerPC systems do not (do) assume that
15879 register 2 contains a pointer to a global area pointing to the addresses
15880 used in the program.
15881
15882 @item -mlittle
15883 @itemx -mlittle-endian
15884 @opindex mlittle
15885 @opindex mlittle-endian
15886 On System V.4 and embedded PowerPC systems compile code for the
15887 processor in little endian mode.  The @option{-mlittle-endian} option is
15888 the same as @option{-mlittle}.
15889
15890 @item -mbig
15891 @itemx -mbig-endian
15892 @opindex mbig
15893 @opindex mbig-endian
15894 On System V.4 and embedded PowerPC systems compile code for the
15895 processor in big endian mode.  The @option{-mbig-endian} option is
15896 the same as @option{-mbig}.
15897
15898 @item -mdynamic-no-pic
15899 @opindex mdynamic-no-pic
15900 On Darwin and Mac OS X systems, compile code so that it is not
15901 relocatable, but that its external references are relocatable.  The
15902 resulting code is suitable for applications, but not shared
15903 libraries.
15904
15905 @item -msingle-pic-base
15906 @opindex msingle-pic-base
15907 Treat the register used for PIC addressing as read-only, rather than
15908 loading it in the prologue for each function.  The run-time system is
15909 responsible for initializing this register with an appropriate value
15910 before execution begins.
15911
15912 @item -mprioritize-restricted-insns=@var{priority}
15913 @opindex mprioritize-restricted-insns
15914 This option controls the priority that is assigned to
15915 dispatch-slot restricted instructions during the second scheduling
15916 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
15917 @var{no/highest/second-highest} priority to dispatch slot restricted
15918 instructions.
15919
15920 @item -msched-costly-dep=@var{dependence_type}
15921 @opindex msched-costly-dep
15922 This option controls which dependences are considered costly
15923 by the target during instruction scheduling.  The argument
15924 @var{dependence_type} takes one of the following values:
15925 @var{no}: no dependence is costly,
15926 @var{all}: all dependences are costly,
15927 @var{true_store_to_load}: a true dependence from store to load is costly,
15928 @var{store_to_load}: any dependence from store to load is costly,
15929 @var{number}: any dependence which latency >= @var{number} is costly.
15930
15931 @item -minsert-sched-nops=@var{scheme}
15932 @opindex minsert-sched-nops
15933 This option controls which nop insertion scheme will be used during
15934 the second scheduling pass.  The argument @var{scheme} takes one of the
15935 following values:
15936 @var{no}: Don't insert nops.
15937 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
15938 according to the scheduler's grouping.
15939 @var{regroup_exact}: Insert nops to force costly dependent insns into
15940 separate groups.  Insert exactly as many nops as needed to force an insn
15941 to a new group, according to the estimated processor grouping.
15942 @var{number}: Insert nops to force costly dependent insns into
15943 separate groups.  Insert @var{number} nops to force an insn to a new group.
15944
15945 @item -mcall-sysv
15946 @opindex mcall-sysv
15947 On System V.4 and embedded PowerPC systems compile code using calling
15948 conventions that adheres to the March 1995 draft of the System V
15949 Application Binary Interface, PowerPC processor supplement.  This is the
15950 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
15951
15952 @item -mcall-sysv-eabi
15953 @itemx -mcall-eabi
15954 @opindex mcall-sysv-eabi
15955 @opindex mcall-eabi
15956 Specify both @option{-mcall-sysv} and @option{-meabi} options.
15957
15958 @item -mcall-sysv-noeabi
15959 @opindex mcall-sysv-noeabi
15960 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
15961
15962 @item -mcall-aixdesc
15963 @opindex m
15964 On System V.4 and embedded PowerPC systems compile code for the AIX
15965 operating system.
15966
15967 @item -mcall-linux
15968 @opindex mcall-linux
15969 On System V.4 and embedded PowerPC systems compile code for the
15970 Linux-based GNU system.
15971
15972 @item -mcall-gnu
15973 @opindex mcall-gnu
15974 On System V.4 and embedded PowerPC systems compile code for the
15975 Hurd-based GNU system.
15976
15977 @item -mcall-freebsd
15978 @opindex mcall-freebsd
15979 On System V.4 and embedded PowerPC systems compile code for the
15980 FreeBSD operating system.
15981
15982 @item -mcall-netbsd
15983 @opindex mcall-netbsd
15984 On System V.4 and embedded PowerPC systems compile code for the
15985 NetBSD operating system.
15986
15987 @item -mcall-openbsd
15988 @opindex mcall-netbsd
15989 On System V.4 and embedded PowerPC systems compile code for the
15990 OpenBSD operating system.
15991
15992 @item -maix-struct-return
15993 @opindex maix-struct-return
15994 Return all structures in memory (as specified by the AIX ABI)@.
15995
15996 @item -msvr4-struct-return
15997 @opindex msvr4-struct-return
15998 Return structures smaller than 8 bytes in registers (as specified by the
15999 SVR4 ABI)@.
16000
16001 @item -mabi=@var{abi-type}
16002 @opindex mabi
16003 Extend the current ABI with a particular extension, or remove such extension.
16004 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
16005 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
16006
16007 @item -mabi=spe
16008 @opindex mabi=spe
16009 Extend the current ABI with SPE ABI extensions.  This does not change
16010 the default ABI, instead it adds the SPE ABI extensions to the current
16011 ABI@.
16012
16013 @item -mabi=no-spe
16014 @opindex mabi=no-spe
16015 Disable Booke SPE ABI extensions for the current ABI@.
16016
16017 @item -mabi=ibmlongdouble
16018 @opindex mabi=ibmlongdouble
16019 Change the current ABI to use IBM extended precision long double.
16020 This is a PowerPC 32-bit SYSV ABI option.
16021
16022 @item -mabi=ieeelongdouble
16023 @opindex mabi=ieeelongdouble
16024 Change the current ABI to use IEEE extended precision long double.
16025 This is a PowerPC 32-bit Linux ABI option.
16026
16027 @item -mprototype
16028 @itemx -mno-prototype
16029 @opindex mprototype
16030 @opindex mno-prototype
16031 On System V.4 and embedded PowerPC systems assume that all calls to
16032 variable argument functions are properly prototyped.  Otherwise, the
16033 compiler must insert an instruction before every non prototyped call to
16034 set or clear bit 6 of the condition code register (@var{CR}) to
16035 indicate whether floating point values were passed in the floating point
16036 registers in case the function takes a variable arguments.  With
16037 @option{-mprototype}, only calls to prototyped variable argument functions
16038 will set or clear the bit.
16039
16040 @item -msim
16041 @opindex msim
16042 On embedded PowerPC systems, assume that the startup module is called
16043 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
16044 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
16045 configurations.
16046
16047 @item -mmvme
16048 @opindex mmvme
16049 On embedded PowerPC systems, assume that the startup module is called
16050 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
16051 @file{libc.a}.
16052
16053 @item -mads
16054 @opindex mads
16055 On embedded PowerPC systems, assume that the startup module is called
16056 @file{crt0.o} and the standard C libraries are @file{libads.a} and
16057 @file{libc.a}.
16058
16059 @item -myellowknife
16060 @opindex myellowknife
16061 On embedded PowerPC systems, assume that the startup module is called
16062 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
16063 @file{libc.a}.
16064
16065 @item -mvxworks
16066 @opindex mvxworks
16067 On System V.4 and embedded PowerPC systems, specify that you are
16068 compiling for a VxWorks system.
16069
16070 @item -memb
16071 @opindex memb
16072 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
16073 header to indicate that @samp{eabi} extended relocations are used.
16074
16075 @item -meabi
16076 @itemx -mno-eabi
16077 @opindex meabi
16078 @opindex mno-eabi
16079 On System V.4 and embedded PowerPC systems do (do not) adhere to the
16080 Embedded Applications Binary Interface (eabi) which is a set of
16081 modifications to the System V.4 specifications.  Selecting @option{-meabi}
16082 means that the stack is aligned to an 8 byte boundary, a function
16083 @code{__eabi} is called to from @code{main} to set up the eabi
16084 environment, and the @option{-msdata} option can use both @code{r2} and
16085 @code{r13} to point to two separate small data areas.  Selecting
16086 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
16087 do not call an initialization function from @code{main}, and the
16088 @option{-msdata} option will only use @code{r13} to point to a single
16089 small data area.  The @option{-meabi} option is on by default if you
16090 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
16091
16092 @item -msdata=eabi
16093 @opindex msdata=eabi
16094 On System V.4 and embedded PowerPC systems, put small initialized
16095 @code{const} global and static data in the @samp{.sdata2} section, which
16096 is pointed to by register @code{r2}.  Put small initialized
16097 non-@code{const} global and static data in the @samp{.sdata} section,
16098 which is pointed to by register @code{r13}.  Put small uninitialized
16099 global and static data in the @samp{.sbss} section, which is adjacent to
16100 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
16101 incompatible with the @option{-mrelocatable} option.  The
16102 @option{-msdata=eabi} option also sets the @option{-memb} option.
16103
16104 @item -msdata=sysv
16105 @opindex msdata=sysv
16106 On System V.4 and embedded PowerPC systems, put small global and static
16107 data in the @samp{.sdata} section, which is pointed to by register
16108 @code{r13}.  Put small uninitialized global and static data in the
16109 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
16110 The @option{-msdata=sysv} option is incompatible with the
16111 @option{-mrelocatable} option.
16112
16113 @item -msdata=default
16114 @itemx -msdata
16115 @opindex msdata=default
16116 @opindex msdata
16117 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
16118 compile code the same as @option{-msdata=eabi}, otherwise compile code the
16119 same as @option{-msdata=sysv}.
16120
16121 @item -msdata=data
16122 @opindex msdata=data
16123 On System V.4 and embedded PowerPC systems, put small global
16124 data in the @samp{.sdata} section.  Put small uninitialized global
16125 data in the @samp{.sbss} section.  Do not use register @code{r13}
16126 to address small data however.  This is the default behavior unless
16127 other @option{-msdata} options are used.
16128
16129 @item -msdata=none
16130 @itemx -mno-sdata
16131 @opindex msdata=none
16132 @opindex mno-sdata
16133 On embedded PowerPC systems, put all initialized global and static data
16134 in the @samp{.data} section, and all uninitialized data in the
16135 @samp{.bss} section.
16136
16137 @item -mblock-move-inline-limit=@var{num}
16138 @opindex mblock-move-inline-limit
16139 Inline all block moves (such as calls to @code{memcpy} or structure
16140 copies) less than or equal to @var{num} bytes.  The minimum value for
16141 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
16142 targets.  The default value is target-specific.
16143
16144 @item -G @var{num}
16145 @opindex G
16146 @cindex smaller data references (PowerPC)
16147 @cindex .sdata/.sdata2 references (PowerPC)
16148 On embedded PowerPC systems, put global and static items less than or
16149 equal to @var{num} bytes into the small data or bss sections instead of
16150 the normal data or bss section.  By default, @var{num} is 8.  The
16151 @option{-G @var{num}} switch is also passed to the linker.
16152 All modules should be compiled with the same @option{-G @var{num}} value.
16153
16154 @item -mregnames
16155 @itemx -mno-regnames
16156 @opindex mregnames
16157 @opindex mno-regnames
16158 On System V.4 and embedded PowerPC systems do (do not) emit register
16159 names in the assembly language output using symbolic forms.
16160
16161 @item -mlongcall
16162 @itemx -mno-longcall
16163 @opindex mlongcall
16164 @opindex mno-longcall
16165 By default assume that all calls are far away so that a longer more
16166 expensive calling sequence is required.  This is required for calls
16167 further than 32 megabytes (33,554,432 bytes) from the current location.
16168 A short call will be generated if the compiler knows
16169 the call cannot be that far away.  This setting can be overridden by
16170 the @code{shortcall} function attribute, or by @code{#pragma
16171 longcall(0)}.
16172
16173 Some linkers are capable of detecting out-of-range calls and generating
16174 glue code on the fly.  On these systems, long calls are unnecessary and
16175 generate slower code.  As of this writing, the AIX linker can do this,
16176 as can the GNU linker for PowerPC/64.  It is planned to add this feature
16177 to the GNU linker for 32-bit PowerPC systems as well.
16178
16179 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
16180 callee, L42'', plus a ``branch island'' (glue code).  The two target
16181 addresses represent the callee and the ``branch island''.  The
16182 Darwin/PPC linker will prefer the first address and generate a ``bl
16183 callee'' if the PPC ``bl'' instruction will reach the callee directly;
16184 otherwise, the linker will generate ``bl L42'' to call the ``branch
16185 island''.  The ``branch island'' is appended to the body of the
16186 calling function; it computes the full 32-bit address of the callee
16187 and jumps to it.
16188
16189 On Mach-O (Darwin) systems, this option directs the compiler emit to
16190 the glue for every direct call, and the Darwin linker decides whether
16191 to use or discard it.
16192
16193 In the future, we may cause GCC to ignore all longcall specifications
16194 when the linker is known to generate glue.
16195
16196 @item -mtls-markers
16197 @itemx -mno-tls-markers
16198 @opindex mtls-markers
16199 @opindex mno-tls-markers
16200 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
16201 specifying the function argument.  The relocation allows ld to
16202 reliably associate function call with argument setup instructions for
16203 TLS optimization, which in turn allows gcc to better schedule the
16204 sequence.
16205
16206 @item -pthread
16207 @opindex pthread
16208 Adds support for multithreading with the @dfn{pthreads} library.
16209 This option sets flags for both the preprocessor and linker.
16210
16211 @item -mrecip
16212 @itemx -mno-recip
16213 @opindex mrecip
16214 This option will enable GCC to use the reciprocal estimate and
16215 reciprocal square root estimate instructions with additional
16216 Newton-Raphson steps to increase precision instead of doing a divide or
16217 square root and divide for floating point arguments.  You should use
16218 the @option{-ffast-math} option when using @option{-mrecip} (or at
16219 least @option{-funsafe-math-optimizations},
16220 @option{-finite-math-only}, @option{-freciprocal-math} and
16221 @option{-fno-trapping-math}).  Note that while the throughput of the
16222 sequence is generally higher than the throughput of the non-reciprocal
16223 instruction, the precision of the sequence can be decreased by up to 2
16224 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
16225 roots.
16226
16227 @item -mrecip=@var{opt}
16228 @opindex mrecip=opt
16229 This option allows to control which reciprocal estimate instructions
16230 may be used.  @var{opt} is a comma separated list of options, that may
16231 be preceded by a @code{!} to invert the option:
16232 @code{all}: enable all estimate instructions,
16233 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
16234 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
16235 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
16236 @code{divf}: enable the single precision reciprocal approximation instructions;
16237 @code{divd}: enable the double precision reciprocal approximation instructions;
16238 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
16239 @code{rsqrtf}: enable the single precision reciprocal square root approximation instructions;
16240 @code{rsqrtd}: enable the double precision reciprocal square root approximation instructions;
16241
16242 So for example, @option{-mrecip=all,!rsqrtd} would enable the
16243 all of the reciprocal estimate instructions, except for the
16244 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
16245 which handle the double precision reciprocal square root calculations.
16246
16247 @item -mrecip-precision
16248 @itemx -mno-recip-precision
16249 @opindex mrecip-precision
16250 Assume (do not assume) that the reciprocal estimate instructions
16251 provide higher precision estimates than is mandated by the powerpc
16252 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
16253 automatically selects @option{-mrecip-precision}.  The double
16254 precision square root estimate instructions are not generated by
16255 default on low precision machines, since they do not provide an
16256 estimate that converges after three steps.
16257
16258 @item -mveclibabi=@var{type}
16259 @opindex mveclibabi
16260 Specifies the ABI type to use for vectorizing intrinsics using an
16261 external library.  The only type supported at present is @code{mass},
16262 which specifies to use IBM's Mathematical Acceleration Subsystem
16263 (MASS) libraries for vectorizing intrinsics using external libraries.
16264 GCC will currently emit calls to @code{acosd2}, @code{acosf4},
16265 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
16266 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
16267 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
16268 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
16269 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
16270 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
16271 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
16272 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
16273 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
16274 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
16275 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
16276 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
16277 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
16278 for power7.  Both @option{-ftree-vectorize} and
16279 @option{-funsafe-math-optimizations} have to be enabled.  The MASS
16280 libraries will have to be specified at link time.
16281
16282 @item -mfriz
16283 @itemx -mno-friz
16284 @opindex mfriz
16285 Generate (do not generate) the @code{friz} instruction when the
16286 @option{-funsafe-math-optimizations} option is used to optimize
16287 rounding a floating point value to 64-bit integer and back to floating
16288 point.  The @code{friz} instruction does not return the same value if
16289 the floating point number is too large to fit in an integer.
16290 @end table
16291
16292 @node RX Options
16293 @subsection RX Options
16294 @cindex RX Options
16295
16296 These command line options are defined for RX targets:
16297
16298 @table @gcctabopt
16299 @item -m64bit-doubles
16300 @itemx -m32bit-doubles
16301 @opindex m64bit-doubles
16302 @opindex m32bit-doubles
16303 Make the @code{double} data type be 64-bits (@option{-m64bit-doubles})
16304 or 32-bits (@option{-m32bit-doubles}) in size.  The default is
16305 @option{-m32bit-doubles}.  @emph{Note} RX floating point hardware only
16306 works on 32-bit values, which is why the default is
16307 @option{-m32bit-doubles}.
16308
16309 @item -fpu
16310 @itemx -nofpu
16311 @opindex fpu
16312 @opindex nofpu
16313 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
16314 floating point hardware.  The default is enabled for the @var{RX600}
16315 series and disabled for the @var{RX200} series.
16316
16317 Floating point instructions will only be generated for 32-bit floating
16318 point values however, so if the @option{-m64bit-doubles} option is in
16319 use then the FPU hardware will not be used for doubles.
16320
16321 @emph{Note} If the @option{-fpu} option is enabled then
16322 @option{-funsafe-math-optimizations} is also enabled automatically.
16323 This is because the RX FPU instructions are themselves unsafe.
16324
16325 @item -mcpu=@var{name}
16326 @opindex -mcpu
16327 Selects the type of RX CPU to be targeted.  Currently three types are
16328 supported, the generic @var{RX600} and @var{RX200} series hardware and
16329 the specific @var{RX610} CPU.  The default is @var{RX600}.
16330
16331 The only difference between @var{RX600} and @var{RX610} is that the
16332 @var{RX610} does not support the @code{MVTIPL} instruction.
16333
16334 The @var{RX200} series does not have a hardware floating point unit
16335 and so @option{-nofpu} is enabled by default when this type is
16336 selected.
16337
16338 @item -mbig-endian-data
16339 @itemx -mlittle-endian-data
16340 @opindex mbig-endian-data
16341 @opindex mlittle-endian-data
16342 Store data (but not code) in the big-endian format.  The default is
16343 @option{-mlittle-endian-data}, i.e.@: to store data in the little endian
16344 format.
16345
16346 @item -msmall-data-limit=@var{N}
16347 @opindex msmall-data-limit
16348 Specifies the maximum size in bytes of global and static variables
16349 which can be placed into the small data area.  Using the small data
16350 area can lead to smaller and faster code, but the size of area is
16351 limited and it is up to the programmer to ensure that the area does
16352 not overflow.  Also when the small data area is used one of the RX's
16353 registers (@code{r13}) is reserved for use pointing to this area, so
16354 it is no longer available for use by the compiler.  This could result
16355 in slower and/or larger code if variables which once could have been
16356 held in @code{r13} are now pushed onto the stack.
16357
16358 Note, common variables (variables which have not been initialised) and
16359 constants are not placed into the small data area as they are assigned
16360 to other sections in the output executable.
16361
16362 The default value is zero, which disables this feature.  Note, this
16363 feature is not enabled by default with higher optimization levels
16364 (@option{-O2} etc) because of the potentially detrimental effects of
16365 reserving register @code{r13}.  It is up to the programmer to
16366 experiment and discover whether this feature is of benefit to their
16367 program.
16368
16369 @item -msim
16370 @itemx -mno-sim
16371 @opindex msim
16372 @opindex mno-sim
16373 Use the simulator runtime.  The default is to use the libgloss board
16374 specific runtime.
16375
16376 @item -mas100-syntax
16377 @itemx -mno-as100-syntax
16378 @opindex mas100-syntax
16379 @opindex mno-as100-syntax
16380 When generating assembler output use a syntax that is compatible with
16381 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
16382 assembler but it has some restrictions so generating it is not the
16383 default option.
16384
16385 @item -mmax-constant-size=@var{N}
16386 @opindex mmax-constant-size
16387 Specifies the maximum size, in bytes, of a constant that can be used as
16388 an operand in a RX instruction.  Although the RX instruction set does
16389 allow constants of up to 4 bytes in length to be used in instructions,
16390 a longer value equates to a longer instruction.  Thus in some
16391 circumstances it can be beneficial to restrict the size of constants
16392 that are used in instructions.  Constants that are too big are instead
16393 placed into a constant pool and referenced via register indirection.
16394
16395 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
16396 or 4 means that constants of any size are allowed.
16397
16398 @item -mrelax
16399 @opindex mrelax
16400 Enable linker relaxation.  Linker relaxation is a process whereby the
16401 linker will attempt to reduce the size of a program by finding shorter
16402 versions of various instructions.  Disabled by default.
16403
16404 @item -mint-register=@var{N}
16405 @opindex mint-register
16406 Specify the number of registers to reserve for fast interrupt handler
16407 functions.  The value @var{N} can be between 0 and 4.  A value of 1
16408 means that register @code{r13} will be reserved for the exclusive use
16409 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
16410 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
16411 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
16412 A value of 0, the default, does not reserve any registers.
16413
16414 @item -msave-acc-in-interrupts
16415 @opindex msave-acc-in-interrupts
16416 Specifies that interrupt handler functions should preserve the
16417 accumulator register.  This is only necessary if normal code might use
16418 the accumulator register, for example because it performs 64-bit
16419 multiplications.  The default is to ignore the accumulator as this
16420 makes the interrupt handlers faster.
16421
16422 @end table
16423
16424 @emph{Note:} The generic GCC command line @option{-ffixed-@var{reg}}
16425 has special significance to the RX port when used with the
16426 @code{interrupt} function attribute.  This attribute indicates a
16427 function intended to process fast interrupts.  GCC will will ensure
16428 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
16429 and/or @code{r13} and only provided that the normal use of the
16430 corresponding registers have been restricted via the
16431 @option{-ffixed-@var{reg}} or @option{-mint-register} command line
16432 options.
16433
16434 @node S/390 and zSeries Options
16435 @subsection S/390 and zSeries Options
16436 @cindex S/390 and zSeries Options
16437
16438 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
16439
16440 @table @gcctabopt
16441 @item -mhard-float
16442 @itemx -msoft-float
16443 @opindex mhard-float
16444 @opindex msoft-float
16445 Use (do not use) the hardware floating-point instructions and registers
16446 for floating-point operations.  When @option{-msoft-float} is specified,
16447 functions in @file{libgcc.a} will be used to perform floating-point
16448 operations.  When @option{-mhard-float} is specified, the compiler
16449 generates IEEE floating-point instructions.  This is the default.
16450
16451 @item -mhard-dfp
16452 @itemx -mno-hard-dfp
16453 @opindex mhard-dfp
16454 @opindex mno-hard-dfp
16455 Use (do not use) the hardware decimal-floating-point instructions for
16456 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
16457 specified, functions in @file{libgcc.a} will be used to perform
16458 decimal-floating-point operations.  When @option{-mhard-dfp} is
16459 specified, the compiler generates decimal-floating-point hardware
16460 instructions.  This is the default for @option{-march=z9-ec} or higher.
16461
16462 @item -mlong-double-64
16463 @itemx -mlong-double-128
16464 @opindex mlong-double-64
16465 @opindex mlong-double-128
16466 These switches control the size of @code{long double} type. A size
16467 of 64bit makes the @code{long double} type equivalent to the @code{double}
16468 type. This is the default.
16469
16470 @item -mbackchain
16471 @itemx -mno-backchain
16472 @opindex mbackchain
16473 @opindex mno-backchain
16474 Store (do not store) the address of the caller's frame as backchain pointer
16475 into the callee's stack frame.
16476 A backchain may be needed to allow debugging using tools that do not understand
16477 DWARF-2 call frame information.
16478 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
16479 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
16480 the backchain is placed into the topmost word of the 96/160 byte register
16481 save area.
16482
16483 In general, code compiled with @option{-mbackchain} is call-compatible with
16484 code compiled with @option{-mmo-backchain}; however, use of the backchain
16485 for debugging purposes usually requires that the whole binary is built with
16486 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
16487 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16488 to build a linux kernel use @option{-msoft-float}.
16489
16490 The default is to not maintain the backchain.
16491
16492 @item -mpacked-stack
16493 @itemx -mno-packed-stack
16494 @opindex mpacked-stack
16495 @opindex mno-packed-stack
16496 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
16497 specified, the compiler uses the all fields of the 96/160 byte register save
16498 area only for their default purpose; unused fields still take up stack space.
16499 When @option{-mpacked-stack} is specified, register save slots are densely
16500 packed at the top of the register save area; unused space is reused for other
16501 purposes, allowing for more efficient use of the available stack space.
16502 However, when @option{-mbackchain} is also in effect, the topmost word of
16503 the save area is always used to store the backchain, and the return address
16504 register is always saved two words below the backchain.
16505
16506 As long as the stack frame backchain is not used, code generated with
16507 @option{-mpacked-stack} is call-compatible with code generated with
16508 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
16509 S/390 or zSeries generated code that uses the stack frame backchain at run
16510 time, not just for debugging purposes.  Such code is not call-compatible
16511 with code compiled with @option{-mpacked-stack}.  Also, note that the
16512 combination of @option{-mbackchain},
16513 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16514 to build a linux kernel use @option{-msoft-float}.
16515
16516 The default is to not use the packed stack layout.
16517
16518 @item -msmall-exec
16519 @itemx -mno-small-exec
16520 @opindex msmall-exec
16521 @opindex mno-small-exec
16522 Generate (or do not generate) code using the @code{bras} instruction
16523 to do subroutine calls.
16524 This only works reliably if the total executable size does not
16525 exceed 64k.  The default is to use the @code{basr} instruction instead,
16526 which does not have this limitation.
16527
16528 @item -m64
16529 @itemx -m31
16530 @opindex m64
16531 @opindex m31
16532 When @option{-m31} is specified, generate code compliant to the
16533 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
16534 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
16535 particular to generate 64-bit instructions.  For the @samp{s390}
16536 targets, the default is @option{-m31}, while the @samp{s390x}
16537 targets default to @option{-m64}.
16538
16539 @item -mzarch
16540 @itemx -mesa
16541 @opindex mzarch
16542 @opindex mesa
16543 When @option{-mzarch} is specified, generate code using the
16544 instructions available on z/Architecture.
16545 When @option{-mesa} is specified, generate code using the
16546 instructions available on ESA/390.  Note that @option{-mesa} is
16547 not possible with @option{-m64}.
16548 When generating code compliant to the GNU/Linux for S/390 ABI,
16549 the default is @option{-mesa}.  When generating code compliant
16550 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
16551
16552 @item -mmvcle
16553 @itemx -mno-mvcle
16554 @opindex mmvcle
16555 @opindex mno-mvcle
16556 Generate (or do not generate) code using the @code{mvcle} instruction
16557 to perform block moves.  When @option{-mno-mvcle} is specified,
16558 use a @code{mvc} loop instead.  This is the default unless optimizing for
16559 size.
16560
16561 @item -mdebug
16562 @itemx -mno-debug
16563 @opindex mdebug
16564 @opindex mno-debug
16565 Print (or do not print) additional debug information when compiling.
16566 The default is to not print debug information.
16567
16568 @item -march=@var{cpu-type}
16569 @opindex march
16570 Generate code that will run on @var{cpu-type}, which is the name of a system
16571 representing a certain processor type.  Possible values for
16572 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
16573 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
16574 When generating code using the instructions available on z/Architecture,
16575 the default is @option{-march=z900}.  Otherwise, the default is
16576 @option{-march=g5}.
16577
16578 @item -mtune=@var{cpu-type}
16579 @opindex mtune
16580 Tune to @var{cpu-type} everything applicable about the generated code,
16581 except for the ABI and the set of available instructions.
16582 The list of @var{cpu-type} values is the same as for @option{-march}.
16583 The default is the value used for @option{-march}.
16584
16585 @item -mtpf-trace
16586 @itemx -mno-tpf-trace
16587 @opindex mtpf-trace
16588 @opindex mno-tpf-trace
16589 Generate code that adds (does not add) in TPF OS specific branches to trace
16590 routines in the operating system.  This option is off by default, even
16591 when compiling for the TPF OS@.
16592
16593 @item -mfused-madd
16594 @itemx -mno-fused-madd
16595 @opindex mfused-madd
16596 @opindex mno-fused-madd
16597 Generate code that uses (does not use) the floating point multiply and
16598 accumulate instructions.  These instructions are generated by default if
16599 hardware floating point is used.
16600
16601 @item -mwarn-framesize=@var{framesize}
16602 @opindex mwarn-framesize
16603 Emit a warning if the current function exceeds the given frame size.  Because
16604 this is a compile time check it doesn't need to be a real problem when the program
16605 runs.  It is intended to identify functions which most probably cause
16606 a stack overflow.  It is useful to be used in an environment with limited stack
16607 size e.g.@: the linux kernel.
16608
16609 @item -mwarn-dynamicstack
16610 @opindex mwarn-dynamicstack
16611 Emit a warning if the function calls alloca or uses dynamically
16612 sized arrays.  This is generally a bad idea with a limited stack size.
16613
16614 @item -mstack-guard=@var{stack-guard}
16615 @itemx -mstack-size=@var{stack-size}
16616 @opindex mstack-guard
16617 @opindex mstack-size
16618 If these options are provided the s390 back end emits additional instructions in
16619 the function prologue which trigger a trap if the stack size is @var{stack-guard}
16620 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
16621 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
16622 the frame size of the compiled function is chosen.
16623 These options are intended to be used to help debugging stack overflow problems.
16624 The additionally emitted code causes only little overhead and hence can also be
16625 used in production like systems without greater performance degradation.  The given
16626 values have to be exact powers of 2 and @var{stack-size} has to be greater than
16627 @var{stack-guard} without exceeding 64k.
16628 In order to be efficient the extra code makes the assumption that the stack starts
16629 at an address aligned to the value given by @var{stack-size}.
16630 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
16631 @end table
16632
16633 @node Score Options
16634 @subsection Score Options
16635 @cindex Score Options
16636
16637 These options are defined for Score implementations:
16638
16639 @table @gcctabopt
16640 @item -meb
16641 @opindex meb
16642 Compile code for big endian mode.  This is the default.
16643
16644 @item -mel
16645 @opindex mel
16646 Compile code for little endian mode.
16647
16648 @item -mnhwloop
16649 @opindex mnhwloop
16650 Disable generate bcnz instruction.
16651
16652 @item -muls
16653 @opindex muls
16654 Enable generate unaligned load and store instruction.
16655
16656 @item -mmac
16657 @opindex mmac
16658 Enable the use of multiply-accumulate instructions. Disabled by default.
16659
16660 @item -mscore5
16661 @opindex mscore5
16662 Specify the SCORE5 as the target architecture.
16663
16664 @item -mscore5u
16665 @opindex mscore5u
16666 Specify the SCORE5U of the target architecture.
16667
16668 @item -mscore7
16669 @opindex mscore7
16670 Specify the SCORE7 as the target architecture. This is the default.
16671
16672 @item -mscore7d
16673 @opindex mscore7d
16674 Specify the SCORE7D as the target architecture.
16675 @end table
16676
16677 @node SH Options
16678 @subsection SH Options
16679
16680 These @samp{-m} options are defined for the SH implementations:
16681
16682 @table @gcctabopt
16683 @item -m1
16684 @opindex m1
16685 Generate code for the SH1.
16686
16687 @item -m2
16688 @opindex m2
16689 Generate code for the SH2.
16690
16691 @item -m2e
16692 Generate code for the SH2e.
16693
16694 @item -m2a-nofpu
16695 @opindex m2a-nofpu
16696 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
16697 that the floating-point unit is not used.
16698
16699 @item -m2a-single-only
16700 @opindex m2a-single-only
16701 Generate code for the SH2a-FPU, in such a way that no double-precision
16702 floating point operations are used.
16703
16704 @item -m2a-single
16705 @opindex m2a-single
16706 Generate code for the SH2a-FPU assuming the floating-point unit is in
16707 single-precision mode by default.
16708
16709 @item -m2a
16710 @opindex m2a
16711 Generate code for the SH2a-FPU assuming the floating-point unit is in
16712 double-precision mode by default.
16713
16714 @item -m3
16715 @opindex m3
16716 Generate code for the SH3.
16717
16718 @item -m3e
16719 @opindex m3e
16720 Generate code for the SH3e.
16721
16722 @item -m4-nofpu
16723 @opindex m4-nofpu
16724 Generate code for the SH4 without a floating-point unit.
16725
16726 @item -m4-single-only
16727 @opindex m4-single-only
16728 Generate code for the SH4 with a floating-point unit that only
16729 supports single-precision arithmetic.
16730
16731 @item -m4-single
16732 @opindex m4-single
16733 Generate code for the SH4 assuming the floating-point unit is in
16734 single-precision mode by default.
16735
16736 @item -m4
16737 @opindex m4
16738 Generate code for the SH4.
16739
16740 @item -m4a-nofpu
16741 @opindex m4a-nofpu
16742 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
16743 floating-point unit is not used.
16744
16745 @item -m4a-single-only
16746 @opindex m4a-single-only
16747 Generate code for the SH4a, in such a way that no double-precision
16748 floating point operations are used.
16749
16750 @item -m4a-single
16751 @opindex m4a-single
16752 Generate code for the SH4a assuming the floating-point unit is in
16753 single-precision mode by default.
16754
16755 @item -m4a
16756 @opindex m4a
16757 Generate code for the SH4a.
16758
16759 @item -m4al
16760 @opindex m4al
16761 Same as @option{-m4a-nofpu}, except that it implicitly passes
16762 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
16763 instructions at the moment.
16764
16765 @item -mb
16766 @opindex mb
16767 Compile code for the processor in big endian mode.
16768
16769 @item -ml
16770 @opindex ml
16771 Compile code for the processor in little endian mode.
16772
16773 @item -mdalign
16774 @opindex mdalign
16775 Align doubles at 64-bit boundaries.  Note that this changes the calling
16776 conventions, and thus some functions from the standard C library will
16777 not work unless you recompile it first with @option{-mdalign}.
16778
16779 @item -mrelax
16780 @opindex mrelax
16781 Shorten some address references at link time, when possible; uses the
16782 linker option @option{-relax}.
16783
16784 @item -mbigtable
16785 @opindex mbigtable
16786 Use 32-bit offsets in @code{switch} tables.  The default is to use
16787 16-bit offsets.
16788
16789 @item -mbitops
16790 @opindex mbitops
16791 Enable the use of bit manipulation instructions on SH2A.
16792
16793 @item -mfmovd
16794 @opindex mfmovd
16795 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
16796 alignment constraints.
16797
16798 @item -mhitachi
16799 @opindex mhitachi
16800 Comply with the calling conventions defined by Renesas.
16801
16802 @item -mrenesas
16803 @opindex mhitachi
16804 Comply with the calling conventions defined by Renesas.
16805
16806 @item -mno-renesas
16807 @opindex mhitachi
16808 Comply with the calling conventions defined for GCC before the Renesas
16809 conventions were available.  This option is the default for all
16810 targets of the SH toolchain except for @samp{sh-symbianelf}.
16811
16812 @item -mnomacsave
16813 @opindex mnomacsave
16814 Mark the @code{MAC} register as call-clobbered, even if
16815 @option{-mhitachi} is given.
16816
16817 @item -mieee
16818 @opindex mieee
16819 Increase IEEE-compliance of floating-point code.
16820 At the moment, this is equivalent to @option{-fno-finite-math-only}.
16821 When generating 16 bit SH opcodes, getting IEEE-conforming results for
16822 comparisons of NANs / infinities incurs extra overhead in every
16823 floating point comparison, therefore the default is set to
16824 @option{-ffinite-math-only}.
16825
16826 @item -minline-ic_invalidate
16827 @opindex minline-ic_invalidate
16828 Inline code to invalidate instruction cache entries after setting up
16829 nested function trampolines.
16830 This option has no effect if -musermode is in effect and the selected
16831 code generation option (e.g. -m4) does not allow the use of the icbi
16832 instruction.
16833 If the selected code generation option does not allow the use of the icbi
16834 instruction, and -musermode is not in effect, the inlined code will
16835 manipulate the instruction cache address array directly with an associative
16836 write.  This not only requires privileged mode, but it will also
16837 fail if the cache line had been mapped via the TLB and has become unmapped.
16838
16839 @item -misize
16840 @opindex misize
16841 Dump instruction size and location in the assembly code.
16842
16843 @item -mpadstruct
16844 @opindex mpadstruct
16845 This option is deprecated.  It pads structures to multiple of 4 bytes,
16846 which is incompatible with the SH ABI@.
16847
16848 @item -mspace
16849 @opindex mspace
16850 Optimize for space instead of speed.  Implied by @option{-Os}.
16851
16852 @item -mprefergot
16853 @opindex mprefergot
16854 When generating position-independent code, emit function calls using
16855 the Global Offset Table instead of the Procedure Linkage Table.
16856
16857 @item -musermode
16858 @opindex musermode
16859 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
16860 if the inlined code would not work in user mode.
16861 This is the default when the target is @code{sh-*-linux*}.
16862
16863 @item -multcost=@var{number}
16864 @opindex multcost=@var{number}
16865 Set the cost to assume for a multiply insn.
16866
16867 @item -mdiv=@var{strategy}
16868 @opindex mdiv=@var{strategy}
16869 Set the division strategy to use for SHmedia code.  @var{strategy} must be
16870 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
16871 inv:call2, inv:fp .
16872 "fp" performs the operation in floating point.  This has a very high latency,
16873 but needs only a few instructions, so it might be a good choice if
16874 your code has enough easily exploitable ILP to allow the compiler to
16875 schedule the floating point instructions together with other instructions.
16876 Division by zero causes a floating point exception.
16877 "inv" uses integer operations to calculate the inverse of the divisor,
16878 and then multiplies the dividend with the inverse.  This strategy allows
16879 cse and hoisting of the inverse calculation.  Division by zero calculates
16880 an unspecified result, but does not trap.
16881 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
16882 have been found, or if the entire operation has been hoisted to the same
16883 place, the last stages of the inverse calculation are intertwined with the
16884 final multiply to reduce the overall latency, at the expense of using a few
16885 more instructions, and thus offering fewer scheduling opportunities with
16886 other code.
16887 "call" calls a library function that usually implements the inv:minlat
16888 strategy.
16889 This gives high code density for m5-*media-nofpu compilations.
16890 "call2" uses a different entry point of the same library function, where it
16891 assumes that a pointer to a lookup table has already been set up, which
16892 exposes the pointer load to cse / code hoisting optimizations.
16893 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
16894 code generation, but if the code stays unoptimized, revert to the "call",
16895 "call2", or "fp" strategies, respectively.  Note that the
16896 potentially-trapping side effect of division by zero is carried by a
16897 separate instruction, so it is possible that all the integer instructions
16898 are hoisted out, but the marker for the side effect stays where it is.
16899 A recombination to fp operations or a call is not possible in that case.
16900 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
16901 that the inverse calculation was nor separated from the multiply, they speed
16902 up division where the dividend fits into 20 bits (plus sign where applicable),
16903 by inserting a test to skip a number of operations in this case; this test
16904 slows down the case of larger dividends.  inv20u assumes the case of a such
16905 a small dividend to be unlikely, and inv20l assumes it to be likely.
16906
16907 @item -maccumulate-outgoing-args
16908 @opindex maccumulate-outgoing-args
16909 Reserve space once for outgoing arguments in the function prologue rather 
16910 than around each call.  Generally beneficial for performance and size.  Also
16911 needed for unwinding to avoid changing the stack frame around conditional code.
16912
16913 @item -mdivsi3_libfunc=@var{name}
16914 @opindex mdivsi3_libfunc=@var{name}
16915 Set the name of the library function used for 32 bit signed division to
16916 @var{name}.  This only affect the name used in the call and inv:call
16917 division strategies, and the compiler will still expect the same
16918 sets of input/output/clobbered registers as if this option was not present.
16919
16920 @item -mfixed-range=@var{register-range}
16921 @opindex mfixed-range
16922 Generate code treating the given register range as fixed registers.
16923 A fixed register is one that the register allocator can not use.  This is
16924 useful when compiling kernel code.  A register range is specified as
16925 two registers separated by a dash.  Multiple register ranges can be
16926 specified separated by a comma.
16927
16928 @item -madjust-unroll
16929 @opindex madjust-unroll
16930 Throttle unrolling to avoid thrashing target registers.
16931 This option only has an effect if the gcc code base supports the
16932 TARGET_ADJUST_UNROLL_MAX target hook.
16933
16934 @item -mindexed-addressing
16935 @opindex mindexed-addressing
16936 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
16937 This is only safe if the hardware and/or OS implement 32 bit wrap-around
16938 semantics for the indexed addressing mode.  The architecture allows the
16939 implementation of processors with 64 bit MMU, which the OS could use to
16940 get 32 bit addressing, but since no current hardware implementation supports
16941 this or any other way to make the indexed addressing mode safe to use in
16942 the 32 bit ABI, the default is -mno-indexed-addressing.
16943
16944 @item -mgettrcost=@var{number}
16945 @opindex mgettrcost=@var{number}
16946 Set the cost assumed for the gettr instruction to @var{number}.
16947 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
16948
16949 @item -mpt-fixed
16950 @opindex mpt-fixed
16951 Assume pt* instructions won't trap.  This will generally generate better
16952 scheduled code, but is unsafe on current hardware.  The current architecture
16953 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
16954 This has the unintentional effect of making it unsafe to schedule ptabs /
16955 ptrel before a branch, or hoist it out of a loop.  For example,
16956 __do_global_ctors, a part of libgcc that runs constructors at program
16957 startup, calls functions in a list which is delimited by @minus{}1.  With the
16958 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
16959 That means that all the constructors will be run a bit quicker, but when
16960 the loop comes to the end of the list, the program crashes because ptabs
16961 loads @minus{}1 into a target register.  Since this option is unsafe for any
16962 hardware implementing the current architecture specification, the default
16963 is -mno-pt-fixed.  Unless the user specifies a specific cost with
16964 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
16965 this deters register allocation using target registers for storing
16966 ordinary integers.
16967
16968 @item -minvalid-symbols
16969 @opindex minvalid-symbols
16970 Assume symbols might be invalid.  Ordinary function symbols generated by
16971 the compiler will always be valid to load with movi/shori/ptabs or
16972 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
16973 to generate symbols that will cause ptabs / ptrel to trap.
16974 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
16975 It will then prevent cross-basic-block cse, hoisting and most scheduling
16976 of symbol loads.  The default is @option{-mno-invalid-symbols}.
16977 @end table
16978
16979 @node Solaris 2 Options
16980 @subsection Solaris 2 Options
16981 @cindex Solaris 2 options
16982
16983 These @samp{-m} options are supported on Solaris 2:
16984
16985 @table @gcctabopt
16986 @item -mimpure-text
16987 @opindex mimpure-text
16988 @option{-mimpure-text}, used in addition to @option{-shared}, tells
16989 the compiler to not pass @option{-z text} to the linker when linking a
16990 shared object.  Using this option, you can link position-dependent
16991 code into a shared object.
16992
16993 @option{-mimpure-text} suppresses the ``relocations remain against
16994 allocatable but non-writable sections'' linker error message.
16995 However, the necessary relocations will trigger copy-on-write, and the
16996 shared object is not actually shared across processes.  Instead of
16997 using @option{-mimpure-text}, you should compile all source code with
16998 @option{-fpic} or @option{-fPIC}.
16999
17000 @end table
17001
17002 These switches are supported in addition to the above on Solaris 2:
17003
17004 @table @gcctabopt
17005 @item -threads
17006 @opindex threads
17007 Add support for multithreading using the Solaris threads library.  This
17008 option sets flags for both the preprocessor and linker.  This option does
17009 not affect the thread safety of object code produced by the compiler or
17010 that of libraries supplied with it.
17011
17012 @item -pthreads
17013 @opindex pthreads
17014 Add support for multithreading using the POSIX threads library.  This
17015 option sets flags for both the preprocessor and linker.  This option does
17016 not affect the thread safety of object code produced  by the compiler or
17017 that of libraries supplied with it.
17018
17019 @item -pthread
17020 @opindex pthread
17021 This is a synonym for @option{-pthreads}.
17022 @end table
17023
17024 @node SPARC Options
17025 @subsection SPARC Options
17026 @cindex SPARC options
17027
17028 These @samp{-m} options are supported on the SPARC:
17029
17030 @table @gcctabopt
17031 @item -mno-app-regs
17032 @itemx -mapp-regs
17033 @opindex mno-app-regs
17034 @opindex mapp-regs
17035 Specify @option{-mapp-regs} to generate output using the global registers
17036 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
17037 is the default.
17038
17039 To be fully SVR4 ABI compliant at the cost of some performance loss,
17040 specify @option{-mno-app-regs}.  You should compile libraries and system
17041 software with this option.
17042
17043 @item -mfpu
17044 @itemx -mhard-float
17045 @opindex mfpu
17046 @opindex mhard-float
17047 Generate output containing floating point instructions.  This is the
17048 default.
17049
17050 @item -mno-fpu
17051 @itemx -msoft-float
17052 @opindex mno-fpu
17053 @opindex msoft-float
17054 Generate output containing library calls for floating point.
17055 @strong{Warning:} the requisite libraries are not available for all SPARC
17056 targets.  Normally the facilities of the machine's usual C compiler are
17057 used, but this cannot be done directly in cross-compilation.  You must make
17058 your own arrangements to provide suitable library functions for
17059 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
17060 @samp{sparclite-*-*} do provide software floating point support.
17061
17062 @option{-msoft-float} changes the calling convention in the output file;
17063 therefore, it is only useful if you compile @emph{all} of a program with
17064 this option.  In particular, you need to compile @file{libgcc.a}, the
17065 library that comes with GCC, with @option{-msoft-float} in order for
17066 this to work.
17067
17068 @item -mhard-quad-float
17069 @opindex mhard-quad-float
17070 Generate output containing quad-word (long double) floating point
17071 instructions.
17072
17073 @item -msoft-quad-float
17074 @opindex msoft-quad-float
17075 Generate output containing library calls for quad-word (long double)
17076 floating point instructions.  The functions called are those specified
17077 in the SPARC ABI@.  This is the default.
17078
17079 As of this writing, there are no SPARC implementations that have hardware
17080 support for the quad-word floating point instructions.  They all invoke
17081 a trap handler for one of these instructions, and then the trap handler
17082 emulates the effect of the instruction.  Because of the trap handler overhead,
17083 this is much slower than calling the ABI library routines.  Thus the
17084 @option{-msoft-quad-float} option is the default.
17085
17086 @item -mno-unaligned-doubles
17087 @itemx -munaligned-doubles
17088 @opindex mno-unaligned-doubles
17089 @opindex munaligned-doubles
17090 Assume that doubles have 8 byte alignment.  This is the default.
17091
17092 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
17093 alignment only if they are contained in another type, or if they have an
17094 absolute address.  Otherwise, it assumes they have 4 byte alignment.
17095 Specifying this option avoids some rare compatibility problems with code
17096 generated by other compilers.  It is not the default because it results
17097 in a performance loss, especially for floating point code.
17098
17099 @item -mno-faster-structs
17100 @itemx -mfaster-structs
17101 @opindex mno-faster-structs
17102 @opindex mfaster-structs
17103 With @option{-mfaster-structs}, the compiler assumes that structures
17104 should have 8 byte alignment.  This enables the use of pairs of
17105 @code{ldd} and @code{std} instructions for copies in structure
17106 assignment, in place of twice as many @code{ld} and @code{st} pairs.
17107 However, the use of this changed alignment directly violates the SPARC
17108 ABI@.  Thus, it's intended only for use on targets where the developer
17109 acknowledges that their resulting code will not be directly in line with
17110 the rules of the ABI@.
17111
17112 @item -mcpu=@var{cpu_type}
17113 @opindex mcpu
17114 Set the instruction set, register set, and instruction scheduling parameters
17115 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
17116 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
17117 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
17118 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
17119 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
17120
17121 Default instruction scheduling parameters are used for values that select
17122 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
17123 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
17124
17125 Here is a list of each supported architecture and their supported
17126 implementations.
17127
17128 @smallexample
17129     v7:             cypress
17130     v8:             supersparc, hypersparc, leon
17131     sparclite:      f930, f934, sparclite86x
17132     sparclet:       tsc701
17133     v9:             ultrasparc, ultrasparc3, niagara, niagara2
17134 @end smallexample
17135
17136 By default (unless configured otherwise), GCC generates code for the V7
17137 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
17138 additionally optimizes it for the Cypress CY7C602 chip, as used in the
17139 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
17140 SPARCStation 1, 2, IPX etc.
17141
17142 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
17143 architecture.  The only difference from V7 code is that the compiler emits
17144 the integer multiply and integer divide instructions which exist in SPARC-V8
17145 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
17146 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
17147 2000 series.
17148
17149 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
17150 the SPARC architecture.  This adds the integer multiply, integer divide step
17151 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
17152 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
17153 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
17154 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
17155 MB86934 chip, which is the more recent SPARClite with FPU@.
17156
17157 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
17158 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
17159 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
17160 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
17161 optimizes it for the TEMIC SPARClet chip.
17162
17163 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
17164 architecture.  This adds 64-bit integer and floating-point move instructions,
17165 3 additional floating-point condition code registers and conditional move
17166 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
17167 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
17168 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
17169 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
17170 @option{-mcpu=niagara}, the compiler additionally optimizes it for
17171 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
17172 additionally optimizes it for Sun UltraSPARC T2 chips.
17173
17174 @item -mtune=@var{cpu_type}
17175 @opindex mtune
17176 Set the instruction scheduling parameters for machine type
17177 @var{cpu_type}, but do not set the instruction set or register set that the
17178 option @option{-mcpu=@var{cpu_type}} would.
17179
17180 The same values for @option{-mcpu=@var{cpu_type}} can be used for
17181 @option{-mtune=@var{cpu_type}}, but the only useful values are those
17182 that select a particular CPU implementation.  Those are @samp{cypress},
17183 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
17184 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
17185 @samp{niagara}, and @samp{niagara2}.
17186
17187 @item -mv8plus
17188 @itemx -mno-v8plus
17189 @opindex mv8plus
17190 @opindex mno-v8plus
17191 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
17192 difference from the V8 ABI is that the global and out registers are
17193 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
17194 mode for all SPARC-V9 processors.
17195
17196 @item -mvis
17197 @itemx -mno-vis
17198 @opindex mvis
17199 @opindex mno-vis
17200 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
17201 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
17202 @end table
17203
17204 These @samp{-m} options are supported in addition to the above
17205 on SPARC-V9 processors in 64-bit environments:
17206
17207 @table @gcctabopt
17208 @item -mlittle-endian
17209 @opindex mlittle-endian
17210 Generate code for a processor running in little-endian mode.  It is only
17211 available for a few configurations and most notably not on Solaris and Linux.
17212
17213 @item -m32
17214 @itemx -m64
17215 @opindex m32
17216 @opindex m64
17217 Generate code for a 32-bit or 64-bit environment.
17218 The 32-bit environment sets int, long and pointer to 32 bits.
17219 The 64-bit environment sets int to 32 bits and long and pointer
17220 to 64 bits.
17221
17222 @item -mcmodel=medlow
17223 @opindex mcmodel=medlow
17224 Generate code for the Medium/Low code model: 64-bit addresses, programs
17225 must be linked in the low 32 bits of memory.  Programs can be statically
17226 or dynamically linked.
17227
17228 @item -mcmodel=medmid
17229 @opindex mcmodel=medmid
17230 Generate code for the Medium/Middle code model: 64-bit addresses, programs
17231 must be linked in the low 44 bits of memory, the text and data segments must
17232 be less than 2GB in size and the data segment must be located within 2GB of
17233 the text segment.
17234
17235 @item -mcmodel=medany
17236 @opindex mcmodel=medany
17237 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
17238 may be linked anywhere in memory, the text and data segments must be less
17239 than 2GB in size and the data segment must be located within 2GB of the
17240 text segment.
17241
17242 @item -mcmodel=embmedany
17243 @opindex mcmodel=embmedany
17244 Generate code for the Medium/Anywhere code model for embedded systems:
17245 64-bit addresses, the text and data segments must be less than 2GB in
17246 size, both starting anywhere in memory (determined at link time).  The
17247 global register %g4 points to the base of the data segment.  Programs
17248 are statically linked and PIC is not supported.
17249
17250 @item -mstack-bias
17251 @itemx -mno-stack-bias
17252 @opindex mstack-bias
17253 @opindex mno-stack-bias
17254 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
17255 frame pointer if present, are offset by @minus{}2047 which must be added back
17256 when making stack frame references.  This is the default in 64-bit mode.
17257 Otherwise, assume no such offset is present.
17258 @end table
17259
17260 @node SPU Options
17261 @subsection SPU Options
17262 @cindex SPU options
17263
17264 These @samp{-m} options are supported on the SPU:
17265
17266 @table @gcctabopt
17267 @item -mwarn-reloc
17268 @itemx -merror-reloc
17269 @opindex mwarn-reloc
17270 @opindex merror-reloc
17271
17272 The loader for SPU does not handle dynamic relocations.  By default, GCC
17273 will give an error when it generates code that requires a dynamic
17274 relocation.  @option{-mno-error-reloc} disables the error,
17275 @option{-mwarn-reloc} will generate a warning instead.
17276
17277 @item -msafe-dma
17278 @itemx -munsafe-dma
17279 @opindex msafe-dma
17280 @opindex munsafe-dma
17281
17282 Instructions which initiate or test completion of DMA must not be
17283 reordered with respect to loads and stores of the memory which is being
17284 accessed.  Users typically address this problem using the volatile
17285 keyword, but that can lead to inefficient code in places where the
17286 memory is known to not change.  Rather than mark the memory as volatile
17287 we treat the DMA instructions as potentially effecting all memory.  With
17288 @option{-munsafe-dma} users must use the volatile keyword to protect
17289 memory accesses.
17290
17291 @item -mbranch-hints
17292 @opindex mbranch-hints
17293
17294 By default, GCC will generate a branch hint instruction to avoid
17295 pipeline stalls for always taken or probably taken branches.  A hint
17296 will not be generated closer than 8 instructions away from its branch.
17297 There is little reason to disable them, except for debugging purposes,
17298 or to make an object a little bit smaller.
17299
17300 @item -msmall-mem
17301 @itemx -mlarge-mem
17302 @opindex msmall-mem
17303 @opindex mlarge-mem
17304
17305 By default, GCC generates code assuming that addresses are never larger
17306 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
17307 a full 32 bit address.
17308
17309 @item -mstdmain
17310 @opindex mstdmain
17311
17312 By default, GCC links against startup code that assumes the SPU-style
17313 main function interface (which has an unconventional parameter list).
17314 With @option{-mstdmain}, GCC will link your program against startup
17315 code that assumes a C99-style interface to @code{main}, including a
17316 local copy of @code{argv} strings.
17317
17318 @item -mfixed-range=@var{register-range}
17319 @opindex mfixed-range
17320 Generate code treating the given register range as fixed registers.
17321 A fixed register is one that the register allocator can not use.  This is
17322 useful when compiling kernel code.  A register range is specified as
17323 two registers separated by a dash.  Multiple register ranges can be
17324 specified separated by a comma.
17325
17326 @item -mea32
17327 @itemx -mea64
17328 @opindex mea32
17329 @opindex mea64
17330 Compile code assuming that pointers to the PPU address space accessed
17331 via the @code{__ea} named address space qualifier are either 32 or 64
17332 bits wide.  The default is 32 bits.  As this is an ABI changing option,
17333 all object code in an executable must be compiled with the same setting.
17334
17335 @item -maddress-space-conversion
17336 @itemx -mno-address-space-conversion
17337 @opindex maddress-space-conversion
17338 @opindex mno-address-space-conversion
17339 Allow/disallow treating the @code{__ea} address space as superset
17340 of the generic address space.  This enables explicit type casts
17341 between @code{__ea} and generic pointer as well as implicit
17342 conversions of generic pointers to @code{__ea} pointers.  The
17343 default is to allow address space pointer conversions.
17344
17345 @item -mcache-size=@var{cache-size}
17346 @opindex mcache-size
17347 This option controls the version of libgcc that the compiler links to an
17348 executable and selects a software-managed cache for accessing variables
17349 in the @code{__ea} address space with a particular cache size.  Possible
17350 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
17351 and @samp{128}.  The default cache size is 64KB.
17352
17353 @item -matomic-updates
17354 @itemx -mno-atomic-updates
17355 @opindex matomic-updates
17356 @opindex mno-atomic-updates
17357 This option controls the version of libgcc that the compiler links to an
17358 executable and selects whether atomic updates to the software-managed
17359 cache of PPU-side variables are used.  If you use atomic updates, changes
17360 to a PPU variable from SPU code using the @code{__ea} named address space
17361 qualifier will not interfere with changes to other PPU variables residing
17362 in the same cache line from PPU code.  If you do not use atomic updates,
17363 such interference may occur; however, writing back cache lines will be
17364 more efficient.  The default behavior is to use atomic updates.
17365
17366 @item -mdual-nops
17367 @itemx -mdual-nops=@var{n}
17368 @opindex mdual-nops
17369 By default, GCC will insert nops to increase dual issue when it expects
17370 it to increase performance.  @var{n} can be a value from 0 to 10.  A
17371 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
17372 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
17373
17374 @item -mhint-max-nops=@var{n}
17375 @opindex mhint-max-nops
17376 Maximum number of nops to insert for a branch hint.  A branch hint must
17377 be at least 8 instructions away from the branch it is effecting.  GCC
17378 will insert up to @var{n} nops to enforce this, otherwise it will not
17379 generate the branch hint.
17380
17381 @item -mhint-max-distance=@var{n}
17382 @opindex mhint-max-distance
17383 The encoding of the branch hint instruction limits the hint to be within
17384 256 instructions of the branch it is effecting.  By default, GCC makes
17385 sure it is within 125.
17386
17387 @item -msafe-hints
17388 @opindex msafe-hints
17389 Work around a hardware bug which causes the SPU to stall indefinitely.
17390 By default, GCC will insert the @code{hbrp} instruction to make sure
17391 this stall won't happen.
17392
17393 @end table
17394
17395 @node System V Options
17396 @subsection Options for System V
17397
17398 These additional options are available on System V Release 4 for
17399 compatibility with other compilers on those systems:
17400
17401 @table @gcctabopt
17402 @item -G
17403 @opindex G
17404 Create a shared object.
17405 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
17406
17407 @item -Qy
17408 @opindex Qy
17409 Identify the versions of each tool used by the compiler, in a
17410 @code{.ident} assembler directive in the output.
17411
17412 @item -Qn
17413 @opindex Qn
17414 Refrain from adding @code{.ident} directives to the output file (this is
17415 the default).
17416
17417 @item -YP,@var{dirs}
17418 @opindex YP
17419 Search the directories @var{dirs}, and no others, for libraries
17420 specified with @option{-l}.
17421
17422 @item -Ym,@var{dir}
17423 @opindex Ym
17424 Look in the directory @var{dir} to find the M4 preprocessor.
17425 The assembler uses this option.
17426 @c This is supposed to go with a -Yd for predefined M4 macro files, but
17427 @c the generic assembler that comes with Solaris takes just -Ym.
17428 @end table
17429
17430 @node V850 Options
17431 @subsection V850 Options
17432 @cindex V850 Options
17433
17434 These @samp{-m} options are defined for V850 implementations:
17435
17436 @table @gcctabopt
17437 @item -mlong-calls
17438 @itemx -mno-long-calls
17439 @opindex mlong-calls
17440 @opindex mno-long-calls
17441 Treat all calls as being far away (near).  If calls are assumed to be
17442 far away, the compiler will always load the functions address up into a
17443 register, and call indirect through the pointer.
17444
17445 @item -mno-ep
17446 @itemx -mep
17447 @opindex mno-ep
17448 @opindex mep
17449 Do not optimize (do optimize) basic blocks that use the same index
17450 pointer 4 or more times to copy pointer into the @code{ep} register, and
17451 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
17452 option is on by default if you optimize.
17453
17454 @item -mno-prolog-function
17455 @itemx -mprolog-function
17456 @opindex mno-prolog-function
17457 @opindex mprolog-function
17458 Do not use (do use) external functions to save and restore registers
17459 at the prologue and epilogue of a function.  The external functions
17460 are slower, but use less code space if more than one function saves
17461 the same number of registers.  The @option{-mprolog-function} option
17462 is on by default if you optimize.
17463
17464 @item -mspace
17465 @opindex mspace
17466 Try to make the code as small as possible.  At present, this just turns
17467 on the @option{-mep} and @option{-mprolog-function} options.
17468
17469 @item -mtda=@var{n}
17470 @opindex mtda
17471 Put static or global variables whose size is @var{n} bytes or less into
17472 the tiny data area that register @code{ep} points to.  The tiny data
17473 area can hold up to 256 bytes in total (128 bytes for byte references).
17474
17475 @item -msda=@var{n}
17476 @opindex msda
17477 Put static or global variables whose size is @var{n} bytes or less into
17478 the small data area that register @code{gp} points to.  The small data
17479 area can hold up to 64 kilobytes.
17480
17481 @item -mzda=@var{n}
17482 @opindex mzda
17483 Put static or global variables whose size is @var{n} bytes or less into
17484 the first 32 kilobytes of memory.
17485
17486 @item -mv850
17487 @opindex mv850
17488 Specify that the target processor is the V850.
17489
17490 @item -mbig-switch
17491 @opindex mbig-switch
17492 Generate code suitable for big switch tables.  Use this option only if
17493 the assembler/linker complain about out of range branches within a switch
17494 table.
17495
17496 @item -mapp-regs
17497 @opindex mapp-regs
17498 This option will cause r2 and r5 to be used in the code generated by
17499 the compiler.  This setting is the default.
17500
17501 @item -mno-app-regs
17502 @opindex mno-app-regs
17503 This option will cause r2 and r5 to be treated as fixed registers.
17504
17505 @item -mv850e2v3
17506 @opindex mv850e2v3
17507 Specify that the target processor is the V850E2V3.  The preprocessor
17508 constants @samp{__v850e2v3__} will be defined if
17509 this option is used.
17510
17511 @item -mv850e2
17512 @opindex mv850e2
17513 Specify that the target processor is the V850E2.  The preprocessor
17514 constants @samp{__v850e2__} will be defined if
17515
17516 @item -mv850e1
17517 @opindex mv850e1
17518 Specify that the target processor is the V850E1.  The preprocessor
17519 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
17520
17521 @item -mv850es
17522 @opindex mv850es
17523 Specify that the target processor is the V850ES.  This is an alias for
17524 the @option{-mv850e1} option.
17525
17526 @item -mv850e
17527 @opindex mv850e
17528 Specify that the target processor is the V850E@.  The preprocessor
17529 constant @samp{__v850e__} will be defined if this option is used.
17530
17531 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
17532 nor @option{-mv850e2} nor @option{-mv850e2v3}
17533 are defined then a default target processor will be chosen and the
17534 relevant @samp{__v850*__} preprocessor constant will be defined.
17535
17536 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
17537 defined, regardless of which processor variant is the target.
17538
17539 @item -mdisable-callt
17540 @opindex mdisable-callt
17541 This option will suppress generation of the CALLT instruction for the
17542 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
17543 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
17544
17545 @end table
17546
17547 @node VAX Options
17548 @subsection VAX Options
17549 @cindex VAX options
17550
17551 These @samp{-m} options are defined for the VAX:
17552
17553 @table @gcctabopt
17554 @item -munix
17555 @opindex munix
17556 Do not output certain jump instructions (@code{aobleq} and so on)
17557 that the Unix assembler for the VAX cannot handle across long
17558 ranges.
17559
17560 @item -mgnu
17561 @opindex mgnu
17562 Do output those jump instructions, on the assumption that you
17563 will assemble with the GNU assembler.
17564
17565 @item -mg
17566 @opindex mg
17567 Output code for g-format floating point numbers instead of d-format.
17568 @end table
17569
17570 @node VxWorks Options
17571 @subsection VxWorks Options
17572 @cindex VxWorks Options
17573
17574 The options in this section are defined for all VxWorks targets.
17575 Options specific to the target hardware are listed with the other
17576 options for that target.
17577
17578 @table @gcctabopt
17579 @item -mrtp
17580 @opindex mrtp
17581 GCC can generate code for both VxWorks kernels and real time processes
17582 (RTPs).  This option switches from the former to the latter.  It also
17583 defines the preprocessor macro @code{__RTP__}.
17584
17585 @item -non-static
17586 @opindex non-static
17587 Link an RTP executable against shared libraries rather than static
17588 libraries.  The options @option{-static} and @option{-shared} can
17589 also be used for RTPs (@pxref{Link Options}); @option{-static}
17590 is the default.
17591
17592 @item -Bstatic
17593 @itemx -Bdynamic
17594 @opindex Bstatic
17595 @opindex Bdynamic
17596 These options are passed down to the linker.  They are defined for
17597 compatibility with Diab.
17598
17599 @item -Xbind-lazy
17600 @opindex Xbind-lazy
17601 Enable lazy binding of function calls.  This option is equivalent to
17602 @option{-Wl,-z,now} and is defined for compatibility with Diab.
17603
17604 @item -Xbind-now
17605 @opindex Xbind-now
17606 Disable lazy binding of function calls.  This option is the default and
17607 is defined for compatibility with Diab.
17608 @end table
17609
17610 @node x86-64 Options
17611 @subsection x86-64 Options
17612 @cindex x86-64 options
17613
17614 These are listed under @xref{i386 and x86-64 Options}.
17615
17616 @node Xstormy16 Options
17617 @subsection Xstormy16 Options
17618 @cindex Xstormy16 Options
17619
17620 These options are defined for Xstormy16:
17621
17622 @table @gcctabopt
17623 @item -msim
17624 @opindex msim
17625 Choose startup files and linker script suitable for the simulator.
17626 @end table
17627
17628 @node Xtensa Options
17629 @subsection Xtensa Options
17630 @cindex Xtensa Options
17631
17632 These options are supported for Xtensa targets:
17633
17634 @table @gcctabopt
17635 @item -mconst16
17636 @itemx -mno-const16
17637 @opindex mconst16
17638 @opindex mno-const16
17639 Enable or disable use of @code{CONST16} instructions for loading
17640 constant values.  The @code{CONST16} instruction is currently not a
17641 standard option from Tensilica.  When enabled, @code{CONST16}
17642 instructions are always used in place of the standard @code{L32R}
17643 instructions.  The use of @code{CONST16} is enabled by default only if
17644 the @code{L32R} instruction is not available.
17645
17646 @item -mfused-madd
17647 @itemx -mno-fused-madd
17648 @opindex mfused-madd
17649 @opindex mno-fused-madd
17650 Enable or disable use of fused multiply/add and multiply/subtract
17651 instructions in the floating-point option.  This has no effect if the
17652 floating-point option is not also enabled.  Disabling fused multiply/add
17653 and multiply/subtract instructions forces the compiler to use separate
17654 instructions for the multiply and add/subtract operations.  This may be
17655 desirable in some cases where strict IEEE 754-compliant results are
17656 required: the fused multiply add/subtract instructions do not round the
17657 intermediate result, thereby producing results with @emph{more} bits of
17658 precision than specified by the IEEE standard.  Disabling fused multiply
17659 add/subtract instructions also ensures that the program output is not
17660 sensitive to the compiler's ability to combine multiply and add/subtract
17661 operations.
17662
17663 @item -mserialize-volatile
17664 @itemx -mno-serialize-volatile
17665 @opindex mserialize-volatile
17666 @opindex mno-serialize-volatile
17667 When this option is enabled, GCC inserts @code{MEMW} instructions before
17668 @code{volatile} memory references to guarantee sequential consistency.
17669 The default is @option{-mserialize-volatile}.  Use
17670 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
17671
17672 @item -mforce-no-pic
17673 @opindex mforce-no-pic
17674 For targets, like GNU/Linux, where all user-mode Xtensa code must be
17675 position-independent code (PIC), this option disables PIC for compiling
17676 kernel code.
17677
17678 @item -mtext-section-literals
17679 @itemx -mno-text-section-literals
17680 @opindex mtext-section-literals
17681 @opindex mno-text-section-literals
17682 Control the treatment of literal pools.  The default is
17683 @option{-mno-text-section-literals}, which places literals in a separate
17684 section in the output file.  This allows the literal pool to be placed
17685 in a data RAM/ROM, and it also allows the linker to combine literal
17686 pools from separate object files to remove redundant literals and
17687 improve code size.  With @option{-mtext-section-literals}, the literals
17688 are interspersed in the text section in order to keep them as close as
17689 possible to their references.  This may be necessary for large assembly
17690 files.
17691
17692 @item -mtarget-align
17693 @itemx -mno-target-align
17694 @opindex mtarget-align
17695 @opindex mno-target-align
17696 When this option is enabled, GCC instructs the assembler to
17697 automatically align instructions to reduce branch penalties at the
17698 expense of some code density.  The assembler attempts to widen density
17699 instructions to align branch targets and the instructions following call
17700 instructions.  If there are not enough preceding safe density
17701 instructions to align a target, no widening will be performed.  The
17702 default is @option{-mtarget-align}.  These options do not affect the
17703 treatment of auto-aligned instructions like @code{LOOP}, which the
17704 assembler will always align, either by widening density instructions or
17705 by inserting no-op instructions.
17706
17707 @item -mlongcalls
17708 @itemx -mno-longcalls
17709 @opindex mlongcalls
17710 @opindex mno-longcalls
17711 When this option is enabled, GCC instructs the assembler to translate
17712 direct calls to indirect calls unless it can determine that the target
17713 of a direct call is in the range allowed by the call instruction.  This
17714 translation typically occurs for calls to functions in other source
17715 files.  Specifically, the assembler translates a direct @code{CALL}
17716 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
17717 The default is @option{-mno-longcalls}.  This option should be used in
17718 programs where the call target can potentially be out of range.  This
17719 option is implemented in the assembler, not the compiler, so the
17720 assembly code generated by GCC will still show direct call
17721 instructions---look at the disassembled object code to see the actual
17722 instructions.  Note that the assembler will use an indirect call for
17723 every cross-file call, not just those that really will be out of range.
17724 @end table
17725
17726 @node zSeries Options
17727 @subsection zSeries Options
17728 @cindex zSeries options
17729
17730 These are listed under @xref{S/390 and zSeries Options}.
17731
17732 @node Code Gen Options
17733 @section Options for Code Generation Conventions
17734 @cindex code generation conventions
17735 @cindex options, code generation
17736 @cindex run-time options
17737
17738 These machine-independent options control the interface conventions
17739 used in code generation.
17740
17741 Most of them have both positive and negative forms; the negative form
17742 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
17743 one of the forms is listed---the one which is not the default.  You
17744 can figure out the other form by either removing @samp{no-} or adding
17745 it.
17746
17747 @table @gcctabopt
17748 @item -fbounds-check
17749 @opindex fbounds-check
17750 For front-ends that support it, generate additional code to check that
17751 indices used to access arrays are within the declared range.  This is
17752 currently only supported by the Java and Fortran front-ends, where
17753 this option defaults to true and false respectively.
17754
17755 @item -ftrapv
17756 @opindex ftrapv
17757 This option generates traps for signed overflow on addition, subtraction,
17758 multiplication operations.
17759
17760 @item -fwrapv
17761 @opindex fwrapv
17762 This option instructs the compiler to assume that signed arithmetic
17763 overflow of addition, subtraction and multiplication wraps around
17764 using twos-complement representation.  This flag enables some optimizations
17765 and disables others.  This option is enabled by default for the Java
17766 front-end, as required by the Java language specification.
17767
17768 @item -fexceptions
17769 @opindex fexceptions
17770 Enable exception handling.  Generates extra code needed to propagate
17771 exceptions.  For some targets, this implies GCC will generate frame
17772 unwind information for all functions, which can produce significant data
17773 size overhead, although it does not affect execution.  If you do not
17774 specify this option, GCC will enable it by default for languages like
17775 C++ which normally require exception handling, and disable it for
17776 languages like C that do not normally require it.  However, you may need
17777 to enable this option when compiling C code that needs to interoperate
17778 properly with exception handlers written in C++.  You may also wish to
17779 disable this option if you are compiling older C++ programs that don't
17780 use exception handling.
17781
17782 @item -fnon-call-exceptions
17783 @opindex fnon-call-exceptions
17784 Generate code that allows trapping instructions to throw exceptions.
17785 Note that this requires platform-specific runtime support that does
17786 not exist everywhere.  Moreover, it only allows @emph{trapping}
17787 instructions to throw exceptions, i.e.@: memory references or floating
17788 point instructions.  It does not allow exceptions to be thrown from
17789 arbitrary signal handlers such as @code{SIGALRM}.
17790
17791 @item -funwind-tables
17792 @opindex funwind-tables
17793 Similar to @option{-fexceptions}, except that it will just generate any needed
17794 static data, but will not affect the generated code in any other way.
17795 You will normally not enable this option; instead, a language processor
17796 that needs this handling would enable it on your behalf.
17797
17798 @item -fasynchronous-unwind-tables
17799 @opindex fasynchronous-unwind-tables
17800 Generate unwind table in dwarf2 format, if supported by target machine.  The
17801 table is exact at each instruction boundary, so it can be used for stack
17802 unwinding from asynchronous events (such as debugger or garbage collector).
17803
17804 @item -fpcc-struct-return
17805 @opindex fpcc-struct-return
17806 Return ``short'' @code{struct} and @code{union} values in memory like
17807 longer ones, rather than in registers.  This convention is less
17808 efficient, but it has the advantage of allowing intercallability between
17809 GCC-compiled files and files compiled with other compilers, particularly
17810 the Portable C Compiler (pcc).
17811
17812 The precise convention for returning structures in memory depends
17813 on the target configuration macros.
17814
17815 Short structures and unions are those whose size and alignment match
17816 that of some integer type.
17817
17818 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
17819 switch is not binary compatible with code compiled with the
17820 @option{-freg-struct-return} switch.
17821 Use it to conform to a non-default application binary interface.
17822
17823 @item -freg-struct-return
17824 @opindex freg-struct-return
17825 Return @code{struct} and @code{union} values in registers when possible.
17826 This is more efficient for small structures than
17827 @option{-fpcc-struct-return}.
17828
17829 If you specify neither @option{-fpcc-struct-return} nor
17830 @option{-freg-struct-return}, GCC defaults to whichever convention is
17831 standard for the target.  If there is no standard convention, GCC
17832 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
17833 the principal compiler.  In those cases, we can choose the standard, and
17834 we chose the more efficient register return alternative.
17835
17836 @strong{Warning:} code compiled with the @option{-freg-struct-return}
17837 switch is not binary compatible with code compiled with the
17838 @option{-fpcc-struct-return} switch.
17839 Use it to conform to a non-default application binary interface.
17840
17841 @item -fshort-enums
17842 @opindex fshort-enums
17843 Allocate to an @code{enum} type only as many bytes as it needs for the
17844 declared range of possible values.  Specifically, the @code{enum} type
17845 will be equivalent to the smallest integer type which has enough room.
17846
17847 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
17848 code that is not binary compatible with code generated without that switch.
17849 Use it to conform to a non-default application binary interface.
17850
17851 @item -fshort-double
17852 @opindex fshort-double
17853 Use the same size for @code{double} as for @code{float}.
17854
17855 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
17856 code that is not binary compatible with code generated without that switch.
17857 Use it to conform to a non-default application binary interface.
17858
17859 @item -fshort-wchar
17860 @opindex fshort-wchar
17861 Override the underlying type for @samp{wchar_t} to be @samp{short
17862 unsigned int} instead of the default for the target.  This option is
17863 useful for building programs to run under WINE@.
17864
17865 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
17866 code that is not binary compatible with code generated without that switch.
17867 Use it to conform to a non-default application binary interface.
17868
17869 @item -fno-common
17870 @opindex fno-common
17871 In C code, controls the placement of uninitialized global variables.
17872 Unix C compilers have traditionally permitted multiple definitions of
17873 such variables in different compilation units by placing the variables
17874 in a common block.
17875 This is the behavior specified by @option{-fcommon}, and is the default
17876 for GCC on most targets.
17877 On the other hand, this behavior is not required by ISO C, and on some
17878 targets may carry a speed or code size penalty on variable references.
17879 The @option{-fno-common} option specifies that the compiler should place
17880 uninitialized global variables in the data section of the object file,
17881 rather than generating them as common blocks.
17882 This has the effect that if the same variable is declared
17883 (without @code{extern}) in two different compilations,
17884 you will get a multiple-definition error when you link them.
17885 In this case, you must compile with @option{-fcommon} instead.
17886 Compiling with @option{-fno-common} is useful on targets for which
17887 it provides better performance, or if you wish to verify that the
17888 program will work on other systems which always treat uninitialized
17889 variable declarations this way.
17890
17891 @item -fno-ident
17892 @opindex fno-ident
17893 Ignore the @samp{#ident} directive.
17894
17895 @item -finhibit-size-directive
17896 @opindex finhibit-size-directive
17897 Don't output a @code{.size} assembler directive, or anything else that
17898 would cause trouble if the function is split in the middle, and the
17899 two halves are placed at locations far apart in memory.  This option is
17900 used when compiling @file{crtstuff.c}; you should not need to use it
17901 for anything else.
17902
17903 @item -fverbose-asm
17904 @opindex fverbose-asm
17905 Put extra commentary information in the generated assembly code to
17906 make it more readable.  This option is generally only of use to those
17907 who actually need to read the generated assembly code (perhaps while
17908 debugging the compiler itself).
17909
17910 @option{-fno-verbose-asm}, the default, causes the
17911 extra information to be omitted and is useful when comparing two assembler
17912 files.
17913
17914 @item -frecord-gcc-switches
17915 @opindex frecord-gcc-switches
17916 This switch causes the command line that was used to invoke the
17917 compiler to be recorded into the object file that is being created.
17918 This switch is only implemented on some targets and the exact format
17919 of the recording is target and binary file format dependent, but it
17920 usually takes the form of a section containing ASCII text.  This
17921 switch is related to the @option{-fverbose-asm} switch, but that
17922 switch only records information in the assembler output file as
17923 comments, so it never reaches the object file.
17924
17925 @item -fpic
17926 @opindex fpic
17927 @cindex global offset table
17928 @cindex PIC
17929 Generate position-independent code (PIC) suitable for use in a shared
17930 library, if supported for the target machine.  Such code accesses all
17931 constant addresses through a global offset table (GOT)@.  The dynamic
17932 loader resolves the GOT entries when the program starts (the dynamic
17933 loader is not part of GCC; it is part of the operating system).  If
17934 the GOT size for the linked executable exceeds a machine-specific
17935 maximum size, you get an error message from the linker indicating that
17936 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
17937 instead.  (These maximums are 8k on the SPARC and 32k
17938 on the m68k and RS/6000.  The 386 has no such limit.)
17939
17940 Position-independent code requires special support, and therefore works
17941 only on certain machines.  For the 386, GCC supports PIC for System V
17942 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
17943 position-independent.
17944
17945 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17946 are defined to 1.
17947
17948 @item -fPIC
17949 @opindex fPIC
17950 If supported for the target machine, emit position-independent code,
17951 suitable for dynamic linking and avoiding any limit on the size of the
17952 global offset table.  This option makes a difference on the m68k,
17953 PowerPC and SPARC@.
17954
17955 Position-independent code requires special support, and therefore works
17956 only on certain machines.
17957
17958 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17959 are defined to 2.
17960
17961 @item -fpie
17962 @itemx -fPIE
17963 @opindex fpie
17964 @opindex fPIE
17965 These options are similar to @option{-fpic} and @option{-fPIC}, but
17966 generated position independent code can be only linked into executables.
17967 Usually these options are used when @option{-pie} GCC option will be
17968 used during linking.
17969
17970 @option{-fpie} and @option{-fPIE} both define the macros
17971 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
17972 for @option{-fpie} and 2 for @option{-fPIE}.
17973
17974 @item -fno-jump-tables
17975 @opindex fno-jump-tables
17976 Do not use jump tables for switch statements even where it would be
17977 more efficient than other code generation strategies.  This option is
17978 of use in conjunction with @option{-fpic} or @option{-fPIC} for
17979 building code which forms part of a dynamic linker and cannot
17980 reference the address of a jump table.  On some targets, jump tables
17981 do not require a GOT and this option is not needed.
17982
17983 @item -ffixed-@var{reg}
17984 @opindex ffixed
17985 Treat the register named @var{reg} as a fixed register; generated code
17986 should never refer to it (except perhaps as a stack pointer, frame
17987 pointer or in some other fixed role).
17988
17989 @var{reg} must be the name of a register.  The register names accepted
17990 are machine-specific and are defined in the @code{REGISTER_NAMES}
17991 macro in the machine description macro file.
17992
17993 This flag does not have a negative form, because it specifies a
17994 three-way choice.
17995
17996 @item -fcall-used-@var{reg}
17997 @opindex fcall-used
17998 Treat the register named @var{reg} as an allocable register that is
17999 clobbered by function calls.  It may be allocated for temporaries or
18000 variables that do not live across a call.  Functions compiled this way
18001 will not save and restore the register @var{reg}.
18002
18003 It is an error to used this flag with the frame pointer or stack pointer.
18004 Use of this flag for other registers that have fixed pervasive roles in
18005 the machine's execution model will produce disastrous results.
18006
18007 This flag does not have a negative form, because it specifies a
18008 three-way choice.
18009
18010 @item -fcall-saved-@var{reg}
18011 @opindex fcall-saved
18012 Treat the register named @var{reg} as an allocable register saved by
18013 functions.  It may be allocated even for temporaries or variables that
18014 live across a call.  Functions compiled this way will save and restore
18015 the register @var{reg} if they use it.
18016
18017 It is an error to used this flag with the frame pointer or stack pointer.
18018 Use of this flag for other registers that have fixed pervasive roles in
18019 the machine's execution model will produce disastrous results.
18020
18021 A different sort of disaster will result from the use of this flag for
18022 a register in which function values may be returned.
18023
18024 This flag does not have a negative form, because it specifies a
18025 three-way choice.
18026
18027 @item -fpack-struct[=@var{n}]
18028 @opindex fpack-struct
18029 Without a value specified, pack all structure members together without
18030 holes.  When a value is specified (which must be a small power of two), pack
18031 structure members according to this value, representing the maximum
18032 alignment (that is, objects with default alignment requirements larger than
18033 this will be output potentially unaligned at the next fitting location.
18034
18035 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
18036 code that is not binary compatible with code generated without that switch.
18037 Additionally, it makes the code suboptimal.
18038 Use it to conform to a non-default application binary interface.
18039
18040 @item -finstrument-functions
18041 @opindex finstrument-functions
18042 Generate instrumentation calls for entry and exit to functions.  Just
18043 after function entry and just before function exit, the following
18044 profiling functions will be called with the address of the current
18045 function and its call site.  (On some platforms,
18046 @code{__builtin_return_address} does not work beyond the current
18047 function, so the call site information may not be available to the
18048 profiling functions otherwise.)
18049
18050 @smallexample
18051 void __cyg_profile_func_enter (void *this_fn,
18052                                void *call_site);
18053 void __cyg_profile_func_exit  (void *this_fn,
18054                                void *call_site);
18055 @end smallexample
18056
18057 The first argument is the address of the start of the current function,
18058 which may be looked up exactly in the symbol table.
18059
18060 This instrumentation is also done for functions expanded inline in other
18061 functions.  The profiling calls will indicate where, conceptually, the
18062 inline function is entered and exited.  This means that addressable
18063 versions of such functions must be available.  If all your uses of a
18064 function are expanded inline, this may mean an additional expansion of
18065 code size.  If you use @samp{extern inline} in your C code, an
18066 addressable version of such functions must be provided.  (This is
18067 normally the case anyways, but if you get lucky and the optimizer always
18068 expands the functions inline, you might have gotten away without
18069 providing static copies.)
18070
18071 A function may be given the attribute @code{no_instrument_function}, in
18072 which case this instrumentation will not be done.  This can be used, for
18073 example, for the profiling functions listed above, high-priority
18074 interrupt routines, and any functions from which the profiling functions
18075 cannot safely be called (perhaps signal handlers, if the profiling
18076 routines generate output or allocate memory).
18077
18078 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
18079 @opindex finstrument-functions-exclude-file-list
18080
18081 Set the list of functions that are excluded from instrumentation (see
18082 the description of @code{-finstrument-functions}).  If the file that
18083 contains a function definition matches with one of @var{file}, then
18084 that function is not instrumented.  The match is done on substrings:
18085 if the @var{file} parameter is a substring of the file name, it is
18086 considered to be a match.
18087
18088 For example:
18089
18090 @smallexample
18091 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
18092 @end smallexample
18093
18094 @noindent
18095 will exclude any inline function defined in files whose pathnames
18096 contain @code{/bits/stl} or @code{include/sys}.
18097
18098 If, for some reason, you want to include letter @code{','} in one of
18099 @var{sym}, write @code{'\,'}. For example,
18100 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
18101 (note the single quote surrounding the option).
18102
18103 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
18104 @opindex finstrument-functions-exclude-function-list
18105
18106 This is similar to @code{-finstrument-functions-exclude-file-list},
18107 but this option sets the list of function names to be excluded from
18108 instrumentation.  The function name to be matched is its user-visible
18109 name, such as @code{vector<int> blah(const vector<int> &)}, not the
18110 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
18111 match is done on substrings: if the @var{sym} parameter is a substring
18112 of the function name, it is considered to be a match.  For C99 and C++
18113 extended identifiers, the function name must be given in UTF-8, not
18114 using universal character names.
18115
18116 @item -fstack-check
18117 @opindex fstack-check
18118 Generate code to verify that you do not go beyond the boundary of the
18119 stack.  You should specify this flag if you are running in an
18120 environment with multiple threads, but only rarely need to specify it in
18121 a single-threaded environment since stack overflow is automatically
18122 detected on nearly all systems if there is only one stack.
18123
18124 Note that this switch does not actually cause checking to be done; the
18125 operating system or the language runtime must do that.  The switch causes
18126 generation of code to ensure that they see the stack being extended.
18127
18128 You can additionally specify a string parameter: @code{no} means no
18129 checking, @code{generic} means force the use of old-style checking,
18130 @code{specific} means use the best checking method and is equivalent
18131 to bare @option{-fstack-check}.
18132
18133 Old-style checking is a generic mechanism that requires no specific
18134 target support in the compiler but comes with the following drawbacks:
18135
18136 @enumerate
18137 @item
18138 Modified allocation strategy for large objects: they will always be
18139 allocated dynamically if their size exceeds a fixed threshold.
18140
18141 @item
18142 Fixed limit on the size of the static frame of functions: when it is
18143 topped by a particular function, stack checking is not reliable and
18144 a warning is issued by the compiler.
18145
18146 @item
18147 Inefficiency: because of both the modified allocation strategy and the
18148 generic implementation, the performances of the code are hampered.
18149 @end enumerate
18150
18151 Note that old-style stack checking is also the fallback method for
18152 @code{specific} if no target support has been added in the compiler.
18153
18154 @item -fstack-limit-register=@var{reg}
18155 @itemx -fstack-limit-symbol=@var{sym}
18156 @itemx -fno-stack-limit
18157 @opindex fstack-limit-register
18158 @opindex fstack-limit-symbol
18159 @opindex fno-stack-limit
18160 Generate code to ensure that the stack does not grow beyond a certain value,
18161 either the value of a register or the address of a symbol.  If the stack
18162 would grow beyond the value, a signal is raised.  For most targets,
18163 the signal is raised before the stack overruns the boundary, so
18164 it is possible to catch the signal without taking special precautions.
18165
18166 For instance, if the stack starts at absolute address @samp{0x80000000}
18167 and grows downwards, you can use the flags
18168 @option{-fstack-limit-symbol=__stack_limit} and
18169 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
18170 of 128KB@.  Note that this may only work with the GNU linker.
18171
18172 @item -fsplit-stack
18173 @opindex fsplit-stack
18174 Generate code to automatically split the stack before it overflows.
18175 The resulting program has a discontiguous stack which can only
18176 overflow if the program is unable to allocate any more memory.  This
18177 is most useful when running threaded programs, as it is no longer
18178 necessary to calculate a good stack size to use for each thread.  This
18179 is currently only implemented for the i386 and x86_64 backends running
18180 GNU/Linux.
18181
18182 When code compiled with @option{-fsplit-stack} calls code compiled
18183 without @option{-fsplit-stack}, there may not be much stack space
18184 available for the latter code to run.  If compiling all code,
18185 including library code, with @option{-fsplit-stack} is not an option,
18186 then the linker can fix up these calls so that the code compiled
18187 without @option{-fsplit-stack} always has a large stack.  Support for
18188 this is implemented in the gold linker in GNU binutils release 2.21
18189 and later.
18190
18191 @item -fleading-underscore
18192 @opindex fleading-underscore
18193 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
18194 change the way C symbols are represented in the object file.  One use
18195 is to help link with legacy assembly code.
18196
18197 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
18198 generate code that is not binary compatible with code generated without that
18199 switch.  Use it to conform to a non-default application binary interface.
18200 Not all targets provide complete support for this switch.
18201
18202 @item -ftls-model=@var{model}
18203 @opindex ftls-model
18204 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
18205 The @var{model} argument should be one of @code{global-dynamic},
18206 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
18207
18208 The default without @option{-fpic} is @code{initial-exec}; with
18209 @option{-fpic} the default is @code{global-dynamic}.
18210
18211 @item -fvisibility=@var{default|internal|hidden|protected}
18212 @opindex fvisibility
18213 Set the default ELF image symbol visibility to the specified option---all
18214 symbols will be marked with this unless overridden within the code.
18215 Using this feature can very substantially improve linking and
18216 load times of shared object libraries, produce more optimized
18217 code, provide near-perfect API export and prevent symbol clashes.
18218 It is @strong{strongly} recommended that you use this in any shared objects
18219 you distribute.
18220
18221 Despite the nomenclature, @code{default} always means public; i.e.,
18222 available to be linked against from outside the shared object.
18223 @code{protected} and @code{internal} are pretty useless in real-world
18224 usage so the only other commonly used option will be @code{hidden}.
18225 The default if @option{-fvisibility} isn't specified is
18226 @code{default}, i.e., make every
18227 symbol public---this causes the same behavior as previous versions of
18228 GCC@.
18229
18230 A good explanation of the benefits offered by ensuring ELF
18231 symbols have the correct visibility is given by ``How To Write
18232 Shared Libraries'' by Ulrich Drepper (which can be found at
18233 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
18234 solution made possible by this option to marking things hidden when
18235 the default is public is to make the default hidden and mark things
18236 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
18237 and @code{__attribute__ ((visibility("default")))} instead of
18238 @code{__declspec(dllexport)} you get almost identical semantics with
18239 identical syntax.  This is a great boon to those working with
18240 cross-platform projects.
18241
18242 For those adding visibility support to existing code, you may find
18243 @samp{#pragma GCC visibility} of use.  This works by you enclosing
18244 the declarations you wish to set visibility for with (for example)
18245 @samp{#pragma GCC visibility push(hidden)} and
18246 @samp{#pragma GCC visibility pop}.
18247 Bear in mind that symbol visibility should be viewed @strong{as
18248 part of the API interface contract} and thus all new code should
18249 always specify visibility when it is not the default; i.e., declarations
18250 only for use within the local DSO should @strong{always} be marked explicitly
18251 as hidden as so to avoid PLT indirection overheads---making this
18252 abundantly clear also aids readability and self-documentation of the code.
18253 Note that due to ISO C++ specification requirements, operator new and
18254 operator delete must always be of default visibility.
18255
18256 Be aware that headers from outside your project, in particular system
18257 headers and headers from any other library you use, may not be
18258 expecting to be compiled with visibility other than the default.  You
18259 may need to explicitly say @samp{#pragma GCC visibility push(default)}
18260 before including any such headers.
18261
18262 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
18263 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
18264 no modifications.  However, this means that calls to @samp{extern}
18265 functions with no explicit visibility will use the PLT, so it is more
18266 effective to use @samp{__attribute ((visibility))} and/or
18267 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
18268 declarations should be treated as hidden.
18269
18270 Note that @samp{-fvisibility} does affect C++ vague linkage
18271 entities. This means that, for instance, an exception class that will
18272 be thrown between DSOs must be explicitly marked with default
18273 visibility so that the @samp{type_info} nodes will be unified between
18274 the DSOs.
18275
18276 An overview of these techniques, their benefits and how to use them
18277 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
18278
18279 @item -fstrict-volatile-bitfields
18280 @opindex fstrict-volatile-bitfields
18281 This option should be used if accesses to volatile bitfields (or other
18282 structure fields, although the compiler usually honors those types
18283 anyway) should use a single access of the width of the
18284 field's type, aligned to a natural alignment if possible.  For
18285 example, targets with memory-mapped peripheral registers might require
18286 all such accesses to be 16 bits wide; with this flag the user could
18287 declare all peripheral bitfields as ``unsigned short'' (assuming short
18288 is 16 bits on these targets) to force GCC to use 16 bit accesses
18289 instead of, perhaps, a more efficient 32 bit access.
18290
18291 If this option is disabled, the compiler will use the most efficient
18292 instruction.  In the previous example, that might be a 32-bit load
18293 instruction, even though that will access bytes that do not contain
18294 any portion of the bitfield, or memory-mapped registers unrelated to
18295 the one being updated.
18296
18297 If the target requires strict alignment, and honoring the field
18298 type would require violating this alignment, a warning is issued.
18299 If the field has @code{packed} attribute, the access is done without
18300 honoring the field type.  If the field doesn't have @code{packed}
18301 attribute, the access is done honoring the field type.  In both cases,
18302 GCC assumes that the user knows something about the target hardware
18303 that it is unaware of.
18304
18305 The default value of this option is determined by the application binary
18306 interface for the target processor.
18307
18308 @end table
18309
18310 @c man end
18311
18312 @node Environment Variables
18313 @section Environment Variables Affecting GCC
18314 @cindex environment variables
18315
18316 @c man begin ENVIRONMENT
18317 This section describes several environment variables that affect how GCC
18318 operates.  Some of them work by specifying directories or prefixes to use
18319 when searching for various kinds of files.  Some are used to specify other
18320 aspects of the compilation environment.
18321
18322 Note that you can also specify places to search using options such as
18323 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
18324 take precedence over places specified using environment variables, which
18325 in turn take precedence over those specified by the configuration of GCC@.
18326 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
18327 GNU Compiler Collection (GCC) Internals}.
18328
18329 @table @env
18330 @item LANG
18331 @itemx LC_CTYPE
18332 @c @itemx LC_COLLATE
18333 @itemx LC_MESSAGES
18334 @c @itemx LC_MONETARY
18335 @c @itemx LC_NUMERIC
18336 @c @itemx LC_TIME
18337 @itemx LC_ALL
18338 @findex LANG
18339 @findex LC_CTYPE
18340 @c @findex LC_COLLATE
18341 @findex LC_MESSAGES
18342 @c @findex LC_MONETARY
18343 @c @findex LC_NUMERIC
18344 @c @findex LC_TIME
18345 @findex LC_ALL
18346 @cindex locale
18347 These environment variables control the way that GCC uses
18348 localization information that allow GCC to work with different
18349 national conventions.  GCC inspects the locale categories
18350 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
18351 so.  These locale categories can be set to any value supported by your
18352 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
18353 Kingdom encoded in UTF-8.
18354
18355 The @env{LC_CTYPE} environment variable specifies character
18356 classification.  GCC uses it to determine the character boundaries in
18357 a string; this is needed for some multibyte encodings that contain quote
18358 and escape characters that would otherwise be interpreted as a string
18359 end or escape.
18360
18361 The @env{LC_MESSAGES} environment variable specifies the language to
18362 use in diagnostic messages.
18363
18364 If the @env{LC_ALL} environment variable is set, it overrides the value
18365 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
18366 and @env{LC_MESSAGES} default to the value of the @env{LANG}
18367 environment variable.  If none of these variables are set, GCC
18368 defaults to traditional C English behavior.
18369
18370 @item TMPDIR
18371 @findex TMPDIR
18372 If @env{TMPDIR} is set, it specifies the directory to use for temporary
18373 files.  GCC uses temporary files to hold the output of one stage of
18374 compilation which is to be used as input to the next stage: for example,
18375 the output of the preprocessor, which is the input to the compiler
18376 proper.
18377
18378 @item GCC_EXEC_PREFIX
18379 @findex GCC_EXEC_PREFIX
18380 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
18381 names of the subprograms executed by the compiler.  No slash is added
18382 when this prefix is combined with the name of a subprogram, but you can
18383 specify a prefix that ends with a slash if you wish.
18384
18385 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
18386 an appropriate prefix to use based on the pathname it was invoked with.
18387
18388 If GCC cannot find the subprogram using the specified prefix, it
18389 tries looking in the usual places for the subprogram.
18390
18391 The default value of @env{GCC_EXEC_PREFIX} is
18392 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
18393 the installed compiler. In many cases @var{prefix} is the value
18394 of @code{prefix} when you ran the @file{configure} script.
18395
18396 Other prefixes specified with @option{-B} take precedence over this prefix.
18397
18398 This prefix is also used for finding files such as @file{crt0.o} that are
18399 used for linking.
18400
18401 In addition, the prefix is used in an unusual way in finding the
18402 directories to search for header files.  For each of the standard
18403 directories whose name normally begins with @samp{/usr/local/lib/gcc}
18404 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
18405 replacing that beginning with the specified prefix to produce an
18406 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
18407 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
18408 These alternate directories are searched first; the standard directories
18409 come next. If a standard directory begins with the configured
18410 @var{prefix} then the value of @var{prefix} is replaced by
18411 @env{GCC_EXEC_PREFIX} when looking for header files.
18412
18413 @item COMPILER_PATH
18414 @findex COMPILER_PATH
18415 The value of @env{COMPILER_PATH} is a colon-separated list of
18416 directories, much like @env{PATH}.  GCC tries the directories thus
18417 specified when searching for subprograms, if it can't find the
18418 subprograms using @env{GCC_EXEC_PREFIX}.
18419
18420 @item LIBRARY_PATH
18421 @findex LIBRARY_PATH
18422 The value of @env{LIBRARY_PATH} is a colon-separated list of
18423 directories, much like @env{PATH}.  When configured as a native compiler,
18424 GCC tries the directories thus specified when searching for special
18425 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
18426 using GCC also uses these directories when searching for ordinary
18427 libraries for the @option{-l} option (but directories specified with
18428 @option{-L} come first).
18429
18430 @item LANG
18431 @findex LANG
18432 @cindex locale definition
18433 This variable is used to pass locale information to the compiler.  One way in
18434 which this information is used is to determine the character set to be used
18435 when character literals, string literals and comments are parsed in C and C++.
18436 When the compiler is configured to allow multibyte characters,
18437 the following values for @env{LANG} are recognized:
18438
18439 @table @samp
18440 @item C-JIS
18441 Recognize JIS characters.
18442 @item C-SJIS
18443 Recognize SJIS characters.
18444 @item C-EUCJP
18445 Recognize EUCJP characters.
18446 @end table
18447
18448 If @env{LANG} is not defined, or if it has some other value, then the
18449 compiler will use mblen and mbtowc as defined by the default locale to
18450 recognize and translate multibyte characters.
18451 @end table
18452
18453 @noindent
18454 Some additional environments variables affect the behavior of the
18455 preprocessor.
18456
18457 @include cppenv.texi
18458
18459 @c man end
18460
18461 @node Precompiled Headers
18462 @section Using Precompiled Headers
18463 @cindex precompiled headers
18464 @cindex speed of compilation
18465
18466 Often large projects have many header files that are included in every
18467 source file.  The time the compiler takes to process these header files
18468 over and over again can account for nearly all of the time required to
18469 build the project.  To make builds faster, GCC allows users to
18470 `precompile' a header file; then, if builds can use the precompiled
18471 header file they will be much faster.
18472
18473 To create a precompiled header file, simply compile it as you would any
18474 other file, if necessary using the @option{-x} option to make the driver
18475 treat it as a C or C++ header file.  You will probably want to use a
18476 tool like @command{make} to keep the precompiled header up-to-date when
18477 the headers it contains change.
18478
18479 A precompiled header file will be searched for when @code{#include} is
18480 seen in the compilation.  As it searches for the included file
18481 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
18482 compiler looks for a precompiled header in each directory just before it
18483 looks for the include file in that directory.  The name searched for is
18484 the name specified in the @code{#include} with @samp{.gch} appended.  If
18485 the precompiled header file can't be used, it is ignored.
18486
18487 For instance, if you have @code{#include "all.h"}, and you have
18488 @file{all.h.gch} in the same directory as @file{all.h}, then the
18489 precompiled header file will be used if possible, and the original
18490 header will be used otherwise.
18491
18492 Alternatively, you might decide to put the precompiled header file in a
18493 directory and use @option{-I} to ensure that directory is searched
18494 before (or instead of) the directory containing the original header.
18495 Then, if you want to check that the precompiled header file is always
18496 used, you can put a file of the same name as the original header in this
18497 directory containing an @code{#error} command.
18498
18499 This also works with @option{-include}.  So yet another way to use
18500 precompiled headers, good for projects not designed with precompiled
18501 header files in mind, is to simply take most of the header files used by
18502 a project, include them from another header file, precompile that header
18503 file, and @option{-include} the precompiled header.  If the header files
18504 have guards against multiple inclusion, they will be skipped because
18505 they've already been included (in the precompiled header).
18506
18507 If you need to precompile the same header file for different
18508 languages, targets, or compiler options, you can instead make a
18509 @emph{directory} named like @file{all.h.gch}, and put each precompiled
18510 header in the directory, perhaps using @option{-o}.  It doesn't matter
18511 what you call the files in the directory, every precompiled header in
18512 the directory will be considered.  The first precompiled header
18513 encountered in the directory that is valid for this compilation will
18514 be used; they're searched in no particular order.
18515
18516 There are many other possibilities, limited only by your imagination,
18517 good sense, and the constraints of your build system.
18518
18519 A precompiled header file can be used only when these conditions apply:
18520
18521 @itemize
18522 @item
18523 Only one precompiled header can be used in a particular compilation.
18524
18525 @item
18526 A precompiled header can't be used once the first C token is seen.  You
18527 can have preprocessor directives before a precompiled header; you can
18528 even include a precompiled header from inside another header, so long as
18529 there are no C tokens before the @code{#include}.
18530
18531 @item
18532 The precompiled header file must be produced for the same language as
18533 the current compilation.  You can't use a C precompiled header for a C++
18534 compilation.
18535
18536 @item
18537 The precompiled header file must have been produced by the same compiler
18538 binary as the current compilation is using.
18539
18540 @item
18541 Any macros defined before the precompiled header is included must
18542 either be defined in the same way as when the precompiled header was
18543 generated, or must not affect the precompiled header, which usually
18544 means that they don't appear in the precompiled header at all.
18545
18546 The @option{-D} option is one way to define a macro before a
18547 precompiled header is included; using a @code{#define} can also do it.
18548 There are also some options that define macros implicitly, like
18549 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
18550 defined this way.
18551
18552 @item If debugging information is output when using the precompiled
18553 header, using @option{-g} or similar, the same kind of debugging information
18554 must have been output when building the precompiled header.  However,
18555 a precompiled header built using @option{-g} can be used in a compilation
18556 when no debugging information is being output.
18557
18558 @item The same @option{-m} options must generally be used when building
18559 and using the precompiled header.  @xref{Submodel Options},
18560 for any cases where this rule is relaxed.
18561
18562 @item Each of the following options must be the same when building and using
18563 the precompiled header:
18564
18565 @gccoptlist{-fexceptions}
18566
18567 @item
18568 Some other command-line options starting with @option{-f},
18569 @option{-p}, or @option{-O} must be defined in the same way as when
18570 the precompiled header was generated.  At present, it's not clear
18571 which options are safe to change and which are not; the safest choice
18572 is to use exactly the same options when generating and using the
18573 precompiled header.  The following are known to be safe:
18574
18575 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
18576 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
18577 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
18578 -pedantic-errors}
18579
18580 @end itemize
18581
18582 For all of these except the last, the compiler will automatically
18583 ignore the precompiled header if the conditions aren't met.  If you
18584 find an option combination that doesn't work and doesn't cause the
18585 precompiled header to be ignored, please consider filing a bug report,
18586 see @ref{Bugs}.
18587
18588 If you do use differing options when generating and using the
18589 precompiled header, the actual behavior will be a mixture of the
18590 behavior for the options.  For instance, if you use @option{-g} to
18591 generate the precompiled header but not when using it, you may or may
18592 not get debugging information for routines in the precompiled header.