OSDN Git Service

b68f607912e22d173d0002ec94ea8473536b95ea
[pf3gnuchains/gcc-fork.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
15 Free Software Foundation, Inc.
16
17 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.3 or
19 any later version published by the Free Software Foundation; with the
20 Invariant Sections being ``GNU General Public License'' and ``Funding
21 Free Software'', the Front-Cover texts being (a) (see below), and with
22 the Back-Cover Texts being (b) (see below).  A copy of the license is
23 included in the gfdl(7) man page.
24
25 (a) The FSF's Front-Cover Text is:
26
27      A GNU Manual
28
29 (b) The FSF's Back-Cover Text is:
30
31      You have freedom to copy and modify this GNU Manual, like GNU
32      software.  Copies published by the Free Software Foundation raise
33      funds for GNU development.
34 @c man end
35 @c Set file name and title for the man page.
36 @setfilename gcc
37 @settitle GNU project C and C++ compiler
38 @c man begin SYNOPSIS
39 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
40     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
41     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
42     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
43     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
44     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
45     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
46
47 Only the most useful options are listed here; see below for the
48 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
49 @c man end
50 @c man begin SEEALSO
51 gpl(7), gfdl(7), fsf-funding(7),
52 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
53 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
54 @file{ld}, @file{binutils} and @file{gdb}.
55 @c man end
56 @c man begin BUGS
57 For instructions on reporting bugs, see
58 @w{@value{BUGURL}}.
59 @c man end
60 @c man begin AUTHOR
61 See the Info entry for @command{gcc}, or
62 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
63 for contributors to GCC@.
64 @c man end
65 @end ignore
66
67 @node Invoking GCC
68 @chapter GCC Command Options
69 @cindex GCC command options
70 @cindex command options
71 @cindex options, GCC command
72
73 @c man begin DESCRIPTION
74 When you invoke GCC, it normally does preprocessing, compilation,
75 assembly and linking.  The ``overall options'' allow you to stop this
76 process at an intermediate stage.  For example, the @option{-c} option
77 says not to run the linker.  Then the output consists of object files
78 output by the assembler.
79
80 Other options are passed on to one stage of processing.  Some options
81 control the preprocessor and others the compiler itself.  Yet other
82 options control the assembler and linker; most of these are not
83 documented here, since you rarely need to use any of them.
84
85 @cindex C compilation options
86 Most of the command line options that you can use with GCC are useful
87 for C programs; when an option is only useful with another language
88 (usually C++), the explanation says so explicitly.  If the description
89 for a particular option does not mention a source language, you can use
90 that option with all supported languages.
91
92 @cindex C++ compilation options
93 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
94 options for compiling C++ programs.
95
96 @cindex grouping options
97 @cindex options, grouping
98 The @command{gcc} program accepts options and file names as operands.  Many
99 options have multi-letter names; therefore multiple single-letter options
100 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
101 -v}}.
102
103 @cindex order of options
104 @cindex options, order
105 You can mix options and other arguments.  For the most part, the order
106 you use doesn't matter.  Order does matter when you use several
107 options of the same kind; for example, if you specify @option{-L} more
108 than once, the directories are searched in the order specified.  Also,
109 the placement of the @option{-l} option is significant.
110
111 Many options have long names starting with @samp{-f} or with
112 @samp{-W}---for example,
113 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
114 these have both positive and negative forms; the negative form of
115 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
116 only one of these two forms, whichever one is not the default.
117
118 @c man end
119
120 @xref{Option Index}, for an index to GCC's options.
121
122 @menu
123 * Option Summary::      Brief list of all options, without explanations.
124 * Overall Options::     Controlling the kind of output:
125                         an executable, object files, assembler files,
126                         or preprocessed source.
127 * Invoking G++::        Compiling C++ programs.
128 * C Dialect Options::   Controlling the variant of C language compiled.
129 * C++ Dialect Options:: Variations on C++.
130 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
131                         and Objective-C++.
132 * Language Independent Options:: Controlling how diagnostics should be
133                         formatted.
134 * Warning Options::     How picky should the compiler be?
135 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
136 * Optimize Options::    How much optimization?
137 * Preprocessor Options:: Controlling header files and macro definitions.
138                          Also, getting dependency information for Make.
139 * Assembler Options::   Passing options to the assembler.
140 * Link Options::        Specifying libraries and so on.
141 * Directory Options::   Where to find header files and libraries.
142                         Where to find the compiler executable files.
143 * Spec Files::          How to pass switches to sub-processes.
144 * Target Options::      Running a cross-compiler, or an old version of GCC.
145 * Submodel Options::    Specifying minor hardware or convention variations,
146                         such as 68010 vs 68020.
147 * Code Gen Options::    Specifying conventions for function calls, data layout
148                         and register usage.
149 * Environment Variables:: Env vars that affect GCC.
150 * Precompiled Headers:: Compiling a header once, and using it many times.
151 @end menu
152
153 @c man begin OPTIONS
154
155 @node Option Summary
156 @section Option Summary
157
158 Here is a summary of all the options, grouped by type.  Explanations are
159 in the following sections.
160
161 @table @emph
162 @item Overall Options
163 @xref{Overall Options,,Options Controlling the Kind of Output}.
164 @gccoptlist{-c  -S  -E  -o @var{file}  -no-canonical-prefixes  @gol
165 -pipe  -pass-exit-codes  @gol
166 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
167 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
168 -fdump-ada-spec@r{[}-slim@r{]} -fdump-go-spec=@var{file}}
169
170 @item C Language Options
171 @xref{C Dialect Options,,Options Controlling C Dialect}.
172 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
173 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
174 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
175 -fhosted  -ffreestanding -fopenmp -fms-extensions -fplan9-extensions @gol
176 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
177 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
178 -fsigned-bitfields  -fsigned-char @gol
179 -funsigned-bitfields  -funsigned-char}
180
181 @item C++ Language Options
182 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
183 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
184 -fconserve-space  -fconstexpr-depth=@var{n}  -ffriend-injection @gol
185 -fno-elide-constructors @gol
186 -fno-enforce-eh-specs @gol
187 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
188 -fno-implicit-templates @gol
189 -fno-implicit-inline-templates @gol
190 -fno-implement-inlines  -fms-extensions @gol
191 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
192 -fno-optional-diags  -fpermissive @gol
193 -fno-pretty-templates @gol
194 -frepo  -fno-rtti  -fstats  -ftemplate-depth=@var{n} @gol
195 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
196 -fno-default-inline  -fvisibility-inlines-hidden @gol
197 -fvisibility-ms-compat @gol
198 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
199 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
200 -Weffc++  -Wstrict-null-sentinel @gol
201 -Wno-non-template-friend  -Wold-style-cast @gol
202 -Woverloaded-virtual  -Wno-pmf-conversions @gol
203 -Wsign-promo}
204
205 @item Objective-C and Objective-C++ Language Options
206 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
207 Objective-C and Objective-C++ Dialects}.
208 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
209 -fgnu-runtime  -fnext-runtime @gol
210 -fno-nil-receivers @gol
211 -fobjc-abi-version=@var{n} @gol
212 -fobjc-call-cxx-cdtors @gol
213 -fobjc-direct-dispatch @gol
214 -fobjc-exceptions @gol
215 -fobjc-gc @gol
216 -fobjc-nilcheck @gol
217 -fobjc-std=objc1 @gol
218 -freplace-objc-classes @gol
219 -fzero-link @gol
220 -gen-decls @gol
221 -Wassign-intercept @gol
222 -Wno-protocol  -Wselector @gol
223 -Wstrict-selector-match @gol
224 -Wundeclared-selector}
225
226 @item Language Independent Options
227 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
228 @gccoptlist{-fmessage-length=@var{n}  @gol
229 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
230 -fno-diagnostics-show-option}
231
232 @item Warning Options
233 @xref{Warning Options,,Options to Request or Suppress Warnings}.
234 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -pedantic @gol
235 -pedantic-errors @gol
236 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
237 -Wno-attributes -Wno-builtin-macro-redefined @gol
238 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
239 -Wchar-subscripts -Wclobbered  -Wcomment @gol
240 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
241 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
242 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
243 -Wno-endif-labels -Werror  -Werror=* @gol
244 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
245 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
246 -Wformat-security  -Wformat-y2k @gol
247 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
248 -Wignored-qualifiers @gol
249 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
250 -Winit-self  -Winline -Wmaybe-uninitialized @gol
251 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
252 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
253 -Wlogical-op -Wlong-long @gol
254 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
255 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
256 -Wno-mudflap @gol
257 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
258 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
259 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
260 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
261 -Wredundant-decls @gol
262 -Wreturn-type  -Wsequence-point  -Wshadow @gol
263 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
264 -Wstack-usage=@var{len} -Wstrict-aliasing -Wstrict-aliasing=n @gol
265 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
266 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]} @gol
267 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
268 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
269 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
270 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
271 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
272 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
273 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
274 -Wvariadic-macros -Wvector-operation-performance -Wvla 
275 -Wvolatile-register-var  -Wwrite-strings}
276
277 @item C and Objective-C-only Warning Options
278 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
279 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
280 -Wold-style-declaration  -Wold-style-definition @gol
281 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
282 -Wdeclaration-after-statement -Wpointer-sign}
283
284 @item Debugging Options
285 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
286 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
287 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
288 -fdisable-ipa-@var{pass_name} @gol
289 -fdisable-rtl-@var{pass_name} @gol
290 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
291 -fdisable-tree-@var{pass_name} @gol
292 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
293 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
294 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
295 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
296 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
297 -fdump-passes @gol
298 -fdump-statistics @gol
299 -fdump-tree-all @gol
300 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
301 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
302 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
303 -fdump-tree-ch @gol
304 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
305 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
306 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
307 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
308 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-nrv -fdump-tree-vect @gol
314 -fdump-tree-sink @gol
315 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
317 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
318 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
319 -ftree-vectorizer-verbose=@var{n} @gol
320 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
321 -fdump-final-insns=@var{file} @gol
322 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
323 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
324 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
325 -fenable-@var{kind}-@var{pass} @gol
326 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
327 -fdebug-types-section @gol
328 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
329 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
330 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
331 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
332 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
333 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
334 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
335 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
336 -gvms  -gxcoff  -gxcoff+ @gol
337 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
338 -fdebug-prefix-map=@var{old}=@var{new} @gol
339 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
340 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
341 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
342 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
343 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
344 -print-sysroot -print-sysroot-headers-suffix @gol
345 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
346
347 @item Optimization Options
348 @xref{Optimize Options,,Options that Control Optimization}.
349 @gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
350 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
351 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
352 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
353 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
354 -fcompare-elim -fcprop-registers -fcrossjumping @gol
355 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
356 -fcx-limited-range @gol
357 -fdata-sections -fdce -fdce -fdelayed-branch @gol
358 -fdelete-null-pointer-checks -fdse -fdevirtualize -fdse @gol
359 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
360 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
361 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
362 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
363 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
364 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
365 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg @gol
366 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
367 -fira-algorithm=@var{algorithm} @gol
368 -fira-region=@var{region} @gol
369 -fira-loop-pressure -fno-ira-share-save-slots @gol
370 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
371 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
372 -floop-block -floop-flatten -floop-interchange -floop-strip-mine @gol
373 -floop-parallelize-all -flto -flto-compression-level @gol
374 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
375 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
376 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
377 -fno-default-inline @gol
378 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
379 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
380 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
381 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
382 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
383 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
384 -fprefetch-loop-arrays @gol
385 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
386 -fprofile-generate=@var{path} @gol
387 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
388 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
389 -freorder-blocks-and-partition -freorder-functions @gol
390 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
391 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
392 -fsched-spec-load -fsched-spec-load-dangerous @gol
393 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
394 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
395 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
396 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
397 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
398 -fselective-scheduling -fselective-scheduling2 @gol
399 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
400 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
401 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
402 -fstack-protector-all -fstrict-aliasing -fstrict-overflow @gol
403 -fthread-jumps -ftracer -ftree-bit-ccp @gol
404 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
405 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
406 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
407 -ftree-loop-if-convert-stores -ftree-loop-im @gol
408 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
409 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
410 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
411 -ftree-sink -ftree-sra -ftree-switch-conversion -ftree-tail-merge @gol
412 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
413 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
414 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
415 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
416 -fwhole-program -fwpa -fuse-linker-plugin @gol
417 --param @var{name}=@var{value}
418 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
419
420 @item Preprocessor Options
421 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
422 @gccoptlist{-A@var{question}=@var{answer} @gol
423 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
424 -C  -dD  -dI  -dM  -dN @gol
425 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
426 -idirafter @var{dir} @gol
427 -include @var{file}  -imacros @var{file} @gol
428 -iprefix @var{file}  -iwithprefix @var{dir} @gol
429 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
430 -imultilib @var{dir} -isysroot @var{dir} @gol
431 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
432 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
433 -remap -trigraphs  -undef  -U@var{macro}  @gol
434 -Wp,@var{option} -Xpreprocessor @var{option}}
435
436 @item Assembler Option
437 @xref{Assembler Options,,Passing Options to the Assembler}.
438 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
439
440 @item Linker Options
441 @xref{Link Options,,Options for Linking}.
442 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
443 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
444 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
445 -shared-libgcc  -symbolic @gol
446 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
447 -u @var{symbol}}
448
449 @item Directory Options
450 @xref{Directory Options,,Options for Directory Search}.
451 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
452 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
453 --sysroot=@var{dir}}
454
455 @item Machine Dependent Options
456 @xref{Submodel Options,,Hardware Models and Configurations}.
457 @c This list is ordered alphanumerically by subsection name.
458 @c Try and put the significant identifier (CPU or system) first,
459 @c so users have a clue at guessing where the ones they want will be.
460
461 @emph{ARM Options}
462 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
463 -mabi=@var{name} @gol
464 -mapcs-stack-check  -mno-apcs-stack-check @gol
465 -mapcs-float  -mno-apcs-float @gol
466 -mapcs-reentrant  -mno-apcs-reentrant @gol
467 -msched-prolog  -mno-sched-prolog @gol
468 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
469 -mfloat-abi=@var{name}  -mfpe @gol
470 -mfp16-format=@var{name}
471 -mthumb-interwork  -mno-thumb-interwork @gol
472 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
473 -mstructure-size-boundary=@var{n} @gol
474 -mabort-on-noreturn @gol
475 -mlong-calls  -mno-long-calls @gol
476 -msingle-pic-base  -mno-single-pic-base @gol
477 -mpic-register=@var{reg} @gol
478 -mnop-fun-dllimport @gol
479 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
480 -mpoke-function-name @gol
481 -mthumb  -marm @gol
482 -mtpcs-frame  -mtpcs-leaf-frame @gol
483 -mcaller-super-interworking  -mcallee-super-interworking @gol
484 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
485 -mword-relocations @gol
486 -mfix-cortex-m3-ldrd}
487
488 @emph{AVR Options}
489 @gccoptlist{-mmcu=@var{mcu}  -mno-interrupts @gol
490 -mcall-prologues  -mtiny-stack  -mint8  -mstrict-X}
491
492 @emph{Blackfin Options}
493 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
494 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
495 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
496 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
497 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
498 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
499 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
500 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
501 -micplb}
502
503 @emph{C6X Options}
504 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
505 -msim -msdata=@var{sdata-type}}
506
507 @emph{CRIS Options}
508 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
509 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
510 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
511 -mstack-align  -mdata-align  -mconst-align @gol
512 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
513 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
514 -mmul-bug-workaround  -mno-mul-bug-workaround}
515
516 @emph{Darwin Options}
517 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
518 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
519 -client_name  -compatibility_version  -current_version @gol
520 -dead_strip @gol
521 -dependency-file  -dylib_file  -dylinker_install_name @gol
522 -dynamic  -dynamiclib  -exported_symbols_list @gol
523 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
524 -force_flat_namespace  -headerpad_max_install_names @gol
525 -iframework @gol
526 -image_base  -init  -install_name  -keep_private_externs @gol
527 -multi_module  -multiply_defined  -multiply_defined_unused @gol
528 -noall_load   -no_dead_strip_inits_and_terms @gol
529 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
530 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
531 -private_bundle  -read_only_relocs  -sectalign @gol
532 -sectobjectsymbols  -whyload  -seg1addr @gol
533 -sectcreate  -sectobjectsymbols  -sectorder @gol
534 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
535 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
536 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
537 -single_module  -static  -sub_library  -sub_umbrella @gol
538 -twolevel_namespace  -umbrella  -undefined @gol
539 -unexported_symbols_list  -weak_reference_mismatches @gol
540 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
541 -mkernel -mone-byte-bool}
542
543 @emph{DEC Alpha Options}
544 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
545 -mieee  -mieee-with-inexact  -mieee-conformant @gol
546 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
547 -mtrap-precision=@var{mode}  -mbuild-constants @gol
548 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
549 -mbwx  -mmax  -mfix  -mcix @gol
550 -mfloat-vax  -mfloat-ieee @gol
551 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
552 -msmall-text  -mlarge-text @gol
553 -mmemory-latency=@var{time}}
554
555 @emph{DEC Alpha/VMS Options}
556 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
557
558 @emph{FR30 Options}
559 @gccoptlist{-msmall-model -mno-lsim}
560
561 @emph{FRV Options}
562 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
563 -mhard-float  -msoft-float @gol
564 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
565 -mdouble  -mno-double @gol
566 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
567 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
568 -mlinked-fp  -mlong-calls  -malign-labels @gol
569 -mlibrary-pic  -macc-4  -macc-8 @gol
570 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
571 -moptimize-membar -mno-optimize-membar @gol
572 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
573 -mvliw-branch  -mno-vliw-branch @gol
574 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
575 -mno-nested-cond-exec  -mtomcat-stats @gol
576 -mTLS -mtls @gol
577 -mcpu=@var{cpu}}
578
579 @emph{GNU/Linux Options}
580 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
581 -tno-android-cc -tno-android-ld}
582
583 @emph{H8/300 Options}
584 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
585
586 @emph{HPPA Options}
587 @gccoptlist{-march=@var{architecture-type} @gol
588 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
589 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
590 -mfixed-range=@var{register-range} @gol
591 -mjump-in-delay -mlinker-opt -mlong-calls @gol
592 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
593 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
594 -mno-jump-in-delay  -mno-long-load-store @gol
595 -mno-portable-runtime  -mno-soft-float @gol
596 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
597 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
598 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
599 -munix=@var{unix-std}  -nolibdld  -static  -threads}
600
601 @emph{i386 and x86-64 Options}
602 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
603 -mfpmath=@var{unit} @gol
604 -masm=@var{dialect}  -mno-fancy-math-387 @gol
605 -mno-fp-ret-in-387  -msoft-float @gol
606 -mno-wide-multiply  -mrtd  -malign-double @gol
607 -mpreferred-stack-boundary=@var{num} @gol
608 -mincoming-stack-boundary=@var{num} @gol
609 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
610 -mrecip -mrecip=@var{opt} @gol
611 -mvzeroupper @gol
612 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
613 -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
614 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
615 -mbmi2 -mlwp -mthreads  -mno-align-stringops  -minline-all-stringops @gol
616 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
617 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
618 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
619 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
620 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
621 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
622 -mcmodel=@var{code-model} -mabi=@var{name} @gol
623 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
624 -msse2avx -mfentry -m8bit-idiv @gol
625 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
626
627 @emph{i386 and x86-64 Windows Options}
628 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
629 -mnop-fun-dllimport -mthread @gol
630 -municode -mwin32 -mwindows -fno-set-stack-executable}
631
632 @emph{IA-64 Options}
633 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
634 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
635 -mconstant-gp  -mauto-pic  -mfused-madd @gol
636 -minline-float-divide-min-latency @gol
637 -minline-float-divide-max-throughput @gol
638 -mno-inline-float-divide @gol
639 -minline-int-divide-min-latency @gol
640 -minline-int-divide-max-throughput  @gol
641 -mno-inline-int-divide @gol
642 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
643 -mno-inline-sqrt @gol
644 -mdwarf2-asm -mearly-stop-bits @gol
645 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
646 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
647 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
648 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
649 -msched-spec-ldc -msched-spec-control-ldc @gol
650 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
651 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
652 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
653 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
654
655 @emph{IA-64/VMS Options}
656 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
657
658 @emph{LM32 Options}
659 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
660 -msign-extend-enabled -muser-enabled}
661
662 @emph{M32R/D Options}
663 @gccoptlist{-m32r2 -m32rx -m32r @gol
664 -mdebug @gol
665 -malign-loops -mno-align-loops @gol
666 -missue-rate=@var{number} @gol
667 -mbranch-cost=@var{number} @gol
668 -mmodel=@var{code-size-model-type} @gol
669 -msdata=@var{sdata-type} @gol
670 -mno-flush-func -mflush-func=@var{name} @gol
671 -mno-flush-trap -mflush-trap=@var{number} @gol
672 -G @var{num}}
673
674 @emph{M32C Options}
675 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
676
677 @emph{M680x0 Options}
678 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
679 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
680 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
681 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
682 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
683 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
684 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
685 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
686 -mxgot -mno-xgot}
687
688 @emph{MCore Options}
689 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
690 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
691 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
692 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
693 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
694
695 @emph{MeP Options}
696 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
697 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
698 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
699 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
700 -mtiny=@var{n}}
701
702 @emph{MicroBlaze Options}
703 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
704 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
705 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
706 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
707 -mxl-mode-@var{app-model}}
708
709 @emph{MIPS Options}
710 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
711 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
712 -mips64  -mips64r2 @gol
713 -mips16  -mno-mips16  -mflip-mips16 @gol
714 -minterlink-mips16  -mno-interlink-mips16 @gol
715 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
716 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
717 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
718 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
719 -mfpu=@var{fpu-type} @gol
720 -msmartmips  -mno-smartmips @gol
721 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
722 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
723 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
724 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
725 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
726 -membedded-data  -mno-embedded-data @gol
727 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
728 -mcode-readable=@var{setting} @gol
729 -msplit-addresses  -mno-split-addresses @gol
730 -mexplicit-relocs  -mno-explicit-relocs @gol
731 -mcheck-zero-division  -mno-check-zero-division @gol
732 -mdivide-traps  -mdivide-breaks @gol
733 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
734 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
735 -mfix-24k -mno-fix-24k @gol
736 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
737 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
738 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
739 -mflush-func=@var{func}  -mno-flush-func @gol
740 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
741 -mfp-exceptions -mno-fp-exceptions @gol
742 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
743 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
744
745 @emph{MMIX Options}
746 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
747 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
748 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
749 -mno-base-addresses  -msingle-exit  -mno-single-exit}
750
751 @emph{MN10300 Options}
752 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
753 -mno-am33 -mam33 -mam33-2 -mam34 @gol
754 -mtune=@var{cpu-type} @gol
755 -mreturn-pointer-on-d0 @gol
756 -mno-crt0  -mrelax -mliw -msetlb}
757
758 @emph{PDP-11 Options}
759 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
760 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
761 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
762 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
763 -mbranch-expensive  -mbranch-cheap @gol
764 -munix-asm  -mdec-asm}
765
766 @emph{picoChip Options}
767 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
768 -msymbol-as-address -mno-inefficient-warnings}
769
770 @emph{PowerPC Options}
771 See RS/6000 and PowerPC Options.
772
773 @emph{RS/6000 and PowerPC Options}
774 @gccoptlist{-mcpu=@var{cpu-type} @gol
775 -mtune=@var{cpu-type} @gol
776 -mcmodel=@var{code-model} @gol
777 -mpower  -mno-power  -mpower2  -mno-power2 @gol
778 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
779 -maltivec  -mno-altivec @gol
780 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
781 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
782 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
783 -mfprnd  -mno-fprnd @gol
784 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
785 -mnew-mnemonics  -mold-mnemonics @gol
786 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
787 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
788 -malign-power  -malign-natural @gol
789 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
790 -msingle-float -mdouble-float -msimple-fpu @gol
791 -mstring  -mno-string  -mupdate  -mno-update @gol
792 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
793 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
794 -mstrict-align  -mno-strict-align  -mrelocatable @gol
795 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
796 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
797 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
798 -mprioritize-restricted-insns=@var{priority} @gol
799 -msched-costly-dep=@var{dependence_type} @gol
800 -minsert-sched-nops=@var{scheme} @gol
801 -mcall-sysv  -mcall-netbsd @gol
802 -maix-struct-return  -msvr4-struct-return @gol
803 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
804 -mblock-move-inline-limit=@var{num} @gol
805 -misel -mno-isel @gol
806 -misel=yes  -misel=no @gol
807 -mspe -mno-spe @gol
808 -mspe=yes  -mspe=no @gol
809 -mpaired @gol
810 -mgen-cell-microcode -mwarn-cell-microcode @gol
811 -mvrsave -mno-vrsave @gol
812 -mmulhw -mno-mulhw @gol
813 -mdlmzb -mno-dlmzb @gol
814 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
815 -mprototype  -mno-prototype @gol
816 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
817 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
818 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
819 -mno-recip-precision @gol
820 -mveclibabi=@var{type} -mfriz -mno-friz @gol
821 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
822 -msave-toc-indirect -mno-save-toc-indirect}
823
824 @emph{RX Options}
825 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
826 -mcpu=@gol
827 -mbig-endian-data -mlittle-endian-data @gol
828 -msmall-data @gol
829 -msim  -mno-sim@gol
830 -mas100-syntax -mno-as100-syntax@gol
831 -mrelax@gol
832 -mmax-constant-size=@gol
833 -mint-register=@gol
834 -mpid@gol
835 -msave-acc-in-interrupts}
836
837 @emph{S/390 and zSeries Options}
838 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
839 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
840 -mlong-double-64 -mlong-double-128 @gol
841 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
842 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
843 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
844 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
845 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
846
847 @emph{Score Options}
848 @gccoptlist{-meb -mel @gol
849 -mnhwloop @gol
850 -muls @gol
851 -mmac @gol
852 -mscore5 -mscore5u -mscore7 -mscore7d}
853
854 @emph{SH Options}
855 @gccoptlist{-m1  -m2  -m2e @gol
856 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
857 -m3  -m3e @gol
858 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
859 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
860 -m5-64media  -m5-64media-nofpu @gol
861 -m5-32media  -m5-32media-nofpu @gol
862 -m5-compact  -m5-compact-nofpu @gol
863 -mb  -ml  -mdalign  -mrelax @gol
864 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
865 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
866 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
867 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
868 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
869 -maccumulate-outgoing-args -minvalid-symbols}
870
871 @emph{Solaris 2 Options}
872 @gccoptlist{-mimpure-text  -mno-impure-text @gol
873 -pthreads -pthread}
874
875 @emph{SPARC Options}
876 @gccoptlist{-mcpu=@var{cpu-type} @gol
877 -mtune=@var{cpu-type} @gol
878 -mcmodel=@var{code-model} @gol
879 -m32  -m64  -mapp-regs  -mno-app-regs @gol
880 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
881 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
882 -mhard-quad-float  -msoft-quad-float @gol
883 -mlittle-endian @gol
884 -mstack-bias  -mno-stack-bias @gol
885 -munaligned-doubles  -mno-unaligned-doubles @gol
886 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
887 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
888 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
889 -mfix-at697f}
890
891 @emph{SPU Options}
892 @gccoptlist{-mwarn-reloc -merror-reloc @gol
893 -msafe-dma -munsafe-dma @gol
894 -mbranch-hints @gol
895 -msmall-mem -mlarge-mem -mstdmain @gol
896 -mfixed-range=@var{register-range} @gol
897 -mea32 -mea64 @gol
898 -maddress-space-conversion -mno-address-space-conversion @gol
899 -mcache-size=@var{cache-size} @gol
900 -matomic-updates -mno-atomic-updates}
901
902 @emph{System V Options}
903 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
904
905 @emph{V850 Options}
906 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
907 -mprolog-function  -mno-prolog-function  -mspace @gol
908 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
909 -mapp-regs  -mno-app-regs @gol
910 -mdisable-callt  -mno-disable-callt @gol
911 -mv850e2v3 @gol
912 -mv850e2 @gol
913 -mv850e1 -mv850es @gol
914 -mv850e @gol
915 -mv850  -mbig-switch}
916
917 @emph{VAX Options}
918 @gccoptlist{-mg  -mgnu  -munix}
919
920 @emph{VxWorks Options}
921 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
922 -Xbind-lazy  -Xbind-now}
923
924 @emph{x86-64 Options}
925 See i386 and x86-64 Options.
926
927 @emph{Xstormy16 Options}
928 @gccoptlist{-msim}
929
930 @emph{Xtensa Options}
931 @gccoptlist{-mconst16 -mno-const16 @gol
932 -mfused-madd  -mno-fused-madd @gol
933 -mforce-no-pic @gol
934 -mserialize-volatile  -mno-serialize-volatile @gol
935 -mtext-section-literals  -mno-text-section-literals @gol
936 -mtarget-align  -mno-target-align @gol
937 -mlongcalls  -mno-longcalls}
938
939 @emph{zSeries Options}
940 See S/390 and zSeries Options.
941
942 @item Code Generation Options
943 @xref{Code Gen Options,,Options for Code Generation Conventions}.
944 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
945 -ffixed-@var{reg}  -fexceptions @gol
946 -fnon-call-exceptions  -funwind-tables @gol
947 -fasynchronous-unwind-tables @gol
948 -finhibit-size-directive  -finstrument-functions @gol
949 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
950 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
951 -fno-common  -fno-ident @gol
952 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
953 -fno-jump-tables @gol
954 -frecord-gcc-switches @gol
955 -freg-struct-return  -fshort-enums @gol
956 -fshort-double  -fshort-wchar @gol
957 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
958 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
959 -fno-stack-limit -fsplit-stack @gol
960 -fleading-underscore  -ftls-model=@var{model} @gol
961 -ftrapv  -fwrapv  -fbounds-check @gol
962 -fvisibility -fstrict-volatile-bitfields}
963 @end table
964
965 @menu
966 * Overall Options::     Controlling the kind of output:
967                         an executable, object files, assembler files,
968                         or preprocessed source.
969 * C Dialect Options::   Controlling the variant of C language compiled.
970 * C++ Dialect Options:: Variations on C++.
971 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
972                         and Objective-C++.
973 * Language Independent Options:: Controlling how diagnostics should be
974                         formatted.
975 * Warning Options::     How picky should the compiler be?
976 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
977 * Optimize Options::    How much optimization?
978 * Preprocessor Options:: Controlling header files and macro definitions.
979                          Also, getting dependency information for Make.
980 * Assembler Options::   Passing options to the assembler.
981 * Link Options::        Specifying libraries and so on.
982 * Directory Options::   Where to find header files and libraries.
983                         Where to find the compiler executable files.
984 * Spec Files::          How to pass switches to sub-processes.
985 * Target Options::      Running a cross-compiler, or an old version of GCC.
986 @end menu
987
988 @node Overall Options
989 @section Options Controlling the Kind of Output
990
991 Compilation can involve up to four stages: preprocessing, compilation
992 proper, assembly and linking, always in that order.  GCC is capable of
993 preprocessing and compiling several files either into several
994 assembler input files, or into one assembler input file; then each
995 assembler input file produces an object file, and linking combines all
996 the object files (those newly compiled, and those specified as input)
997 into an executable file.
998
999 @cindex file name suffix
1000 For any given input file, the file name suffix determines what kind of
1001 compilation is done:
1002
1003 @table @gcctabopt
1004 @item @var{file}.c
1005 C source code which must be preprocessed.
1006
1007 @item @var{file}.i
1008 C source code which should not be preprocessed.
1009
1010 @item @var{file}.ii
1011 C++ source code which should not be preprocessed.
1012
1013 @item @var{file}.m
1014 Objective-C source code.  Note that you must link with the @file{libobjc}
1015 library to make an Objective-C program work.
1016
1017 @item @var{file}.mi
1018 Objective-C source code which should not be preprocessed.
1019
1020 @item @var{file}.mm
1021 @itemx @var{file}.M
1022 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1023 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1024 to a literal capital M@.
1025
1026 @item @var{file}.mii
1027 Objective-C++ source code which should not be preprocessed.
1028
1029 @item @var{file}.h
1030 C, C++, Objective-C or Objective-C++ header file to be turned into a
1031 precompiled header (default), or C, C++ header file to be turned into an
1032 Ada spec (via the @option{-fdump-ada-spec} switch).
1033
1034 @item @var{file}.cc
1035 @itemx @var{file}.cp
1036 @itemx @var{file}.cxx
1037 @itemx @var{file}.cpp
1038 @itemx @var{file}.CPP
1039 @itemx @var{file}.c++
1040 @itemx @var{file}.C
1041 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
1042 the last two letters must both be literally @samp{x}.  Likewise,
1043 @samp{.C} refers to a literal capital C@.
1044
1045 @item @var{file}.mm
1046 @itemx @var{file}.M
1047 Objective-C++ source code which must be preprocessed.
1048
1049 @item @var{file}.mii
1050 Objective-C++ source code which should not be preprocessed.
1051
1052 @item @var{file}.hh
1053 @itemx @var{file}.H
1054 @itemx @var{file}.hp
1055 @itemx @var{file}.hxx
1056 @itemx @var{file}.hpp
1057 @itemx @var{file}.HPP
1058 @itemx @var{file}.h++
1059 @itemx @var{file}.tcc
1060 C++ header file to be turned into a precompiled header or Ada spec.
1061
1062 @item @var{file}.f
1063 @itemx @var{file}.for
1064 @itemx @var{file}.ftn
1065 Fixed form Fortran source code which should not be preprocessed.
1066
1067 @item @var{file}.F
1068 @itemx @var{file}.FOR
1069 @itemx @var{file}.fpp
1070 @itemx @var{file}.FPP
1071 @itemx @var{file}.FTN
1072 Fixed form Fortran source code which must be preprocessed (with the traditional
1073 preprocessor).
1074
1075 @item @var{file}.f90
1076 @itemx @var{file}.f95
1077 @itemx @var{file}.f03
1078 @itemx @var{file}.f08
1079 Free form Fortran source code which should not be preprocessed.
1080
1081 @item @var{file}.F90
1082 @itemx @var{file}.F95
1083 @itemx @var{file}.F03
1084 @itemx @var{file}.F08
1085 Free form Fortran source code which must be preprocessed (with the
1086 traditional preprocessor).
1087
1088 @item @var{file}.go
1089 Go source code.
1090
1091 @c FIXME: Descriptions of Java file types.
1092 @c @var{file}.java
1093 @c @var{file}.class
1094 @c @var{file}.zip
1095 @c @var{file}.jar
1096
1097 @item @var{file}.ads
1098 Ada source code file which contains a library unit declaration (a
1099 declaration of a package, subprogram, or generic, or a generic
1100 instantiation), or a library unit renaming declaration (a package,
1101 generic, or subprogram renaming declaration).  Such files are also
1102 called @dfn{specs}.
1103
1104 @item @var{file}.adb
1105 Ada source code file containing a library unit body (a subprogram or
1106 package body).  Such files are also called @dfn{bodies}.
1107
1108 @c GCC also knows about some suffixes for languages not yet included:
1109 @c Pascal:
1110 @c @var{file}.p
1111 @c @var{file}.pas
1112 @c Ratfor:
1113 @c @var{file}.r
1114
1115 @item @var{file}.s
1116 Assembler code.
1117
1118 @item @var{file}.S
1119 @itemx @var{file}.sx
1120 Assembler code which must be preprocessed.
1121
1122 @item @var{other}
1123 An object file to be fed straight into linking.
1124 Any file name with no recognized suffix is treated this way.
1125 @end table
1126
1127 @opindex x
1128 You can specify the input language explicitly with the @option{-x} option:
1129
1130 @table @gcctabopt
1131 @item -x @var{language}
1132 Specify explicitly the @var{language} for the following input files
1133 (rather than letting the compiler choose a default based on the file
1134 name suffix).  This option applies to all following input files until
1135 the next @option{-x} option.  Possible values for @var{language} are:
1136 @smallexample
1137 c  c-header  cpp-output
1138 c++  c++-header  c++-cpp-output
1139 objective-c  objective-c-header  objective-c-cpp-output
1140 objective-c++ objective-c++-header objective-c++-cpp-output
1141 assembler  assembler-with-cpp
1142 ada
1143 f77  f77-cpp-input f95  f95-cpp-input
1144 go
1145 java
1146 @end smallexample
1147
1148 @item -x none
1149 Turn off any specification of a language, so that subsequent files are
1150 handled according to their file name suffixes (as they are if @option{-x}
1151 has not been used at all).
1152
1153 @item -pass-exit-codes
1154 @opindex pass-exit-codes
1155 Normally the @command{gcc} program will exit with the code of 1 if any
1156 phase of the compiler returns a non-success return code.  If you specify
1157 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1158 numerically highest error produced by any phase that returned an error
1159 indication.  The C, C++, and Fortran frontends return 4, if an internal
1160 compiler error is encountered.
1161 @end table
1162
1163 If you only want some of the stages of compilation, you can use
1164 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1165 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1166 @command{gcc} is to stop.  Note that some combinations (for example,
1167 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1168
1169 @table @gcctabopt
1170 @item -c
1171 @opindex c
1172 Compile or assemble the source files, but do not link.  The linking
1173 stage simply is not done.  The ultimate output is in the form of an
1174 object file for each source file.
1175
1176 By default, the object file name for a source file is made by replacing
1177 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1178
1179 Unrecognized input files, not requiring compilation or assembly, are
1180 ignored.
1181
1182 @item -S
1183 @opindex S
1184 Stop after the stage of compilation proper; do not assemble.  The output
1185 is in the form of an assembler code file for each non-assembler input
1186 file specified.
1187
1188 By default, the assembler file name for a source file is made by
1189 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1190
1191 Input files that don't require compilation are ignored.
1192
1193 @item -E
1194 @opindex E
1195 Stop after the preprocessing stage; do not run the compiler proper.  The
1196 output is in the form of preprocessed source code, which is sent to the
1197 standard output.
1198
1199 Input files which don't require preprocessing are ignored.
1200
1201 @cindex output file option
1202 @item -o @var{file}
1203 @opindex o
1204 Place output in file @var{file}.  This applies regardless to whatever
1205 sort of output is being produced, whether it be an executable file,
1206 an object file, an assembler file or preprocessed C code.
1207
1208 If @option{-o} is not specified, the default is to put an executable
1209 file in @file{a.out}, the object file for
1210 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1211 assembler file in @file{@var{source}.s}, a precompiled header file in
1212 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1213 standard output.
1214
1215 @item -v
1216 @opindex v
1217 Print (on standard error output) the commands executed to run the stages
1218 of compilation.  Also print the version number of the compiler driver
1219 program and of the preprocessor and the compiler proper.
1220
1221 @item -###
1222 @opindex ###
1223 Like @option{-v} except the commands are not executed and arguments
1224 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1225 This is useful for shell scripts to capture the driver-generated command lines.
1226
1227 @item -pipe
1228 @opindex pipe
1229 Use pipes rather than temporary files for communication between the
1230 various stages of compilation.  This fails to work on some systems where
1231 the assembler is unable to read from a pipe; but the GNU assembler has
1232 no trouble.
1233
1234 @item --help
1235 @opindex help
1236 Print (on the standard output) a description of the command line options
1237 understood by @command{gcc}.  If the @option{-v} option is also specified
1238 then @option{--help} will also be passed on to the various processes
1239 invoked by @command{gcc}, so that they can display the command line options
1240 they accept.  If the @option{-Wextra} option has also been specified
1241 (prior to the @option{--help} option), then command line options which
1242 have no documentation associated with them will also be displayed.
1243
1244 @item --target-help
1245 @opindex target-help
1246 Print (on the standard output) a description of target-specific command
1247 line options for each tool.  For some targets extra target-specific
1248 information may also be printed.
1249
1250 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1251 Print (on the standard output) a description of the command line
1252 options understood by the compiler that fit into all specified classes
1253 and qualifiers.  These are the supported classes:
1254
1255 @table @asis
1256 @item @samp{optimizers}
1257 This will display all of the optimization options supported by the
1258 compiler.
1259
1260 @item @samp{warnings}
1261 This will display all of the options controlling warning messages
1262 produced by the compiler.
1263
1264 @item @samp{target}
1265 This will display target-specific options.  Unlike the
1266 @option{--target-help} option however, target-specific options of the
1267 linker and assembler will not be displayed.  This is because those
1268 tools do not currently support the extended @option{--help=} syntax.
1269
1270 @item @samp{params}
1271 This will display the values recognized by the @option{--param}
1272 option.
1273
1274 @item @var{language}
1275 This will display the options supported for @var{language}, where
1276 @var{language} is the name of one of the languages supported in this
1277 version of GCC.
1278
1279 @item @samp{common}
1280 This will display the options that are common to all languages.
1281 @end table
1282
1283 These are the supported qualifiers:
1284
1285 @table @asis
1286 @item @samp{undocumented}
1287 Display only those options which are undocumented.
1288
1289 @item @samp{joined}
1290 Display options which take an argument that appears after an equal
1291 sign in the same continuous piece of text, such as:
1292 @samp{--help=target}.
1293
1294 @item @samp{separate}
1295 Display options which take an argument that appears as a separate word
1296 following the original option, such as: @samp{-o output-file}.
1297 @end table
1298
1299 Thus for example to display all the undocumented target-specific
1300 switches supported by the compiler the following can be used:
1301
1302 @smallexample
1303 --help=target,undocumented
1304 @end smallexample
1305
1306 The sense of a qualifier can be inverted by prefixing it with the
1307 @samp{^} character, so for example to display all binary warning
1308 options (i.e., ones that are either on or off and that do not take an
1309 argument), which have a description the following can be used:
1310
1311 @smallexample
1312 --help=warnings,^joined,^undocumented
1313 @end smallexample
1314
1315 The argument to @option{--help=} should not consist solely of inverted
1316 qualifiers.
1317
1318 Combining several classes is possible, although this usually
1319 restricts the output by so much that there is nothing to display.  One
1320 case where it does work however is when one of the classes is
1321 @var{target}.  So for example to display all the target-specific
1322 optimization options the following can be used:
1323
1324 @smallexample
1325 --help=target,optimizers
1326 @end smallexample
1327
1328 The @option{--help=} option can be repeated on the command line.  Each
1329 successive use will display its requested class of options, skipping
1330 those that have already been displayed.
1331
1332 If the @option{-Q} option appears on the command line before the
1333 @option{--help=} option, then the descriptive text displayed by
1334 @option{--help=} is changed.  Instead of describing the displayed
1335 options, an indication is given as to whether the option is enabled,
1336 disabled or set to a specific value (assuming that the compiler
1337 knows this at the point where the @option{--help=} option is used).
1338
1339 Here is a truncated example from the ARM port of @command{gcc}:
1340
1341 @smallexample
1342   % gcc -Q -mabi=2 --help=target -c
1343   The following options are target specific:
1344   -mabi=                                2
1345   -mabort-on-noreturn                   [disabled]
1346   -mapcs                                [disabled]
1347 @end smallexample
1348
1349 The output is sensitive to the effects of previous command line
1350 options, so for example it is possible to find out which optimizations
1351 are enabled at @option{-O2} by using:
1352
1353 @smallexample
1354 -Q -O2 --help=optimizers
1355 @end smallexample
1356
1357 Alternatively you can discover which binary optimizations are enabled
1358 by @option{-O3} by using:
1359
1360 @smallexample
1361 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1362 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1363 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1364 @end smallexample
1365
1366 @item -no-canonical-prefixes
1367 @opindex no-canonical-prefixes
1368 Do not expand any symbolic links, resolve references to @samp{/../}
1369 or @samp{/./}, or make the path absolute when generating a relative
1370 prefix.
1371
1372 @item --version
1373 @opindex version
1374 Display the version number and copyrights of the invoked GCC@.
1375
1376 @item -wrapper
1377 @opindex wrapper
1378 Invoke all subcommands under a wrapper program.  The name of the
1379 wrapper program and its parameters are passed as a comma separated
1380 list.
1381
1382 @smallexample
1383 gcc -c t.c -wrapper gdb,--args
1384 @end smallexample
1385
1386 This will invoke all subprograms of @command{gcc} under
1387 @samp{gdb --args}, thus the invocation of @command{cc1} will be
1388 @samp{gdb --args cc1 @dots{}}.
1389
1390 @item -fplugin=@var{name}.so
1391 Load the plugin code in file @var{name}.so, assumed to be a
1392 shared object to be dlopen'd by the compiler.  The base name of
1393 the shared object file is used to identify the plugin for the
1394 purposes of argument parsing (See
1395 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1396 Each plugin should define the callback functions specified in the
1397 Plugins API.
1398
1399 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1400 Define an argument called @var{key} with a value of @var{value}
1401 for the plugin called @var{name}.
1402
1403 @item -fdump-ada-spec@r{[}-slim@r{]}
1404 For C and C++ source and include files, generate corresponding Ada
1405 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1406 GNAT User's Guide}, which provides detailed documentation on this feature.
1407
1408 @item -fdump-go-spec=@var{file}
1409 For input files in any language, generate corresponding Go
1410 declarations in @var{file}.  This generates Go @code{const},
1411 @code{type}, @code{var}, and @code{func} declarations which may be a
1412 useful way to start writing a Go interface to code written in some
1413 other language.
1414
1415 @include @value{srcdir}/../libiberty/at-file.texi
1416 @end table
1417
1418 @node Invoking G++
1419 @section Compiling C++ Programs
1420
1421 @cindex suffixes for C++ source
1422 @cindex C++ source file suffixes
1423 C++ source files conventionally use one of the suffixes @samp{.C},
1424 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1425 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1426 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1427 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1428 files with these names and compiles them as C++ programs even if you
1429 call the compiler the same way as for compiling C programs (usually
1430 with the name @command{gcc}).
1431
1432 @findex g++
1433 @findex c++
1434 However, the use of @command{gcc} does not add the C++ library.
1435 @command{g++} is a program that calls GCC and treats @samp{.c},
1436 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1437 files unless @option{-x} is used, and automatically specifies linking
1438 against the C++ library.  This program is also useful when
1439 precompiling a C header file with a @samp{.h} extension for use in C++
1440 compilations.  On many systems, @command{g++} is also installed with
1441 the name @command{c++}.
1442
1443 @cindex invoking @command{g++}
1444 When you compile C++ programs, you may specify many of the same
1445 command-line options that you use for compiling programs in any
1446 language; or command-line options meaningful for C and related
1447 languages; or options that are meaningful only for C++ programs.
1448 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1449 explanations of options for languages related to C@.
1450 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1451 explanations of options that are meaningful only for C++ programs.
1452
1453 @node C Dialect Options
1454 @section Options Controlling C Dialect
1455 @cindex dialect options
1456 @cindex language dialect options
1457 @cindex options, dialect
1458
1459 The following options control the dialect of C (or languages derived
1460 from C, such as C++, Objective-C and Objective-C++) that the compiler
1461 accepts:
1462
1463 @table @gcctabopt
1464 @cindex ANSI support
1465 @cindex ISO support
1466 @item -ansi
1467 @opindex ansi
1468 In C mode, this is equivalent to @samp{-std=c90}. In C++ mode, it is
1469 equivalent to @samp{-std=c++98}.
1470
1471 This turns off certain features of GCC that are incompatible with ISO
1472 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1473 such as the @code{asm} and @code{typeof} keywords, and
1474 predefined macros such as @code{unix} and @code{vax} that identify the
1475 type of system you are using.  It also enables the undesirable and
1476 rarely used ISO trigraph feature.  For the C compiler,
1477 it disables recognition of C++ style @samp{//} comments as well as
1478 the @code{inline} keyword.
1479
1480 The alternate keywords @code{__asm__}, @code{__extension__},
1481 @code{__inline__} and @code{__typeof__} continue to work despite
1482 @option{-ansi}.  You would not want to use them in an ISO C program, of
1483 course, but it is useful to put them in header files that might be included
1484 in compilations done with @option{-ansi}.  Alternate predefined macros
1485 such as @code{__unix__} and @code{__vax__} are also available, with or
1486 without @option{-ansi}.
1487
1488 The @option{-ansi} option does not cause non-ISO programs to be
1489 rejected gratuitously.  For that, @option{-pedantic} is required in
1490 addition to @option{-ansi}.  @xref{Warning Options}.
1491
1492 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1493 option is used.  Some header files may notice this macro and refrain
1494 from declaring certain functions or defining certain macros that the
1495 ISO standard doesn't call for; this is to avoid interfering with any
1496 programs that might use these names for other things.
1497
1498 Functions that would normally be built in but do not have semantics
1499 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1500 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1501 built-in functions provided by GCC}, for details of the functions
1502 affected.
1503
1504 @item -std=
1505 @opindex std
1506 Determine the language standard. @xref{Standards,,Language Standards
1507 Supported by GCC}, for details of these standard versions.  This option
1508 is currently only supported when compiling C or C++.
1509
1510 The compiler can accept several base standards, such as @samp{c90} or
1511 @samp{c++98}, and GNU dialects of those standards, such as
1512 @samp{gnu90} or @samp{gnu++98}.  By specifying a base standard, the
1513 compiler will accept all programs following that standard and those
1514 using GNU extensions that do not contradict it.  For example,
1515 @samp{-std=c90} turns off certain features of GCC that are
1516 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1517 keywords, but not other GNU extensions that do not have a meaning in
1518 ISO C90, such as omitting the middle term of a @code{?:}
1519 expression. On the other hand, by specifying a GNU dialect of a
1520 standard, all features the compiler support are enabled, even when
1521 those features change the meaning of the base standard and some
1522 strict-conforming programs may be rejected.  The particular standard
1523 is used by @option{-pedantic} to identify which features are GNU
1524 extensions given that version of the standard. For example
1525 @samp{-std=gnu90 -pedantic} would warn about C++ style @samp{//}
1526 comments, while @samp{-std=gnu99 -pedantic} would not.
1527
1528 A value for this option must be provided; possible values are
1529
1530 @table @samp
1531 @item c90
1532 @itemx c89
1533 @itemx iso9899:1990
1534 Support all ISO C90 programs (certain GNU extensions that conflict
1535 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1536
1537 @item iso9899:199409
1538 ISO C90 as modified in amendment 1.
1539
1540 @item c99
1541 @itemx c9x
1542 @itemx iso9899:1999
1543 @itemx iso9899:199x
1544 ISO C99.  Note that this standard is not yet fully supported; see
1545 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1546 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1547
1548 @item c1x
1549 ISO C1X, the draft of the next revision of the ISO C standard.
1550 Support is limited and experimental and features enabled by this
1551 option may be changed or removed if changed in or removed from the
1552 standard draft.
1553
1554 @item gnu90
1555 @itemx gnu89
1556 GNU dialect of ISO C90 (including some C99 features). This
1557 is the default for C code.
1558
1559 @item gnu99
1560 @itemx gnu9x
1561 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1562 this will become the default.  The name @samp{gnu9x} is deprecated.
1563
1564 @item gnu1x
1565 GNU dialect of ISO C1X.  Support is limited and experimental and
1566 features enabled by this option may be changed or removed if changed
1567 in or removed from the standard draft.
1568
1569 @item c++98
1570 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1571 C++ code.
1572
1573 @item gnu++98
1574 GNU dialect of @option{-std=c++98}.  This is the default for
1575 C++ code.
1576
1577 @item c++11
1578 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1579 experimental, and may change in incompatible ways in future releases.
1580
1581 @item gnu++11
1582 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1583 experimental, and may change in incompatible ways in future releases.
1584 @end table
1585
1586 @item -fgnu89-inline
1587 @opindex fgnu89-inline
1588 The option @option{-fgnu89-inline} tells GCC to use the traditional
1589 GNU semantics for @code{inline} functions when in C99 mode.
1590 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1591 is accepted and ignored by GCC versions 4.1.3 up to but not including
1592 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1593 C99 mode.  Using this option is roughly equivalent to adding the
1594 @code{gnu_inline} function attribute to all inline functions
1595 (@pxref{Function Attributes}).
1596
1597 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1598 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1599 specifies the default behavior).  This option was first supported in
1600 GCC 4.3.  This option is not supported in @option{-std=c90} or
1601 @option{-std=gnu90} mode.
1602
1603 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1604 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1605 in effect for @code{inline} functions.  @xref{Common Predefined
1606 Macros,,,cpp,The C Preprocessor}.
1607
1608 @item -aux-info @var{filename}
1609 @opindex aux-info
1610 Output to the given filename prototyped declarations for all functions
1611 declared and/or defined in a translation unit, including those in header
1612 files.  This option is silently ignored in any language other than C@.
1613
1614 Besides declarations, the file indicates, in comments, the origin of
1615 each declaration (source file and line), whether the declaration was
1616 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1617 @samp{O} for old, respectively, in the first character after the line
1618 number and the colon), and whether it came from a declaration or a
1619 definition (@samp{C} or @samp{F}, respectively, in the following
1620 character).  In the case of function definitions, a K&R-style list of
1621 arguments followed by their declarations is also provided, inside
1622 comments, after the declaration.
1623
1624 @item -fallow-parameterless-variadic-functions
1625 Accept variadic functions without named parameters.
1626
1627 Although it is possible to define such a function, this is not very
1628 useful as it is not possible to read the arguments.  This is only
1629 supported for C as this construct is allowed by C++.
1630
1631 @item -fno-asm
1632 @opindex fno-asm
1633 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1634 keyword, so that code can use these words as identifiers.  You can use
1635 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1636 instead.  @option{-ansi} implies @option{-fno-asm}.
1637
1638 In C++, this switch only affects the @code{typeof} keyword, since
1639 @code{asm} and @code{inline} are standard keywords.  You may want to
1640 use the @option{-fno-gnu-keywords} flag instead, which has the same
1641 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1642 switch only affects the @code{asm} and @code{typeof} keywords, since
1643 @code{inline} is a standard keyword in ISO C99.
1644
1645 @item -fno-builtin
1646 @itemx -fno-builtin-@var{function}
1647 @opindex fno-builtin
1648 @cindex built-in functions
1649 Don't recognize built-in functions that do not begin with
1650 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1651 functions provided by GCC}, for details of the functions affected,
1652 including those which are not built-in functions when @option{-ansi} or
1653 @option{-std} options for strict ISO C conformance are used because they
1654 do not have an ISO standard meaning.
1655
1656 GCC normally generates special code to handle certain built-in functions
1657 more efficiently; for instance, calls to @code{alloca} may become single
1658 instructions that adjust the stack directly, and calls to @code{memcpy}
1659 may become inline copy loops.  The resulting code is often both smaller
1660 and faster, but since the function calls no longer appear as such, you
1661 cannot set a breakpoint on those calls, nor can you change the behavior
1662 of the functions by linking with a different library.  In addition,
1663 when a function is recognized as a built-in function, GCC may use
1664 information about that function to warn about problems with calls to
1665 that function, or to generate more efficient code, even if the
1666 resulting code still contains calls to that function.  For example,
1667 warnings are given with @option{-Wformat} for bad calls to
1668 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1669 known not to modify global memory.
1670
1671 With the @option{-fno-builtin-@var{function}} option
1672 only the built-in function @var{function} is
1673 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1674 function is named that is not built-in in this version of GCC, this
1675 option is ignored.  There is no corresponding
1676 @option{-fbuiltin-@var{function}} option; if you wish to enable
1677 built-in functions selectively when using @option{-fno-builtin} or
1678 @option{-ffreestanding}, you may define macros such as:
1679
1680 @smallexample
1681 #define abs(n)          __builtin_abs ((n))
1682 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1683 @end smallexample
1684
1685 @item -fhosted
1686 @opindex fhosted
1687 @cindex hosted environment
1688
1689 Assert that compilation takes place in a hosted environment.  This implies
1690 @option{-fbuiltin}.  A hosted environment is one in which the
1691 entire standard library is available, and in which @code{main} has a return
1692 type of @code{int}.  Examples are nearly everything except a kernel.
1693 This is equivalent to @option{-fno-freestanding}.
1694
1695 @item -ffreestanding
1696 @opindex ffreestanding
1697 @cindex hosted environment
1698
1699 Assert that compilation takes place in a freestanding environment.  This
1700 implies @option{-fno-builtin}.  A freestanding environment
1701 is one in which the standard library may not exist, and program startup may
1702 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1703 This is equivalent to @option{-fno-hosted}.
1704
1705 @xref{Standards,,Language Standards Supported by GCC}, for details of
1706 freestanding and hosted environments.
1707
1708 @item -fopenmp
1709 @opindex fopenmp
1710 @cindex OpenMP parallel
1711 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1712 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1713 compiler generates parallel code according to the OpenMP Application
1714 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1715 implies @option{-pthread}, and thus is only supported on targets that
1716 have support for @option{-pthread}.
1717
1718 @item -fms-extensions
1719 @opindex fms-extensions
1720 Accept some non-standard constructs used in Microsoft header files.
1721
1722 In C++ code, this allows member names in structures to be similar
1723 to previous types declarations.
1724
1725 @smallexample
1726 typedef int UOW;
1727 struct ABC @{
1728   UOW UOW;
1729 @};
1730 @end smallexample
1731
1732 Some cases of unnamed fields in structures and unions are only
1733 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1734 fields within structs/unions}, for details.
1735
1736 @item -fplan9-extensions
1737 Accept some non-standard constructs used in Plan 9 code.
1738
1739 This enables @option{-fms-extensions}, permits passing pointers to
1740 structures with anonymous fields to functions which expect pointers to
1741 elements of the type of the field, and permits referring to anonymous
1742 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1743 struct/union fields within structs/unions}, for details.  This is only
1744 supported for C, not C++.
1745
1746 @item -trigraphs
1747 @opindex trigraphs
1748 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1749 options for strict ISO C conformance) implies @option{-trigraphs}.
1750
1751 @item -no-integrated-cpp
1752 @opindex no-integrated-cpp
1753 Performs a compilation in two passes: preprocessing and compiling.  This
1754 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1755 @option{-B} option.  The user supplied compilation step can then add in
1756 an additional preprocessing step after normal preprocessing but before
1757 compiling.  The default is to use the integrated cpp (internal cpp)
1758
1759 The semantics of this option will change if "cc1", "cc1plus", and
1760 "cc1obj" are merged.
1761
1762 @cindex traditional C language
1763 @cindex C language, traditional
1764 @item -traditional
1765 @itemx -traditional-cpp
1766 @opindex traditional-cpp
1767 @opindex traditional
1768 Formerly, these options caused GCC to attempt to emulate a pre-standard
1769 C compiler.  They are now only supported with the @option{-E} switch.
1770 The preprocessor continues to support a pre-standard mode.  See the GNU
1771 CPP manual for details.
1772
1773 @item -fcond-mismatch
1774 @opindex fcond-mismatch
1775 Allow conditional expressions with mismatched types in the second and
1776 third arguments.  The value of such an expression is void.  This option
1777 is not supported for C++.
1778
1779 @item -flax-vector-conversions
1780 @opindex flax-vector-conversions
1781 Allow implicit conversions between vectors with differing numbers of
1782 elements and/or incompatible element types.  This option should not be
1783 used for new code.
1784
1785 @item -funsigned-char
1786 @opindex funsigned-char
1787 Let the type @code{char} be unsigned, like @code{unsigned char}.
1788
1789 Each kind of machine has a default for what @code{char} should
1790 be.  It is either like @code{unsigned char} by default or like
1791 @code{signed char} by default.
1792
1793 Ideally, a portable program should always use @code{signed char} or
1794 @code{unsigned char} when it depends on the signedness of an object.
1795 But many programs have been written to use plain @code{char} and
1796 expect it to be signed, or expect it to be unsigned, depending on the
1797 machines they were written for.  This option, and its inverse, let you
1798 make such a program work with the opposite default.
1799
1800 The type @code{char} is always a distinct type from each of
1801 @code{signed char} or @code{unsigned char}, even though its behavior
1802 is always just like one of those two.
1803
1804 @item -fsigned-char
1805 @opindex fsigned-char
1806 Let the type @code{char} be signed, like @code{signed char}.
1807
1808 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1809 the negative form of @option{-funsigned-char}.  Likewise, the option
1810 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1811
1812 @item -fsigned-bitfields
1813 @itemx -funsigned-bitfields
1814 @itemx -fno-signed-bitfields
1815 @itemx -fno-unsigned-bitfields
1816 @opindex fsigned-bitfields
1817 @opindex funsigned-bitfields
1818 @opindex fno-signed-bitfields
1819 @opindex fno-unsigned-bitfields
1820 These options control whether a bit-field is signed or unsigned, when the
1821 declaration does not use either @code{signed} or @code{unsigned}.  By
1822 default, such a bit-field is signed, because this is consistent: the
1823 basic integer types such as @code{int} are signed types.
1824 @end table
1825
1826 @node C++ Dialect Options
1827 @section Options Controlling C++ Dialect
1828
1829 @cindex compiler options, C++
1830 @cindex C++ options, command line
1831 @cindex options, C++
1832 This section describes the command-line options that are only meaningful
1833 for C++ programs; but you can also use most of the GNU compiler options
1834 regardless of what language your program is in.  For example, you
1835 might compile a file @code{firstClass.C} like this:
1836
1837 @smallexample
1838 g++ -g -frepo -O -c firstClass.C
1839 @end smallexample
1840
1841 @noindent
1842 In this example, only @option{-frepo} is an option meant
1843 only for C++ programs; you can use the other options with any
1844 language supported by GCC@.
1845
1846 Here is a list of options that are @emph{only} for compiling C++ programs:
1847
1848 @table @gcctabopt
1849
1850 @item -fabi-version=@var{n}
1851 @opindex fabi-version
1852 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1853 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1854 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1855 the version that conforms most closely to the C++ ABI specification.
1856 Therefore, the ABI obtained using version 0 will change as ABI bugs
1857 are fixed.
1858
1859 The default is version 2.
1860
1861 Version 3 corrects an error in mangling a constant address as a
1862 template argument.
1863
1864 Version 4 implements a standard mangling for vector types.
1865
1866 Version 5 corrects the mangling of attribute const/volatile on
1867 function pointer types, decltype of a plain decl, and use of a
1868 function parameter in the declaration of another parameter.
1869
1870 Version 6 corrects the promotion behavior of C++11 scoped enums.
1871
1872 See also @option{-Wabi}.
1873
1874 @item -fno-access-control
1875 @opindex fno-access-control
1876 Turn off all access checking.  This switch is mainly useful for working
1877 around bugs in the access control code.
1878
1879 @item -fcheck-new
1880 @opindex fcheck-new
1881 Check that the pointer returned by @code{operator new} is non-null
1882 before attempting to modify the storage allocated.  This check is
1883 normally unnecessary because the C++ standard specifies that
1884 @code{operator new} will only return @code{0} if it is declared
1885 @samp{throw()}, in which case the compiler will always check the
1886 return value even without this option.  In all other cases, when
1887 @code{operator new} has a non-empty exception specification, memory
1888 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1889 @samp{new (nothrow)}.
1890
1891 @item -fconserve-space
1892 @opindex fconserve-space
1893 Put uninitialized or runtime-initialized global variables into the
1894 common segment, as C does.  This saves space in the executable at the
1895 cost of not diagnosing duplicate definitions.  If you compile with this
1896 flag and your program mysteriously crashes after @code{main()} has
1897 completed, you may have an object that is being destroyed twice because
1898 two definitions were merged.
1899
1900 This option is no longer useful on most targets, now that support has
1901 been added for putting variables into BSS without making them common.
1902
1903 @item -fconstexpr-depth=@var{n}
1904 @opindex fconstexpr-depth
1905 Set the maximum nested evaluation depth for C++11 constexpr functions
1906 to @var{n}.  A limit is needed to detect endless recursion during
1907 constant expression evaluation.  The minimum specified by the standard
1908 is 512.
1909
1910 @item -fdeduce-init-list
1911 @opindex fdeduce-init-list
1912 Enable deduction of a template type parameter as
1913 std::initializer_list from a brace-enclosed initializer list, i.e.
1914
1915 @smallexample
1916 template <class T> auto forward(T t) -> decltype (realfn (t))
1917 @{
1918   return realfn (t);
1919 @}
1920
1921 void f()
1922 @{
1923   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1924 @}
1925 @end smallexample
1926
1927 This deduction was implemented as a possible extension to the
1928 originally proposed semantics for the C++11 standard, but was not part
1929 of the final standard, so it is disabled by default.  This option is
1930 deprecated, and may be removed in a future version of G++.
1931
1932 @item -ffriend-injection
1933 @opindex ffriend-injection
1934 Inject friend functions into the enclosing namespace, so that they are
1935 visible outside the scope of the class in which they are declared.
1936 Friend functions were documented to work this way in the old Annotated
1937 C++ Reference Manual, and versions of G++ before 4.1 always worked
1938 that way.  However, in ISO C++ a friend function which is not declared
1939 in an enclosing scope can only be found using argument dependent
1940 lookup.  This option causes friends to be injected as they were in
1941 earlier releases.
1942
1943 This option is for compatibility, and may be removed in a future
1944 release of G++.
1945
1946 @item -fno-elide-constructors
1947 @opindex fno-elide-constructors
1948 The C++ standard allows an implementation to omit creating a temporary
1949 which is only used to initialize another object of the same type.
1950 Specifying this option disables that optimization, and forces G++ to
1951 call the copy constructor in all cases.
1952
1953 @item -fno-enforce-eh-specs
1954 @opindex fno-enforce-eh-specs
1955 Don't generate code to check for violation of exception specifications
1956 at runtime.  This option violates the C++ standard, but may be useful
1957 for reducing code size in production builds, much like defining
1958 @samp{NDEBUG}.  This does not give user code permission to throw
1959 exceptions in violation of the exception specifications; the compiler
1960 will still optimize based on the specifications, so throwing an
1961 unexpected exception will result in undefined behavior.
1962
1963 @item -ffor-scope
1964 @itemx -fno-for-scope
1965 @opindex ffor-scope
1966 @opindex fno-for-scope
1967 If @option{-ffor-scope} is specified, the scope of variables declared in
1968 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1969 as specified by the C++ standard.
1970 If @option{-fno-for-scope} is specified, the scope of variables declared in
1971 a @i{for-init-statement} extends to the end of the enclosing scope,
1972 as was the case in old versions of G++, and other (traditional)
1973 implementations of C++.
1974
1975 The default if neither flag is given to follow the standard,
1976 but to allow and give a warning for old-style code that would
1977 otherwise be invalid, or have different behavior.
1978
1979 @item -fno-gnu-keywords
1980 @opindex fno-gnu-keywords
1981 Do not recognize @code{typeof} as a keyword, so that code can use this
1982 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1983 @option{-ansi} implies @option{-fno-gnu-keywords}.
1984
1985 @item -fno-implicit-templates
1986 @opindex fno-implicit-templates
1987 Never emit code for non-inline templates which are instantiated
1988 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1989 @xref{Template Instantiation}, for more information.
1990
1991 @item -fno-implicit-inline-templates
1992 @opindex fno-implicit-inline-templates
1993 Don't emit code for implicit instantiations of inline templates, either.
1994 The default is to handle inlines differently so that compiles with and
1995 without optimization will need the same set of explicit instantiations.
1996
1997 @item -fno-implement-inlines
1998 @opindex fno-implement-inlines
1999 To save space, do not emit out-of-line copies of inline functions
2000 controlled by @samp{#pragma implementation}.  This will cause linker
2001 errors if these functions are not inlined everywhere they are called.
2002
2003 @item -fms-extensions
2004 @opindex fms-extensions
2005 Disable pedantic warnings about constructs used in MFC, such as implicit
2006 int and getting a pointer to member function via non-standard syntax.
2007
2008 @item -fno-nonansi-builtins
2009 @opindex fno-nonansi-builtins
2010 Disable built-in declarations of functions that are not mandated by
2011 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2012 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2013
2014 @item -fnothrow-opt
2015 @opindex fnothrow-opt
2016 Treat a @code{throw()} exception specification as though it were a
2017 @code{noexcept} specification to reduce or eliminate the text size
2018 overhead relative to a function with no exception specification.  If
2019 the function has local variables of types with non-trivial
2020 destructors, the exception specification will actually make the
2021 function smaller because the EH cleanups for those variables can be
2022 optimized away.  The semantic effect is that an exception thrown out of
2023 a function with such an exception specification will result in a call
2024 to @code{terminate} rather than @code{unexpected}.
2025
2026 @item -fno-operator-names
2027 @opindex fno-operator-names
2028 Do not treat the operator name keywords @code{and}, @code{bitand},
2029 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2030 synonyms as keywords.
2031
2032 @item -fno-optional-diags
2033 @opindex fno-optional-diags
2034 Disable diagnostics that the standard says a compiler does not need to
2035 issue.  Currently, the only such diagnostic issued by G++ is the one for
2036 a name having multiple meanings within a class.
2037
2038 @item -fpermissive
2039 @opindex fpermissive
2040 Downgrade some diagnostics about nonconformant code from errors to
2041 warnings.  Thus, using @option{-fpermissive} will allow some
2042 nonconforming code to compile.
2043
2044 @item -fno-pretty-templates
2045 @opindex fno-pretty-templates
2046 When an error message refers to a specialization of a function
2047 template, the compiler will normally print the signature of the
2048 template followed by the template arguments and any typedefs or
2049 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2050 rather than @code{void f(int)}) so that it's clear which template is
2051 involved.  When an error message refers to a specialization of a class
2052 template, the compiler will omit any template arguments which match
2053 the default template arguments for that template.  If either of these
2054 behaviors make it harder to understand the error message rather than
2055 easier, using @option{-fno-pretty-templates} will disable them.
2056
2057 @item -frepo
2058 @opindex frepo
2059 Enable automatic template instantiation at link time.  This option also
2060 implies @option{-fno-implicit-templates}.  @xref{Template
2061 Instantiation}, for more information.
2062
2063 @item -fno-rtti
2064 @opindex fno-rtti
2065 Disable generation of information about every class with virtual
2066 functions for use by the C++ runtime type identification features
2067 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2068 of the language, you can save some space by using this flag.  Note that
2069 exception handling uses the same information, but it will generate it as
2070 needed. The @samp{dynamic_cast} operator can still be used for casts that
2071 do not require runtime type information, i.e.@: casts to @code{void *} or to
2072 unambiguous base classes.
2073
2074 @item -fstats
2075 @opindex fstats
2076 Emit statistics about front-end processing at the end of the compilation.
2077 This information is generally only useful to the G++ development team.
2078
2079 @item -fstrict-enums
2080 @opindex fstrict-enums
2081 Allow the compiler to optimize using the assumption that a value of
2082 enumeration type can only be one of the values of the enumeration (as
2083 defined in the C++ standard; basically, a value which can be
2084 represented in the minimum number of bits needed to represent all the
2085 enumerators).  This assumption may not be valid if the program uses a
2086 cast to convert an arbitrary integer value to the enumeration type.
2087
2088 @item -ftemplate-depth=@var{n}
2089 @opindex ftemplate-depth
2090 Set the maximum instantiation depth for template classes to @var{n}.
2091 A limit on the template instantiation depth is needed to detect
2092 endless recursions during template class instantiation.  ANSI/ISO C++
2093 conforming programs must not rely on a maximum depth greater than 17
2094 (changed to 1024 in C++11).  The default value is 900, as the compiler
2095 can run out of stack space before hitting 1024 in some situations.
2096
2097 @item -fno-threadsafe-statics
2098 @opindex fno-threadsafe-statics
2099 Do not emit the extra code to use the routines specified in the C++
2100 ABI for thread-safe initialization of local statics.  You can use this
2101 option to reduce code size slightly in code that doesn't need to be
2102 thread-safe.
2103
2104 @item -fuse-cxa-atexit
2105 @opindex fuse-cxa-atexit
2106 Register destructors for objects with static storage duration with the
2107 @code{__cxa_atexit} function rather than the @code{atexit} function.
2108 This option is required for fully standards-compliant handling of static
2109 destructors, but will only work if your C library supports
2110 @code{__cxa_atexit}.
2111
2112 @item -fno-use-cxa-get-exception-ptr
2113 @opindex fno-use-cxa-get-exception-ptr
2114 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2115 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
2116 if the runtime routine is not available.
2117
2118 @item -fvisibility-inlines-hidden
2119 @opindex fvisibility-inlines-hidden
2120 This switch declares that the user does not attempt to compare
2121 pointers to inline functions or methods where the addresses of the two functions
2122 were taken in different shared objects.
2123
2124 The effect of this is that GCC may, effectively, mark inline methods with
2125 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2126 appear in the export table of a DSO and do not require a PLT indirection
2127 when used within the DSO@.  Enabling this option can have a dramatic effect
2128 on load and link times of a DSO as it massively reduces the size of the
2129 dynamic export table when the library makes heavy use of templates.
2130
2131 The behavior of this switch is not quite the same as marking the
2132 methods as hidden directly, because it does not affect static variables
2133 local to the function or cause the compiler to deduce that
2134 the function is defined in only one shared object.
2135
2136 You may mark a method as having a visibility explicitly to negate the
2137 effect of the switch for that method.  For example, if you do want to
2138 compare pointers to a particular inline method, you might mark it as
2139 having default visibility.  Marking the enclosing class with explicit
2140 visibility will have no effect.
2141
2142 Explicitly instantiated inline methods are unaffected by this option
2143 as their linkage might otherwise cross a shared library boundary.
2144 @xref{Template Instantiation}.
2145
2146 @item -fvisibility-ms-compat
2147 @opindex fvisibility-ms-compat
2148 This flag attempts to use visibility settings to make GCC's C++
2149 linkage model compatible with that of Microsoft Visual Studio.
2150
2151 The flag makes these changes to GCC's linkage model:
2152
2153 @enumerate
2154 @item
2155 It sets the default visibility to @code{hidden}, like
2156 @option{-fvisibility=hidden}.
2157
2158 @item
2159 Types, but not their members, are not hidden by default.
2160
2161 @item
2162 The One Definition Rule is relaxed for types without explicit
2163 visibility specifications which are defined in more than one different
2164 shared object: those declarations are permitted if they would have
2165 been permitted when this option was not used.
2166 @end enumerate
2167
2168 In new code it is better to use @option{-fvisibility=hidden} and
2169 export those classes which are intended to be externally visible.
2170 Unfortunately it is possible for code to rely, perhaps accidentally,
2171 on the Visual Studio behavior.
2172
2173 Among the consequences of these changes are that static data members
2174 of the same type with the same name but defined in different shared
2175 objects will be different, so changing one will not change the other;
2176 and that pointers to function members defined in different shared
2177 objects may not compare equal.  When this flag is given, it is a
2178 violation of the ODR to define types with the same name differently.
2179
2180 @item -fno-weak
2181 @opindex fno-weak
2182 Do not use weak symbol support, even if it is provided by the linker.
2183 By default, G++ will use weak symbols if they are available.  This
2184 option exists only for testing, and should not be used by end-users;
2185 it will result in inferior code and has no benefits.  This option may
2186 be removed in a future release of G++.
2187
2188 @item -nostdinc++
2189 @opindex nostdinc++
2190 Do not search for header files in the standard directories specific to
2191 C++, but do still search the other standard directories.  (This option
2192 is used when building the C++ library.)
2193 @end table
2194
2195 In addition, these optimization, warning, and code generation options
2196 have meanings only for C++ programs:
2197
2198 @table @gcctabopt
2199 @item -fno-default-inline
2200 @opindex fno-default-inline
2201 Do not assume @samp{inline} for functions defined inside a class scope.
2202 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2203 functions will have linkage like inline functions; they just won't be
2204 inlined by default.
2205
2206 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2207 @opindex Wabi
2208 @opindex Wno-abi
2209 Warn when G++ generates code that is probably not compatible with the
2210 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2211 all such cases, there are probably some cases that are not warned about,
2212 even though G++ is generating incompatible code.  There may also be
2213 cases where warnings are emitted even though the code that is generated
2214 will be compatible.
2215
2216 You should rewrite your code to avoid these warnings if you are
2217 concerned about the fact that code generated by G++ may not be binary
2218 compatible with code generated by other compilers.
2219
2220 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2221
2222 @itemize @bullet
2223
2224 @item
2225 A template with a non-type template parameter of reference type is
2226 mangled incorrectly:
2227 @smallexample
2228 extern int N;
2229 template <int &> struct S @{@};
2230 void n (S<N>) @{2@}
2231 @end smallexample
2232
2233 This is fixed in @option{-fabi-version=3}.
2234
2235 @item
2236 SIMD vector types declared using @code{__attribute ((vector_size))} are
2237 mangled in a non-standard way that does not allow for overloading of
2238 functions taking vectors of different sizes.
2239
2240 The mangling is changed in @option{-fabi-version=4}.
2241 @end itemize
2242
2243 The known incompatibilities in @option{-fabi-version=1} include:
2244
2245 @itemize @bullet
2246
2247 @item
2248 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2249 pack data into the same byte as a base class.  For example:
2250
2251 @smallexample
2252 struct A @{ virtual void f(); int f1 : 1; @};
2253 struct B : public A @{ int f2 : 1; @};
2254 @end smallexample
2255
2256 @noindent
2257 In this case, G++ will place @code{B::f2} into the same byte
2258 as@code{A::f1}; other compilers will not.  You can avoid this problem
2259 by explicitly padding @code{A} so that its size is a multiple of the
2260 byte size on your platform; that will cause G++ and other compilers to
2261 layout @code{B} identically.
2262
2263 @item
2264 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2265 tail padding when laying out virtual bases.  For example:
2266
2267 @smallexample
2268 struct A @{ virtual void f(); char c1; @};
2269 struct B @{ B(); char c2; @};
2270 struct C : public A, public virtual B @{@};
2271 @end smallexample
2272
2273 @noindent
2274 In this case, G++ will not place @code{B} into the tail-padding for
2275 @code{A}; other compilers will.  You can avoid this problem by
2276 explicitly padding @code{A} so that its size is a multiple of its
2277 alignment (ignoring virtual base classes); that will cause G++ and other
2278 compilers to layout @code{C} identically.
2279
2280 @item
2281 Incorrect handling of bit-fields with declared widths greater than that
2282 of their underlying types, when the bit-fields appear in a union.  For
2283 example:
2284
2285 @smallexample
2286 union U @{ int i : 4096; @};
2287 @end smallexample
2288
2289 @noindent
2290 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2291 union too small by the number of bits in an @code{int}.
2292
2293 @item
2294 Empty classes can be placed at incorrect offsets.  For example:
2295
2296 @smallexample
2297 struct A @{@};
2298
2299 struct B @{
2300   A a;
2301   virtual void f ();
2302 @};
2303
2304 struct C : public B, public A @{@};
2305 @end smallexample
2306
2307 @noindent
2308 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2309 it should be placed at offset zero.  G++ mistakenly believes that the
2310 @code{A} data member of @code{B} is already at offset zero.
2311
2312 @item
2313 Names of template functions whose types involve @code{typename} or
2314 template template parameters can be mangled incorrectly.
2315
2316 @smallexample
2317 template <typename Q>
2318 void f(typename Q::X) @{@}
2319
2320 template <template <typename> class Q>
2321 void f(typename Q<int>::X) @{@}
2322 @end smallexample
2323
2324 @noindent
2325 Instantiations of these templates may be mangled incorrectly.
2326
2327 @end itemize
2328
2329 It also warns psABI related changes.  The known psABI changes at this
2330 point include:
2331
2332 @itemize @bullet
2333
2334 @item
2335 For SYSV/x86-64, when passing union with long double, it is changed to
2336 pass in memory as specified in psABI.  For example:
2337
2338 @smallexample
2339 union U @{
2340   long double ld;
2341   int i;
2342 @};
2343 @end smallexample
2344
2345 @noindent
2346 @code{union U} will always be passed in memory.
2347
2348 @end itemize
2349
2350 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2351 @opindex Wctor-dtor-privacy
2352 @opindex Wno-ctor-dtor-privacy
2353 Warn when a class seems unusable because all the constructors or
2354 destructors in that class are private, and it has neither friends nor
2355 public static member functions.
2356
2357 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2358 @opindex Wdelete-non-virtual-dtor
2359 @opindex Wno-delete-non-virtual-dtor
2360 Warn when @samp{delete} is used to destroy an instance of a class which
2361 has virtual functions and non-virtual destructor. It is unsafe to delete
2362 an instance of a derived class through a pointer to a base class if the
2363 base class does not have a virtual destructor.  This warning is enabled
2364 by @option{-Wall}.
2365
2366 @item -Wno-narrowing @r{(C++ and Objective-C++ only)}
2367 @opindex Wnarrowing
2368 @opindex Wno-narrowing
2369 With -std=c++11, suppress the diagnostic required by the standard for
2370 narrowing conversions within @samp{@{ @}}, e.g.
2371
2372 @smallexample
2373 int i = @{ 2.2 @}; // error: narrowing from double to int
2374 @end smallexample
2375
2376 This flag can be useful for compiling valid C++98 code in C++11 mode.
2377
2378 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2379 @opindex Wnoexcept
2380 @opindex Wno-noexcept
2381 Warn when a noexcept-expression evaluates to false because of a call
2382 to a function that does not have a non-throwing exception
2383 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2384 the compiler to never throw an exception.
2385
2386 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2387 @opindex Wnon-virtual-dtor
2388 @opindex Wno-non-virtual-dtor
2389 Warn when a class has virtual functions and accessible non-virtual
2390 destructor, in which case it would be possible but unsafe to delete
2391 an instance of a derived class through a pointer to the base class.
2392 This warning is also enabled if -Weffc++ is specified.
2393
2394 @item -Wreorder @r{(C++ and Objective-C++ only)}
2395 @opindex Wreorder
2396 @opindex Wno-reorder
2397 @cindex reordering, warning
2398 @cindex warning for reordering of member initializers
2399 Warn when the order of member initializers given in the code does not
2400 match the order in which they must be executed.  For instance:
2401
2402 @smallexample
2403 struct A @{
2404   int i;
2405   int j;
2406   A(): j (0), i (1) @{ @}
2407 @};
2408 @end smallexample
2409
2410 The compiler will rearrange the member initializers for @samp{i}
2411 and @samp{j} to match the declaration order of the members, emitting
2412 a warning to that effect.  This warning is enabled by @option{-Wall}.
2413 @end table
2414
2415 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2416
2417 @table @gcctabopt
2418 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2419 @opindex Weffc++
2420 @opindex Wno-effc++
2421 Warn about violations of the following style guidelines from Scott Meyers'
2422 @cite{Effective C++} book:
2423
2424 @itemize @bullet
2425 @item
2426 Item 11:  Define a copy constructor and an assignment operator for classes
2427 with dynamically allocated memory.
2428
2429 @item
2430 Item 12:  Prefer initialization to assignment in constructors.
2431
2432 @item
2433 Item 14:  Make destructors virtual in base classes.
2434
2435 @item
2436 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2437
2438 @item
2439 Item 23:  Don't try to return a reference when you must return an object.
2440
2441 @end itemize
2442
2443 Also warn about violations of the following style guidelines from
2444 Scott Meyers' @cite{More Effective C++} book:
2445
2446 @itemize @bullet
2447 @item
2448 Item 6:  Distinguish between prefix and postfix forms of increment and
2449 decrement operators.
2450
2451 @item
2452 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2453
2454 @end itemize
2455
2456 When selecting this option, be aware that the standard library
2457 headers do not obey all of these guidelines; use @samp{grep -v}
2458 to filter out those warnings.
2459
2460 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2461 @opindex Wstrict-null-sentinel
2462 @opindex Wno-strict-null-sentinel
2463 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2464 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2465 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2466 it is guaranteed to be of the same size as a pointer.  But this use is
2467 not portable across different compilers.
2468
2469 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2470 @opindex Wno-non-template-friend
2471 @opindex Wnon-template-friend
2472 Disable warnings when non-templatized friend functions are declared
2473 within a template.  Since the advent of explicit template specification
2474 support in G++, if the name of the friend is an unqualified-id (i.e.,
2475 @samp{friend foo(int)}), the C++ language specification demands that the
2476 friend declare or define an ordinary, nontemplate function.  (Section
2477 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2478 could be interpreted as a particular specialization of a templatized
2479 function.  Because this non-conforming behavior is no longer the default
2480 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2481 check existing code for potential trouble spots and is on by default.
2482 This new compiler behavior can be turned off with
2483 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2484 but disables the helpful warning.
2485
2486 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2487 @opindex Wold-style-cast
2488 @opindex Wno-old-style-cast
2489 Warn if an old-style (C-style) cast to a non-void type is used within
2490 a C++ program.  The new-style casts (@samp{dynamic_cast},
2491 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2492 less vulnerable to unintended effects and much easier to search for.
2493
2494 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2495 @opindex Woverloaded-virtual
2496 @opindex Wno-overloaded-virtual
2497 @cindex overloaded virtual function, warning
2498 @cindex warning for overloaded virtual function
2499 Warn when a function declaration hides virtual functions from a
2500 base class.  For example, in:
2501
2502 @smallexample
2503 struct A @{
2504   virtual void f();
2505 @};
2506
2507 struct B: public A @{
2508   void f(int);
2509 @};
2510 @end smallexample
2511
2512 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2513 like:
2514
2515 @smallexample
2516 B* b;
2517 b->f();
2518 @end smallexample
2519
2520 will fail to compile.
2521
2522 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2523 @opindex Wno-pmf-conversions
2524 @opindex Wpmf-conversions
2525 Disable the diagnostic for converting a bound pointer to member function
2526 to a plain pointer.
2527
2528 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2529 @opindex Wsign-promo
2530 @opindex Wno-sign-promo
2531 Warn when overload resolution chooses a promotion from unsigned or
2532 enumerated type to a signed type, over a conversion to an unsigned type of
2533 the same size.  Previous versions of G++ would try to preserve
2534 unsignedness, but the standard mandates the current behavior.
2535
2536 @smallexample
2537 struct A @{
2538   operator int ();
2539   A& operator = (int);
2540 @};
2541
2542 main ()
2543 @{
2544   A a,b;
2545   a = b;
2546 @}
2547 @end smallexample
2548
2549 In this example, G++ will synthesize a default @samp{A& operator =
2550 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2551 @end table
2552
2553 @node Objective-C and Objective-C++ Dialect Options
2554 @section Options Controlling Objective-C and Objective-C++ Dialects
2555
2556 @cindex compiler options, Objective-C and Objective-C++
2557 @cindex Objective-C and Objective-C++ options, command line
2558 @cindex options, Objective-C and Objective-C++
2559 (NOTE: This manual does not describe the Objective-C and Objective-C++
2560 languages themselves.  @xref{Standards,,Language Standards
2561 Supported by GCC}, for references.)
2562
2563 This section describes the command-line options that are only meaningful
2564 for Objective-C and Objective-C++ programs, but you can also use most of
2565 the language-independent GNU compiler options.
2566 For example, you might compile a file @code{some_class.m} like this:
2567
2568 @smallexample
2569 gcc -g -fgnu-runtime -O -c some_class.m
2570 @end smallexample
2571
2572 @noindent
2573 In this example, @option{-fgnu-runtime} is an option meant only for
2574 Objective-C and Objective-C++ programs; you can use the other options with
2575 any language supported by GCC@.
2576
2577 Note that since Objective-C is an extension of the C language, Objective-C
2578 compilations may also use options specific to the C front-end (e.g.,
2579 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2580 C++-specific options (e.g., @option{-Wabi}).
2581
2582 Here is a list of options that are @emph{only} for compiling Objective-C
2583 and Objective-C++ programs:
2584
2585 @table @gcctabopt
2586 @item -fconstant-string-class=@var{class-name}
2587 @opindex fconstant-string-class
2588 Use @var{class-name} as the name of the class to instantiate for each
2589 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2590 class name is @code{NXConstantString} if the GNU runtime is being used, and
2591 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2592 @option{-fconstant-cfstrings} option, if also present, will override the
2593 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2594 to be laid out as constant CoreFoundation strings.
2595
2596 @item -fgnu-runtime
2597 @opindex fgnu-runtime
2598 Generate object code compatible with the standard GNU Objective-C
2599 runtime.  This is the default for most types of systems.
2600
2601 @item -fnext-runtime
2602 @opindex fnext-runtime
2603 Generate output compatible with the NeXT runtime.  This is the default
2604 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2605 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2606 used.
2607
2608 @item -fno-nil-receivers
2609 @opindex fno-nil-receivers
2610 Assume that all Objective-C message dispatches (@code{[receiver
2611 message:arg]}) in this translation unit ensure that the receiver is
2612 not @code{nil}.  This allows for more efficient entry points in the
2613 runtime to be used.  This option is only available in conjunction with
2614 the NeXT runtime and ABI version 0 or 1.
2615
2616 @item -fobjc-abi-version=@var{n}
2617 @opindex fobjc-abi-version
2618 Use version @var{n} of the Objective-C ABI for the selected runtime.
2619 This option is currently supported only for the NeXT runtime.  In that
2620 case, Version 0 is the traditional (32-bit) ABI without support for
2621 properties and other Objective-C 2.0 additions.  Version 1 is the
2622 traditional (32-bit) ABI with support for properties and other
2623 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2624 nothing is specified, the default is Version 0 on 32-bit target
2625 machines, and Version 2 on 64-bit target machines.
2626
2627 @item -fobjc-call-cxx-cdtors
2628 @opindex fobjc-call-cxx-cdtors
2629 For each Objective-C class, check if any of its instance variables is a
2630 C++ object with a non-trivial default constructor.  If so, synthesize a
2631 special @code{- (id) .cxx_construct} instance method that will run
2632 non-trivial default constructors on any such instance variables, in order,
2633 and then return @code{self}.  Similarly, check if any instance variable
2634 is a C++ object with a non-trivial destructor, and if so, synthesize a
2635 special @code{- (void) .cxx_destruct} method that will run
2636 all such default destructors, in reverse order.
2637
2638 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2639 methods thusly generated will only operate on instance variables
2640 declared in the current Objective-C class, and not those inherited
2641 from superclasses.  It is the responsibility of the Objective-C
2642 runtime to invoke all such methods in an object's inheritance
2643 hierarchy.  The @code{- (id) .cxx_construct} methods will be invoked
2644 by the runtime immediately after a new object instance is allocated;
2645 the @code{- (void) .cxx_destruct} methods will be invoked immediately
2646 before the runtime deallocates an object instance.
2647
2648 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2649 support for invoking the @code{- (id) .cxx_construct} and
2650 @code{- (void) .cxx_destruct} methods.
2651
2652 @item -fobjc-direct-dispatch
2653 @opindex fobjc-direct-dispatch
2654 Allow fast jumps to the message dispatcher.  On Darwin this is
2655 accomplished via the comm page.
2656
2657 @item -fobjc-exceptions
2658 @opindex fobjc-exceptions
2659 Enable syntactic support for structured exception handling in
2660 Objective-C, similar to what is offered by C++ and Java.  This option
2661 is required to use the Objective-C keywords @code{@@try},
2662 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2663 @code{@@synchronized}.  This option is available with both the GNU
2664 runtime and the NeXT runtime (but not available in conjunction with
2665 the NeXT runtime on Mac OS X 10.2 and earlier).
2666
2667 @item -fobjc-gc
2668 @opindex fobjc-gc
2669 Enable garbage collection (GC) in Objective-C and Objective-C++
2670 programs.  This option is only available with the NeXT runtime; the
2671 GNU runtime has a different garbage collection implementation that
2672 does not require special compiler flags.
2673
2674 @item -fobjc-nilcheck
2675 @opindex fobjc-nilcheck
2676 For the NeXT runtime with version 2 of the ABI, check for a nil
2677 receiver in method invocations before doing the actual method call.
2678 This is the default and can be disabled using
2679 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2680 checked for nil in this way no matter what this flag is set to.
2681 Currently this flag does nothing when the GNU runtime, or an older
2682 version of the NeXT runtime ABI, is used.
2683
2684 @item -fobjc-std=objc1
2685 @opindex fobjc-std
2686 Conform to the language syntax of Objective-C 1.0, the language
2687 recognized by GCC 4.0.  This only affects the Objective-C additions to
2688 the C/C++ language; it does not affect conformance to C/C++ standards,
2689 which is controlled by the separate C/C++ dialect option flags.  When
2690 this option is used with the Objective-C or Objective-C++ compiler,
2691 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2692 This is useful if you need to make sure that your Objective-C code can
2693 be compiled with older versions of GCC.
2694
2695 @item -freplace-objc-classes
2696 @opindex freplace-objc-classes
2697 Emit a special marker instructing @command{ld(1)} not to statically link in
2698 the resulting object file, and allow @command{dyld(1)} to load it in at
2699 run time instead.  This is used in conjunction with the Fix-and-Continue
2700 debugging mode, where the object file in question may be recompiled and
2701 dynamically reloaded in the course of program execution, without the need
2702 to restart the program itself.  Currently, Fix-and-Continue functionality
2703 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2704 and later.
2705
2706 @item -fzero-link
2707 @opindex fzero-link
2708 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2709 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2710 compile time) with static class references that get initialized at load time,
2711 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2712 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2713 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2714 for individual class implementations to be modified during program execution.
2715 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2716 regardless of command line options.
2717
2718 @item -gen-decls
2719 @opindex gen-decls
2720 Dump interface declarations for all classes seen in the source file to a
2721 file named @file{@var{sourcename}.decl}.
2722
2723 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2724 @opindex Wassign-intercept
2725 @opindex Wno-assign-intercept
2726 Warn whenever an Objective-C assignment is being intercepted by the
2727 garbage collector.
2728
2729 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2730 @opindex Wno-protocol
2731 @opindex Wprotocol
2732 If a class is declared to implement a protocol, a warning is issued for
2733 every method in the protocol that is not implemented by the class.  The
2734 default behavior is to issue a warning for every method not explicitly
2735 implemented in the class, even if a method implementation is inherited
2736 from the superclass.  If you use the @option{-Wno-protocol} option, then
2737 methods inherited from the superclass are considered to be implemented,
2738 and no warning is issued for them.
2739
2740 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2741 @opindex Wselector
2742 @opindex Wno-selector
2743 Warn if multiple methods of different types for the same selector are
2744 found during compilation.  The check is performed on the list of methods
2745 in the final stage of compilation.  Additionally, a check is performed
2746 for each selector appearing in a @code{@@selector(@dots{})}
2747 expression, and a corresponding method for that selector has been found
2748 during compilation.  Because these checks scan the method table only at
2749 the end of compilation, these warnings are not produced if the final
2750 stage of compilation is not reached, for example because an error is
2751 found during compilation, or because the @option{-fsyntax-only} option is
2752 being used.
2753
2754 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2755 @opindex Wstrict-selector-match
2756 @opindex Wno-strict-selector-match
2757 Warn if multiple methods with differing argument and/or return types are
2758 found for a given selector when attempting to send a message using this
2759 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2760 is off (which is the default behavior), the compiler will omit such warnings
2761 if any differences found are confined to types which share the same size
2762 and alignment.
2763
2764 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2765 @opindex Wundeclared-selector
2766 @opindex Wno-undeclared-selector
2767 Warn if a @code{@@selector(@dots{})} expression referring to an
2768 undeclared selector is found.  A selector is considered undeclared if no
2769 method with that name has been declared before the
2770 @code{@@selector(@dots{})} expression, either explicitly in an
2771 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2772 an @code{@@implementation} section.  This option always performs its
2773 checks as soon as a @code{@@selector(@dots{})} expression is found,
2774 while @option{-Wselector} only performs its checks in the final stage of
2775 compilation.  This also enforces the coding style convention
2776 that methods and selectors must be declared before being used.
2777
2778 @item -print-objc-runtime-info
2779 @opindex print-objc-runtime-info
2780 Generate C header describing the largest structure that is passed by
2781 value, if any.
2782
2783 @end table
2784
2785 @node Language Independent Options
2786 @section Options to Control Diagnostic Messages Formatting
2787 @cindex options to control diagnostics formatting
2788 @cindex diagnostic messages
2789 @cindex message formatting
2790
2791 Traditionally, diagnostic messages have been formatted irrespective of
2792 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2793 below can be used to control the diagnostic messages formatting
2794 algorithm, e.g.@: how many characters per line, how often source location
2795 information should be reported.  Right now, only the C++ front end can
2796 honor these options.  However it is expected, in the near future, that
2797 the remaining front ends would be able to digest them correctly.
2798
2799 @table @gcctabopt
2800 @item -fmessage-length=@var{n}
2801 @opindex fmessage-length
2802 Try to format error messages so that they fit on lines of about @var{n}
2803 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2804 the front ends supported by GCC@.  If @var{n} is zero, then no
2805 line-wrapping will be done; each error message will appear on a single
2806 line.
2807
2808 @opindex fdiagnostics-show-location
2809 @item -fdiagnostics-show-location=once
2810 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2811 reporter to emit @emph{once} source location information; that is, in
2812 case the message is too long to fit on a single physical line and has to
2813 be wrapped, the source location won't be emitted (as prefix) again,
2814 over and over, in subsequent continuation lines.  This is the default
2815 behavior.
2816
2817 @item -fdiagnostics-show-location=every-line
2818 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2819 messages reporter to emit the same source location information (as
2820 prefix) for physical lines that result from the process of breaking
2821 a message which is too long to fit on a single line.
2822
2823 @item -fno-diagnostics-show-option
2824 @opindex fno-diagnostics-show-option
2825 @opindex fdiagnostics-show-option
2826 By default, each diagnostic emitted includes text which indicates the
2827 command line option that directly controls the diagnostic (if such an
2828 option is known to the diagnostic machinery).  Specifying the
2829 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2830
2831 @item -Wcoverage-mismatch
2832 @opindex Wcoverage-mismatch
2833 Warn if feedback profiles do not match when using the
2834 @option{-fprofile-use} option.
2835 If a source file was changed between @option{-fprofile-gen} and
2836 @option{-fprofile-use}, the files with the profile feedback can fail
2837 to match the source file and GCC can not use the profile feedback
2838 information.  By default, this warning is enabled and is treated as an
2839 error.  @option{-Wno-coverage-mismatch} can be used to disable the
2840 warning or @option{-Wno-error=coverage-mismatch} can be used to
2841 disable the error.  Disable the error for this warning can result in
2842 poorly optimized code, so disabling the error is useful only in the
2843 case of very minor changes such as bug fixes to an existing code-base.
2844 Completely disabling the warning is not recommended.
2845
2846 @end table
2847
2848 @node Warning Options
2849 @section Options to Request or Suppress Warnings
2850 @cindex options to control warnings
2851 @cindex warning messages
2852 @cindex messages, warning
2853 @cindex suppressing warnings
2854
2855 Warnings are diagnostic messages that report constructions which
2856 are not inherently erroneous but which are risky or suggest there
2857 may have been an error.
2858
2859 The following language-independent options do not enable specific
2860 warnings but control the kinds of diagnostics produced by GCC.
2861
2862 @table @gcctabopt
2863 @cindex syntax checking
2864 @item -fsyntax-only
2865 @opindex fsyntax-only
2866 Check the code for syntax errors, but don't do anything beyond that.
2867
2868 @item -fmax-errors=@var{n}
2869 @opindex fmax-errors
2870 Limits the maximum number of error messages to @var{n}, at which point
2871 GCC bails out rather than attempting to continue processing the source
2872 code.  If @var{n} is 0 (the default), there is no limit on the number
2873 of error messages produced.  If @option{-Wfatal-errors} is also
2874 specified, then @option{-Wfatal-errors} takes precedence over this
2875 option.
2876
2877 @item -w
2878 @opindex w
2879 Inhibit all warning messages.
2880
2881 @item -Werror
2882 @opindex Werror
2883 @opindex Wno-error
2884 Make all warnings into errors.
2885
2886 @item -Werror=
2887 @opindex Werror=
2888 @opindex Wno-error=
2889 Make the specified warning into an error.  The specifier for a warning
2890 is appended, for example @option{-Werror=switch} turns the warnings
2891 controlled by @option{-Wswitch} into errors.  This switch takes a
2892 negative form, to be used to negate @option{-Werror} for specific
2893 warnings, for example @option{-Wno-error=switch} makes
2894 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2895 is in effect.
2896
2897 The warning message for each controllable warning includes the
2898 option which controls the warning.  That option can then be used with
2899 @option{-Werror=} and @option{-Wno-error=} as described above.
2900 (Printing of the option in the warning message can be disabled using the
2901 @option{-fno-diagnostics-show-option} flag.)
2902
2903 Note that specifying @option{-Werror=}@var{foo} automatically implies
2904 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2905 imply anything.
2906
2907 @item -Wfatal-errors
2908 @opindex Wfatal-errors
2909 @opindex Wno-fatal-errors
2910 This option causes the compiler to abort compilation on the first error
2911 occurred rather than trying to keep going and printing further error
2912 messages.
2913
2914 @end table
2915
2916 You can request many specific warnings with options beginning
2917 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2918 implicit declarations.  Each of these specific warning options also
2919 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2920 example, @option{-Wno-implicit}.  This manual lists only one of the
2921 two forms, whichever is not the default.  For further,
2922 language-specific options also refer to @ref{C++ Dialect Options} and
2923 @ref{Objective-C and Objective-C++ Dialect Options}.
2924
2925 When an unrecognized warning option is requested (e.g.,
2926 @option{-Wunknown-warning}), GCC will emit a diagnostic stating
2927 that the option is not recognized.  However, if the @option{-Wno-} form
2928 is used, the behavior is slightly different: No diagnostic will be
2929 produced for @option{-Wno-unknown-warning} unless other diagnostics
2930 are being produced.  This allows the use of new @option{-Wno-} options
2931 with old compilers, but if something goes wrong, the compiler will
2932 warn that an unrecognized option was used.
2933
2934 @table @gcctabopt
2935 @item -pedantic
2936 @opindex pedantic
2937 Issue all the warnings demanded by strict ISO C and ISO C++;
2938 reject all programs that use forbidden extensions, and some other
2939 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2940 version of the ISO C standard specified by any @option{-std} option used.
2941
2942 Valid ISO C and ISO C++ programs should compile properly with or without
2943 this option (though a rare few will require @option{-ansi} or a
2944 @option{-std} option specifying the required version of ISO C)@.  However,
2945 without this option, certain GNU extensions and traditional C and C++
2946 features are supported as well.  With this option, they are rejected.
2947
2948 @option{-pedantic} does not cause warning messages for use of the
2949 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2950 warnings are also disabled in the expression that follows
2951 @code{__extension__}.  However, only system header files should use
2952 these escape routes; application programs should avoid them.
2953 @xref{Alternate Keywords}.
2954
2955 Some users try to use @option{-pedantic} to check programs for strict ISO
2956 C conformance.  They soon find that it does not do quite what they want:
2957 it finds some non-ISO practices, but not all---only those for which
2958 ISO C @emph{requires} a diagnostic, and some others for which
2959 diagnostics have been added.
2960
2961 A feature to report any failure to conform to ISO C might be useful in
2962 some instances, but would require considerable additional work and would
2963 be quite different from @option{-pedantic}.  We don't have plans to
2964 support such a feature in the near future.
2965
2966 Where the standard specified with @option{-std} represents a GNU
2967 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
2968 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2969 extended dialect is based.  Warnings from @option{-pedantic} are given
2970 where they are required by the base standard.  (It would not make sense
2971 for such warnings to be given only for features not in the specified GNU
2972 C dialect, since by definition the GNU dialects of C include all
2973 features the compiler supports with the given option, and there would be
2974 nothing to warn about.)
2975
2976 @item -pedantic-errors
2977 @opindex pedantic-errors
2978 Like @option{-pedantic}, except that errors are produced rather than
2979 warnings.
2980
2981 @item -Wall
2982 @opindex Wall
2983 @opindex Wno-all
2984 This enables all the warnings about constructions that some users
2985 consider questionable, and that are easy to avoid (or modify to
2986 prevent the warning), even in conjunction with macros.  This also
2987 enables some language-specific warnings described in @ref{C++ Dialect
2988 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2989
2990 @option{-Wall} turns on the following warning flags:
2991
2992 @gccoptlist{-Waddress   @gol
2993 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2994 -Wc++11-compat  @gol
2995 -Wchar-subscripts  @gol
2996 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2997 -Wimplicit-int @r{(C and Objective-C only)} @gol
2998 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
2999 -Wcomment  @gol
3000 -Wformat   @gol
3001 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3002 -Wmaybe-uninitialized @gol
3003 -Wmissing-braces  @gol
3004 -Wnonnull  @gol
3005 -Wparentheses  @gol
3006 -Wpointer-sign  @gol
3007 -Wreorder   @gol
3008 -Wreturn-type  @gol
3009 -Wsequence-point  @gol
3010 -Wsign-compare @r{(only in C++)}  @gol
3011 -Wstrict-aliasing  @gol
3012 -Wstrict-overflow=1  @gol
3013 -Wswitch  @gol
3014 -Wtrigraphs  @gol
3015 -Wuninitialized  @gol
3016 -Wunknown-pragmas  @gol
3017 -Wunused-function  @gol
3018 -Wunused-label     @gol
3019 -Wunused-value     @gol
3020 -Wunused-variable  @gol
3021 -Wvolatile-register-var @gol
3022 }
3023
3024 Note that some warning flags are not implied by @option{-Wall}.  Some of
3025 them warn about constructions that users generally do not consider
3026 questionable, but which occasionally you might wish to check for;
3027 others warn about constructions that are necessary or hard to avoid in
3028 some cases, and there is no simple way to modify the code to suppress
3029 the warning. Some of them are enabled by @option{-Wextra} but many of
3030 them must be enabled individually.
3031
3032 @item -Wextra
3033 @opindex W
3034 @opindex Wextra
3035 @opindex Wno-extra
3036 This enables some extra warning flags that are not enabled by
3037 @option{-Wall}. (This option used to be called @option{-W}.  The older
3038 name is still supported, but the newer name is more descriptive.)
3039
3040 @gccoptlist{-Wclobbered  @gol
3041 -Wempty-body  @gol
3042 -Wignored-qualifiers @gol
3043 -Wmissing-field-initializers  @gol
3044 -Wmissing-parameter-type @r{(C only)}  @gol
3045 -Wold-style-declaration @r{(C only)}  @gol
3046 -Woverride-init  @gol
3047 -Wsign-compare  @gol
3048 -Wtype-limits  @gol
3049 -Wuninitialized  @gol
3050 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3051 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3052 }
3053
3054 The option @option{-Wextra} also prints warning messages for the
3055 following cases:
3056
3057 @itemize @bullet
3058
3059 @item
3060 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3061 @samp{>}, or @samp{>=}.
3062
3063 @item
3064 (C++ only) An enumerator and a non-enumerator both appear in a
3065 conditional expression.
3066
3067 @item
3068 (C++ only) Ambiguous virtual bases.
3069
3070 @item
3071 (C++ only) Subscripting an array which has been declared @samp{register}.
3072
3073 @item
3074 (C++ only) Taking the address of a variable which has been declared
3075 @samp{register}.
3076
3077 @item
3078 (C++ only) A base class is not initialized in a derived class' copy
3079 constructor.
3080
3081 @end itemize
3082
3083 @item -Wchar-subscripts
3084 @opindex Wchar-subscripts
3085 @opindex Wno-char-subscripts
3086 Warn if an array subscript has type @code{char}.  This is a common cause
3087 of error, as programmers often forget that this type is signed on some
3088 machines.
3089 This warning is enabled by @option{-Wall}.
3090
3091 @item -Wcomment
3092 @opindex Wcomment
3093 @opindex Wno-comment
3094 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3095 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3096 This warning is enabled by @option{-Wall}.
3097
3098 @item -Wno-cpp
3099 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3100
3101 Suppress warning messages emitted by @code{#warning} directives.
3102
3103 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3104 @opindex Wdouble-promotion
3105 @opindex Wno-double-promotion
3106 Give a warning when a value of type @code{float} is implicitly
3107 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3108 floating-point unit implement @code{float} in hardware, but emulate
3109 @code{double} in software.  On such a machine, doing computations
3110 using @code{double} values is much more expensive because of the
3111 overhead required for software emulation.
3112
3113 It is easy to accidentally do computations with @code{double} because
3114 floating-point literals are implicitly of type @code{double}.  For
3115 example, in:
3116 @smallexample
3117 @group
3118 float area(float radius)
3119 @{
3120    return 3.14159 * radius * radius;
3121 @}
3122 @end group
3123 @end smallexample
3124 the compiler will perform the entire computation with @code{double}
3125 because the floating-point literal is a @code{double}.
3126
3127 @item -Wformat
3128 @opindex Wformat
3129 @opindex Wno-format
3130 @opindex ffreestanding
3131 @opindex fno-builtin
3132 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3133 the arguments supplied have types appropriate to the format string
3134 specified, and that the conversions specified in the format string make
3135 sense.  This includes standard functions, and others specified by format
3136 attributes (@pxref{Function Attributes}), in the @code{printf},
3137 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3138 not in the C standard) families (or other target-specific families).
3139 Which functions are checked without format attributes having been
3140 specified depends on the standard version selected, and such checks of
3141 functions without the attribute specified are disabled by
3142 @option{-ffreestanding} or @option{-fno-builtin}.
3143
3144 The formats are checked against the format features supported by GNU
3145 libc version 2.2.  These include all ISO C90 and C99 features, as well
3146 as features from the Single Unix Specification and some BSD and GNU
3147 extensions.  Other library implementations may not support all these
3148 features; GCC does not support warning about features that go beyond a
3149 particular library's limitations.  However, if @option{-pedantic} is used
3150 with @option{-Wformat}, warnings will be given about format features not
3151 in the selected standard version (but not for @code{strfmon} formats,
3152 since those are not in any version of the C standard).  @xref{C Dialect
3153 Options,,Options Controlling C Dialect}.
3154
3155 Since @option{-Wformat} also checks for null format arguments for
3156 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3157
3158 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3159 aspects of format checking, the options @option{-Wformat-y2k},
3160 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3161 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3162 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3163
3164 @item -Wformat-y2k
3165 @opindex Wformat-y2k
3166 @opindex Wno-format-y2k
3167 If @option{-Wformat} is specified, also warn about @code{strftime}
3168 formats which may yield only a two-digit year.
3169
3170 @item -Wno-format-contains-nul
3171 @opindex Wno-format-contains-nul
3172 @opindex Wformat-contains-nul
3173 If @option{-Wformat} is specified, do not warn about format strings that
3174 contain NUL bytes.
3175
3176 @item -Wno-format-extra-args
3177 @opindex Wno-format-extra-args
3178 @opindex Wformat-extra-args
3179 If @option{-Wformat} is specified, do not warn about excess arguments to a
3180 @code{printf} or @code{scanf} format function.  The C standard specifies
3181 that such arguments are ignored.
3182
3183 Where the unused arguments lie between used arguments that are
3184 specified with @samp{$} operand number specifications, normally
3185 warnings are still given, since the implementation could not know what
3186 type to pass to @code{va_arg} to skip the unused arguments.  However,
3187 in the case of @code{scanf} formats, this option will suppress the
3188 warning if the unused arguments are all pointers, since the Single
3189 Unix Specification says that such unused arguments are allowed.
3190
3191 @item -Wno-format-zero-length
3192 @opindex Wno-format-zero-length
3193 @opindex Wformat-zero-length
3194 If @option{-Wformat} is specified, do not warn about zero-length formats.
3195 The C standard specifies that zero-length formats are allowed.
3196
3197 @item -Wformat-nonliteral
3198 @opindex Wformat-nonliteral
3199 @opindex Wno-format-nonliteral
3200 If @option{-Wformat} is specified, also warn if the format string is not a
3201 string literal and so cannot be checked, unless the format function
3202 takes its format arguments as a @code{va_list}.
3203
3204 @item -Wformat-security
3205 @opindex Wformat-security
3206 @opindex Wno-format-security
3207 If @option{-Wformat} is specified, also warn about uses of format
3208 functions that represent possible security problems.  At present, this
3209 warns about calls to @code{printf} and @code{scanf} functions where the
3210 format string is not a string literal and there are no format arguments,
3211 as in @code{printf (foo);}.  This may be a security hole if the format
3212 string came from untrusted input and contains @samp{%n}.  (This is
3213 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3214 in future warnings may be added to @option{-Wformat-security} that are not
3215 included in @option{-Wformat-nonliteral}.)
3216
3217 @item -Wformat=2
3218 @opindex Wformat=2
3219 @opindex Wno-format=2
3220 Enable @option{-Wformat} plus format checks not included in
3221 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
3222 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3223
3224 @item -Wnonnull
3225 @opindex Wnonnull
3226 @opindex Wno-nonnull
3227 Warn about passing a null pointer for arguments marked as
3228 requiring a non-null value by the @code{nonnull} function attribute.
3229
3230 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3231 can be disabled with the @option{-Wno-nonnull} option.
3232
3233 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3234 @opindex Winit-self
3235 @opindex Wno-init-self
3236 Warn about uninitialized variables which are initialized with themselves.
3237 Note this option can only be used with the @option{-Wuninitialized} option.
3238
3239 For example, GCC will warn about @code{i} being uninitialized in the
3240 following snippet only when @option{-Winit-self} has been specified:
3241 @smallexample
3242 @group
3243 int f()
3244 @{
3245   int i = i;
3246   return i;
3247 @}
3248 @end group
3249 @end smallexample
3250
3251 @item -Wimplicit-int @r{(C and Objective-C only)}
3252 @opindex Wimplicit-int
3253 @opindex Wno-implicit-int
3254 Warn when a declaration does not specify a type.
3255 This warning is enabled by @option{-Wall}.
3256
3257 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3258 @opindex Wimplicit-function-declaration
3259 @opindex Wno-implicit-function-declaration
3260 Give a warning whenever a function is used before being declared. In
3261 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3262 enabled by default and it is made into an error by
3263 @option{-pedantic-errors}. This warning is also enabled by
3264 @option{-Wall}.
3265
3266 @item -Wimplicit @r{(C and Objective-C only)}
3267 @opindex Wimplicit
3268 @opindex Wno-implicit
3269 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3270 This warning is enabled by @option{-Wall}.
3271
3272 @item -Wignored-qualifiers @r{(C and C++ only)}
3273 @opindex Wignored-qualifiers
3274 @opindex Wno-ignored-qualifiers
3275 Warn if the return type of a function has a type qualifier
3276 such as @code{const}.  For ISO C such a type qualifier has no effect,
3277 since the value returned by a function is not an lvalue.
3278 For C++, the warning is only emitted for scalar types or @code{void}.
3279 ISO C prohibits qualified @code{void} return types on function
3280 definitions, so such return types always receive a warning
3281 even without this option.
3282
3283 This warning is also enabled by @option{-Wextra}.
3284
3285 @item -Wmain
3286 @opindex Wmain
3287 @opindex Wno-main
3288 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3289 a function with external linkage, returning int, taking either zero
3290 arguments, two, or three arguments of appropriate types.  This warning
3291 is enabled by default in C++ and is enabled by either @option{-Wall}
3292 or @option{-pedantic}.
3293
3294 @item -Wmissing-braces
3295 @opindex Wmissing-braces
3296 @opindex Wno-missing-braces
3297 Warn if an aggregate or union initializer is not fully bracketed.  In
3298 the following example, the initializer for @samp{a} is not fully
3299 bracketed, but that for @samp{b} is fully bracketed.
3300
3301 @smallexample
3302 int a[2][2] = @{ 0, 1, 2, 3 @};
3303 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3304 @end smallexample
3305
3306 This warning is enabled by @option{-Wall}.
3307
3308 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3309 @opindex Wmissing-include-dirs
3310 @opindex Wno-missing-include-dirs
3311 Warn if a user-supplied include directory does not exist.
3312
3313 @item -Wparentheses
3314 @opindex Wparentheses
3315 @opindex Wno-parentheses
3316 Warn if parentheses are omitted in certain contexts, such
3317 as when there is an assignment in a context where a truth value
3318 is expected, or when operators are nested whose precedence people
3319 often get confused about.
3320
3321 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3322 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3323 interpretation from that of ordinary mathematical notation.
3324
3325 Also warn about constructions where there may be confusion to which
3326 @code{if} statement an @code{else} branch belongs.  Here is an example of
3327 such a case:
3328
3329 @smallexample
3330 @group
3331 @{
3332   if (a)
3333     if (b)
3334       foo ();
3335   else
3336     bar ();
3337 @}
3338 @end group
3339 @end smallexample
3340
3341 In C/C++, every @code{else} branch belongs to the innermost possible
3342 @code{if} statement, which in this example is @code{if (b)}.  This is
3343 often not what the programmer expected, as illustrated in the above
3344 example by indentation the programmer chose.  When there is the
3345 potential for this confusion, GCC will issue a warning when this flag
3346 is specified.  To eliminate the warning, add explicit braces around
3347 the innermost @code{if} statement so there is no way the @code{else}
3348 could belong to the enclosing @code{if}.  The resulting code would
3349 look like this:
3350
3351 @smallexample
3352 @group
3353 @{
3354   if (a)
3355     @{
3356       if (b)
3357         foo ();
3358       else
3359         bar ();
3360     @}
3361 @}
3362 @end group
3363 @end smallexample
3364
3365 Also warn for dangerous uses of the
3366 ?: with omitted middle operand GNU extension. When the condition
3367 in the ?: operator is a boolean expression the omitted value will
3368 be always 1. Often the user expects it to be a value computed
3369 inside the conditional expression instead.
3370
3371 This warning is enabled by @option{-Wall}.
3372
3373 @item -Wsequence-point
3374 @opindex Wsequence-point
3375 @opindex Wno-sequence-point
3376 Warn about code that may have undefined semantics because of violations
3377 of sequence point rules in the C and C++ standards.
3378
3379 The C and C++ standards defines the order in which expressions in a C/C++
3380 program are evaluated in terms of @dfn{sequence points}, which represent
3381 a partial ordering between the execution of parts of the program: those
3382 executed before the sequence point, and those executed after it.  These
3383 occur after the evaluation of a full expression (one which is not part
3384 of a larger expression), after the evaluation of the first operand of a
3385 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3386 function is called (but after the evaluation of its arguments and the
3387 expression denoting the called function), and in certain other places.
3388 Other than as expressed by the sequence point rules, the order of
3389 evaluation of subexpressions of an expression is not specified.  All
3390 these rules describe only a partial order rather than a total order,
3391 since, for example, if two functions are called within one expression
3392 with no sequence point between them, the order in which the functions
3393 are called is not specified.  However, the standards committee have
3394 ruled that function calls do not overlap.
3395
3396 It is not specified when between sequence points modifications to the
3397 values of objects take effect.  Programs whose behavior depends on this
3398 have undefined behavior; the C and C++ standards specify that ``Between
3399 the previous and next sequence point an object shall have its stored
3400 value modified at most once by the evaluation of an expression.
3401 Furthermore, the prior value shall be read only to determine the value
3402 to be stored.''.  If a program breaks these rules, the results on any
3403 particular implementation are entirely unpredictable.
3404
3405 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3406 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3407 diagnosed by this option, and it may give an occasional false positive
3408 result, but in general it has been found fairly effective at detecting
3409 this sort of problem in programs.
3410
3411 The standard is worded confusingly, therefore there is some debate
3412 over the precise meaning of the sequence point rules in subtle cases.
3413 Links to discussions of the problem, including proposed formal
3414 definitions, may be found on the GCC readings page, at
3415 @uref{http://gcc.gnu.org/@/readings.html}.
3416
3417 This warning is enabled by @option{-Wall} for C and C++.
3418
3419 @item -Wreturn-type
3420 @opindex Wreturn-type
3421 @opindex Wno-return-type
3422 Warn whenever a function is defined with a return-type that defaults
3423 to @code{int}.  Also warn about any @code{return} statement with no
3424 return-value in a function whose return-type is not @code{void}
3425 (falling off the end of the function body is considered returning
3426 without a value), and about a @code{return} statement with an
3427 expression in a function whose return-type is @code{void}.
3428
3429 For C++, a function without return type always produces a diagnostic
3430 message, even when @option{-Wno-return-type} is specified.  The only
3431 exceptions are @samp{main} and functions defined in system headers.
3432
3433 This warning is enabled by @option{-Wall}.
3434
3435 @item -Wswitch
3436 @opindex Wswitch
3437 @opindex Wno-switch
3438 Warn whenever a @code{switch} statement has an index of enumerated type
3439 and lacks a @code{case} for one or more of the named codes of that
3440 enumeration.  (The presence of a @code{default} label prevents this
3441 warning.)  @code{case} labels outside the enumeration range also
3442 provoke warnings when this option is used (even if there is a
3443 @code{default} label).
3444 This warning is enabled by @option{-Wall}.
3445
3446 @item -Wswitch-default
3447 @opindex Wswitch-default
3448 @opindex Wno-switch-default
3449 Warn whenever a @code{switch} statement does not have a @code{default}
3450 case.
3451
3452 @item -Wswitch-enum
3453 @opindex Wswitch-enum
3454 @opindex Wno-switch-enum
3455 Warn whenever a @code{switch} statement has an index of enumerated type
3456 and lacks a @code{case} for one or more of the named codes of that
3457 enumeration.  @code{case} labels outside the enumeration range also
3458 provoke warnings when this option is used.  The only difference
3459 between @option{-Wswitch} and this option is that this option gives a
3460 warning about an omitted enumeration code even if there is a
3461 @code{default} label.
3462
3463 @item -Wsync-nand @r{(C and C++ only)}
3464 @opindex Wsync-nand
3465 @opindex Wno-sync-nand
3466 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3467 built-in functions are used.  These functions changed semantics in GCC 4.4.
3468
3469 @item -Wtrigraphs
3470 @opindex Wtrigraphs
3471 @opindex Wno-trigraphs
3472 Warn if any trigraphs are encountered that might change the meaning of
3473 the program (trigraphs within comments are not warned about).
3474 This warning is enabled by @option{-Wall}.
3475
3476 @item -Wunused-but-set-parameter
3477 @opindex Wunused-but-set-parameter
3478 @opindex Wno-unused-but-set-parameter
3479 Warn whenever a function parameter is assigned to, but otherwise unused
3480 (aside from its declaration).
3481
3482 To suppress this warning use the @samp{unused} attribute
3483 (@pxref{Variable Attributes}).
3484
3485 This warning is also enabled by @option{-Wunused} together with
3486 @option{-Wextra}.
3487
3488 @item -Wunused-but-set-variable
3489 @opindex Wunused-but-set-variable
3490 @opindex Wno-unused-but-set-variable
3491 Warn whenever a local variable is assigned to, but otherwise unused
3492 (aside from its declaration).
3493 This warning is enabled by @option{-Wall}.
3494
3495 To suppress this warning use the @samp{unused} attribute
3496 (@pxref{Variable Attributes}).
3497
3498 This warning is also enabled by @option{-Wunused}, which is enabled
3499 by @option{-Wall}.
3500
3501 @item -Wunused-function
3502 @opindex Wunused-function
3503 @opindex Wno-unused-function
3504 Warn whenever a static function is declared but not defined or a
3505 non-inline static function is unused.
3506 This warning is enabled by @option{-Wall}.
3507
3508 @item -Wunused-label
3509 @opindex Wunused-label
3510 @opindex Wno-unused-label
3511 Warn whenever a label is declared but not used.
3512 This warning is enabled by @option{-Wall}.
3513
3514 To suppress this warning use the @samp{unused} attribute
3515 (@pxref{Variable Attributes}).
3516
3517 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3518 @opindex Wunused-local-typedefs
3519 Warn when a typedef locally defined in a function is not used.
3520
3521 @item -Wunused-parameter
3522 @opindex Wunused-parameter
3523 @opindex Wno-unused-parameter
3524 Warn whenever a function parameter is unused aside from its declaration.
3525
3526 To suppress this warning use the @samp{unused} attribute
3527 (@pxref{Variable Attributes}).
3528
3529 @item -Wno-unused-result
3530 @opindex Wunused-result
3531 @opindex Wno-unused-result
3532 Do not warn if a caller of a function marked with attribute
3533 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3534 its return value. The default is @option{-Wunused-result}.
3535
3536 @item -Wunused-variable
3537 @opindex Wunused-variable
3538 @opindex Wno-unused-variable
3539 Warn whenever a local variable or non-constant static variable is unused
3540 aside from its declaration.
3541 This warning is enabled by @option{-Wall}.
3542
3543 To suppress this warning use the @samp{unused} attribute
3544 (@pxref{Variable Attributes}).
3545
3546 @item -Wunused-value
3547 @opindex Wunused-value
3548 @opindex Wno-unused-value
3549 Warn whenever a statement computes a result that is explicitly not
3550 used. To suppress this warning cast the unused expression to
3551 @samp{void}. This includes an expression-statement or the left-hand
3552 side of a comma expression that contains no side effects. For example,
3553 an expression such as @samp{x[i,j]} will cause a warning, while
3554 @samp{x[(void)i,j]} will not.
3555
3556 This warning is enabled by @option{-Wall}.
3557
3558 @item -Wunused
3559 @opindex Wunused
3560 @opindex Wno-unused
3561 All the above @option{-Wunused} options combined.
3562
3563 In order to get a warning about an unused function parameter, you must
3564 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3565 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3566
3567 @item -Wuninitialized
3568 @opindex Wuninitialized
3569 @opindex Wno-uninitialized
3570 Warn if an automatic variable is used without first being initialized
3571 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3572 warn if a non-static reference or non-static @samp{const} member
3573 appears in a class without constructors.
3574
3575 If you want to warn about code which uses the uninitialized value of the
3576 variable in its own initializer, use the @option{-Winit-self} option.
3577
3578 These warnings occur for individual uninitialized or clobbered
3579 elements of structure, union or array variables as well as for
3580 variables which are uninitialized or clobbered as a whole.  They do
3581 not occur for variables or elements declared @code{volatile}.  Because
3582 these warnings depend on optimization, the exact variables or elements
3583 for which there are warnings will depend on the precise optimization
3584 options and version of GCC used.
3585
3586 Note that there may be no warning about a variable that is used only
3587 to compute a value that itself is never used, because such
3588 computations may be deleted by data flow analysis before the warnings
3589 are printed.
3590
3591 @item -Wmaybe-uninitialized
3592 @opindex Wmaybe-uninitialized
3593 @opindex Wno-maybe-uninitialized
3594 For an automatic variable, if there exists a path from the function
3595 entry to a use of the variable that is initialized, but there exist
3596 some other paths the variable is not initialized, the compiler will
3597 emit a warning if it can not prove the uninitialized paths do not
3598 happen at runtime. These warnings are made optional because GCC is
3599 not smart enough to see all the reasons why the code might be correct
3600 despite appearing to have an error.  Here is one example of how
3601 this can happen:
3602
3603 @smallexample
3604 @group
3605 @{
3606   int x;
3607   switch (y)
3608     @{
3609     case 1: x = 1;
3610       break;
3611     case 2: x = 4;
3612       break;
3613     case 3: x = 5;
3614     @}
3615   foo (x);
3616 @}
3617 @end group
3618 @end smallexample
3619
3620 @noindent
3621 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3622 always initialized, but GCC doesn't know this. To suppress the
3623 warning, the user needs to provide a default case with assert(0) or
3624 similar code.
3625
3626 @cindex @code{longjmp} warnings
3627 This option also warns when a non-volatile automatic variable might be
3628 changed by a call to @code{longjmp}.  These warnings as well are possible
3629 only in optimizing compilation.
3630
3631 The compiler sees only the calls to @code{setjmp}.  It cannot know
3632 where @code{longjmp} will be called; in fact, a signal handler could
3633 call it at any point in the code.  As a result, you may get a warning
3634 even when there is in fact no problem because @code{longjmp} cannot
3635 in fact be called at the place which would cause a problem.
3636
3637 Some spurious warnings can be avoided if you declare all the functions
3638 you use that never return as @code{noreturn}.  @xref{Function
3639 Attributes}.
3640
3641 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3642
3643 @item -Wunknown-pragmas
3644 @opindex Wunknown-pragmas
3645 @opindex Wno-unknown-pragmas
3646 @cindex warning for unknown pragmas
3647 @cindex unknown pragmas, warning
3648 @cindex pragmas, warning of unknown
3649 Warn when a #pragma directive is encountered which is not understood by
3650 GCC@.  If this command line option is used, warnings will even be issued
3651 for unknown pragmas in system header files.  This is not the case if
3652 the warnings were only enabled by the @option{-Wall} command line option.
3653
3654 @item -Wno-pragmas
3655 @opindex Wno-pragmas
3656 @opindex Wpragmas
3657 Do not warn about misuses of pragmas, such as incorrect parameters,
3658 invalid syntax, or conflicts between pragmas.  See also
3659 @samp{-Wunknown-pragmas}.
3660
3661 @item -Wstrict-aliasing
3662 @opindex Wstrict-aliasing
3663 @opindex Wno-strict-aliasing
3664 This option is only active when @option{-fstrict-aliasing} is active.
3665 It warns about code which might break the strict aliasing rules that the
3666 compiler is using for optimization.  The warning does not catch all
3667 cases, but does attempt to catch the more common pitfalls.  It is
3668 included in @option{-Wall}.
3669 It is equivalent to @option{-Wstrict-aliasing=3}
3670
3671 @item -Wstrict-aliasing=n
3672 @opindex Wstrict-aliasing=n
3673 @opindex Wno-strict-aliasing=n
3674 This option is only active when @option{-fstrict-aliasing} is active.
3675 It warns about code which might break the strict aliasing rules that the
3676 compiler is using for optimization.
3677 Higher levels correspond to higher accuracy (fewer false positives).
3678 Higher levels also correspond to more effort, similar to the way -O works.
3679 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3680 with n=3.
3681
3682 Level 1: Most aggressive, quick, least accurate.
3683 Possibly useful when higher levels
3684 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3685 false negatives.  However, it has many false positives.
3686 Warns for all pointer conversions between possibly incompatible types,
3687 even if never dereferenced.  Runs in the frontend only.
3688
3689 Level 2: Aggressive, quick, not too precise.
3690 May still have many false positives (not as many as level 1 though),
3691 and few false negatives (but possibly more than level 1).
3692 Unlike level 1, it only warns when an address is taken.  Warns about
3693 incomplete types.  Runs in the frontend only.
3694
3695 Level 3 (default for @option{-Wstrict-aliasing}):
3696 Should have very few false positives and few false
3697 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3698 Takes care of the common pun+dereference pattern in the frontend:
3699 @code{*(int*)&some_float}.
3700 If optimization is enabled, it also runs in the backend, where it deals
3701 with multiple statement cases using flow-sensitive points-to information.
3702 Only warns when the converted pointer is dereferenced.
3703 Does not warn about incomplete types.
3704
3705 @item -Wstrict-overflow
3706 @itemx -Wstrict-overflow=@var{n}
3707 @opindex Wstrict-overflow
3708 @opindex Wno-strict-overflow
3709 This option is only active when @option{-fstrict-overflow} is active.
3710 It warns about cases where the compiler optimizes based on the
3711 assumption that signed overflow does not occur.  Note that it does not
3712 warn about all cases where the code might overflow: it only warns
3713 about cases where the compiler implements some optimization.  Thus
3714 this warning depends on the optimization level.
3715
3716 An optimization which assumes that signed overflow does not occur is
3717 perfectly safe if the values of the variables involved are such that
3718 overflow never does, in fact, occur.  Therefore this warning can
3719 easily give a false positive: a warning about code which is not
3720 actually a problem.  To help focus on important issues, several
3721 warning levels are defined.  No warnings are issued for the use of
3722 undefined signed overflow when estimating how many iterations a loop
3723 will require, in particular when determining whether a loop will be
3724 executed at all.
3725
3726 @table @gcctabopt
3727 @item -Wstrict-overflow=1
3728 Warn about cases which are both questionable and easy to avoid.  For
3729 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3730 compiler will simplify this to @code{1}.  This level of
3731 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3732 are not, and must be explicitly requested.
3733
3734 @item -Wstrict-overflow=2
3735 Also warn about other cases where a comparison is simplified to a
3736 constant.  For example: @code{abs (x) >= 0}.  This can only be
3737 simplified when @option{-fstrict-overflow} is in effect, because
3738 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3739 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3740 @option{-Wstrict-overflow=2}.
3741
3742 @item -Wstrict-overflow=3
3743 Also warn about other cases where a comparison is simplified.  For
3744 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3745
3746 @item -Wstrict-overflow=4
3747 Also warn about other simplifications not covered by the above cases.
3748 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3749
3750 @item -Wstrict-overflow=5
3751 Also warn about cases where the compiler reduces the magnitude of a
3752 constant involved in a comparison.  For example: @code{x + 2 > y} will
3753 be simplified to @code{x + 1 >= y}.  This is reported only at the
3754 highest warning level because this simplification applies to many
3755 comparisons, so this warning level will give a very large number of
3756 false positives.
3757 @end table
3758
3759 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3760 @opindex Wsuggest-attribute=
3761 @opindex Wno-suggest-attribute=
3762 Warn for cases where adding an attribute may be beneficial. The
3763 attributes currently supported are listed below.
3764
3765 @table @gcctabopt
3766 @item -Wsuggest-attribute=pure
3767 @itemx -Wsuggest-attribute=const
3768 @itemx -Wsuggest-attribute=noreturn
3769 @opindex Wsuggest-attribute=pure
3770 @opindex Wno-suggest-attribute=pure
3771 @opindex Wsuggest-attribute=const
3772 @opindex Wno-suggest-attribute=const
3773 @opindex Wsuggest-attribute=noreturn
3774 @opindex Wno-suggest-attribute=noreturn
3775
3776 Warn about functions which might be candidates for attributes
3777 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3778 functions visible in other compilation units or (in the case of @code{pure} and
3779 @code{const}) if it cannot prove that the function returns normally. A function
3780 returns normally if it doesn't contain an infinite loop nor returns abnormally
3781 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3782 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3783 higher.  Higher optimization levels improve the accuracy of the analysis.
3784 @end table
3785
3786 @item -Warray-bounds
3787 @opindex Wno-array-bounds
3788 @opindex Warray-bounds
3789 This option is only active when @option{-ftree-vrp} is active
3790 (default for @option{-O2} and above). It warns about subscripts to arrays
3791 that are always out of bounds. This warning is enabled by @option{-Wall}.
3792
3793 @item -Wno-div-by-zero
3794 @opindex Wno-div-by-zero
3795 @opindex Wdiv-by-zero
3796 Do not warn about compile-time integer division by zero.  Floating point
3797 division by zero is not warned about, as it can be a legitimate way of
3798 obtaining infinities and NaNs.
3799
3800 @item -Wsystem-headers
3801 @opindex Wsystem-headers
3802 @opindex Wno-system-headers
3803 @cindex warnings from system headers
3804 @cindex system headers, warnings from
3805 Print warning messages for constructs found in system header files.
3806 Warnings from system headers are normally suppressed, on the assumption
3807 that they usually do not indicate real problems and would only make the
3808 compiler output harder to read.  Using this command line option tells
3809 GCC to emit warnings from system headers as if they occurred in user
3810 code.  However, note that using @option{-Wall} in conjunction with this
3811 option will @emph{not} warn about unknown pragmas in system
3812 headers---for that, @option{-Wunknown-pragmas} must also be used.
3813
3814 @item -Wtrampolines
3815 @opindex Wtrampolines
3816 @opindex Wno-trampolines
3817  Warn about trampolines generated for pointers to nested functions.
3818
3819  A trampoline is a small piece of data or code that is created at run
3820  time on the stack when the address of a nested function is taken, and
3821  is used to call the nested function indirectly.  For some targets, it
3822  is made up of data only and thus requires no special treatment.  But,
3823  for most targets, it is made up of code and thus requires the stack
3824  to be made executable in order for the program to work properly.
3825
3826 @item -Wfloat-equal
3827 @opindex Wfloat-equal
3828 @opindex Wno-float-equal
3829 Warn if floating point values are used in equality comparisons.
3830
3831 The idea behind this is that sometimes it is convenient (for the
3832 programmer) to consider floating-point values as approximations to
3833 infinitely precise real numbers.  If you are doing this, then you need
3834 to compute (by analyzing the code, or in some other way) the maximum or
3835 likely maximum error that the computation introduces, and allow for it
3836 when performing comparisons (and when producing output, but that's a
3837 different problem).  In particular, instead of testing for equality, you
3838 would check to see whether the two values have ranges that overlap; and
3839 this is done with the relational operators, so equality comparisons are
3840 probably mistaken.
3841
3842 @item -Wtraditional @r{(C and Objective-C only)}
3843 @opindex Wtraditional
3844 @opindex Wno-traditional
3845 Warn about certain constructs that behave differently in traditional and
3846 ISO C@.  Also warn about ISO C constructs that have no traditional C
3847 equivalent, and/or problematic constructs which should be avoided.
3848
3849 @itemize @bullet
3850 @item
3851 Macro parameters that appear within string literals in the macro body.
3852 In traditional C macro replacement takes place within string literals,
3853 but does not in ISO C@.
3854
3855 @item
3856 In traditional C, some preprocessor directives did not exist.
3857 Traditional preprocessors would only consider a line to be a directive
3858 if the @samp{#} appeared in column 1 on the line.  Therefore
3859 @option{-Wtraditional} warns about directives that traditional C
3860 understands but would ignore because the @samp{#} does not appear as the
3861 first character on the line.  It also suggests you hide directives like
3862 @samp{#pragma} not understood by traditional C by indenting them.  Some
3863 traditional implementations would not recognize @samp{#elif}, so it
3864 suggests avoiding it altogether.
3865
3866 @item
3867 A function-like macro that appears without arguments.
3868
3869 @item
3870 The unary plus operator.
3871
3872 @item
3873 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3874 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3875 constants.)  Note, these suffixes appear in macros defined in the system
3876 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3877 Use of these macros in user code might normally lead to spurious
3878 warnings, however GCC's integrated preprocessor has enough context to
3879 avoid warning in these cases.
3880
3881 @item
3882 A function declared external in one block and then used after the end of
3883 the block.
3884
3885 @item
3886 A @code{switch} statement has an operand of type @code{long}.
3887
3888 @item
3889 A non-@code{static} function declaration follows a @code{static} one.
3890 This construct is not accepted by some traditional C compilers.
3891
3892 @item
3893 The ISO type of an integer constant has a different width or
3894 signedness from its traditional type.  This warning is only issued if
3895 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3896 typically represent bit patterns, are not warned about.
3897
3898 @item
3899 Usage of ISO string concatenation is detected.
3900
3901 @item
3902 Initialization of automatic aggregates.
3903
3904 @item
3905 Identifier conflicts with labels.  Traditional C lacks a separate
3906 namespace for labels.
3907
3908 @item
3909 Initialization of unions.  If the initializer is zero, the warning is
3910 omitted.  This is done under the assumption that the zero initializer in
3911 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3912 initializer warnings and relies on default initialization to zero in the
3913 traditional C case.
3914
3915 @item
3916 Conversions by prototypes between fixed/floating point values and vice
3917 versa.  The absence of these prototypes when compiling with traditional
3918 C would cause serious problems.  This is a subset of the possible
3919 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3920
3921 @item
3922 Use of ISO C style function definitions.  This warning intentionally is
3923 @emph{not} issued for prototype declarations or variadic functions
3924 because these ISO C features will appear in your code when using
3925 libiberty's traditional C compatibility macros, @code{PARAMS} and
3926 @code{VPARAMS}.  This warning is also bypassed for nested functions
3927 because that feature is already a GCC extension and thus not relevant to
3928 traditional C compatibility.
3929 @end itemize
3930
3931 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3932 @opindex Wtraditional-conversion
3933 @opindex Wno-traditional-conversion
3934 Warn if a prototype causes a type conversion that is different from what
3935 would happen to the same argument in the absence of a prototype.  This
3936 includes conversions of fixed point to floating and vice versa, and
3937 conversions changing the width or signedness of a fixed point argument
3938 except when the same as the default promotion.
3939
3940 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3941 @opindex Wdeclaration-after-statement
3942 @opindex Wno-declaration-after-statement
3943 Warn when a declaration is found after a statement in a block.  This
3944 construct, known from C++, was introduced with ISO C99 and is by default
3945 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3946 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3947
3948 @item -Wundef
3949 @opindex Wundef
3950 @opindex Wno-undef
3951 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3952
3953 @item -Wno-endif-labels
3954 @opindex Wno-endif-labels
3955 @opindex Wendif-labels
3956 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3957
3958 @item -Wshadow
3959 @opindex Wshadow
3960 @opindex Wno-shadow
3961 Warn whenever a local variable or type declaration shadows another variable,
3962 parameter, type, or class member (in C++), or whenever a built-in function
3963 is shadowed. Note that in C++, the compiler will not warn if a local variable
3964 shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
3965
3966 @item -Wlarger-than=@var{len}
3967 @opindex Wlarger-than=@var{len}
3968 @opindex Wlarger-than-@var{len}
3969 Warn whenever an object of larger than @var{len} bytes is defined.
3970
3971 @item -Wframe-larger-than=@var{len}
3972 @opindex Wframe-larger-than
3973 Warn if the size of a function frame is larger than @var{len} bytes.
3974 The computation done to determine the stack frame size is approximate
3975 and not conservative.
3976 The actual requirements may be somewhat greater than @var{len}
3977 even if you do not get a warning.  In addition, any space allocated
3978 via @code{alloca}, variable-length arrays, or related constructs
3979 is not included by the compiler when determining
3980 whether or not to issue a warning.
3981
3982 @item -Wno-free-nonheap-object
3983 @opindex Wno-free-nonheap-object
3984 @opindex Wfree-nonheap-object
3985 Do not warn when attempting to free an object which was not allocated
3986 on the heap.
3987
3988 @item -Wstack-usage=@var{len}
3989 @opindex Wstack-usage
3990 Warn if the stack usage of a function might be larger than @var{len} bytes.
3991 The computation done to determine the stack usage is conservative.
3992 Any space allocated via @code{alloca}, variable-length arrays, or related
3993 constructs is included by the compiler when determining whether or not to
3994 issue a warning.
3995
3996 The message is in keeping with the output of @option{-fstack-usage}.
3997
3998 @itemize
3999 @item
4000 If the stack usage is fully static but exceeds the specified amount, it's:
4001
4002 @smallexample
4003   warning: stack usage is 1120 bytes
4004 @end smallexample
4005 @item
4006 If the stack usage is (partly) dynamic but bounded, it's:
4007
4008 @smallexample
4009   warning: stack usage might be 1648 bytes
4010 @end smallexample
4011 @item
4012 If the stack usage is (partly) dynamic and not bounded, it's:
4013
4014 @smallexample
4015   warning: stack usage might be unbounded
4016 @end smallexample
4017 @end itemize
4018
4019 @item -Wunsafe-loop-optimizations
4020 @opindex Wunsafe-loop-optimizations
4021 @opindex Wno-unsafe-loop-optimizations
4022 Warn if the loop cannot be optimized because the compiler could not
4023 assume anything on the bounds of the loop indices.  With
4024 @option{-funsafe-loop-optimizations} warn if the compiler made
4025 such assumptions.
4026
4027 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4028 @opindex Wno-pedantic-ms-format
4029 @opindex Wpedantic-ms-format
4030 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
4031 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
4032 depending on the MS runtime, when you are using the options @option{-Wformat}
4033 and @option{-pedantic} without gnu-extensions.
4034
4035 @item -Wpointer-arith
4036 @opindex Wpointer-arith
4037 @opindex Wno-pointer-arith
4038 Warn about anything that depends on the ``size of'' a function type or
4039 of @code{void}.  GNU C assigns these types a size of 1, for
4040 convenience in calculations with @code{void *} pointers and pointers
4041 to functions.  In C++, warn also when an arithmetic operation involves
4042 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
4043
4044 @item -Wtype-limits
4045 @opindex Wtype-limits
4046 @opindex Wno-type-limits
4047 Warn if a comparison is always true or always false due to the limited
4048 range of the data type, but do not warn for constant expressions.  For
4049 example, warn if an unsigned variable is compared against zero with
4050 @samp{<} or @samp{>=}.  This warning is also enabled by
4051 @option{-Wextra}.
4052
4053 @item -Wbad-function-cast @r{(C and Objective-C only)}
4054 @opindex Wbad-function-cast
4055 @opindex Wno-bad-function-cast
4056 Warn whenever a function call is cast to a non-matching type.
4057 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4058
4059 @item -Wc++-compat @r{(C and Objective-C only)}
4060 Warn about ISO C constructs that are outside of the common subset of
4061 ISO C and ISO C++, e.g.@: request for implicit conversion from
4062 @code{void *} to a pointer to non-@code{void} type.
4063
4064 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4065 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
4066 ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that will become keywords
4067 in ISO C++ 2011.  This warning is enabled by @option{-Wall}.
4068
4069 @item -Wcast-qual
4070 @opindex Wcast-qual
4071 @opindex Wno-cast-qual
4072 Warn whenever a pointer is cast so as to remove a type qualifier from
4073 the target type.  For example, warn if a @code{const char *} is cast
4074 to an ordinary @code{char *}.
4075
4076 Also warn when making a cast which introduces a type qualifier in an
4077 unsafe way.  For example, casting @code{char **} to @code{const char **}
4078 is unsafe, as in this example:
4079
4080 @smallexample
4081   /* p is char ** value.  */
4082   const char **q = (const char **) p;
4083   /* Assignment of readonly string to const char * is OK.  */
4084   *q = "string";
4085   /* Now char** pointer points to read-only memory.  */
4086   **p = 'b';
4087 @end smallexample
4088
4089 @item -Wcast-align
4090 @opindex Wcast-align
4091 @opindex Wno-cast-align
4092 Warn whenever a pointer is cast such that the required alignment of the
4093 target is increased.  For example, warn if a @code{char *} is cast to
4094 an @code{int *} on machines where integers can only be accessed at
4095 two- or four-byte boundaries.
4096
4097 @item -Wwrite-strings
4098 @opindex Wwrite-strings
4099 @opindex Wno-write-strings
4100 When compiling C, give string constants the type @code{const
4101 char[@var{length}]} so that copying the address of one into a
4102 non-@code{const} @code{char *} pointer will get a warning.  These
4103 warnings will help you find at compile time code that can try to write
4104 into a string constant, but only if you have been very careful about
4105 using @code{const} in declarations and prototypes.  Otherwise, it will
4106 just be a nuisance. This is why we did not make @option{-Wall} request
4107 these warnings.
4108
4109 When compiling C++, warn about the deprecated conversion from string
4110 literals to @code{char *}.  This warning is enabled by default for C++
4111 programs.
4112
4113 @item -Wclobbered
4114 @opindex Wclobbered
4115 @opindex Wno-clobbered
4116 Warn for variables that might be changed by @samp{longjmp} or
4117 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4118
4119 @item -Wconversion
4120 @opindex Wconversion
4121 @opindex Wno-conversion
4122 Warn for implicit conversions that may alter a value. This includes
4123 conversions between real and integer, like @code{abs (x)} when
4124 @code{x} is @code{double}; conversions between signed and unsigned,
4125 like @code{unsigned ui = -1}; and conversions to smaller types, like
4126 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4127 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4128 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4129 conversions between signed and unsigned integers can be disabled by
4130 using @option{-Wno-sign-conversion}.
4131
4132 For C++, also warn for confusing overload resolution for user-defined
4133 conversions; and conversions that will never use a type conversion
4134 operator: conversions to @code{void}, the same type, a base class or a
4135 reference to them. Warnings about conversions between signed and
4136 unsigned integers are disabled by default in C++ unless
4137 @option{-Wsign-conversion} is explicitly enabled.
4138
4139 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4140 @opindex Wconversion-null
4141 @opindex Wno-conversion-null
4142 Do not warn for conversions between @code{NULL} and non-pointer
4143 types. @option{-Wconversion-null} is enabled by default.
4144
4145 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4146 @opindex Wzero-as-null-pointer-constant
4147 @opindex Wno-zero-as-null-pointer-constant
4148 Warn when a literal '0' is used as null pointer constant.  This can
4149 be useful to facilitate the conversion to @code{nullptr} in C++11.
4150
4151 @item -Wempty-body
4152 @opindex Wempty-body
4153 @opindex Wno-empty-body
4154 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4155 while} statement.  This warning is also enabled by @option{-Wextra}.
4156
4157 @item -Wenum-compare
4158 @opindex Wenum-compare
4159 @opindex Wno-enum-compare
4160 Warn about a comparison between values of different enum types. In C++
4161 this warning is enabled by default.  In C this warning is enabled by
4162 @option{-Wall}.
4163
4164 @item -Wjump-misses-init @r{(C, Objective-C only)}
4165 @opindex Wjump-misses-init
4166 @opindex Wno-jump-misses-init
4167 Warn if a @code{goto} statement or a @code{switch} statement jumps
4168 forward across the initialization of a variable, or jumps backward to a
4169 label after the variable has been initialized.  This only warns about
4170 variables which are initialized when they are declared.  This warning is
4171 only supported for C and Objective C; in C++ this sort of branch is an
4172 error in any case.
4173
4174 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4175 can be disabled with the @option{-Wno-jump-misses-init} option.
4176
4177 @item -Wsign-compare
4178 @opindex Wsign-compare
4179 @opindex Wno-sign-compare
4180 @cindex warning for comparison of signed and unsigned values
4181 @cindex comparison of signed and unsigned values, warning
4182 @cindex signed and unsigned values, comparison warning
4183 Warn when a comparison between signed and unsigned values could produce
4184 an incorrect result when the signed value is converted to unsigned.
4185 This warning is also enabled by @option{-Wextra}; to get the other warnings
4186 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
4187
4188 @item -Wsign-conversion
4189 @opindex Wsign-conversion
4190 @opindex Wno-sign-conversion
4191 Warn for implicit conversions that may change the sign of an integer
4192 value, like assigning a signed integer expression to an unsigned
4193 integer variable. An explicit cast silences the warning. In C, this
4194 option is enabled also by @option{-Wconversion}.
4195
4196 @item -Waddress
4197 @opindex Waddress
4198 @opindex Wno-address
4199 Warn about suspicious uses of memory addresses. These include using
4200 the address of a function in a conditional expression, such as
4201 @code{void func(void); if (func)}, and comparisons against the memory
4202 address of a string literal, such as @code{if (x == "abc")}.  Such
4203 uses typically indicate a programmer error: the address of a function
4204 always evaluates to true, so their use in a conditional usually
4205 indicate that the programmer forgot the parentheses in a function
4206 call; and comparisons against string literals result in unspecified
4207 behavior and are not portable in C, so they usually indicate that the
4208 programmer intended to use @code{strcmp}.  This warning is enabled by
4209 @option{-Wall}.
4210
4211 @item -Wlogical-op
4212 @opindex Wlogical-op
4213 @opindex Wno-logical-op
4214 Warn about suspicious uses of logical operators in expressions.
4215 This includes using logical operators in contexts where a
4216 bit-wise operator is likely to be expected.
4217
4218 @item -Waggregate-return
4219 @opindex Waggregate-return
4220 @opindex Wno-aggregate-return
4221 Warn if any functions that return structures or unions are defined or
4222 called.  (In languages where you can return an array, this also elicits
4223 a warning.)
4224
4225 @item -Wno-attributes
4226 @opindex Wno-attributes
4227 @opindex Wattributes
4228 Do not warn if an unexpected @code{__attribute__} is used, such as
4229 unrecognized attributes, function attributes applied to variables,
4230 etc.  This will not stop errors for incorrect use of supported
4231 attributes.
4232
4233 @item -Wno-builtin-macro-redefined
4234 @opindex Wno-builtin-macro-redefined
4235 @opindex Wbuiltin-macro-redefined
4236 Do not warn if certain built-in macros are redefined.  This suppresses
4237 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4238 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4239
4240 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4241 @opindex Wstrict-prototypes
4242 @opindex Wno-strict-prototypes
4243 Warn if a function is declared or defined without specifying the
4244 argument types.  (An old-style function definition is permitted without
4245 a warning if preceded by a declaration which specifies the argument
4246 types.)
4247
4248 @item -Wold-style-declaration @r{(C and Objective-C only)}
4249 @opindex Wold-style-declaration
4250 @opindex Wno-old-style-declaration
4251 Warn for obsolescent usages, according to the C Standard, in a
4252 declaration. For example, warn if storage-class specifiers like
4253 @code{static} are not the first things in a declaration.  This warning
4254 is also enabled by @option{-Wextra}.
4255
4256 @item -Wold-style-definition @r{(C and Objective-C only)}
4257 @opindex Wold-style-definition
4258 @opindex Wno-old-style-definition
4259 Warn if an old-style function definition is used.  A warning is given
4260 even if there is a previous prototype.
4261
4262 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4263 @opindex Wmissing-parameter-type
4264 @opindex Wno-missing-parameter-type
4265 A function parameter is declared without a type specifier in K&R-style
4266 functions:
4267
4268 @smallexample
4269 void foo(bar) @{ @}
4270 @end smallexample
4271
4272 This warning is also enabled by @option{-Wextra}.
4273
4274 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4275 @opindex Wmissing-prototypes
4276 @opindex Wno-missing-prototypes
4277 Warn if a global function is defined without a previous prototype
4278 declaration.  This warning is issued even if the definition itself
4279 provides a prototype.  The aim is to detect global functions that fail
4280 to be declared in header files.
4281
4282 @item -Wmissing-declarations
4283 @opindex Wmissing-declarations
4284 @opindex Wno-missing-declarations
4285 Warn if a global function is defined without a previous declaration.
4286 Do so even if the definition itself provides a prototype.
4287 Use this option to detect global functions that are not declared in
4288 header files.  In C++, no warnings are issued for function templates,
4289 or for inline functions, or for functions in anonymous namespaces.
4290
4291 @item -Wmissing-field-initializers
4292 @opindex Wmissing-field-initializers
4293 @opindex Wno-missing-field-initializers
4294 @opindex W
4295 @opindex Wextra
4296 @opindex Wno-extra
4297 Warn if a structure's initializer has some fields missing.  For
4298 example, the following code would cause such a warning, because
4299 @code{x.h} is implicitly zero:
4300
4301 @smallexample
4302 struct s @{ int f, g, h; @};
4303 struct s x = @{ 3, 4 @};
4304 @end smallexample
4305
4306 This option does not warn about designated initializers, so the following
4307 modification would not trigger a warning:
4308
4309 @smallexample
4310 struct s @{ int f, g, h; @};
4311 struct s x = @{ .f = 3, .g = 4 @};
4312 @end smallexample
4313
4314 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4315 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
4316
4317 @item -Wmissing-format-attribute
4318 @opindex Wmissing-format-attribute
4319 @opindex Wno-missing-format-attribute
4320 @opindex Wformat
4321 @opindex Wno-format
4322 Warn about function pointers which might be candidates for @code{format}
4323 attributes.  Note these are only possible candidates, not absolute ones.
4324 GCC will guess that function pointers with @code{format} attributes that
4325 are used in assignment, initialization, parameter passing or return
4326 statements should have a corresponding @code{format} attribute in the
4327 resulting type.  I.e.@: the left-hand side of the assignment or
4328 initialization, the type of the parameter variable, or the return type
4329 of the containing function respectively should also have a @code{format}
4330 attribute to avoid the warning.
4331
4332 GCC will also warn about function definitions which might be
4333 candidates for @code{format} attributes.  Again, these are only
4334 possible candidates.  GCC will guess that @code{format} attributes
4335 might be appropriate for any function that calls a function like
4336 @code{vprintf} or @code{vscanf}, but this might not always be the
4337 case, and some functions for which @code{format} attributes are
4338 appropriate may not be detected.
4339
4340 @item -Wno-multichar
4341 @opindex Wno-multichar
4342 @opindex Wmultichar
4343 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4344 Usually they indicate a typo in the user's code, as they have
4345 implementation-defined values, and should not be used in portable code.
4346
4347 @item -Wnormalized=<none|id|nfc|nfkc>
4348 @opindex Wnormalized=
4349 @cindex NFC
4350 @cindex NFKC
4351 @cindex character set, input normalization
4352 In ISO C and ISO C++, two identifiers are different if they are
4353 different sequences of characters.  However, sometimes when characters
4354 outside the basic ASCII character set are used, you can have two
4355 different character sequences that look the same.  To avoid confusion,
4356 the ISO 10646 standard sets out some @dfn{normalization rules} which
4357 when applied ensure that two sequences that look the same are turned into
4358 the same sequence.  GCC can warn you if you are using identifiers which
4359 have not been normalized; this option controls that warning.
4360
4361 There are four levels of warning that GCC supports.  The default is
4362 @option{-Wnormalized=nfc}, which warns about any identifier which is
4363 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4364 recommended form for most uses.
4365
4366 Unfortunately, there are some characters which ISO C and ISO C++ allow
4367 in identifiers that when turned into NFC aren't allowable as
4368 identifiers.  That is, there's no way to use these symbols in portable
4369 ISO C or C++ and have all your identifiers in NFC@.
4370 @option{-Wnormalized=id} suppresses the warning for these characters.
4371 It is hoped that future versions of the standards involved will correct
4372 this, which is why this option is not the default.
4373
4374 You can switch the warning off for all characters by writing
4375 @option{-Wnormalized=none}.  You would only want to do this if you
4376 were using some other normalization scheme (like ``D''), because
4377 otherwise you can easily create bugs that are literally impossible to see.
4378
4379 Some characters in ISO 10646 have distinct meanings but look identical
4380 in some fonts or display methodologies, especially once formatting has
4381 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4382 LETTER N'', will display just like a regular @code{n} which has been
4383 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4384 normalization scheme to convert all these into a standard form as
4385 well, and GCC will warn if your code is not in NFKC if you use
4386 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4387 about every identifier that contains the letter O because it might be
4388 confused with the digit 0, and so is not the default, but may be
4389 useful as a local coding convention if the programming environment is
4390 unable to be fixed to display these characters distinctly.
4391
4392 @item -Wno-deprecated
4393 @opindex Wno-deprecated
4394 @opindex Wdeprecated
4395 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4396
4397 @item -Wno-deprecated-declarations
4398 @opindex Wno-deprecated-declarations
4399 @opindex Wdeprecated-declarations
4400 Do not warn about uses of functions (@pxref{Function Attributes}),
4401 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4402 Attributes}) marked as deprecated by using the @code{deprecated}
4403 attribute.
4404
4405 @item -Wno-overflow
4406 @opindex Wno-overflow
4407 @opindex Woverflow
4408 Do not warn about compile-time overflow in constant expressions.
4409
4410 @item -Woverride-init @r{(C and Objective-C only)}
4411 @opindex Woverride-init
4412 @opindex Wno-override-init
4413 @opindex W
4414 @opindex Wextra
4415 @opindex Wno-extra
4416 Warn if an initialized field without side effects is overridden when
4417 using designated initializers (@pxref{Designated Inits, , Designated
4418 Initializers}).
4419
4420 This warning is included in @option{-Wextra}.  To get other
4421 @option{-Wextra} warnings without this one, use @samp{-Wextra
4422 -Wno-override-init}.
4423
4424 @item -Wpacked
4425 @opindex Wpacked
4426 @opindex Wno-packed
4427 Warn if a structure is given the packed attribute, but the packed
4428 attribute has no effect on the layout or size of the structure.
4429 Such structures may be mis-aligned for little benefit.  For
4430 instance, in this code, the variable @code{f.x} in @code{struct bar}
4431 will be misaligned even though @code{struct bar} does not itself
4432 have the packed attribute:
4433
4434 @smallexample
4435 @group
4436 struct foo @{
4437   int x;
4438   char a, b, c, d;
4439 @} __attribute__((packed));
4440 struct bar @{
4441   char z;
4442   struct foo f;
4443 @};
4444 @end group
4445 @end smallexample
4446
4447 @item -Wpacked-bitfield-compat
4448 @opindex Wpacked-bitfield-compat
4449 @opindex Wno-packed-bitfield-compat
4450 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4451 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4452 the change can lead to differences in the structure layout.  GCC
4453 informs you when the offset of such a field has changed in GCC 4.4.
4454 For example there is no longer a 4-bit padding between field @code{a}
4455 and @code{b} in this structure:
4456
4457 @smallexample
4458 struct foo
4459 @{
4460   char a:4;
4461   char b:8;
4462 @} __attribute__ ((packed));
4463 @end smallexample
4464
4465 This warning is enabled by default.  Use
4466 @option{-Wno-packed-bitfield-compat} to disable this warning.
4467
4468 @item -Wpadded
4469 @opindex Wpadded
4470 @opindex Wno-padded
4471 Warn if padding is included in a structure, either to align an element
4472 of the structure or to align the whole structure.  Sometimes when this
4473 happens it is possible to rearrange the fields of the structure to
4474 reduce the padding and so make the structure smaller.
4475
4476 @item -Wredundant-decls
4477 @opindex Wredundant-decls
4478 @opindex Wno-redundant-decls
4479 Warn if anything is declared more than once in the same scope, even in
4480 cases where multiple declaration is valid and changes nothing.
4481
4482 @item -Wnested-externs @r{(C and Objective-C only)}
4483 @opindex Wnested-externs
4484 @opindex Wno-nested-externs
4485 Warn if an @code{extern} declaration is encountered within a function.
4486
4487 @item -Winline
4488 @opindex Winline
4489 @opindex Wno-inline
4490 Warn if a function can not be inlined and it was declared as inline.
4491 Even with this option, the compiler will not warn about failures to
4492 inline functions declared in system headers.
4493
4494 The compiler uses a variety of heuristics to determine whether or not
4495 to inline a function.  For example, the compiler takes into account
4496 the size of the function being inlined and the amount of inlining
4497 that has already been done in the current function.  Therefore,
4498 seemingly insignificant changes in the source program can cause the
4499 warnings produced by @option{-Winline} to appear or disappear.
4500
4501 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4502 @opindex Wno-invalid-offsetof
4503 @opindex Winvalid-offsetof
4504 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4505 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4506 to a non-POD type is undefined.  In existing C++ implementations,
4507 however, @samp{offsetof} typically gives meaningful results even when
4508 applied to certain kinds of non-POD types. (Such as a simple
4509 @samp{struct} that fails to be a POD type only by virtue of having a
4510 constructor.)  This flag is for users who are aware that they are
4511 writing nonportable code and who have deliberately chosen to ignore the
4512 warning about it.
4513
4514 The restrictions on @samp{offsetof} may be relaxed in a future version
4515 of the C++ standard.
4516
4517 @item -Wno-int-to-pointer-cast
4518 @opindex Wno-int-to-pointer-cast
4519 @opindex Wint-to-pointer-cast
4520 Suppress warnings from casts to pointer type of an integer of a
4521 different size. In C++, casting to a pointer type of smaller size is
4522 an error. @option{Wint-to-pointer-cast} is enabled by default.
4523
4524
4525 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4526 @opindex Wno-pointer-to-int-cast
4527 @opindex Wpointer-to-int-cast
4528 Suppress warnings from casts from a pointer to an integer type of a
4529 different size.
4530
4531 @item -Winvalid-pch
4532 @opindex Winvalid-pch
4533 @opindex Wno-invalid-pch
4534 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4535 the search path but can't be used.
4536
4537 @item -Wlong-long
4538 @opindex Wlong-long
4539 @opindex Wno-long-long
4540 Warn if @samp{long long} type is used.  This is enabled by either
4541 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4542 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4543
4544 @item -Wvariadic-macros
4545 @opindex Wvariadic-macros
4546 @opindex Wno-variadic-macros
4547 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4548 alternate syntax when in pedantic ISO C99 mode.  This is default.
4549 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4550
4551 @item -Wvector-operation-performance
4552 @opindex Wvector-operation-performance
4553 @opindex Wno-vector-operation-performance
4554 Warn if vector operation is not implemented via SIMD capabilities of the
4555 architecture.  Mainly useful for the performance tuning.
4556 Vector operation can be implemented @code{piecewise} which means that the
4557 scalar operation is performed on every vector element; 
4558 @code{in parallel} which means that the vector operation is implemented
4559 using scalars of wider type, which normally is more performance efficient;
4560 and @code{as a single scalar} which means that vector fits into a
4561 scalar type.
4562
4563 @item -Wvla
4564 @opindex Wvla
4565 @opindex Wno-vla
4566 Warn if variable length array is used in the code.
4567 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4568 the variable length array.
4569
4570 @item -Wvolatile-register-var
4571 @opindex Wvolatile-register-var
4572 @opindex Wno-volatile-register-var
4573 Warn if a register variable is declared volatile.  The volatile
4574 modifier does not inhibit all optimizations that may eliminate reads
4575 and/or writes to register variables.  This warning is enabled by
4576 @option{-Wall}.
4577
4578 @item -Wdisabled-optimization
4579 @opindex Wdisabled-optimization
4580 @opindex Wno-disabled-optimization
4581 Warn if a requested optimization pass is disabled.  This warning does
4582 not generally indicate that there is anything wrong with your code; it
4583 merely indicates that GCC's optimizers were unable to handle the code
4584 effectively.  Often, the problem is that your code is too big or too
4585 complex; GCC will refuse to optimize programs when the optimization
4586 itself is likely to take inordinate amounts of time.
4587
4588 @item -Wpointer-sign @r{(C and Objective-C only)}
4589 @opindex Wpointer-sign
4590 @opindex Wno-pointer-sign
4591 Warn for pointer argument passing or assignment with different signedness.
4592 This option is only supported for C and Objective-C@.  It is implied by
4593 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4594 @option{-Wno-pointer-sign}.
4595
4596 @item -Wstack-protector
4597 @opindex Wstack-protector
4598 @opindex Wno-stack-protector
4599 This option is only active when @option{-fstack-protector} is active.  It
4600 warns about functions that will not be protected against stack smashing.
4601
4602 @item -Wno-mudflap
4603 @opindex Wno-mudflap
4604 Suppress warnings about constructs that cannot be instrumented by
4605 @option{-fmudflap}.
4606
4607 @item -Woverlength-strings
4608 @opindex Woverlength-strings
4609 @opindex Wno-overlength-strings
4610 Warn about string constants which are longer than the ``minimum
4611 maximum'' length specified in the C standard.  Modern compilers
4612 generally allow string constants which are much longer than the
4613 standard's minimum limit, but very portable programs should avoid
4614 using longer strings.
4615
4616 The limit applies @emph{after} string constant concatenation, and does
4617 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4618 C99, it was raised to 4095.  C++98 does not specify a normative
4619 minimum maximum, so we do not diagnose overlength strings in C++@.
4620
4621 This option is implied by @option{-pedantic}, and can be disabled with
4622 @option{-Wno-overlength-strings}.
4623
4624 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4625 @opindex Wunsuffixed-float-constants
4626
4627 GCC will issue a warning for any floating constant that does not have
4628 a suffix.  When used together with @option{-Wsystem-headers} it will
4629 warn about such constants in system header files.  This can be useful
4630 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4631 from the decimal floating-point extension to C99.
4632 @end table
4633
4634 @node Debugging Options
4635 @section Options for Debugging Your Program or GCC
4636 @cindex options, debugging
4637 @cindex debugging information options
4638
4639 GCC has various special options that are used for debugging
4640 either your program or GCC:
4641
4642 @table @gcctabopt
4643 @item -g
4644 @opindex g
4645 Produce debugging information in the operating system's native format
4646 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4647 information.
4648
4649 On most systems that use stabs format, @option{-g} enables use of extra
4650 debugging information that only GDB can use; this extra information
4651 makes debugging work better in GDB but will probably make other debuggers
4652 crash or
4653 refuse to read the program.  If you want to control for certain whether
4654 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4655 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4656
4657 GCC allows you to use @option{-g} with
4658 @option{-O}.  The shortcuts taken by optimized code may occasionally
4659 produce surprising results: some variables you declared may not exist
4660 at all; flow of control may briefly move where you did not expect it;
4661 some statements may not be executed because they compute constant
4662 results or their values were already at hand; some statements may
4663 execute in different places because they were moved out of loops.
4664
4665 Nevertheless it proves possible to debug optimized output.  This makes
4666 it reasonable to use the optimizer for programs that might have bugs.
4667
4668 The following options are useful when GCC is generated with the
4669 capability for more than one debugging format.
4670
4671 @item -ggdb
4672 @opindex ggdb
4673 Produce debugging information for use by GDB@.  This means to use the
4674 most expressive format available (DWARF 2, stabs, or the native format
4675 if neither of those are supported), including GDB extensions if at all
4676 possible.
4677
4678 @item -gstabs
4679 @opindex gstabs
4680 Produce debugging information in stabs format (if that is supported),
4681 without GDB extensions.  This is the format used by DBX on most BSD
4682 systems.  On MIPS, Alpha and System V Release 4 systems this option
4683 produces stabs debugging output which is not understood by DBX or SDB@.
4684 On System V Release 4 systems this option requires the GNU assembler.
4685
4686 @item -feliminate-unused-debug-symbols
4687 @opindex feliminate-unused-debug-symbols
4688 Produce debugging information in stabs format (if that is supported),
4689 for only symbols that are actually used.
4690
4691 @item -femit-class-debug-always
4692 Instead of emitting debugging information for a C++ class in only one
4693 object file, emit it in all object files using the class.  This option
4694 should be used only with debuggers that are unable to handle the way GCC
4695 normally emits debugging information for classes because using this
4696 option will increase the size of debugging information by as much as a
4697 factor of two.
4698
4699 @item -fno-debug-types-section
4700 @opindex fno-debug-types-section
4701 @opindex fdebug-types-section
4702 By default when using DWARF v4 or higher type DIEs will be put into
4703 their own .debug_types section instead of making them part of the
4704 .debug_info section.  It is more efficient to put them in a separate
4705 comdat sections since the linker will then be able to remove duplicates.
4706 But not all DWARF consumers support .debug_types sections yet.
4707
4708 @item -gstabs+
4709 @opindex gstabs+
4710 Produce debugging information in stabs format (if that is supported),
4711 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4712 use of these extensions is likely to make other debuggers crash or
4713 refuse to read the program.
4714
4715 @item -gcoff
4716 @opindex gcoff
4717 Produce debugging information in COFF format (if that is supported).
4718 This is the format used by SDB on most System V systems prior to
4719 System V Release 4.
4720
4721 @item -gxcoff
4722 @opindex gxcoff
4723 Produce debugging information in XCOFF format (if that is supported).
4724 This is the format used by the DBX debugger on IBM RS/6000 systems.
4725
4726 @item -gxcoff+
4727 @opindex gxcoff+
4728 Produce debugging information in XCOFF format (if that is supported),
4729 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4730 use of these extensions is likely to make other debuggers crash or
4731 refuse to read the program, and may cause assemblers other than the GNU
4732 assembler (GAS) to fail with an error.
4733
4734 @item -gdwarf-@var{version}
4735 @opindex gdwarf-@var{version}
4736 Produce debugging information in DWARF format (if that is
4737 supported).  This is the format used by DBX on IRIX 6.  The value
4738 of @var{version} may be either 2, 3 or 4; the default version is 2.
4739
4740 Note that with DWARF version 2 some ports require, and will always
4741 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4742
4743 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4744 for maximum benefit.
4745
4746 @item -grecord-gcc-switches
4747 @opindex grecord-gcc-switches
4748 This switch causes the command line options, that were used to invoke the
4749 compiler and may affect code generation, to be appended to the
4750 DW_AT_producer attribute in DWARF debugging information.  The options
4751 are concatenated with spaces separating them from each other and from
4752 the compiler version.  See also @option{-frecord-gcc-switches} for another
4753 way of storing compiler options into the object file.
4754
4755 @item -gno-record-gcc-switches
4756 @opindex gno-record-gcc-switches
4757 Disallow appending command line options to the DW_AT_producer attribute
4758 in DWARF debugging information.  This is the default.
4759
4760 @item -gstrict-dwarf
4761 @opindex gstrict-dwarf
4762 Disallow using extensions of later DWARF standard version than selected
4763 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4764 DWARF extensions from later standard versions is allowed.
4765
4766 @item -gno-strict-dwarf
4767 @opindex gno-strict-dwarf
4768 Allow using extensions of later DWARF standard version than selected with
4769 @option{-gdwarf-@var{version}}.
4770
4771 @item -gvms
4772 @opindex gvms
4773 Produce debugging information in VMS debug format (if that is
4774 supported).  This is the format used by DEBUG on VMS systems.
4775
4776 @item -g@var{level}
4777 @itemx -ggdb@var{level}
4778 @itemx -gstabs@var{level}
4779 @itemx -gcoff@var{level}
4780 @itemx -gxcoff@var{level}
4781 @itemx -gvms@var{level}
4782 Request debugging information and also use @var{level} to specify how
4783 much information.  The default level is 2.
4784
4785 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4786 @option{-g}.
4787
4788 Level 1 produces minimal information, enough for making backtraces in
4789 parts of the program that you don't plan to debug.  This includes
4790 descriptions of functions and external variables, but no information
4791 about local variables and no line numbers.
4792
4793 Level 3 includes extra information, such as all the macro definitions
4794 present in the program.  Some debuggers support macro expansion when
4795 you use @option{-g3}.
4796
4797 @option{-gdwarf-2} does not accept a concatenated debug level, because
4798 GCC used to support an option @option{-gdwarf} that meant to generate
4799 debug information in version 1 of the DWARF format (which is very
4800 different from version 2), and it would have been too confusing.  That
4801 debug format is long obsolete, but the option cannot be changed now.
4802 Instead use an additional @option{-g@var{level}} option to change the
4803 debug level for DWARF.
4804
4805 @item -gtoggle
4806 @opindex gtoggle
4807 Turn off generation of debug info, if leaving out this option would have
4808 generated it, or turn it on at level 2 otherwise.  The position of this
4809 argument in the command line does not matter, it takes effect after all
4810 other options are processed, and it does so only once, no matter how
4811 many times it is given.  This is mainly intended to be used with
4812 @option{-fcompare-debug}.
4813
4814 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4815 @opindex fdump-final-insns
4816 Dump the final internal representation (RTL) to @var{file}.  If the
4817 optional argument is omitted (or if @var{file} is @code{.}), the name
4818 of the dump file will be determined by appending @code{.gkd} to the
4819 compilation output file name.
4820
4821 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4822 @opindex fcompare-debug
4823 @opindex fno-compare-debug
4824 If no error occurs during compilation, run the compiler a second time,
4825 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4826 passed to the second compilation.  Dump the final internal
4827 representation in both compilations, and print an error if they differ.
4828
4829 If the equal sign is omitted, the default @option{-gtoggle} is used.
4830
4831 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4832 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4833 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4834 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4835 is used.
4836
4837 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4838 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4839 of the final representation and the second compilation, preventing even
4840 @env{GCC_COMPARE_DEBUG} from taking effect.
4841
4842 To verify full coverage during @option{-fcompare-debug} testing, set
4843 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4844 which GCC will reject as an invalid option in any actual compilation
4845 (rather than preprocessing, assembly or linking).  To get just a
4846 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4847 not overridden} will do.
4848
4849 @item -fcompare-debug-second
4850 @opindex fcompare-debug-second
4851 This option is implicitly passed to the compiler for the second
4852 compilation requested by @option{-fcompare-debug}, along with options to
4853 silence warnings, and omitting other options that would cause
4854 side-effect compiler outputs to files or to the standard output.  Dump
4855 files and preserved temporary files are renamed so as to contain the
4856 @code{.gk} additional extension during the second compilation, to avoid
4857 overwriting those generated by the first.
4858
4859 When this option is passed to the compiler driver, it causes the
4860 @emph{first} compilation to be skipped, which makes it useful for little
4861 other than debugging the compiler proper.
4862
4863 @item -feliminate-dwarf2-dups
4864 @opindex feliminate-dwarf2-dups
4865 Compress DWARF2 debugging information by eliminating duplicated
4866 information about each symbol.  This option only makes sense when
4867 generating DWARF2 debugging information with @option{-gdwarf-2}.
4868
4869 @item -femit-struct-debug-baseonly
4870 Emit debug information for struct-like types
4871 only when the base name of the compilation source file
4872 matches the base name of file in which the struct was defined.
4873
4874 This option substantially reduces the size of debugging information,
4875 but at significant potential loss in type information to the debugger.
4876 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4877 See @option{-femit-struct-debug-detailed} for more detailed control.
4878
4879 This option works only with DWARF 2.
4880
4881 @item -femit-struct-debug-reduced
4882 Emit debug information for struct-like types
4883 only when the base name of the compilation source file
4884 matches the base name of file in which the type was defined,
4885 unless the struct is a template or defined in a system header.
4886
4887 This option significantly reduces the size of debugging information,
4888 with some potential loss in type information to the debugger.
4889 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4890 See @option{-femit-struct-debug-detailed} for more detailed control.
4891
4892 This option works only with DWARF 2.
4893
4894 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4895 Specify the struct-like types
4896 for which the compiler will generate debug information.
4897 The intent is to reduce duplicate struct debug information
4898 between different object files within the same program.
4899
4900 This option is a detailed version of
4901 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4902 which will serve for most needs.
4903
4904 A specification has the syntax@*
4905 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4906
4907 The optional first word limits the specification to
4908 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4909 A struct type is used directly when it is the type of a variable, member.
4910 Indirect uses arise through pointers to structs.
4911 That is, when use of an incomplete struct would be legal, the use is indirect.
4912 An example is
4913 @samp{struct one direct; struct two * indirect;}.
4914
4915 The optional second word limits the specification to
4916 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4917 Generic structs are a bit complicated to explain.
4918 For C++, these are non-explicit specializations of template classes,
4919 or non-template classes within the above.
4920 Other programming languages have generics,
4921 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4922
4923 The third word specifies the source files for those
4924 structs for which the compiler will emit debug information.
4925 The values @samp{none} and @samp{any} have the normal meaning.
4926 The value @samp{base} means that
4927 the base of name of the file in which the type declaration appears
4928 must match the base of the name of the main compilation file.
4929 In practice, this means that
4930 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4931 but types declared in other header will not.
4932 The value @samp{sys} means those types satisfying @samp{base}
4933 or declared in system or compiler headers.
4934
4935 You may need to experiment to determine the best settings for your application.
4936
4937 The default is @samp{-femit-struct-debug-detailed=all}.
4938
4939 This option works only with DWARF 2.
4940
4941 @item -fno-merge-debug-strings
4942 @opindex fmerge-debug-strings
4943 @opindex fno-merge-debug-strings
4944 Direct the linker to not merge together strings in the debugging
4945 information which are identical in different object files.  Merging is
4946 not supported by all assemblers or linkers.  Merging decreases the size
4947 of the debug information in the output file at the cost of increasing
4948 link processing time.  Merging is enabled by default.
4949
4950 @item -fdebug-prefix-map=@var{old}=@var{new}
4951 @opindex fdebug-prefix-map
4952 When compiling files in directory @file{@var{old}}, record debugging
4953 information describing them as in @file{@var{new}} instead.
4954
4955 @item -fno-dwarf2-cfi-asm
4956 @opindex fdwarf2-cfi-asm
4957 @opindex fno-dwarf2-cfi-asm
4958 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4959 instead of using GAS @code{.cfi_*} directives.
4960
4961 @cindex @command{prof}
4962 @item -p
4963 @opindex p
4964 Generate extra code to write profile information suitable for the
4965 analysis program @command{prof}.  You must use this option when compiling
4966 the source files you want data about, and you must also use it when
4967 linking.
4968
4969 @cindex @command{gprof}
4970 @item -pg
4971 @opindex pg
4972 Generate extra code to write profile information suitable for the
4973 analysis program @command{gprof}.  You must use this option when compiling
4974 the source files you want data about, and you must also use it when
4975 linking.
4976
4977 @item -Q
4978 @opindex Q
4979 Makes the compiler print out each function name as it is compiled, and
4980 print some statistics about each pass when it finishes.
4981
4982 @item -ftime-report
4983 @opindex ftime-report
4984 Makes the compiler print some statistics about the time consumed by each
4985 pass when it finishes.
4986
4987 @item -fmem-report
4988 @opindex fmem-report
4989 Makes the compiler print some statistics about permanent memory
4990 allocation when it finishes.
4991
4992 @item -fpre-ipa-mem-report
4993 @opindex fpre-ipa-mem-report
4994 @item -fpost-ipa-mem-report
4995 @opindex fpost-ipa-mem-report
4996 Makes the compiler print some statistics about permanent memory
4997 allocation before or after interprocedural optimization.
4998
4999 @item -fstack-usage
5000 @opindex fstack-usage
5001 Makes the compiler output stack usage information for the program, on a
5002 per-function basis.  The filename for the dump is made by appending
5003 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5004 the output file, if explicitly specified and it is not an executable,
5005 otherwise it is the basename of the source file.  An entry is made up
5006 of three fields:
5007
5008 @itemize
5009 @item
5010 The name of the function.
5011 @item
5012 A number of bytes.
5013 @item
5014 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5015 @end itemize
5016
5017 The qualifier @code{static} means that the function manipulates the stack
5018 statically: a fixed number of bytes are allocated for the frame on function
5019 entry and released on function exit; no stack adjustments are otherwise made
5020 in the function.  The second field is this fixed number of bytes.
5021
5022 The qualifier @code{dynamic} means that the function manipulates the stack
5023 dynamically: in addition to the static allocation described above, stack
5024 adjustments are made in the body of the function, for example to push/pop
5025 arguments around function calls.  If the qualifier @code{bounded} is also
5026 present, the amount of these adjustments is bounded at compile-time and
5027 the second field is an upper bound of the total amount of stack used by
5028 the function.  If it is not present, the amount of these adjustments is
5029 not bounded at compile-time and the second field only represents the
5030 bounded part.
5031
5032 @item -fprofile-arcs
5033 @opindex fprofile-arcs
5034 Add code so that program flow @dfn{arcs} are instrumented.  During
5035 execution the program records how many times each branch and call is
5036 executed and how many times it is taken or returns.  When the compiled
5037 program exits it saves this data to a file called
5038 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5039 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5040 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5041 @var{auxname} is generated from the name of the output file, if
5042 explicitly specified and it is not the final executable, otherwise it is
5043 the basename of the source file.  In both cases any suffix is removed
5044 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5045 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5046 @xref{Cross-profiling}.
5047
5048 @cindex @command{gcov}
5049 @item --coverage
5050 @opindex coverage
5051
5052 This option is used to compile and link code instrumented for coverage
5053 analysis.  The option is a synonym for @option{-fprofile-arcs}
5054 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5055 linking).  See the documentation for those options for more details.
5056
5057 @itemize
5058
5059 @item
5060 Compile the source files with @option{-fprofile-arcs} plus optimization
5061 and code generation options.  For test coverage analysis, use the
5062 additional @option{-ftest-coverage} option.  You do not need to profile
5063 every source file in a program.
5064
5065 @item
5066 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5067 (the latter implies the former).
5068
5069 @item
5070 Run the program on a representative workload to generate the arc profile
5071 information.  This may be repeated any number of times.  You can run
5072 concurrent instances of your program, and provided that the file system
5073 supports locking, the data files will be correctly updated.  Also
5074 @code{fork} calls are detected and correctly handled (double counting
5075 will not happen).
5076
5077 @item
5078 For profile-directed optimizations, compile the source files again with
5079 the same optimization and code generation options plus
5080 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5081 Control Optimization}).
5082
5083 @item
5084 For test coverage analysis, use @command{gcov} to produce human readable
5085 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5086 @command{gcov} documentation for further information.
5087
5088 @end itemize
5089
5090 With @option{-fprofile-arcs}, for each function of your program GCC
5091 creates a program flow graph, then finds a spanning tree for the graph.
5092 Only arcs that are not on the spanning tree have to be instrumented: the
5093 compiler adds code to count the number of times that these arcs are
5094 executed.  When an arc is the only exit or only entrance to a block, the
5095 instrumentation code can be added to the block; otherwise, a new basic
5096 block must be created to hold the instrumentation code.
5097
5098 @need 2000
5099 @item -ftest-coverage
5100 @opindex ftest-coverage
5101 Produce a notes file that the @command{gcov} code-coverage utility
5102 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5103 show program coverage.  Each source file's note file is called
5104 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5105 above for a description of @var{auxname} and instructions on how to
5106 generate test coverage data.  Coverage data will match the source files
5107 more closely, if you do not optimize.
5108
5109 @item -fdbg-cnt-list
5110 @opindex fdbg-cnt-list
5111 Print the name and the counter upper bound for all debug counters.
5112
5113
5114 @item -fdbg-cnt=@var{counter-value-list}
5115 @opindex fdbg-cnt
5116 Set the internal debug counter upper bound.  @var{counter-value-list}
5117 is a comma-separated list of @var{name}:@var{value} pairs
5118 which sets the upper bound of each debug counter @var{name} to @var{value}.
5119 All debug counters have the initial upper bound of @var{UINT_MAX},
5120 thus dbg_cnt() returns true always unless the upper bound is set by this option.
5121 e.g. With -fdbg-cnt=dce:10,tail_call:0
5122 dbg_cnt(dce) will return true only for first 10 invocations
5123
5124 @itemx -fenable-@var{kind}-@var{pass}
5125 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5126 @opindex fdisable-
5127 @opindex fenable-
5128
5129 This is a set of debugging options that are used to explicitly disable/enable
5130 optimization passes. For compiler users, regular options for enabling/disabling
5131 passes should be used instead.
5132
5133 @itemize
5134
5135 @item -fdisable-ipa-@var{pass}
5136 Disable ipa pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5137 statically invoked in the compiler multiple times, the pass name should be
5138 appended with a sequential number starting from 1.
5139
5140 @item -fdisable-rtl-@var{pass}
5141 @item -fdisable-rtl-@var{pass}=@var{range-list}
5142 Disable rtl pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5143 statically invoked in the compiler multiple times, the pass name should be
5144 appended with a sequential number starting from 1.  @var{range-list} is a comma
5145 seperated list of function ranges or assembler names.  Each range is a number
5146 pair seperated by a colon.  The range is inclusive in both ends.  If the range
5147 is trivial, the number pair can be simplified as a single number.  If the
5148 function's cgraph node's @var{uid} is falling within one of the specified ranges,
5149 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5150 function header of a dump file, and the pass names can be dumped by using
5151 option @option{-fdump-passes}.
5152
5153 @item -fdisable-tree-@var{pass}
5154 @item -fdisable-tree-@var{pass}=@var{range-list}
5155 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5156 option arguments.
5157
5158 @item -fenable-ipa-@var{pass}
5159 Enable ipa pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5160 statically invoked in the compiler multiple times, the pass name should be
5161 appended with a sequential number starting from 1.
5162
5163 @item -fenable-rtl-@var{pass}
5164 @item -fenable-rtl-@var{pass}=@var{range-list}
5165 Enable rtl pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5166 description and examples.
5167
5168 @item -fenable-tree-@var{pass}
5169 @item -fenable-tree-@var{pass}=@var{range-list}
5170 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5171 of option arguments.
5172
5173 @smallexample
5174
5175 # disable ccp1 for all functions
5176    -fdisable-tree-ccp1
5177 # disable complete unroll for function whose cgraph node uid is 1
5178    -fenable-tree-cunroll=1
5179 # disable gcse2 for functions at the following ranges [1,1],
5180 # [300,400], and [400,1000]
5181 # disable gcse2 for functions foo and foo2
5182    -fdisable-rtl-gcse2=foo,foo2
5183 # disable early inlining
5184    -fdisable-tree-einline
5185 # disable ipa inlining
5186    -fdisable-ipa-inline
5187 # enable tree full unroll
5188    -fenable-tree-unroll
5189
5190 @end smallexample
5191
5192 @end itemize
5193
5194 @item -d@var{letters}
5195 @itemx -fdump-rtl-@var{pass}
5196 @opindex d
5197 Says to make debugging dumps during compilation at times specified by
5198 @var{letters}.  This is used for debugging the RTL-based passes of the
5199 compiler.  The file names for most of the dumps are made by appending
5200 a pass number and a word to the @var{dumpname}, and the files are
5201 created in the directory of the output file.  Note that the pass
5202 number is computed statically as passes get registered into the pass
5203 manager.  Thus the numbering is not related to the dynamic order of
5204 execution of passes.  In particular, a pass installed by a plugin
5205 could have a number over 200 even if it executed quite early.
5206 @var{dumpname} is generated from the name of the output file, if
5207 explicitly specified and it is not an executable, otherwise it is the
5208 basename of the source file. These switches may have different effects
5209 when @option{-E} is used for preprocessing.
5210
5211 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5212 @option{-d} option @var{letters}.  Here are the possible
5213 letters for use in @var{pass} and @var{letters}, and their meanings:
5214
5215 @table @gcctabopt
5216
5217 @item -fdump-rtl-alignments
5218 @opindex fdump-rtl-alignments
5219 Dump after branch alignments have been computed.
5220
5221 @item -fdump-rtl-asmcons
5222 @opindex fdump-rtl-asmcons
5223 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5224
5225 @item -fdump-rtl-auto_inc_dec
5226 @opindex fdump-rtl-auto_inc_dec
5227 Dump after auto-inc-dec discovery.  This pass is only run on
5228 architectures that have auto inc or auto dec instructions.
5229
5230 @item -fdump-rtl-barriers
5231 @opindex fdump-rtl-barriers
5232 Dump after cleaning up the barrier instructions.
5233
5234 @item -fdump-rtl-bbpart
5235 @opindex fdump-rtl-bbpart
5236 Dump after partitioning hot and cold basic blocks.
5237
5238 @item -fdump-rtl-bbro
5239 @opindex fdump-rtl-bbro
5240 Dump after block reordering.
5241
5242 @item -fdump-rtl-btl1
5243 @itemx -fdump-rtl-btl2
5244 @opindex fdump-rtl-btl2
5245 @opindex fdump-rtl-btl2
5246 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5247 after the two branch
5248 target load optimization passes.
5249
5250 @item -fdump-rtl-bypass
5251 @opindex fdump-rtl-bypass
5252 Dump after jump bypassing and control flow optimizations.
5253
5254 @item -fdump-rtl-combine
5255 @opindex fdump-rtl-combine
5256 Dump after the RTL instruction combination pass.
5257
5258 @item -fdump-rtl-compgotos
5259 @opindex fdump-rtl-compgotos
5260 Dump after duplicating the computed gotos.
5261
5262 @item -fdump-rtl-ce1
5263 @itemx -fdump-rtl-ce2
5264 @itemx -fdump-rtl-ce3
5265 @opindex fdump-rtl-ce1
5266 @opindex fdump-rtl-ce2
5267 @opindex fdump-rtl-ce3
5268 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5269 @option{-fdump-rtl-ce3} enable dumping after the three
5270 if conversion passes.
5271
5272 @itemx -fdump-rtl-cprop_hardreg
5273 @opindex fdump-rtl-cprop_hardreg
5274 Dump after hard register copy propagation.
5275
5276 @itemx -fdump-rtl-csa
5277 @opindex fdump-rtl-csa
5278 Dump after combining stack adjustments.
5279
5280 @item -fdump-rtl-cse1
5281 @itemx -fdump-rtl-cse2
5282 @opindex fdump-rtl-cse1
5283 @opindex fdump-rtl-cse2
5284 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5285 the two common sub-expression elimination passes.
5286
5287 @itemx -fdump-rtl-dce
5288 @opindex fdump-rtl-dce
5289 Dump after the standalone dead code elimination passes.
5290
5291 @itemx -fdump-rtl-dbr
5292 @opindex fdump-rtl-dbr
5293 Dump after delayed branch scheduling.
5294
5295 @item -fdump-rtl-dce1
5296 @itemx -fdump-rtl-dce2
5297 @opindex fdump-rtl-dce1
5298 @opindex fdump-rtl-dce2
5299 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5300 the two dead store elimination passes.
5301
5302 @item -fdump-rtl-eh
5303 @opindex fdump-rtl-eh
5304 Dump after finalization of EH handling code.
5305
5306 @item -fdump-rtl-eh_ranges
5307 @opindex fdump-rtl-eh_ranges
5308 Dump after conversion of EH handling range regions.
5309
5310 @item -fdump-rtl-expand
5311 @opindex fdump-rtl-expand
5312 Dump after RTL generation.
5313
5314 @item -fdump-rtl-fwprop1
5315 @itemx -fdump-rtl-fwprop2
5316 @opindex fdump-rtl-fwprop1
5317 @opindex fdump-rtl-fwprop2
5318 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5319 dumping after the two forward propagation passes.
5320
5321 @item -fdump-rtl-gcse1
5322 @itemx -fdump-rtl-gcse2
5323 @opindex fdump-rtl-gcse1
5324 @opindex fdump-rtl-gcse2
5325 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5326 after global common subexpression elimination.
5327
5328 @item -fdump-rtl-init-regs
5329 @opindex fdump-rtl-init-regs
5330 Dump after the initialization of the registers.
5331
5332 @item -fdump-rtl-initvals
5333 @opindex fdump-rtl-initvals
5334 Dump after the computation of the initial value sets.
5335
5336 @itemx -fdump-rtl-into_cfglayout
5337 @opindex fdump-rtl-into_cfglayout
5338 Dump after converting to cfglayout mode.
5339
5340 @item -fdump-rtl-ira
5341 @opindex fdump-rtl-ira
5342 Dump after iterated register allocation.
5343
5344 @item -fdump-rtl-jump
5345 @opindex fdump-rtl-jump
5346 Dump after the second jump optimization.
5347
5348 @item -fdump-rtl-loop2
5349 @opindex fdump-rtl-loop2
5350 @option{-fdump-rtl-loop2} enables dumping after the rtl
5351 loop optimization passes.
5352
5353 @item -fdump-rtl-mach
5354 @opindex fdump-rtl-mach
5355 Dump after performing the machine dependent reorganization pass, if that
5356 pass exists.
5357
5358 @item -fdump-rtl-mode_sw
5359 @opindex fdump-rtl-mode_sw
5360 Dump after removing redundant mode switches.
5361
5362 @item -fdump-rtl-rnreg
5363 @opindex fdump-rtl-rnreg
5364 Dump after register renumbering.
5365
5366 @itemx -fdump-rtl-outof_cfglayout
5367 @opindex fdump-rtl-outof_cfglayout
5368 Dump after converting from cfglayout mode.
5369
5370 @item -fdump-rtl-peephole2
5371 @opindex fdump-rtl-peephole2
5372 Dump after the peephole pass.
5373
5374 @item -fdump-rtl-postreload
5375 @opindex fdump-rtl-postreload
5376 Dump after post-reload optimizations.
5377
5378 @itemx -fdump-rtl-pro_and_epilogue
5379 @opindex fdump-rtl-pro_and_epilogue
5380 Dump after generating the function pro and epilogues.
5381
5382 @item -fdump-rtl-regmove
5383 @opindex fdump-rtl-regmove
5384 Dump after the register move pass.
5385
5386 @item -fdump-rtl-sched1
5387 @itemx -fdump-rtl-sched2
5388 @opindex fdump-rtl-sched1
5389 @opindex fdump-rtl-sched2
5390 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5391 after the basic block scheduling passes.
5392
5393 @item -fdump-rtl-see
5394 @opindex fdump-rtl-see
5395 Dump after sign extension elimination.
5396
5397 @item -fdump-rtl-seqabstr
5398 @opindex fdump-rtl-seqabstr
5399 Dump after common sequence discovery.
5400
5401 @item -fdump-rtl-shorten
5402 @opindex fdump-rtl-shorten
5403 Dump after shortening branches.
5404
5405 @item -fdump-rtl-sibling
5406 @opindex fdump-rtl-sibling
5407 Dump after sibling call optimizations.
5408
5409 @item -fdump-rtl-split1
5410 @itemx -fdump-rtl-split2
5411 @itemx -fdump-rtl-split3
5412 @itemx -fdump-rtl-split4
5413 @itemx -fdump-rtl-split5
5414 @opindex fdump-rtl-split1
5415 @opindex fdump-rtl-split2
5416 @opindex fdump-rtl-split3
5417 @opindex fdump-rtl-split4
5418 @opindex fdump-rtl-split5
5419 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5420 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5421 @option{-fdump-rtl-split5} enable dumping after five rounds of
5422 instruction splitting.
5423
5424 @item -fdump-rtl-sms
5425 @opindex fdump-rtl-sms
5426 Dump after modulo scheduling.  This pass is only run on some
5427 architectures.
5428
5429 @item -fdump-rtl-stack
5430 @opindex fdump-rtl-stack
5431 Dump after conversion from GCC's "flat register file" registers to the
5432 x87's stack-like registers.  This pass is only run on x86 variants.
5433
5434 @item -fdump-rtl-subreg1
5435 @itemx -fdump-rtl-subreg2
5436 @opindex fdump-rtl-subreg1
5437 @opindex fdump-rtl-subreg2
5438 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5439 the two subreg expansion passes.
5440
5441 @item -fdump-rtl-unshare
5442 @opindex fdump-rtl-unshare
5443 Dump after all rtl has been unshared.
5444
5445 @item -fdump-rtl-vartrack
5446 @opindex fdump-rtl-vartrack
5447 Dump after variable tracking.
5448
5449 @item -fdump-rtl-vregs
5450 @opindex fdump-rtl-vregs
5451 Dump after converting virtual registers to hard registers.
5452
5453 @item -fdump-rtl-web
5454 @opindex fdump-rtl-web
5455 Dump after live range splitting.
5456
5457 @item -fdump-rtl-regclass
5458 @itemx -fdump-rtl-subregs_of_mode_init
5459 @itemx -fdump-rtl-subregs_of_mode_finish
5460 @itemx -fdump-rtl-dfinit
5461 @itemx -fdump-rtl-dfinish
5462 @opindex fdump-rtl-regclass
5463 @opindex fdump-rtl-subregs_of_mode_init
5464 @opindex fdump-rtl-subregs_of_mode_finish
5465 @opindex fdump-rtl-dfinit
5466 @opindex fdump-rtl-dfinish
5467 These dumps are defined but always produce empty files.
5468
5469 @item -fdump-rtl-all
5470 @opindex fdump-rtl-all
5471 Produce all the dumps listed above.
5472
5473 @item -dA
5474 @opindex dA
5475 Annotate the assembler output with miscellaneous debugging information.
5476
5477 @item -dD
5478 @opindex dD
5479 Dump all macro definitions, at the end of preprocessing, in addition to
5480 normal output.
5481
5482 @item -dH
5483 @opindex dH
5484 Produce a core dump whenever an error occurs.
5485
5486 @item -dm
5487 @opindex dm
5488 Print statistics on memory usage, at the end of the run, to
5489 standard error.
5490
5491 @item -dp
5492 @opindex dp
5493 Annotate the assembler output with a comment indicating which
5494 pattern and alternative was used.  The length of each instruction is
5495 also printed.
5496
5497 @item -dP
5498 @opindex dP
5499 Dump the RTL in the assembler output as a comment before each instruction.
5500 Also turns on @option{-dp} annotation.
5501
5502 @item -dv
5503 @opindex dv
5504 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5505 dump a representation of the control flow graph suitable for viewing with VCG
5506 to @file{@var{file}.@var{pass}.vcg}.
5507
5508 @item -dx
5509 @opindex dx
5510 Just generate RTL for a function instead of compiling it.  Usually used
5511 with @option{-fdump-rtl-expand}.
5512 @end table
5513
5514 @item -fdump-noaddr
5515 @opindex fdump-noaddr
5516 When doing debugging dumps, suppress address output.  This makes it more
5517 feasible to use diff on debugging dumps for compiler invocations with
5518 different compiler binaries and/or different
5519 text / bss / data / heap / stack / dso start locations.
5520
5521 @item -fdump-unnumbered
5522 @opindex fdump-unnumbered
5523 When doing debugging dumps, suppress instruction numbers and address output.
5524 This makes it more feasible to use diff on debugging dumps for compiler
5525 invocations with different options, in particular with and without
5526 @option{-g}.
5527
5528 @item -fdump-unnumbered-links
5529 @opindex fdump-unnumbered-links
5530 When doing debugging dumps (see @option{-d} option above), suppress
5531 instruction numbers for the links to the previous and next instructions
5532 in a sequence.
5533
5534 @item -fdump-translation-unit @r{(C++ only)}
5535 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5536 @opindex fdump-translation-unit
5537 Dump a representation of the tree structure for the entire translation
5538 unit to a file.  The file name is made by appending @file{.tu} to the
5539 source file name, and the file is created in the same directory as the
5540 output file.  If the @samp{-@var{options}} form is used, @var{options}
5541 controls the details of the dump as described for the
5542 @option{-fdump-tree} options.
5543
5544 @item -fdump-class-hierarchy @r{(C++ only)}
5545 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5546 @opindex fdump-class-hierarchy
5547 Dump a representation of each class's hierarchy and virtual function
5548 table layout to a file.  The file name is made by appending
5549 @file{.class} to the source file name, and the file is created in the
5550 same directory as the output file.  If the @samp{-@var{options}} form
5551 is used, @var{options} controls the details of the dump as described
5552 for the @option{-fdump-tree} options.
5553
5554 @item -fdump-ipa-@var{switch}
5555 @opindex fdump-ipa
5556 Control the dumping at various stages of inter-procedural analysis
5557 language tree to a file.  The file name is generated by appending a
5558 switch specific suffix to the source file name, and the file is created
5559 in the same directory as the output file.  The following dumps are
5560 possible:
5561
5562 @table @samp
5563 @item all
5564 Enables all inter-procedural analysis dumps.
5565
5566 @item cgraph
5567 Dumps information about call-graph optimization, unused function removal,
5568 and inlining decisions.
5569
5570 @item inline
5571 Dump after function inlining.
5572
5573 @end table
5574
5575 @item -fdump-passes
5576 @opindex fdump-passes
5577 Dump the list of optimization passes that are turned on and off by
5578 the current command line options.
5579
5580 @item -fdump-statistics-@var{option}
5581 @opindex fdump-statistics
5582 Enable and control dumping of pass statistics in a separate file.  The
5583 file name is generated by appending a suffix ending in
5584 @samp{.statistics} to the source file name, and the file is created in
5585 the same directory as the output file.  If the @samp{-@var{option}}
5586 form is used, @samp{-stats} will cause counters to be summed over the
5587 whole compilation unit while @samp{-details} will dump every event as
5588 the passes generate them.  The default with no option is to sum
5589 counters for each function compiled.
5590
5591 @item -fdump-tree-@var{switch}
5592 @itemx -fdump-tree-@var{switch}-@var{options}
5593 @opindex fdump-tree
5594 Control the dumping at various stages of processing the intermediate
5595 language tree to a file.  The file name is generated by appending a
5596 switch specific suffix to the source file name, and the file is
5597 created in the same directory as the output file.  If the
5598 @samp{-@var{options}} form is used, @var{options} is a list of
5599 @samp{-} separated options that control the details of the dump.  Not
5600 all options are applicable to all dumps, those which are not
5601 meaningful will be ignored.  The following options are available
5602
5603 @table @samp
5604 @item address
5605 Print the address of each node.  Usually this is not meaningful as it
5606 changes according to the environment and source file.  Its primary use
5607 is for tying up a dump file with a debug environment.
5608 @item asmname
5609 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5610 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5611 use working backward from mangled names in the assembly file.
5612 @item slim
5613 Inhibit dumping of members of a scope or body of a function merely
5614 because that scope has been reached.  Only dump such items when they
5615 are directly reachable by some other path.  When dumping pretty-printed
5616 trees, this option inhibits dumping the bodies of control structures.
5617 @item raw
5618 Print a raw representation of the tree.  By default, trees are
5619 pretty-printed into a C-like representation.
5620 @item details
5621 Enable more detailed dumps (not honored by every dump option).
5622 @item stats
5623 Enable dumping various statistics about the pass (not honored by every dump
5624 option).
5625 @item blocks
5626 Enable showing basic block boundaries (disabled in raw dumps).
5627 @item vops
5628 Enable showing virtual operands for every statement.
5629 @item lineno
5630 Enable showing line numbers for statements.
5631 @item uid
5632 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5633 @item verbose
5634 Enable showing the tree dump for each statement.
5635 @item eh
5636 Enable showing the EH region number holding each statement.
5637 @item scev
5638 Enable showing scalar evolution analysis details.
5639 @item all
5640 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5641 and @option{lineno}.
5642 @end table
5643
5644 The following tree dumps are possible:
5645 @table @samp
5646
5647 @item original
5648 @opindex fdump-tree-original
5649 Dump before any tree based optimization, to @file{@var{file}.original}.
5650
5651 @item optimized
5652 @opindex fdump-tree-optimized
5653 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5654
5655 @item gimple
5656 @opindex fdump-tree-gimple
5657 Dump each function before and after the gimplification pass to a file.  The
5658 file name is made by appending @file{.gimple} to the source file name.
5659
5660 @item cfg
5661 @opindex fdump-tree-cfg
5662 Dump the control flow graph of each function to a file.  The file name is
5663 made by appending @file{.cfg} to the source file name.
5664
5665 @item vcg
5666 @opindex fdump-tree-vcg
5667 Dump the control flow graph of each function to a file in VCG format.  The
5668 file name is made by appending @file{.vcg} to the source file name.  Note
5669 that if the file contains more than one function, the generated file cannot
5670 be used directly by VCG@.  You will need to cut and paste each function's
5671 graph into its own separate file first.
5672
5673 @item ch
5674 @opindex fdump-tree-ch
5675 Dump each function after copying loop headers.  The file name is made by
5676 appending @file{.ch} to the source file name.
5677
5678 @item ssa
5679 @opindex fdump-tree-ssa
5680 Dump SSA related information to a file.  The file name is made by appending
5681 @file{.ssa} to the source file name.
5682
5683 @item alias
5684 @opindex fdump-tree-alias
5685 Dump aliasing information for each function.  The file name is made by
5686 appending @file{.alias} to the source file name.
5687
5688 @item ccp
5689 @opindex fdump-tree-ccp
5690 Dump each function after CCP@.  The file name is made by appending
5691 @file{.ccp} to the source file name.
5692
5693 @item storeccp
5694 @opindex fdump-tree-storeccp
5695 Dump each function after STORE-CCP@.  The file name is made by appending
5696 @file{.storeccp} to the source file name.
5697
5698 @item pre
5699 @opindex fdump-tree-pre
5700 Dump trees after partial redundancy elimination.  The file name is made
5701 by appending @file{.pre} to the source file name.
5702
5703 @item fre
5704 @opindex fdump-tree-fre
5705 Dump trees after full redundancy elimination.  The file name is made
5706 by appending @file{.fre} to the source file name.
5707
5708 @item copyprop
5709 @opindex fdump-tree-copyprop
5710 Dump trees after copy propagation.  The file name is made
5711 by appending @file{.copyprop} to the source file name.
5712
5713 @item store_copyprop
5714 @opindex fdump-tree-store_copyprop
5715 Dump trees after store copy-propagation.  The file name is made
5716 by appending @file{.store_copyprop} to the source file name.
5717
5718 @item dce
5719 @opindex fdump-tree-dce
5720 Dump each function after dead code elimination.  The file name is made by
5721 appending @file{.dce} to the source file name.
5722
5723 @item mudflap
5724 @opindex fdump-tree-mudflap
5725 Dump each function after adding mudflap instrumentation.  The file name is
5726 made by appending @file{.mudflap} to the source file name.
5727
5728 @item sra
5729 @opindex fdump-tree-sra
5730 Dump each function after performing scalar replacement of aggregates.  The
5731 file name is made by appending @file{.sra} to the source file name.
5732
5733 @item sink
5734 @opindex fdump-tree-sink
5735 Dump each function after performing code sinking.  The file name is made
5736 by appending @file{.sink} to the source file name.
5737
5738 @item dom
5739 @opindex fdump-tree-dom
5740 Dump each function after applying dominator tree optimizations.  The file
5741 name is made by appending @file{.dom} to the source file name.
5742
5743 @item dse
5744 @opindex fdump-tree-dse
5745 Dump each function after applying dead store elimination.  The file
5746 name is made by appending @file{.dse} to the source file name.
5747
5748 @item phiopt
5749 @opindex fdump-tree-phiopt
5750 Dump each function after optimizing PHI nodes into straightline code.  The file
5751 name is made by appending @file{.phiopt} to the source file name.
5752
5753 @item forwprop
5754 @opindex fdump-tree-forwprop
5755 Dump each function after forward propagating single use variables.  The file
5756 name is made by appending @file{.forwprop} to the source file name.
5757
5758 @item copyrename
5759 @opindex fdump-tree-copyrename
5760 Dump each function after applying the copy rename optimization.  The file
5761 name is made by appending @file{.copyrename} to the source file name.
5762
5763 @item nrv
5764 @opindex fdump-tree-nrv
5765 Dump each function after applying the named return value optimization on
5766 generic trees.  The file name is made by appending @file{.nrv} to the source
5767 file name.
5768
5769 @item vect
5770 @opindex fdump-tree-vect
5771 Dump each function after applying vectorization of loops.  The file name is
5772 made by appending @file{.vect} to the source file name.
5773
5774 @item slp
5775 @opindex fdump-tree-slp
5776 Dump each function after applying vectorization of basic blocks.  The file name
5777 is made by appending @file{.slp} to the source file name.
5778
5779 @item vrp
5780 @opindex fdump-tree-vrp
5781 Dump each function after Value Range Propagation (VRP).  The file name
5782 is made by appending @file{.vrp} to the source file name.
5783
5784 @item all
5785 @opindex fdump-tree-all
5786 Enable all the available tree dumps with the flags provided in this option.
5787 @end table
5788
5789 @item -ftree-vectorizer-verbose=@var{n}
5790 @opindex ftree-vectorizer-verbose
5791 This option controls the amount of debugging output the vectorizer prints.
5792 This information is written to standard error, unless
5793 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5794 in which case it is output to the usual dump listing file, @file{.vect}.
5795 For @var{n}=0 no diagnostic information is reported.
5796 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5797 and the total number of loops that got vectorized.
5798 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5799 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5800 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5801 level that @option{-fdump-tree-vect-stats} uses.
5802 Higher verbosity levels mean either more information dumped for each
5803 reported loop, or same amount of information reported for more loops:
5804 if @var{n}=3, vectorizer cost model information is reported.
5805 If @var{n}=4, alignment related information is added to the reports.
5806 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5807 memory access-patterns) is added to the reports.
5808 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5809 that did not pass the first analysis phase (i.e., may not be countable, or
5810 may have complicated control-flow).
5811 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5812 If @var{n}=8, SLP related information is added to the reports.
5813 For @var{n}=9, all the information the vectorizer generates during its
5814 analysis and transformation is reported.  This is the same verbosity level
5815 that @option{-fdump-tree-vect-details} uses.
5816
5817 @item -frandom-seed=@var{string}
5818 @opindex frandom-seed
5819 This option provides a seed that GCC uses when it would otherwise use
5820 random numbers.  It is used to generate certain symbol names
5821 that have to be different in every compiled file.  It is also used to
5822 place unique stamps in coverage data files and the object files that
5823 produce them.  You can use the @option{-frandom-seed} option to produce
5824 reproducibly identical object files.
5825
5826 The @var{string} should be different for every file you compile.
5827
5828 @item -fsched-verbose=@var{n}
5829 @opindex fsched-verbose
5830 On targets that use instruction scheduling, this option controls the
5831 amount of debugging output the scheduler prints.  This information is
5832 written to standard error, unless @option{-fdump-rtl-sched1} or
5833 @option{-fdump-rtl-sched2} is specified, in which case it is output
5834 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5835 respectively.  However for @var{n} greater than nine, the output is
5836 always printed to standard error.
5837
5838 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5839 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5840 For @var{n} greater than one, it also output basic block probabilities,
5841 detailed ready list information and unit/insn info.  For @var{n} greater
5842 than two, it includes RTL at abort point, control-flow and regions info.
5843 And for @var{n} over four, @option{-fsched-verbose} also includes
5844 dependence info.
5845
5846 @item -save-temps
5847 @itemx -save-temps=cwd
5848 @opindex save-temps
5849 Store the usual ``temporary'' intermediate files permanently; place them
5850 in the current directory and name them based on the source file.  Thus,
5851 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5852 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5853 preprocessed @file{foo.i} output file even though the compiler now
5854 normally uses an integrated preprocessor.
5855
5856 When used in combination with the @option{-x} command line option,
5857 @option{-save-temps} is sensible enough to avoid over writing an
5858 input source file with the same extension as an intermediate file.
5859 The corresponding intermediate file may be obtained by renaming the
5860 source file before using @option{-save-temps}.
5861
5862 If you invoke GCC in parallel, compiling several different source
5863 files that share a common base name in different subdirectories or the
5864 same source file compiled for multiple output destinations, it is
5865 likely that the different parallel compilers will interfere with each
5866 other, and overwrite the temporary files.  For instance:
5867
5868 @smallexample
5869 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5870 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5871 @end smallexample
5872
5873 may result in @file{foo.i} and @file{foo.o} being written to
5874 simultaneously by both compilers.
5875
5876 @item -save-temps=obj
5877 @opindex save-temps=obj
5878 Store the usual ``temporary'' intermediate files permanently.  If the
5879 @option{-o} option is used, the temporary files are based on the
5880 object file.  If the @option{-o} option is not used, the
5881 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5882
5883 For example:
5884
5885 @smallexample
5886 gcc -save-temps=obj -c foo.c
5887 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5888 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5889 @end smallexample
5890
5891 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5892 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5893 @file{dir2/yfoobar.o}.
5894
5895 @item -time@r{[}=@var{file}@r{]}
5896 @opindex time
5897 Report the CPU time taken by each subprocess in the compilation
5898 sequence.  For C source files, this is the compiler proper and assembler
5899 (plus the linker if linking is done).
5900
5901 Without the specification of an output file, the output looks like this:
5902
5903 @smallexample
5904 # cc1 0.12 0.01
5905 # as 0.00 0.01
5906 @end smallexample
5907
5908 The first number on each line is the ``user time'', that is time spent
5909 executing the program itself.  The second number is ``system time'',
5910 time spent executing operating system routines on behalf of the program.
5911 Both numbers are in seconds.
5912
5913 With the specification of an output file, the output is appended to the
5914 named file, and it looks like this:
5915
5916 @smallexample
5917 0.12 0.01 cc1 @var{options}
5918 0.00 0.01 as @var{options}
5919 @end smallexample
5920
5921 The ``user time'' and the ``system time'' are moved before the program
5922 name, and the options passed to the program are displayed, so that one
5923 can later tell what file was being compiled, and with which options.
5924
5925 @item -fvar-tracking
5926 @opindex fvar-tracking
5927 Run variable tracking pass.  It computes where variables are stored at each
5928 position in code.  Better debugging information is then generated
5929 (if the debugging information format supports this information).
5930
5931 It is enabled by default when compiling with optimization (@option{-Os},
5932 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5933 the debug info format supports it.
5934
5935 @item -fvar-tracking-assignments
5936 @opindex fvar-tracking-assignments
5937 @opindex fno-var-tracking-assignments
5938 Annotate assignments to user variables early in the compilation and
5939 attempt to carry the annotations over throughout the compilation all the
5940 way to the end, in an attempt to improve debug information while
5941 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
5942
5943 It can be enabled even if var-tracking is disabled, in which case
5944 annotations will be created and maintained, but discarded at the end.
5945
5946 @item -fvar-tracking-assignments-toggle
5947 @opindex fvar-tracking-assignments-toggle
5948 @opindex fno-var-tracking-assignments-toggle
5949 Toggle @option{-fvar-tracking-assignments}, in the same way that
5950 @option{-gtoggle} toggles @option{-g}.
5951
5952 @item -print-file-name=@var{library}
5953 @opindex print-file-name
5954 Print the full absolute name of the library file @var{library} that
5955 would be used when linking---and don't do anything else.  With this
5956 option, GCC does not compile or link anything; it just prints the
5957 file name.
5958
5959 @item -print-multi-directory
5960 @opindex print-multi-directory
5961 Print the directory name corresponding to the multilib selected by any
5962 other switches present in the command line.  This directory is supposed
5963 to exist in @env{GCC_EXEC_PREFIX}.
5964
5965 @item -print-multi-lib
5966 @opindex print-multi-lib
5967 Print the mapping from multilib directory names to compiler switches
5968 that enable them.  The directory name is separated from the switches by
5969 @samp{;}, and each switch starts with an @samp{@@} instead of the
5970 @samp{-}, without spaces between multiple switches.  This is supposed to
5971 ease shell-processing.
5972
5973 @item -print-multi-os-directory
5974 @opindex print-multi-os-directory
5975 Print the path to OS libraries for the selected
5976 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
5977 present in the @file{lib} subdirectory and no multilibs are used, this is
5978 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
5979 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
5980 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
5981 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
5982
5983 @item -print-prog-name=@var{program}
5984 @opindex print-prog-name
5985 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5986
5987 @item -print-libgcc-file-name
5988 @opindex print-libgcc-file-name
5989 Same as @option{-print-file-name=libgcc.a}.
5990
5991 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5992 but you do want to link with @file{libgcc.a}.  You can do
5993
5994 @smallexample
5995 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5996 @end smallexample
5997
5998 @item -print-search-dirs
5999 @opindex print-search-dirs
6000 Print the name of the configured installation directory and a list of
6001 program and library directories @command{gcc} will search---and don't do anything else.
6002
6003 This is useful when @command{gcc} prints the error message
6004 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6005 To resolve this you either need to put @file{cpp0} and the other compiler
6006 components where @command{gcc} expects to find them, or you can set the environment
6007 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6008 Don't forget the trailing @samp{/}.
6009 @xref{Environment Variables}.
6010
6011 @item -print-sysroot
6012 @opindex print-sysroot
6013 Print the target sysroot directory that will be used during
6014 compilation.  This is the target sysroot specified either at configure
6015 time or using the @option{--sysroot} option, possibly with an extra
6016 suffix that depends on compilation options.  If no target sysroot is
6017 specified, the option prints nothing.
6018
6019 @item -print-sysroot-headers-suffix
6020 @opindex print-sysroot-headers-suffix
6021 Print the suffix added to the target sysroot when searching for
6022 headers, or give an error if the compiler is not configured with such
6023 a suffix---and don't do anything else.
6024
6025 @item -dumpmachine
6026 @opindex dumpmachine
6027 Print the compiler's target machine (for example,
6028 @samp{i686-pc-linux-gnu})---and don't do anything else.
6029
6030 @item -dumpversion
6031 @opindex dumpversion
6032 Print the compiler version (for example, @samp{3.0})---and don't do
6033 anything else.
6034
6035 @item -dumpspecs
6036 @opindex dumpspecs
6037 Print the compiler's built-in specs---and don't do anything else.  (This
6038 is used when GCC itself is being built.)  @xref{Spec Files}.
6039
6040 @item -feliminate-unused-debug-types
6041 @opindex feliminate-unused-debug-types
6042 Normally, when producing DWARF2 output, GCC will emit debugging
6043 information for all types declared in a compilation
6044 unit, regardless of whether or not they are actually used
6045 in that compilation unit.  Sometimes this is useful, such as
6046 if, in the debugger, you want to cast a value to a type that is
6047 not actually used in your program (but is declared).  More often,
6048 however, this results in a significant amount of wasted space.
6049 With this option, GCC will avoid producing debug symbol output
6050 for types that are nowhere used in the source file being compiled.
6051 @end table
6052
6053 @node Optimize Options
6054 @section Options That Control Optimization
6055 @cindex optimize options
6056 @cindex options, optimization
6057
6058 These options control various sorts of optimizations.
6059
6060 Without any optimization option, the compiler's goal is to reduce the
6061 cost of compilation and to make debugging produce the expected
6062 results.  Statements are independent: if you stop the program with a
6063 breakpoint between statements, you can then assign a new value to any
6064 variable or change the program counter to any other statement in the
6065 function and get exactly the results you would expect from the source
6066 code.
6067
6068 Turning on optimization flags makes the compiler attempt to improve
6069 the performance and/or code size at the expense of compilation time
6070 and possibly the ability to debug the program.
6071
6072 The compiler performs optimization based on the knowledge it has of the
6073 program.  Compiling multiple files at once to a single output file mode allows
6074 the compiler to use information gained from all of the files when compiling
6075 each of them.
6076
6077 Not all optimizations are controlled directly by a flag.  Only
6078 optimizations that have a flag are listed in this section.
6079
6080 Most optimizations are only enabled if an @option{-O} level is set on
6081 the command line.  Otherwise they are disabled, even if individual
6082 optimization flags are specified.
6083
6084 Depending on the target and how GCC was configured, a slightly different
6085 set of optimizations may be enabled at each @option{-O} level than
6086 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
6087 to find out the exact set of optimizations that are enabled at each level.
6088 @xref{Overall Options}, for examples.
6089
6090 @table @gcctabopt
6091 @item -O
6092 @itemx -O1
6093 @opindex O
6094 @opindex O1
6095 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6096 more memory for a large function.
6097
6098 With @option{-O}, the compiler tries to reduce code size and execution
6099 time, without performing any optimizations that take a great deal of
6100 compilation time.
6101
6102 @option{-O} turns on the following optimization flags:
6103 @gccoptlist{
6104 -fauto-inc-dec @gol
6105 -fcompare-elim @gol
6106 -fcprop-registers @gol
6107 -fdce @gol
6108 -fdefer-pop @gol
6109 -fdelayed-branch @gol
6110 -fdse @gol
6111 -fguess-branch-probability @gol
6112 -fif-conversion2 @gol
6113 -fif-conversion @gol
6114 -fipa-pure-const @gol
6115 -fipa-profile @gol
6116 -fipa-reference @gol
6117 -fmerge-constants
6118 -fsplit-wide-types @gol
6119 -ftree-bit-ccp @gol
6120 -ftree-builtin-call-dce @gol
6121 -ftree-ccp @gol
6122 -ftree-ch @gol
6123 -ftree-copyrename @gol
6124 -ftree-dce @gol
6125 -ftree-dominator-opts @gol
6126 -ftree-dse @gol
6127 -ftree-forwprop @gol
6128 -ftree-fre @gol
6129 -ftree-phiprop @gol
6130 -ftree-sra @gol
6131 -ftree-pta @gol
6132 -ftree-ter @gol
6133 -funit-at-a-time}
6134
6135 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6136 where doing so does not interfere with debugging.
6137
6138 @item -O2
6139 @opindex O2
6140 Optimize even more.  GCC performs nearly all supported optimizations
6141 that do not involve a space-speed tradeoff.
6142 As compared to @option{-O}, this option increases both compilation time
6143 and the performance of the generated code.
6144
6145 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6146 also turns on the following optimization flags:
6147 @gccoptlist{-fthread-jumps @gol
6148 -falign-functions  -falign-jumps @gol
6149 -falign-loops  -falign-labels @gol
6150 -fcaller-saves @gol
6151 -fcrossjumping @gol
6152 -fcse-follow-jumps  -fcse-skip-blocks @gol
6153 -fdelete-null-pointer-checks @gol
6154 -fdevirtualize @gol
6155 -fexpensive-optimizations @gol
6156 -fgcse  -fgcse-lm  @gol
6157 -finline-small-functions @gol
6158 -findirect-inlining @gol
6159 -fipa-sra @gol
6160 -foptimize-sibling-calls @gol
6161 -fpartial-inlining @gol
6162 -fpeephole2 @gol
6163 -fregmove @gol
6164 -freorder-blocks  -freorder-functions @gol
6165 -frerun-cse-after-loop  @gol
6166 -fsched-interblock  -fsched-spec @gol
6167 -fschedule-insns  -fschedule-insns2 @gol
6168 -fstrict-aliasing -fstrict-overflow @gol
6169 -ftree-switch-conversion -ftree-tail-merge @gol
6170 -ftree-pre @gol
6171 -ftree-vrp}
6172
6173 Please note the warning under @option{-fgcse} about
6174 invoking @option{-O2} on programs that use computed gotos.
6175
6176 @item -O3
6177 @opindex O3
6178 Optimize yet more.  @option{-O3} turns on all optimizations specified
6179 by @option{-O2} and also turns on the @option{-finline-functions},
6180 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6181 @option{-fgcse-after-reload}, @option{-ftree-vectorize} and
6182 @option{-fipa-cp-clone} options.
6183
6184 @item -O0
6185 @opindex O0
6186 Reduce compilation time and make debugging produce the expected
6187 results.  This is the default.
6188
6189 @item -Os
6190 @opindex Os
6191 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6192 do not typically increase code size.  It also performs further
6193 optimizations designed to reduce code size.
6194
6195 @option{-Os} disables the following optimization flags:
6196 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6197 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6198 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6199
6200 @item -Ofast
6201 @opindex Ofast
6202 Disregard strict standards compliance.  @option{-Ofast} enables all
6203 @option{-O3} optimizations.  It also enables optimizations that are not
6204 valid for all standard compliant programs.
6205 It turns on @option{-ffast-math} and the Fortran-specific
6206 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6207
6208 If you use multiple @option{-O} options, with or without level numbers,
6209 the last such option is the one that is effective.
6210 @end table
6211
6212 Options of the form @option{-f@var{flag}} specify machine-independent
6213 flags.  Most flags have both positive and negative forms; the negative
6214 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
6215 below, only one of the forms is listed---the one you typically will
6216 use.  You can figure out the other form by either removing @samp{no-}
6217 or adding it.
6218
6219 The following options control specific optimizations.  They are either
6220 activated by @option{-O} options or are related to ones that are.  You
6221 can use the following flags in the rare cases when ``fine-tuning'' of
6222 optimizations to be performed is desired.
6223
6224 @table @gcctabopt
6225 @item -fno-default-inline
6226 @opindex fno-default-inline
6227 Do not make member functions inline by default merely because they are
6228 defined inside the class scope (C++ only).  Otherwise, when you specify
6229 @w{@option{-O}}, member functions defined inside class scope are compiled
6230 inline by default; i.e., you don't need to add @samp{inline} in front of
6231 the member function name.
6232
6233 @item -fno-defer-pop
6234 @opindex fno-defer-pop
6235 Always pop the arguments to each function call as soon as that function
6236 returns.  For machines which must pop arguments after a function call,
6237 the compiler normally lets arguments accumulate on the stack for several
6238 function calls and pops them all at once.
6239
6240 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6241
6242 @item -fforward-propagate
6243 @opindex fforward-propagate
6244 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6245 instructions and checks if the result can be simplified.  If loop unrolling
6246 is active, two passes are performed and the second is scheduled after
6247 loop unrolling.
6248
6249 This option is enabled by default at optimization levels @option{-O},
6250 @option{-O2}, @option{-O3}, @option{-Os}.
6251
6252 @item -ffp-contract=@var{style}
6253 @opindex ffp-contract
6254 @option{-ffp-contract=off} disables floating-point expression contraction.
6255 @option{-ffp-contract=fast} enables floating-point expression contraction
6256 such as forming of fused multiply-add operations if the target has
6257 native support for them.
6258 @option{-ffp-contract=on} enables floating-point expression contraction
6259 if allowed by the language standard.  This is currently not implemented
6260 and treated equal to @option{-ffp-contract=off}.
6261
6262 The default is @option{-ffp-contract=fast}.
6263
6264 @item -fomit-frame-pointer
6265 @opindex fomit-frame-pointer
6266 Don't keep the frame pointer in a register for functions that
6267 don't need one.  This avoids the instructions to save, set up and
6268 restore frame pointers; it also makes an extra register available
6269 in many functions.  @strong{It also makes debugging impossible on
6270 some machines.}
6271
6272 On some machines, such as the VAX, this flag has no effect, because
6273 the standard calling sequence automatically handles the frame pointer
6274 and nothing is saved by pretending it doesn't exist.  The
6275 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6276 whether a target machine supports this flag.  @xref{Registers,,Register
6277 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6278
6279 Starting with GCC version 4.6, the default setting (when not optimizing for
6280 size) for 32-bit Linux x86 and 32-bit Darwin x86 targets has been changed to
6281 @option{-fomit-frame-pointer}.  The default can be reverted to
6282 @option{-fno-omit-frame-pointer} by configuring GCC with the
6283 @option{--enable-frame-pointer} configure option.
6284
6285 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6286
6287 @item -foptimize-sibling-calls
6288 @opindex foptimize-sibling-calls
6289 Optimize sibling and tail recursive calls.
6290
6291 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6292
6293 @item -fno-inline
6294 @opindex fno-inline
6295 Don't pay attention to the @code{inline} keyword.  Normally this option
6296 is used to keep the compiler from expanding any functions inline.
6297 Note that if you are not optimizing, no functions can be expanded inline.
6298
6299 @item -finline-small-functions
6300 @opindex finline-small-functions
6301 Integrate functions into their callers when their body is smaller than expected
6302 function call code (so overall size of program gets smaller).  The compiler
6303 heuristically decides which functions are simple enough to be worth integrating
6304 in this way.
6305
6306 Enabled at level @option{-O2}.
6307
6308 @item -findirect-inlining
6309 @opindex findirect-inlining
6310 Inline also indirect calls that are discovered to be known at compile
6311 time thanks to previous inlining.  This option has any effect only
6312 when inlining itself is turned on by the @option{-finline-functions}
6313 or @option{-finline-small-functions} options.
6314
6315 Enabled at level @option{-O2}.
6316
6317 @item -finline-functions
6318 @opindex finline-functions
6319 Integrate all simple functions into their callers.  The compiler
6320 heuristically decides which functions are simple enough to be worth
6321 integrating in this way.
6322
6323 If all calls to a given function are integrated, and the function is
6324 declared @code{static}, then the function is normally not output as
6325 assembler code in its own right.
6326
6327 Enabled at level @option{-O3}.
6328
6329 @item -finline-functions-called-once
6330 @opindex finline-functions-called-once
6331 Consider all @code{static} functions called once for inlining into their
6332 caller even if they are not marked @code{inline}.  If a call to a given
6333 function is integrated, then the function is not output as assembler code
6334 in its own right.
6335
6336 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6337
6338 @item -fearly-inlining
6339 @opindex fearly-inlining
6340 Inline functions marked by @code{always_inline} and functions whose body seems
6341 smaller than the function call overhead early before doing
6342 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6343 makes profiling significantly cheaper and usually inlining faster on programs
6344 having large chains of nested wrapper functions.
6345
6346 Enabled by default.
6347
6348 @item -fipa-sra
6349 @opindex fipa-sra
6350 Perform interprocedural scalar replacement of aggregates, removal of
6351 unused parameters and replacement of parameters passed by reference
6352 by parameters passed by value.
6353
6354 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6355
6356 @item -finline-limit=@var{n}
6357 @opindex finline-limit
6358 By default, GCC limits the size of functions that can be inlined.  This flag
6359 allows coarse control of this limit.  @var{n} is the size of functions that
6360 can be inlined in number of pseudo instructions.
6361
6362 Inlining is actually controlled by a number of parameters, which may be
6363 specified individually by using @option{--param @var{name}=@var{value}}.
6364 The @option{-finline-limit=@var{n}} option sets some of these parameters
6365 as follows:
6366
6367 @table @gcctabopt
6368 @item max-inline-insns-single
6369 is set to @var{n}/2.
6370 @item max-inline-insns-auto
6371 is set to @var{n}/2.
6372 @end table
6373
6374 See below for a documentation of the individual
6375 parameters controlling inlining and for the defaults of these parameters.
6376
6377 @emph{Note:} there may be no value to @option{-finline-limit} that results
6378 in default behavior.
6379
6380 @emph{Note:} pseudo instruction represents, in this particular context, an
6381 abstract measurement of function's size.  In no way does it represent a count
6382 of assembly instructions and as such its exact meaning might change from one
6383 release to an another.
6384
6385 @item -fno-keep-inline-dllexport
6386 @opindex -fno-keep-inline-dllexport
6387 This is a more fine-grained version of @option{-fkeep-inline-functions},
6388 which applies only to functions that are declared using the @code{dllexport}
6389 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6390 Functions}.)
6391
6392 @item -fkeep-inline-functions
6393 @opindex fkeep-inline-functions
6394 In C, emit @code{static} functions that are declared @code{inline}
6395 into the object file, even if the function has been inlined into all
6396 of its callers.  This switch does not affect functions using the
6397 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6398 inline functions into the object file.
6399
6400 @item -fkeep-static-consts
6401 @opindex fkeep-static-consts
6402 Emit variables declared @code{static const} when optimization isn't turned
6403 on, even if the variables aren't referenced.
6404
6405 GCC enables this option by default.  If you want to force the compiler to
6406 check if the variable was referenced, regardless of whether or not
6407 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6408
6409 @item -fmerge-constants
6410 @opindex fmerge-constants
6411 Attempt to merge identical constants (string constants and floating point
6412 constants) across compilation units.
6413
6414 This option is the default for optimized compilation if the assembler and
6415 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6416 behavior.
6417
6418 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6419
6420 @item -fmerge-all-constants
6421 @opindex fmerge-all-constants
6422 Attempt to merge identical constants and identical variables.
6423
6424 This option implies @option{-fmerge-constants}.  In addition to
6425 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6426 arrays or initialized constant variables with integral or floating point
6427 types.  Languages like C or C++ require each variable, including multiple
6428 instances of the same variable in recursive calls, to have distinct locations,
6429 so using this option will result in non-conforming
6430 behavior.
6431
6432 @item -fmodulo-sched
6433 @opindex fmodulo-sched
6434 Perform swing modulo scheduling immediately before the first scheduling
6435 pass.  This pass looks at innermost loops and reorders their
6436 instructions by overlapping different iterations.
6437
6438 @item -fmodulo-sched-allow-regmoves
6439 @opindex fmodulo-sched-allow-regmoves
6440 Perform more aggressive SMS based modulo scheduling with register moves
6441 allowed.  By setting this flag certain anti-dependences edges will be
6442 deleted which will trigger the generation of reg-moves based on the
6443 life-range analysis.  This option is effective only with
6444 @option{-fmodulo-sched} enabled.
6445
6446 @item -fno-branch-count-reg
6447 @opindex fno-branch-count-reg
6448 Do not use ``decrement and branch'' instructions on a count register,
6449 but instead generate a sequence of instructions that decrement a
6450 register, compare it against zero, then branch based upon the result.
6451 This option is only meaningful on architectures that support such
6452 instructions, which include x86, PowerPC, IA-64 and S/390.
6453
6454 The default is @option{-fbranch-count-reg}.
6455
6456 @item -fno-function-cse
6457 @opindex fno-function-cse
6458 Do not put function addresses in registers; make each instruction that
6459 calls a constant function contain the function's address explicitly.
6460
6461 This option results in less efficient code, but some strange hacks
6462 that alter the assembler output may be confused by the optimizations
6463 performed when this option is not used.
6464
6465 The default is @option{-ffunction-cse}
6466
6467 @item -fno-zero-initialized-in-bss
6468 @opindex fno-zero-initialized-in-bss
6469 If the target supports a BSS section, GCC by default puts variables that
6470 are initialized to zero into BSS@.  This can save space in the resulting
6471 code.
6472
6473 This option turns off this behavior because some programs explicitly
6474 rely on variables going to the data section.  E.g., so that the
6475 resulting executable can find the beginning of that section and/or make
6476 assumptions based on that.
6477
6478 The default is @option{-fzero-initialized-in-bss}.
6479
6480 @item -fmudflap -fmudflapth -fmudflapir
6481 @opindex fmudflap
6482 @opindex fmudflapth
6483 @opindex fmudflapir
6484 @cindex bounds checking
6485 @cindex mudflap
6486 For front-ends that support it (C and C++), instrument all risky
6487 pointer/array dereferencing operations, some standard library
6488 string/heap functions, and some other associated constructs with
6489 range/validity tests.  Modules so instrumented should be immune to
6490 buffer overflows, invalid heap use, and some other classes of C/C++
6491 programming errors.  The instrumentation relies on a separate runtime
6492 library (@file{libmudflap}), which will be linked into a program if
6493 @option{-fmudflap} is given at link time.  Run-time behavior of the
6494 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6495 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6496 for its options.
6497
6498 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6499 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6500 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6501 instrumentation should ignore pointer reads.  This produces less
6502 instrumentation (and therefore faster execution) and still provides
6503 some protection against outright memory corrupting writes, but allows
6504 erroneously read data to propagate within a program.
6505
6506 @item -fthread-jumps
6507 @opindex fthread-jumps
6508 Perform optimizations where we check to see if a jump branches to a
6509 location where another comparison subsumed by the first is found.  If
6510 so, the first branch is redirected to either the destination of the
6511 second branch or a point immediately following it, depending on whether
6512 the condition is known to be true or false.
6513
6514 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6515
6516 @item -fsplit-wide-types
6517 @opindex fsplit-wide-types
6518 When using a type that occupies multiple registers, such as @code{long
6519 long} on a 32-bit system, split the registers apart and allocate them
6520 independently.  This normally generates better code for those types,
6521 but may make debugging more difficult.
6522
6523 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6524 @option{-Os}.
6525
6526 @item -fcse-follow-jumps
6527 @opindex fcse-follow-jumps
6528 In common subexpression elimination (CSE), scan through jump instructions
6529 when the target of the jump is not reached by any other path.  For
6530 example, when CSE encounters an @code{if} statement with an
6531 @code{else} clause, CSE will follow the jump when the condition
6532 tested is false.
6533
6534 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6535
6536 @item -fcse-skip-blocks
6537 @opindex fcse-skip-blocks
6538 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6539 follow jumps which conditionally skip over blocks.  When CSE
6540 encounters a simple @code{if} statement with no else clause,
6541 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6542 body of the @code{if}.
6543
6544 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6545
6546 @item -frerun-cse-after-loop
6547 @opindex frerun-cse-after-loop
6548 Re-run common subexpression elimination after loop optimizations has been
6549 performed.
6550
6551 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6552
6553 @item -fgcse
6554 @opindex fgcse
6555 Perform a global common subexpression elimination pass.
6556 This pass also performs global constant and copy propagation.
6557
6558 @emph{Note:} When compiling a program using computed gotos, a GCC
6559 extension, you may get better runtime performance if you disable
6560 the global common subexpression elimination pass by adding
6561 @option{-fno-gcse} to the command line.
6562
6563 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6564
6565 @item -fgcse-lm
6566 @opindex fgcse-lm
6567 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
6568 attempt to move loads which are only killed by stores into themselves.  This
6569 allows a loop containing a load/store sequence to be changed to a load outside
6570 the loop, and a copy/store within the loop.
6571
6572 Enabled by default when gcse is enabled.
6573
6574 @item -fgcse-sm
6575 @opindex fgcse-sm
6576 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6577 global common subexpression elimination.  This pass will attempt to move
6578 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6579 loops containing a load/store sequence can be changed to a load before
6580 the loop and a store after the loop.
6581
6582 Not enabled at any optimization level.
6583
6584 @item -fgcse-las
6585 @opindex fgcse-las
6586 When @option{-fgcse-las} is enabled, the global common subexpression
6587 elimination pass eliminates redundant loads that come after stores to the
6588 same memory location (both partial and full redundancies).
6589
6590 Not enabled at any optimization level.
6591
6592 @item -fgcse-after-reload
6593 @opindex fgcse-after-reload
6594 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6595 pass is performed after reload.  The purpose of this pass is to cleanup
6596 redundant spilling.
6597
6598 @item -funsafe-loop-optimizations
6599 @opindex funsafe-loop-optimizations
6600 If given, the loop optimizer will assume that loop indices do not
6601 overflow, and that the loops with nontrivial exit condition are not
6602 infinite.  This enables a wider range of loop optimizations even if
6603 the loop optimizer itself cannot prove that these assumptions are valid.
6604 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6605 if it finds this kind of loop.
6606
6607 @item -fcrossjumping
6608 @opindex fcrossjumping
6609 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6610 resulting code may or may not perform better than without cross-jumping.
6611
6612 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6613
6614 @item -fauto-inc-dec
6615 @opindex fauto-inc-dec
6616 Combine increments or decrements of addresses with memory accesses.
6617 This pass is always skipped on architectures that do not have
6618 instructions to support this.  Enabled by default at @option{-O} and
6619 higher on architectures that support this.
6620
6621 @item -fdce
6622 @opindex fdce
6623 Perform dead code elimination (DCE) on RTL@.
6624 Enabled by default at @option{-O} and higher.
6625
6626 @item -fdse
6627 @opindex fdse
6628 Perform dead store elimination (DSE) on RTL@.
6629 Enabled by default at @option{-O} and higher.
6630
6631 @item -fif-conversion
6632 @opindex fif-conversion
6633 Attempt to transform conditional jumps into branch-less equivalents.  This
6634 include use of conditional moves, min, max, set flags and abs instructions, and
6635 some tricks doable by standard arithmetics.  The use of conditional execution
6636 on chips where it is available is controlled by @code{if-conversion2}.
6637
6638 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6639
6640 @item -fif-conversion2
6641 @opindex fif-conversion2
6642 Use conditional execution (where available) to transform conditional jumps into
6643 branch-less equivalents.
6644
6645 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6646
6647 @item -fdelete-null-pointer-checks
6648 @opindex fdelete-null-pointer-checks
6649 Assume that programs cannot safely dereference null pointers, and that
6650 no code or data element resides there.  This enables simple constant
6651 folding optimizations at all optimization levels.  In addition, other
6652 optimization passes in GCC use this flag to control global dataflow
6653 analyses that eliminate useless checks for null pointers; these assume
6654 that if a pointer is checked after it has already been dereferenced,
6655 it cannot be null.
6656
6657 Note however that in some environments this assumption is not true.
6658 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6659 for programs which depend on that behavior.
6660
6661 Some targets, especially embedded ones, disable this option at all levels.
6662 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6663 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6664 are enabled independently at different optimization levels.
6665
6666 @item -fdevirtualize
6667 @opindex fdevirtualize
6668 Attempt to convert calls to virtual functions to direct calls.  This
6669 is done both within a procedure and interprocedurally as part of
6670 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
6671 propagation (@option{-fipa-cp}).
6672 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6673
6674 @item -fexpensive-optimizations
6675 @opindex fexpensive-optimizations
6676 Perform a number of minor optimizations that are relatively expensive.
6677
6678 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6679
6680 @item -foptimize-register-move
6681 @itemx -fregmove
6682 @opindex foptimize-register-move
6683 @opindex fregmove
6684 Attempt to reassign register numbers in move instructions and as
6685 operands of other simple instructions in order to maximize the amount of
6686 register tying.  This is especially helpful on machines with two-operand
6687 instructions.
6688
6689 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6690 optimization.
6691
6692 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6693
6694 @item -fira-algorithm=@var{algorithm}
6695 Use specified coloring algorithm for the integrated register
6696 allocator.  The @var{algorithm} argument should be @code{priority} or
6697 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6698 the second one specifies Chaitin-Briggs coloring.  The second
6699 algorithm can be unimplemented for some architectures.  If it is
6700 implemented, it is the default because Chaitin-Briggs coloring as a
6701 rule generates a better code.
6702
6703 @item -fira-region=@var{region}
6704 Use specified regions for the integrated register allocator.  The
6705 @var{region} argument should be one of @code{all}, @code{mixed}, or
6706 @code{one}.  The first value means using all loops as register
6707 allocation regions, the second value which is the default means using
6708 all loops except for loops with small register pressure as the
6709 regions, and third one means using all function as a single region.
6710 The first value can give best result for machines with small size and
6711 irregular register set, the third one results in faster and generates
6712 decent code and the smallest size code, and the default value usually
6713 give the best results in most cases and for most architectures.
6714
6715 @item -fira-loop-pressure
6716 @opindex fira-loop-pressure
6717 Use IRA to evaluate register pressure in loops for decision to move
6718 loop invariants.  Usage of this option usually results in generation
6719 of faster and smaller code on machines with big register files (>= 32
6720 registers) but it can slow compiler down.
6721
6722 This option is enabled at level @option{-O3} for some targets.
6723
6724 @item -fno-ira-share-save-slots
6725 @opindex fno-ira-share-save-slots
6726 Switch off sharing stack slots used for saving call used hard
6727 registers living through a call.  Each hard register will get a
6728 separate stack slot and as a result function stack frame will be
6729 bigger.
6730
6731 @item -fno-ira-share-spill-slots
6732 @opindex fno-ira-share-spill-slots
6733 Switch off sharing stack slots allocated for pseudo-registers.  Each
6734 pseudo-register which did not get a hard register will get a separate
6735 stack slot and as a result function stack frame will be bigger.
6736
6737 @item -fira-verbose=@var{n}
6738 @opindex fira-verbose
6739 Set up how verbose dump file for the integrated register allocator
6740 will be.  Default value is 5.  If the value is greater or equal to 10,
6741 the dump file will be stderr as if the value were @var{n} minus 10.
6742
6743 @item -fdelayed-branch
6744 @opindex fdelayed-branch
6745 If supported for the target machine, attempt to reorder instructions
6746 to exploit instruction slots available after delayed branch
6747 instructions.
6748
6749 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6750
6751 @item -fschedule-insns
6752 @opindex fschedule-insns
6753 If supported for the target machine, attempt to reorder instructions to
6754 eliminate execution stalls due to required data being unavailable.  This
6755 helps machines that have slow floating point or memory load instructions
6756 by allowing other instructions to be issued until the result of the load
6757 or floating point instruction is required.
6758
6759 Enabled at levels @option{-O2}, @option{-O3}.
6760
6761 @item -fschedule-insns2
6762 @opindex fschedule-insns2
6763 Similar to @option{-fschedule-insns}, but requests an additional pass of
6764 instruction scheduling after register allocation has been done.  This is
6765 especially useful on machines with a relatively small number of
6766 registers and where memory load instructions take more than one cycle.
6767
6768 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6769
6770 @item -fno-sched-interblock
6771 @opindex fno-sched-interblock
6772 Don't schedule instructions across basic blocks.  This is normally
6773 enabled by default when scheduling before register allocation, i.e.@:
6774 with @option{-fschedule-insns} or at @option{-O2} or higher.
6775
6776 @item -fno-sched-spec
6777 @opindex fno-sched-spec
6778 Don't allow speculative motion of non-load instructions.  This is normally
6779 enabled by default when scheduling before register allocation, i.e.@:
6780 with @option{-fschedule-insns} or at @option{-O2} or higher.
6781
6782 @item -fsched-pressure
6783 @opindex fsched-pressure
6784 Enable register pressure sensitive insn scheduling before the register
6785 allocation.  This only makes sense when scheduling before register
6786 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6787 @option{-O2} or higher.  Usage of this option can improve the
6788 generated code and decrease its size by preventing register pressure
6789 increase above the number of available hard registers and as a
6790 consequence register spills in the register allocation.
6791
6792 @item -fsched-spec-load
6793 @opindex fsched-spec-load
6794 Allow speculative motion of some load instructions.  This only makes
6795 sense when scheduling before register allocation, i.e.@: with
6796 @option{-fschedule-insns} or at @option{-O2} or higher.
6797
6798 @item -fsched-spec-load-dangerous
6799 @opindex fsched-spec-load-dangerous
6800 Allow speculative motion of more load instructions.  This only makes
6801 sense when scheduling before register allocation, i.e.@: with
6802 @option{-fschedule-insns} or at @option{-O2} or higher.
6803
6804 @item -fsched-stalled-insns
6805 @itemx -fsched-stalled-insns=@var{n}
6806 @opindex fsched-stalled-insns
6807 Define how many insns (if any) can be moved prematurely from the queue
6808 of stalled insns into the ready list, during the second scheduling pass.
6809 @option{-fno-sched-stalled-insns} means that no insns will be moved
6810 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6811 on how many queued insns can be moved prematurely.
6812 @option{-fsched-stalled-insns} without a value is equivalent to
6813 @option{-fsched-stalled-insns=1}.
6814
6815 @item -fsched-stalled-insns-dep
6816 @itemx -fsched-stalled-insns-dep=@var{n}
6817 @opindex fsched-stalled-insns-dep
6818 Define how many insn groups (cycles) will be examined for a dependency
6819 on a stalled insn that is candidate for premature removal from the queue
6820 of stalled insns.  This has an effect only during the second scheduling pass,
6821 and only if @option{-fsched-stalled-insns} is used.
6822 @option{-fno-sched-stalled-insns-dep} is equivalent to
6823 @option{-fsched-stalled-insns-dep=0}.
6824 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6825 @option{-fsched-stalled-insns-dep=1}.
6826
6827 @item -fsched2-use-superblocks
6828 @opindex fsched2-use-superblocks
6829 When scheduling after register allocation, do use superblock scheduling
6830 algorithm.  Superblock scheduling allows motion across basic block boundaries
6831 resulting on faster schedules.  This option is experimental, as not all machine
6832 descriptions used by GCC model the CPU closely enough to avoid unreliable
6833 results from the algorithm.
6834
6835 This only makes sense when scheduling after register allocation, i.e.@: with
6836 @option{-fschedule-insns2} or at @option{-O2} or higher.
6837
6838 @item -fsched-group-heuristic
6839 @opindex fsched-group-heuristic
6840 Enable the group heuristic in the scheduler.  This heuristic favors
6841 the instruction that belongs to a schedule group.  This is enabled
6842 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6843 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6844
6845 @item -fsched-critical-path-heuristic
6846 @opindex fsched-critical-path-heuristic
6847 Enable the critical-path heuristic in the scheduler.  This heuristic favors
6848 instructions on the critical path.  This is enabled by default when
6849 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6850 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6851
6852 @item -fsched-spec-insn-heuristic
6853 @opindex fsched-spec-insn-heuristic
6854 Enable the speculative instruction heuristic in the scheduler.  This
6855 heuristic favors speculative instructions with greater dependency weakness.
6856 This is enabled by default when scheduling is enabled, i.e.@:
6857 with @option{-fschedule-insns} or @option{-fschedule-insns2}
6858 or at @option{-O2} or higher.
6859
6860 @item -fsched-rank-heuristic
6861 @opindex fsched-rank-heuristic
6862 Enable the rank heuristic in the scheduler.  This heuristic favors
6863 the instruction belonging to a basic block with greater size or frequency.
6864 This is enabled by default when scheduling is enabled, i.e.@:
6865 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6866 at @option{-O2} or higher.
6867
6868 @item -fsched-last-insn-heuristic
6869 @opindex fsched-last-insn-heuristic
6870 Enable the last-instruction heuristic in the scheduler.  This heuristic
6871 favors the instruction that is less dependent on the last instruction
6872 scheduled.  This is enabled by default when scheduling is enabled,
6873 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6874 at @option{-O2} or higher.
6875
6876 @item -fsched-dep-count-heuristic
6877 @opindex fsched-dep-count-heuristic
6878 Enable the dependent-count heuristic in the scheduler.  This heuristic
6879 favors the instruction that has more instructions depending on it.
6880 This is enabled by default when scheduling is enabled, i.e.@:
6881 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6882 at @option{-O2} or higher.
6883
6884 @item -freschedule-modulo-scheduled-loops
6885 @opindex freschedule-modulo-scheduled-loops
6886 The modulo scheduling comes before the traditional scheduling, if a loop
6887 was modulo scheduled we may want to prevent the later scheduling passes
6888 from changing its schedule, we use this option to control that.
6889
6890 @item -fselective-scheduling
6891 @opindex fselective-scheduling
6892 Schedule instructions using selective scheduling algorithm.  Selective
6893 scheduling runs instead of the first scheduler pass.
6894
6895 @item -fselective-scheduling2
6896 @opindex fselective-scheduling2
6897 Schedule instructions using selective scheduling algorithm.  Selective
6898 scheduling runs instead of the second scheduler pass.
6899
6900 @item -fsel-sched-pipelining
6901 @opindex fsel-sched-pipelining
6902 Enable software pipelining of innermost loops during selective scheduling.
6903 This option has no effect until one of @option{-fselective-scheduling} or
6904 @option{-fselective-scheduling2} is turned on.
6905
6906 @item -fsel-sched-pipelining-outer-loops
6907 @opindex fsel-sched-pipelining-outer-loops
6908 When pipelining loops during selective scheduling, also pipeline outer loops.
6909 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6910
6911 @item -fshrink-wrap
6912 @opindex fshrink-wrap
6913 Emit function prologues only before parts of the function that need it,
6914 rather than at the top of the function.  This flag is enabled by default at
6915 @option{-O} and higher.
6916
6917 @item -fcaller-saves
6918 @opindex fcaller-saves
6919 Enable values to be allocated in registers that will be clobbered by
6920 function calls, by emitting extra instructions to save and restore the
6921 registers around such calls.  Such allocation is done only when it
6922 seems to result in better code than would otherwise be produced.
6923
6924 This option is always enabled by default on certain machines, usually
6925 those which have no call-preserved registers to use instead.
6926
6927 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6928
6929 @item -fcombine-stack-adjustments
6930 @opindex fcombine-stack-adjustments
6931 Tracks stack adjustments (pushes and pops) and stack memory references
6932 and then tries to find ways to combine them.
6933
6934 Enabled by default at @option{-O1} and higher.
6935
6936 @item -fconserve-stack
6937 @opindex fconserve-stack
6938 Attempt to minimize stack usage.  The compiler will attempt to use less
6939 stack space, even if that makes the program slower.  This option
6940 implies setting the @option{large-stack-frame} parameter to 100
6941 and the @option{large-stack-frame-growth} parameter to 400.
6942
6943 @item -ftree-reassoc
6944 @opindex ftree-reassoc
6945 Perform reassociation on trees.  This flag is enabled by default
6946 at @option{-O} and higher.
6947
6948 @item -ftree-pre
6949 @opindex ftree-pre
6950 Perform partial redundancy elimination (PRE) on trees.  This flag is
6951 enabled by default at @option{-O2} and @option{-O3}.
6952
6953 @item -ftree-forwprop
6954 @opindex ftree-forwprop
6955 Perform forward propagation on trees.  This flag is enabled by default
6956 at @option{-O} and higher.
6957
6958 @item -ftree-fre
6959 @opindex ftree-fre
6960 Perform full redundancy elimination (FRE) on trees.  The difference
6961 between FRE and PRE is that FRE only considers expressions
6962 that are computed on all paths leading to the redundant computation.
6963 This analysis is faster than PRE, though it exposes fewer redundancies.
6964 This flag is enabled by default at @option{-O} and higher.
6965
6966 @item -ftree-phiprop
6967 @opindex ftree-phiprop
6968 Perform hoisting of loads from conditional pointers on trees.  This
6969 pass is enabled by default at @option{-O} and higher.
6970
6971 @item -ftree-copy-prop
6972 @opindex ftree-copy-prop
6973 Perform copy propagation on trees.  This pass eliminates unnecessary
6974 copy operations.  This flag is enabled by default at @option{-O} and
6975 higher.
6976
6977 @item -fipa-pure-const
6978 @opindex fipa-pure-const
6979 Discover which functions are pure or constant.
6980 Enabled by default at @option{-O} and higher.
6981
6982 @item -fipa-reference
6983 @opindex fipa-reference
6984 Discover which static variables do not escape cannot escape the
6985 compilation unit.
6986 Enabled by default at @option{-O} and higher.
6987
6988 @item -fipa-pta
6989 @opindex fipa-pta
6990 Perform interprocedural pointer analysis and interprocedural modification
6991 and reference analysis.  This option can cause excessive memory and
6992 compile-time usage on large compilation units.  It is not enabled by
6993 default at any optimization level.
6994
6995 @item -fipa-profile
6996 @opindex fipa-profile
6997 Perform interprocedural profile propagation.  The functions called only from
6998 cold functions are marked as cold. Also functions executed once (such as
6999 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7000 functions and loop less parts of functions executed once are then optimized for
7001 size.
7002 Enabled by default at @option{-O} and higher.
7003
7004 @item -fipa-cp
7005 @opindex fipa-cp
7006 Perform interprocedural constant propagation.
7007 This optimization analyzes the program to determine when values passed
7008 to functions are constants and then optimizes accordingly.
7009 This optimization can substantially increase performance
7010 if the application has constants passed to functions.
7011 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7012
7013 @item -fipa-cp-clone
7014 @opindex fipa-cp-clone
7015 Perform function cloning to make interprocedural constant propagation stronger.
7016 When enabled, interprocedural constant propagation will perform function cloning
7017 when externally visible function can be called with constant arguments.
7018 Because this optimization can create multiple copies of functions,
7019 it may significantly increase code size
7020 (see @option{--param ipcp-unit-growth=@var{value}}).
7021 This flag is enabled by default at @option{-O3}.
7022
7023 @item -fipa-matrix-reorg
7024 @opindex fipa-matrix-reorg
7025 Perform matrix flattening and transposing.
7026 Matrix flattening tries to replace an @math{m}-dimensional matrix
7027 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
7028 This reduces the level of indirection needed for accessing the elements
7029 of the matrix. The second optimization is matrix transposing that
7030 attempts to change the order of the matrix's dimensions in order to
7031 improve cache locality.
7032 Both optimizations need the @option{-fwhole-program} flag.
7033 Transposing is enabled only if profiling information is available.
7034
7035 @item -ftree-sink
7036 @opindex ftree-sink
7037 Perform forward store motion  on trees.  This flag is
7038 enabled by default at @option{-O} and higher.
7039
7040 @item -ftree-bit-ccp
7041 @opindex ftree-bit-ccp
7042 Perform sparse conditional bit constant propagation on trees and propagate
7043 pointer alignment information.
7044 This pass only operates on local scalar variables and is enabled by default
7045 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7046
7047 @item -ftree-ccp
7048 @opindex ftree-ccp
7049 Perform sparse conditional constant propagation (CCP) on trees.  This
7050 pass only operates on local scalar variables and is enabled by default
7051 at @option{-O} and higher.
7052
7053 @item -ftree-switch-conversion
7054 Perform conversion of simple initializations in a switch to
7055 initializations from a scalar array.  This flag is enabled by default
7056 at @option{-O2} and higher.
7057
7058 @item -ftree-tail-merge
7059 Look for identical code sequences.  When found, replace one with a jump to the
7060 other.  This optimization is known as tail merging or cross jumping.  This flag
7061 is enabled by default at @option{-O2} and higher.  The run time of this pass can
7062 be limited using @option{max-tail-merge-comparisons} parameter and
7063 @option{max-tail-merge-iterations} parameter.
7064
7065 @item -ftree-dce
7066 @opindex ftree-dce
7067 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7068 default at @option{-O} and higher.
7069
7070 @item -ftree-builtin-call-dce
7071 @opindex ftree-builtin-call-dce
7072 Perform conditional dead code elimination (DCE) for calls to builtin functions
7073 that may set @code{errno} but are otherwise side-effect free.  This flag is
7074 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7075 specified.
7076
7077 @item -ftree-dominator-opts
7078 @opindex ftree-dominator-opts
7079 Perform a variety of simple scalar cleanups (constant/copy
7080 propagation, redundancy elimination, range propagation and expression
7081 simplification) based on a dominator tree traversal.  This also
7082 performs jump threading (to reduce jumps to jumps). This flag is
7083 enabled by default at @option{-O} and higher.
7084
7085 @item -ftree-dse
7086 @opindex ftree-dse
7087 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7088 a memory location which will later be overwritten by another store without
7089 any intervening loads.  In this case the earlier store can be deleted.  This
7090 flag is enabled by default at @option{-O} and higher.
7091
7092 @item -ftree-ch
7093 @opindex ftree-ch
7094 Perform loop header copying on trees.  This is beneficial since it increases
7095 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7096 is enabled by default at @option{-O} and higher.  It is not enabled
7097 for @option{-Os}, since it usually increases code size.
7098
7099 @item -ftree-loop-optimize
7100 @opindex ftree-loop-optimize
7101 Perform loop optimizations on trees.  This flag is enabled by default
7102 at @option{-O} and higher.
7103
7104 @item -ftree-loop-linear
7105 @opindex ftree-loop-linear
7106 Perform loop interchange transformations on tree.  Same as
7107 @option{-floop-interchange}.  To use this code transformation, GCC has
7108 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7109 enable the Graphite loop transformation infrastructure.
7110
7111 @item -floop-interchange
7112 @opindex floop-interchange
7113 Perform loop interchange transformations on loops.  Interchanging two
7114 nested loops switches the inner and outer loops.  For example, given a
7115 loop like:
7116 @smallexample
7117 DO J = 1, M
7118   DO I = 1, N
7119     A(J, I) = A(J, I) * C
7120   ENDDO
7121 ENDDO
7122 @end smallexample
7123 loop interchange will transform the loop as if the user had written:
7124 @smallexample
7125 DO I = 1, N
7126   DO J = 1, M
7127     A(J, I) = A(J, I) * C
7128   ENDDO
7129 ENDDO
7130 @end smallexample
7131 which can be beneficial when @code{N} is larger than the caches,
7132 because in Fortran, the elements of an array are stored in memory
7133 contiguously by column, and the original loop iterates over rows,
7134 potentially creating at each access a cache miss.  This optimization
7135 applies to all the languages supported by GCC and is not limited to
7136 Fortran.  To use this code transformation, GCC has to be configured
7137 with @option{--with-ppl} and @option{--with-cloog} to enable the
7138 Graphite loop transformation infrastructure.
7139
7140 @item -floop-strip-mine
7141 @opindex floop-strip-mine
7142 Perform loop strip mining transformations on loops.  Strip mining
7143 splits a loop into two nested loops.  The outer loop has strides
7144 equal to the strip size and the inner loop has strides of the
7145 original loop within a strip.  The strip length can be changed
7146 using the @option{loop-block-tile-size} parameter.  For example,
7147 given a loop like:
7148 @smallexample
7149 DO I = 1, N
7150   A(I) = A(I) + C
7151 ENDDO
7152 @end smallexample
7153 loop strip mining will transform the loop as if the user had written:
7154 @smallexample
7155 DO II = 1, N, 51
7156   DO I = II, min (II + 50, N)
7157     A(I) = A(I) + C
7158   ENDDO
7159 ENDDO
7160 @end smallexample
7161 This optimization applies to all the languages supported by GCC and is
7162 not limited to Fortran.  To use this code transformation, GCC has to
7163 be configured with @option{--with-ppl} and @option{--with-cloog} to
7164 enable the Graphite loop transformation infrastructure.
7165
7166 @item -floop-block
7167 @opindex floop-block
7168 Perform loop blocking transformations on loops.  Blocking strip mines
7169 each loop in the loop nest such that the memory accesses of the
7170 element loops fit inside caches.  The strip length can be changed
7171 using the @option{loop-block-tile-size} parameter.  For example, given
7172 a loop like:
7173 @smallexample
7174 DO I = 1, N
7175   DO J = 1, M
7176     A(J, I) = B(I) + C(J)
7177   ENDDO
7178 ENDDO
7179 @end smallexample
7180 loop blocking will transform the loop as if the user had written:
7181 @smallexample
7182 DO II = 1, N, 51
7183   DO JJ = 1, M, 51
7184     DO I = II, min (II + 50, N)
7185       DO J = JJ, min (JJ + 50, M)
7186         A(J, I) = B(I) + C(J)
7187       ENDDO
7188     ENDDO
7189   ENDDO
7190 ENDDO
7191 @end smallexample
7192 which can be beneficial when @code{M} is larger than the caches,
7193 because the innermost loop will iterate over a smaller amount of data
7194 that can be kept in the caches.  This optimization applies to all the
7195 languages supported by GCC and is not limited to Fortran.  To use this
7196 code transformation, GCC has to be configured with @option{--with-ppl}
7197 and @option{--with-cloog} to enable the Graphite loop transformation
7198 infrastructure.
7199
7200 @item -fgraphite-identity
7201 @opindex fgraphite-identity
7202 Enable the identity transformation for graphite.  For every SCoP we generate
7203 the polyhedral representation and transform it back to gimple.  Using
7204 @option{-fgraphite-identity} we can check the costs or benefits of the
7205 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7206 are also performed by the code generator CLooG, like index splitting and
7207 dead code elimination in loops.
7208
7209 @item -floop-flatten
7210 @opindex floop-flatten
7211 Removes the loop nesting structure: transforms the loop nest into a
7212 single loop.  This transformation can be useful to vectorize all the
7213 levels of the loop nest.
7214
7215 @item -floop-parallelize-all
7216 @opindex floop-parallelize-all
7217 Use the Graphite data dependence analysis to identify loops that can
7218 be parallelized.  Parallelize all the loops that can be analyzed to
7219 not contain loop carried dependences without checking that it is
7220 profitable to parallelize the loops.
7221
7222 @item -fcheck-data-deps
7223 @opindex fcheck-data-deps
7224 Compare the results of several data dependence analyzers.  This option
7225 is used for debugging the data dependence analyzers.
7226
7227 @item -ftree-loop-if-convert
7228 Attempt to transform conditional jumps in the innermost loops to
7229 branch-less equivalents.  The intent is to remove control-flow from
7230 the innermost loops in order to improve the ability of the
7231 vectorization pass to handle these loops.  This is enabled by default
7232 if vectorization is enabled.
7233
7234 @item -ftree-loop-if-convert-stores
7235 Attempt to also if-convert conditional jumps containing memory writes.
7236 This transformation can be unsafe for multi-threaded programs as it
7237 transforms conditional memory writes into unconditional memory writes.
7238 For example,
7239 @smallexample
7240 for (i = 0; i < N; i++)
7241   if (cond)
7242     A[i] = expr;
7243 @end smallexample
7244 would be transformed to
7245 @smallexample
7246 for (i = 0; i < N; i++)
7247   A[i] = cond ? expr : A[i];
7248 @end smallexample
7249 potentially producing data races.
7250
7251 @item -ftree-loop-distribution
7252 Perform loop distribution.  This flag can improve cache performance on
7253 big loop bodies and allow further loop optimizations, like
7254 parallelization or vectorization, to take place.  For example, the loop
7255 @smallexample
7256 DO I = 1, N
7257   A(I) = B(I) + C
7258   D(I) = E(I) * F
7259 ENDDO
7260 @end smallexample
7261 is transformed to
7262 @smallexample
7263 DO I = 1, N
7264    A(I) = B(I) + C
7265 ENDDO
7266 DO I = 1, N
7267    D(I) = E(I) * F
7268 ENDDO
7269 @end smallexample
7270
7271 @item -ftree-loop-distribute-patterns
7272 Perform loop distribution of patterns that can be code generated with
7273 calls to a library.  This flag is enabled by default at @option{-O3}.
7274
7275 This pass distributes the initialization loops and generates a call to
7276 memset zero.  For example, the loop
7277 @smallexample
7278 DO I = 1, N
7279   A(I) = 0
7280   B(I) = A(I) + I
7281 ENDDO
7282 @end smallexample
7283 is transformed to
7284 @smallexample
7285 DO I = 1, N
7286    A(I) = 0
7287 ENDDO
7288 DO I = 1, N
7289    B(I) = A(I) + I
7290 ENDDO
7291 @end smallexample
7292 and the initialization loop is transformed into a call to memset zero.
7293
7294 @item -ftree-loop-im
7295 @opindex ftree-loop-im
7296 Perform loop invariant motion on trees.  This pass moves only invariants that
7297 would be hard to handle at RTL level (function calls, operations that expand to
7298 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7299 operands of conditions that are invariant out of the loop, so that we can use
7300 just trivial invariantness analysis in loop unswitching.  The pass also includes
7301 store motion.
7302
7303 @item -ftree-loop-ivcanon
7304 @opindex ftree-loop-ivcanon
7305 Create a canonical counter for number of iterations in the loop for that
7306 determining number of iterations requires complicated analysis.  Later
7307 optimizations then may determine the number easily.  Useful especially
7308 in connection with unrolling.
7309
7310 @item -fivopts
7311 @opindex fivopts
7312 Perform induction variable optimizations (strength reduction, induction
7313 variable merging and induction variable elimination) on trees.
7314
7315 @item -ftree-parallelize-loops=n
7316 @opindex ftree-parallelize-loops
7317 Parallelize loops, i.e., split their iteration space to run in n threads.
7318 This is only possible for loops whose iterations are independent
7319 and can be arbitrarily reordered.  The optimization is only
7320 profitable on multiprocessor machines, for loops that are CPU-intensive,
7321 rather than constrained e.g.@: by memory bandwidth.  This option
7322 implies @option{-pthread}, and thus is only supported on targets
7323 that have support for @option{-pthread}.
7324
7325 @item -ftree-pta
7326 @opindex ftree-pta
7327 Perform function-local points-to analysis on trees.  This flag is
7328 enabled by default at @option{-O} and higher.
7329
7330 @item -ftree-sra
7331 @opindex ftree-sra
7332 Perform scalar replacement of aggregates.  This pass replaces structure
7333 references with scalars to prevent committing structures to memory too
7334 early.  This flag is enabled by default at @option{-O} and higher.
7335
7336 @item -ftree-copyrename
7337 @opindex ftree-copyrename
7338 Perform copy renaming on trees.  This pass attempts to rename compiler
7339 temporaries to other variables at copy locations, usually resulting in
7340 variable names which more closely resemble the original variables.  This flag
7341 is enabled by default at @option{-O} and higher.
7342
7343 @item -ftree-ter
7344 @opindex ftree-ter
7345 Perform temporary expression replacement during the SSA->normal phase.  Single
7346 use/single def temporaries are replaced at their use location with their
7347 defining expression.  This results in non-GIMPLE code, but gives the expanders
7348 much more complex trees to work on resulting in better RTL generation.  This is
7349 enabled by default at @option{-O} and higher.
7350
7351 @item -ftree-vectorize
7352 @opindex ftree-vectorize
7353 Perform loop vectorization on trees. This flag is enabled by default at
7354 @option{-O3}.
7355
7356 @item -ftree-slp-vectorize
7357 @opindex ftree-slp-vectorize
7358 Perform basic block vectorization on trees. This flag is enabled by default at
7359 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7360
7361 @item -ftree-vect-loop-version
7362 @opindex ftree-vect-loop-version
7363 Perform loop versioning when doing loop vectorization on trees.  When a loop
7364 appears to be vectorizable except that data alignment or data dependence cannot
7365 be determined at compile time then vectorized and non-vectorized versions of
7366 the loop are generated along with runtime checks for alignment or dependence
7367 to control which version is executed.  This option is enabled by default
7368 except at level @option{-Os} where it is disabled.
7369
7370 @item -fvect-cost-model
7371 @opindex fvect-cost-model
7372 Enable cost model for vectorization.
7373
7374 @item -ftree-vrp
7375 @opindex ftree-vrp
7376 Perform Value Range Propagation on trees.  This is similar to the
7377 constant propagation pass, but instead of values, ranges of values are
7378 propagated.  This allows the optimizers to remove unnecessary range
7379 checks like array bound checks and null pointer checks.  This is
7380 enabled by default at @option{-O2} and higher.  Null pointer check
7381 elimination is only done if @option{-fdelete-null-pointer-checks} is
7382 enabled.
7383
7384 @item -ftracer
7385 @opindex ftracer
7386 Perform tail duplication to enlarge superblock size.  This transformation
7387 simplifies the control flow of the function allowing other optimizations to do
7388 better job.
7389
7390 @item -funroll-loops
7391 @opindex funroll-loops
7392 Unroll loops whose number of iterations can be determined at compile
7393 time or upon entry to the loop.  @option{-funroll-loops} implies
7394 @option{-frerun-cse-after-loop}.  This option makes code larger,
7395 and may or may not make it run faster.
7396
7397 @item -funroll-all-loops
7398 @opindex funroll-all-loops
7399 Unroll all loops, even if their number of iterations is uncertain when
7400 the loop is entered.  This usually makes programs run more slowly.
7401 @option{-funroll-all-loops} implies the same options as
7402 @option{-funroll-loops},
7403
7404 @item -fsplit-ivs-in-unroller
7405 @opindex fsplit-ivs-in-unroller
7406 Enables expressing of values of induction variables in later iterations
7407 of the unrolled loop using the value in the first iteration.  This breaks
7408 long dependency chains, thus improving efficiency of the scheduling passes.
7409
7410 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7411 same effect.  However in cases the loop body is more complicated than
7412 a single basic block, this is not reliable.  It also does not work at all
7413 on some of the architectures due to restrictions in the CSE pass.
7414
7415 This optimization is enabled by default.
7416
7417 @item -fvariable-expansion-in-unroller
7418 @opindex fvariable-expansion-in-unroller
7419 With this option, the compiler will create multiple copies of some
7420 local variables when unrolling a loop which can result in superior code.
7421
7422 @item -fpartial-inlining
7423 @opindex fpartial-inlining
7424 Inline parts of functions.  This option has any effect only
7425 when inlining itself is turned on by the @option{-finline-functions}
7426 or @option{-finline-small-functions} options.
7427
7428 Enabled at level @option{-O2}.
7429
7430 @item -fpredictive-commoning
7431 @opindex fpredictive-commoning
7432 Perform predictive commoning optimization, i.e., reusing computations
7433 (especially memory loads and stores) performed in previous
7434 iterations of loops.
7435
7436 This option is enabled at level @option{-O3}.
7437
7438 @item -fprefetch-loop-arrays
7439 @opindex fprefetch-loop-arrays
7440 If supported by the target machine, generate instructions to prefetch
7441 memory to improve the performance of loops that access large arrays.
7442
7443 This option may generate better or worse code; results are highly
7444 dependent on the structure of loops within the source code.
7445
7446 Disabled at level @option{-Os}.
7447
7448 @item -fno-peephole
7449 @itemx -fno-peephole2
7450 @opindex fno-peephole
7451 @opindex fno-peephole2
7452 Disable any machine-specific peephole optimizations.  The difference
7453 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7454 are implemented in the compiler; some targets use one, some use the
7455 other, a few use both.
7456
7457 @option{-fpeephole} is enabled by default.
7458 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7459
7460 @item -fno-guess-branch-probability
7461 @opindex fno-guess-branch-probability
7462 Do not guess branch probabilities using heuristics.
7463
7464 GCC will use heuristics to guess branch probabilities if they are
7465 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7466 heuristics are based on the control flow graph.  If some branch probabilities
7467 are specified by @samp{__builtin_expect}, then the heuristics will be
7468 used to guess branch probabilities for the rest of the control flow graph,
7469 taking the @samp{__builtin_expect} info into account.  The interactions
7470 between the heuristics and @samp{__builtin_expect} can be complex, and in
7471 some cases, it may be useful to disable the heuristics so that the effects
7472 of @samp{__builtin_expect} are easier to understand.
7473
7474 The default is @option{-fguess-branch-probability} at levels
7475 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7476
7477 @item -freorder-blocks
7478 @opindex freorder-blocks
7479 Reorder basic blocks in the compiled function in order to reduce number of
7480 taken branches and improve code locality.
7481
7482 Enabled at levels @option{-O2}, @option{-O3}.
7483
7484 @item -freorder-blocks-and-partition
7485 @opindex freorder-blocks-and-partition
7486 In addition to reordering basic blocks in the compiled function, in order
7487 to reduce number of taken branches, partitions hot and cold basic blocks
7488 into separate sections of the assembly and .o files, to improve
7489 paging and cache locality performance.
7490
7491 This optimization is automatically turned off in the presence of
7492 exception handling, for linkonce sections, for functions with a user-defined
7493 section attribute and on any architecture that does not support named
7494 sections.
7495
7496 @item -freorder-functions
7497 @opindex freorder-functions
7498 Reorder functions in the object file in order to
7499 improve code locality.  This is implemented by using special
7500 subsections @code{.text.hot} for most frequently executed functions and
7501 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7502 the linker so object file format must support named sections and linker must
7503 place them in a reasonable way.
7504
7505 Also profile feedback must be available in to make this option effective.  See
7506 @option{-fprofile-arcs} for details.
7507
7508 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7509
7510 @item -fstrict-aliasing
7511 @opindex fstrict-aliasing
7512 Allow the compiler to assume the strictest aliasing rules applicable to
7513 the language being compiled.  For C (and C++), this activates
7514 optimizations based on the type of expressions.  In particular, an
7515 object of one type is assumed never to reside at the same address as an
7516 object of a different type, unless the types are almost the same.  For
7517 example, an @code{unsigned int} can alias an @code{int}, but not a
7518 @code{void*} or a @code{double}.  A character type may alias any other
7519 type.
7520
7521 @anchor{Type-punning}Pay special attention to code like this:
7522 @smallexample
7523 union a_union @{
7524   int i;
7525   double d;
7526 @};
7527
7528 int f() @{
7529   union a_union t;
7530   t.d = 3.0;
7531   return t.i;
7532 @}
7533 @end smallexample
7534 The practice of reading from a different union member than the one most
7535 recently written to (called ``type-punning'') is common.  Even with
7536 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7537 is accessed through the union type.  So, the code above will work as
7538 expected.  @xref{Structures unions enumerations and bit-fields
7539 implementation}.  However, this code might not:
7540 @smallexample
7541 int f() @{
7542   union a_union t;
7543   int* ip;
7544   t.d = 3.0;
7545   ip = &t.i;
7546   return *ip;
7547 @}
7548 @end smallexample
7549
7550 Similarly, access by taking the address, casting the resulting pointer
7551 and dereferencing the result has undefined behavior, even if the cast
7552 uses a union type, e.g.:
7553 @smallexample
7554 int f() @{
7555   double d = 3.0;
7556   return ((union a_union *) &d)->i;
7557 @}
7558 @end smallexample
7559
7560 The @option{-fstrict-aliasing} option is enabled at levels
7561 @option{-O2}, @option{-O3}, @option{-Os}.
7562
7563 @item -fstrict-overflow
7564 @opindex fstrict-overflow
7565 Allow the compiler to assume strict signed overflow rules, depending
7566 on the language being compiled.  For C (and C++) this means that
7567 overflow when doing arithmetic with signed numbers is undefined, which
7568 means that the compiler may assume that it will not happen.  This
7569 permits various optimizations.  For example, the compiler will assume
7570 that an expression like @code{i + 10 > i} will always be true for
7571 signed @code{i}.  This assumption is only valid if signed overflow is
7572 undefined, as the expression is false if @code{i + 10} overflows when
7573 using twos complement arithmetic.  When this option is in effect any
7574 attempt to determine whether an operation on signed numbers will
7575 overflow must be written carefully to not actually involve overflow.
7576
7577 This option also allows the compiler to assume strict pointer
7578 semantics: given a pointer to an object, if adding an offset to that
7579 pointer does not produce a pointer to the same object, the addition is
7580 undefined.  This permits the compiler to conclude that @code{p + u >
7581 p} is always true for a pointer @code{p} and unsigned integer
7582 @code{u}.  This assumption is only valid because pointer wraparound is
7583 undefined, as the expression is false if @code{p + u} overflows using
7584 twos complement arithmetic.
7585
7586 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7587 that integer signed overflow is fully defined: it wraps.  When
7588 @option{-fwrapv} is used, there is no difference between
7589 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7590 integers.  With @option{-fwrapv} certain types of overflow are
7591 permitted.  For example, if the compiler gets an overflow when doing
7592 arithmetic on constants, the overflowed value can still be used with
7593 @option{-fwrapv}, but not otherwise.
7594
7595 The @option{-fstrict-overflow} option is enabled at levels
7596 @option{-O2}, @option{-O3}, @option{-Os}.
7597
7598 @item -falign-functions
7599 @itemx -falign-functions=@var{n}
7600 @opindex falign-functions
7601 Align the start of functions to the next power-of-two greater than
7602 @var{n}, skipping up to @var{n} bytes.  For instance,
7603 @option{-falign-functions=32} aligns functions to the next 32-byte
7604 boundary, but @option{-falign-functions=24} would align to the next
7605 32-byte boundary only if this can be done by skipping 23 bytes or less.
7606
7607 @option{-fno-align-functions} and @option{-falign-functions=1} are
7608 equivalent and mean that functions will not be aligned.
7609
7610 Some assemblers only support this flag when @var{n} is a power of two;
7611 in that case, it is rounded up.
7612
7613 If @var{n} is not specified or is zero, use a machine-dependent default.
7614
7615 Enabled at levels @option{-O2}, @option{-O3}.
7616
7617 @item -falign-labels
7618 @itemx -falign-labels=@var{n}
7619 @opindex falign-labels
7620 Align all branch targets to a power-of-two boundary, skipping up to
7621 @var{n} bytes like @option{-falign-functions}.  This option can easily
7622 make code slower, because it must insert dummy operations for when the
7623 branch target is reached in the usual flow of the code.
7624
7625 @option{-fno-align-labels} and @option{-falign-labels=1} are
7626 equivalent and mean that labels will not be aligned.
7627
7628 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7629 are greater than this value, then their values are used instead.
7630
7631 If @var{n} is not specified or is zero, use a machine-dependent default
7632 which is very likely to be @samp{1}, meaning no alignment.
7633
7634 Enabled at levels @option{-O2}, @option{-O3}.
7635
7636 @item -falign-loops
7637 @itemx -falign-loops=@var{n}
7638 @opindex falign-loops
7639 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7640 like @option{-falign-functions}.  The hope is that the loop will be
7641 executed many times, which will make up for any execution of the dummy
7642 operations.
7643
7644 @option{-fno-align-loops} and @option{-falign-loops=1} are
7645 equivalent and mean that loops will not be aligned.
7646
7647 If @var{n} is not specified or is zero, use a machine-dependent default.
7648
7649 Enabled at levels @option{-O2}, @option{-O3}.
7650
7651 @item -falign-jumps
7652 @itemx -falign-jumps=@var{n}
7653 @opindex falign-jumps
7654 Align branch targets to a power-of-two boundary, for branch targets
7655 where the targets can only be reached by jumping, skipping up to @var{n}
7656 bytes like @option{-falign-functions}.  In this case, no dummy operations
7657 need be executed.
7658
7659 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7660 equivalent and mean that loops will not be aligned.
7661
7662 If @var{n} is not specified or is zero, use a machine-dependent default.
7663
7664 Enabled at levels @option{-O2}, @option{-O3}.
7665
7666 @item -funit-at-a-time
7667 @opindex funit-at-a-time
7668 This option is left for compatibility reasons. @option{-funit-at-a-time}
7669 has no effect, while @option{-fno-unit-at-a-time} implies
7670 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7671
7672 Enabled by default.
7673
7674 @item -fno-toplevel-reorder
7675 @opindex fno-toplevel-reorder
7676 Do not reorder top-level functions, variables, and @code{asm}
7677 statements.  Output them in the same order that they appear in the
7678 input file.  When this option is used, unreferenced static variables
7679 will not be removed.  This option is intended to support existing code
7680 which relies on a particular ordering.  For new code, it is better to
7681 use attributes.
7682
7683 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
7684 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
7685 targets.
7686
7687 @item -fweb
7688 @opindex fweb
7689 Constructs webs as commonly used for register allocation purposes and assign
7690 each web individual pseudo register.  This allows the register allocation pass
7691 to operate on pseudos directly, but also strengthens several other optimization
7692 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7693 however, make debugging impossible, since variables will no longer stay in a
7694 ``home register''.
7695
7696 Enabled by default with @option{-funroll-loops}.
7697
7698 @item -fwhole-program
7699 @opindex fwhole-program
7700 Assume that the current compilation unit represents the whole program being
7701 compiled.  All public functions and variables with the exception of @code{main}
7702 and those merged by attribute @code{externally_visible} become static functions
7703 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.
7704 While this option is equivalent to proper use of the @code{static} keyword for
7705 programs consisting of a single file, in combination with option
7706 @option{-flto} this flag can be used to
7707 compile many smaller scale programs since the functions and variables become
7708 local for the whole combined compilation unit, not for the single source file
7709 itself.
7710
7711 This option implies @option{-fwhole-file} for Fortran programs.
7712
7713 @item -flto[=@var{n}]
7714 @opindex flto
7715 This option runs the standard link-time optimizer.  When invoked
7716 with source code, it generates GIMPLE (one of GCC's internal
7717 representations) and writes it to special ELF sections in the object
7718 file.  When the object files are linked together, all the function
7719 bodies are read from these ELF sections and instantiated as if they
7720 had been part of the same translation unit.
7721
7722 To use the link-timer optimizer, @option{-flto} needs to be specified at
7723 compile time and during the final link.  For example,
7724
7725 @smallexample
7726 gcc -c -O2 -flto foo.c
7727 gcc -c -O2 -flto bar.c
7728 gcc -o myprog -flto -O2 foo.o bar.o
7729 @end smallexample
7730
7731 The first two invocations to GCC will save a bytecode representation
7732 of GIMPLE into special ELF sections inside @file{foo.o} and
7733 @file{bar.o}.  The final invocation will read the GIMPLE bytecode from
7734 @file{foo.o} and @file{bar.o}, merge the two files into a single
7735 internal image, and compile the result as usual.  Since both
7736 @file{foo.o} and @file{bar.o} are merged into a single image, this
7737 causes all the inter-procedural analyses and optimizations in GCC to
7738 work across the two files as if they were a single one.  This means,
7739 for example, that the inliner will be able to inline functions in
7740 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7741
7742 Another (simpler) way to enable link-time optimization is,
7743
7744 @smallexample
7745 gcc -o myprog -flto -O2 foo.c bar.c
7746 @end smallexample
7747
7748 The above will generate bytecode for @file{foo.c} and @file{bar.c},
7749 merge them together into a single GIMPLE representation and optimize
7750 them as usual to produce @file{myprog}.
7751
7752 The only important thing to keep in mind is that to enable link-time
7753 optimizations the @option{-flto} flag needs to be passed to both the
7754 compile and the link commands.
7755
7756 To make whole program optimization effective, it is necessary to make
7757 certain whole program assumptions.  The compiler needs to know
7758 what functions and variables can be accessed by libraries and runtime
7759 outside of the link time optimized unit.  When supported by the linker,
7760 the linker plugin (see @option{-fuse-linker-plugin}) passes to the
7761 compiler information about used and externally visible symbols.  When
7762 the linker plugin is not available, @option{-fwhole-program} should be
7763 used to allow the compiler to make these assumptions, which will lead
7764 to more aggressive optimization decisions.
7765
7766 Note that when a file is compiled with @option{-flto}, the generated
7767 object file will be larger than a regular object file because it will
7768 contain GIMPLE bytecodes and the usual final code.  This means that
7769 object files with LTO information can be linked as a normal object
7770 file.  So, in the previous example, if the final link is done with
7771
7772 @smallexample
7773 gcc -o myprog foo.o bar.o
7774 @end smallexample
7775
7776 The only difference will be that no inter-procedural optimizations
7777 will be applied to produce @file{myprog}.  The two object files
7778 @file{foo.o} and @file{bar.o} will be simply sent to the regular
7779 linker.
7780
7781 Additionally, the optimization flags used to compile individual files
7782 are not necessarily related to those used at link-time.  For instance,
7783
7784 @smallexample
7785 gcc -c -O0 -flto foo.c
7786 gcc -c -O0 -flto bar.c
7787 gcc -o myprog -flto -O3 foo.o bar.o
7788 @end smallexample
7789
7790 This will produce individual object files with unoptimized assembler
7791 code, but the resulting binary @file{myprog} will be optimized at
7792 @option{-O3}.  Now, if the final binary is generated without
7793 @option{-flto}, then @file{myprog} will not be optimized.
7794
7795 When producing the final binary with @option{-flto}, GCC will only
7796 apply link-time optimizations to those files that contain bytecode.
7797 Therefore, you can mix and match object files and libraries with
7798 GIMPLE bytecodes and final object code.  GCC will automatically select
7799 which files to optimize in LTO mode and which files to link without
7800 further processing.
7801
7802 There are some code generation flags that GCC will preserve when
7803 generating bytecodes, as they need to be used during the final link
7804 stage.  Currently, the following options are saved into the GIMPLE
7805 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7806 @option{-m} target flags.
7807
7808 At link time, these options are read-in and reapplied.  Note that the
7809 current implementation makes no attempt at recognizing conflicting
7810 values for these options.  If two or more files have a conflicting
7811 value (e.g., one file is compiled with @option{-fPIC} and another
7812 isn't), the compiler will simply use the last value read from the
7813 bytecode files.  It is recommended, then, that all the files
7814 participating in the same link be compiled with the same options.
7815
7816 Another feature of LTO is that it is possible to apply interprocedural
7817 optimizations on files written in different languages.  This requires
7818 some support in the language front end.  Currently, the C, C++ and
7819 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7820 something like this should work
7821
7822 @smallexample
7823 gcc -c -flto foo.c
7824 g++ -c -flto bar.cc
7825 gfortran -c -flto baz.f90
7826 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7827 @end smallexample
7828
7829 Notice that the final link is done with @command{g++} to get the C++
7830 runtime libraries and @option{-lgfortran} is added to get the Fortran
7831 runtime libraries.  In general, when mixing languages in LTO mode, you
7832 should use the same link command used when mixing languages in a
7833 regular (non-LTO) compilation.  This means that if your build process
7834 was mixing languages before, all you need to add is @option{-flto} to
7835 all the compile and link commands.
7836
7837 If LTO encounters objects with C linkage declared with incompatible
7838 types in separate translation units to be linked together (undefined
7839 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7840 issued.  The behavior is still undefined at runtime.
7841
7842 If object files containing GIMPLE bytecode are stored in a library archive, say
7843 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
7844 are using a linker with linker plugin support.  To enable this feature, use
7845 the flag @option{-fuse-linker-plugin} at link-time:
7846
7847 @smallexample
7848 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7849 @end smallexample
7850
7851 With the linker plugin enabled, the linker will extract the needed
7852 GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
7853 to make them part of the aggregated GIMPLE image to be optimized.
7854
7855 If you are not using a linker with linker plugin support and/or do not
7856 enable linker plugin then the objects inside @file{libfoo.a}
7857 will be extracted and linked as usual, but they will not participate
7858 in the LTO optimization process.
7859
7860 Link time optimizations do not require the presence of the whole program to
7861 operate.  If the program does not require any symbols to be exported, it is
7862 possible to combine @option{-flto} and with @option{-fwhole-program} to allow
7863 the interprocedural optimizers to use more aggressive assumptions which may
7864 lead to improved optimization opportunities.
7865 Use of @option{-fwhole-program} is not needed when linker plugin is
7866 active (see @option{-fuse-linker-plugin}).
7867
7868 Regarding portability: the current implementation of LTO makes no
7869 attempt at generating bytecode that can be ported between different
7870 types of hosts.  The bytecode files are versioned and there is a
7871 strict version check, so bytecode files generated in one version of
7872 GCC will not work with an older/newer version of GCC.
7873
7874 Link time optimization does not play well with generating debugging
7875 information.  Combining @option{-flto} with
7876 @option{-g} is currently experimental and expected to produce wrong
7877 results.
7878
7879 If you specify the optional @var{n}, the optimization and code
7880 generation done at link time is executed in parallel using @var{n}
7881 parallel jobs by utilizing an installed @command{make} program.  The
7882 environment variable @env{MAKE} may be used to override the program
7883 used.  The default value for @var{n} is 1.
7884
7885 You can also specify @option{-flto=jobserver} to use GNU make's
7886 job server mode to determine the number of parallel jobs. This
7887 is useful when the Makefile calling GCC is already executing in parallel.
7888 The parent Makefile will need a @samp{+} prepended to the command recipe
7889 for this to work. This will likely only work if @env{MAKE} is
7890 GNU make.
7891
7892 This option is disabled by default.
7893
7894 @item -flto-partition=@var{alg}
7895 @opindex flto-partition
7896 Specify the partitioning algorithm used by the link time optimizer.
7897 The value is either @code{1to1} to specify a partitioning mirroring
7898 the original source files or @code{balanced} to specify partitioning
7899 into equally sized chunks (whenever possible).  Specifying @code{none}
7900 as an algorithm disables partitioning and streaming completely. The
7901 default value is @code{balanced}.
7902
7903 @item -flto-compression-level=@var{n}
7904 This option specifies the level of compression used for intermediate
7905 language written to LTO object files, and is only meaningful in
7906 conjunction with LTO mode (@option{-flto}).  Valid
7907 values are 0 (no compression) to 9 (maximum compression).  Values
7908 outside this range are clamped to either 0 or 9.  If the option is not
7909 given, a default balanced compression setting is used.
7910
7911 @item -flto-report
7912 Prints a report with internal details on the workings of the link-time
7913 optimizer.  The contents of this report vary from version to version,
7914 it is meant to be useful to GCC developers when processing object
7915 files in LTO mode (via @option{-flto}).
7916
7917 Disabled by default.
7918
7919 @item -fuse-linker-plugin
7920 Enables the use of a linker plugin during link time optimization.  This
7921 option relies on plugin support in the linker, which is available in gold
7922 or in GNU ld 2.21 or newer.
7923
7924 This option enables the extraction of object files with GIMPLE bytecode out
7925 of library archives. This improves the quality of optimization by exposing
7926 more code to the link time optimizer.  This information specifies what
7927 symbols can be accessed externally (by non-LTO object or during dynamic
7928 linking).  Resulting code quality improvements on binaries (and shared
7929 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
7930 See @option{-flto} for a description of the effect of this flag and how to
7931 use it.
7932
7933 Enabled by default when LTO support in GCC is enabled and GCC was compiled
7934 with a linker supporting plugins (GNU ld 2.21 or newer or gold).
7935
7936 @item -ffat-lto-objects
7937 @opindex ffat-lto-objects
7938 Fat LTO objects are object files that contain both the intermediate language
7939 and the object code. This makes them useable for both LTO linking and normal
7940 linking. This option makes effect only with @option{-flto} and is ignored 
7941 at linktime.
7942
7943 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
7944 requires the complete toolchain to be aware of LTO. It requires a linker with
7945 linker plugin support for basic functionality.  Additionally, nm, ar and ranlib
7946 need to support linker plugins to allow a full-featured build environment
7947 (capable of building static libraries etc).
7948
7949 The default is @option{-ffat-lto-objects} but this default is intended to
7950 change in future releases when linker plugin enabled environments become more
7951 common.
7952 @item -fcompare-elim
7953 @opindex fcompare-elim
7954 After register allocation and post-register allocation instruction splitting,
7955 identify arithmetic instructions that compute processor flags similar to a
7956 comparison operation based on that arithmetic.  If possible, eliminate the
7957 explicit comparison operation.
7958
7959 This pass only applies to certain targets that cannot explicitly represent
7960 the comparison operation before register allocation is complete.
7961
7962 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7963
7964 @item -fcprop-registers
7965 @opindex fcprop-registers
7966 After register allocation and post-register allocation instruction splitting,
7967 we perform a copy-propagation pass to try to reduce scheduling dependencies
7968 and occasionally eliminate the copy.
7969
7970 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7971
7972 @item -fprofile-correction
7973 @opindex fprofile-correction
7974 Profiles collected using an instrumented binary for multi-threaded programs may
7975 be inconsistent due to missed counter updates. When this option is specified,
7976 GCC will use heuristics to correct or smooth out such inconsistencies. By
7977 default, GCC will emit an error message when an inconsistent profile is detected.
7978
7979 @item -fprofile-dir=@var{path}
7980 @opindex fprofile-dir
7981
7982 Set the directory to search for the profile data files in to @var{path}.
7983 This option affects only the profile data generated by
7984 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
7985 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
7986 and its related options.  Both absolute and relative paths can be used.
7987 By default, GCC will use the current directory as @var{path}, thus the
7988 profile data file will appear in the same directory as the object file.
7989
7990 @item -fprofile-generate
7991 @itemx -fprofile-generate=@var{path}
7992 @opindex fprofile-generate
7993
7994 Enable options usually used for instrumenting application to produce
7995 profile useful for later recompilation with profile feedback based
7996 optimization.  You must use @option{-fprofile-generate} both when
7997 compiling and when linking your program.
7998
7999 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8000
8001 If @var{path} is specified, GCC will look at the @var{path} to find
8002 the profile feedback data files. See @option{-fprofile-dir}.
8003
8004 @item -fprofile-use
8005 @itemx -fprofile-use=@var{path}
8006 @opindex fprofile-use
8007 Enable profile feedback directed optimizations, and optimizations
8008 generally profitable only with profile feedback available.
8009
8010 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8011 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
8012
8013 By default, GCC emits an error message if the feedback profiles do not
8014 match the source code.  This error can be turned into a warning by using
8015 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8016 code.
8017
8018 If @var{path} is specified, GCC will look at the @var{path} to find
8019 the profile feedback data files. See @option{-fprofile-dir}.
8020 @end table
8021
8022 The following options control compiler behavior regarding floating
8023 point arithmetic.  These options trade off between speed and
8024 correctness.  All must be specifically enabled.
8025
8026 @table @gcctabopt
8027 @item -ffloat-store
8028 @opindex ffloat-store
8029 Do not store floating point variables in registers, and inhibit other
8030 options that might change whether a floating point value is taken from a
8031 register or memory.
8032
8033 @cindex floating point precision
8034 This option prevents undesirable excess precision on machines such as
8035 the 68000 where the floating registers (of the 68881) keep more
8036 precision than a @code{double} is supposed to have.  Similarly for the
8037 x86 architecture.  For most programs, the excess precision does only
8038 good, but a few programs rely on the precise definition of IEEE floating
8039 point.  Use @option{-ffloat-store} for such programs, after modifying
8040 them to store all pertinent intermediate computations into variables.
8041
8042 @item -fexcess-precision=@var{style}
8043 @opindex fexcess-precision
8044 This option allows further control over excess precision on machines
8045 where floating-point registers have more precision than the IEEE
8046 @code{float} and @code{double} types and the processor does not
8047 support operations rounding to those types.  By default,
8048 @option{-fexcess-precision=fast} is in effect; this means that
8049 operations are carried out in the precision of the registers and that
8050 it is unpredictable when rounding to the types specified in the source
8051 code takes place.  When compiling C, if
8052 @option{-fexcess-precision=standard} is specified then excess
8053 precision will follow the rules specified in ISO C99; in particular,
8054 both casts and assignments cause values to be rounded to their
8055 semantic types (whereas @option{-ffloat-store} only affects
8056 assignments).  This option is enabled by default for C if a strict
8057 conformance option such as @option{-std=c99} is used.
8058
8059 @opindex mfpmath
8060 @option{-fexcess-precision=standard} is not implemented for languages
8061 other than C, and has no effect if
8062 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8063 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8064 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8065 semantics apply without excess precision, and in the latter, rounding
8066 is unpredictable.
8067
8068 @item -ffast-math
8069 @opindex ffast-math
8070 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8071 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8072 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8073
8074 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8075
8076 This option is not turned on by any @option{-O} option besides
8077 @option{-Ofast} since it can result in incorrect output for programs
8078 which depend on an exact implementation of IEEE or ISO rules/specifications
8079 for math functions. It may, however, yield faster code for programs
8080 that do not require the guarantees of these specifications.
8081
8082 @item -fno-math-errno
8083 @opindex fno-math-errno
8084 Do not set ERRNO after calling math functions that are executed
8085 with a single instruction, e.g., sqrt.  A program that relies on
8086 IEEE exceptions for math error handling may want to use this flag
8087 for speed while maintaining IEEE arithmetic compatibility.
8088
8089 This option is not turned on by any @option{-O} option since
8090 it can result in incorrect output for programs which depend on
8091 an exact implementation of IEEE or ISO rules/specifications for
8092 math functions. It may, however, yield faster code for programs
8093 that do not require the guarantees of these specifications.
8094
8095 The default is @option{-fmath-errno}.
8096
8097 On Darwin systems, the math library never sets @code{errno}.  There is
8098 therefore no reason for the compiler to consider the possibility that
8099 it might, and @option{-fno-math-errno} is the default.
8100
8101 @item -funsafe-math-optimizations
8102 @opindex funsafe-math-optimizations
8103
8104 Allow optimizations for floating-point arithmetic that (a) assume
8105 that arguments and results are valid and (b) may violate IEEE or
8106 ANSI standards.  When used at link-time, it may include libraries
8107 or startup files that change the default FPU control word or other
8108 similar optimizations.
8109
8110 This option is not turned on by any @option{-O} option since
8111 it can result in incorrect output for programs which depend on
8112 an exact implementation of IEEE or ISO rules/specifications for
8113 math functions. It may, however, yield faster code for programs
8114 that do not require the guarantees of these specifications.
8115 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8116 @option{-fassociative-math} and @option{-freciprocal-math}.
8117
8118 The default is @option{-fno-unsafe-math-optimizations}.
8119
8120 @item -fassociative-math
8121 @opindex fassociative-math
8122
8123 Allow re-association of operands in series of floating-point operations.
8124 This violates the ISO C and C++ language standard by possibly changing
8125 computation result.  NOTE: re-ordering may change the sign of zero as
8126 well as ignore NaNs and inhibit or create underflow or overflow (and
8127 thus cannot be used on a code which relies on rounding behavior like
8128 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
8129 and thus may not be used when ordered comparisons are required.
8130 This option requires that both @option{-fno-signed-zeros} and
8131 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8132 much sense with @option{-frounding-math}. For Fortran the option
8133 is automatically enabled when both @option{-fno-signed-zeros} and
8134 @option{-fno-trapping-math} are in effect.
8135
8136 The default is @option{-fno-associative-math}.
8137
8138 @item -freciprocal-math
8139 @opindex freciprocal-math
8140
8141 Allow the reciprocal of a value to be used instead of dividing by
8142 the value if this enables optimizations.  For example @code{x / y}
8143 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
8144 is subject to common subexpression elimination.  Note that this loses
8145 precision and increases the number of flops operating on the value.
8146
8147 The default is @option{-fno-reciprocal-math}.
8148
8149 @item -ffinite-math-only
8150 @opindex ffinite-math-only
8151 Allow optimizations for floating-point arithmetic that assume
8152 that arguments and results are not NaNs or +-Infs.
8153
8154 This option is not turned on by any @option{-O} option since
8155 it can result in incorrect output for programs which depend on
8156 an exact implementation of IEEE or ISO rules/specifications for
8157 math functions. It may, however, yield faster code for programs
8158 that do not require the guarantees of these specifications.
8159
8160 The default is @option{-fno-finite-math-only}.
8161
8162 @item -fno-signed-zeros
8163 @opindex fno-signed-zeros
8164 Allow optimizations for floating point arithmetic that ignore the
8165 signedness of zero.  IEEE arithmetic specifies the behavior of
8166 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8167 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8168 This option implies that the sign of a zero result isn't significant.
8169
8170 The default is @option{-fsigned-zeros}.
8171
8172 @item -fno-trapping-math
8173 @opindex fno-trapping-math
8174 Compile code assuming that floating-point operations cannot generate
8175 user-visible traps.  These traps include division by zero, overflow,
8176 underflow, inexact result and invalid operation.  This option requires
8177 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8178 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8179
8180 This option should never be turned on by any @option{-O} option since
8181 it can result in incorrect output for programs which depend on
8182 an exact implementation of IEEE or ISO rules/specifications for
8183 math functions.
8184
8185 The default is @option{-ftrapping-math}.
8186
8187 @item -frounding-math
8188 @opindex frounding-math
8189 Disable transformations and optimizations that assume default floating
8190 point rounding behavior.  This is round-to-zero for all floating point
8191 to integer conversions, and round-to-nearest for all other arithmetic
8192 truncations.  This option should be specified for programs that change
8193 the FP rounding mode dynamically, or that may be executed with a
8194 non-default rounding mode.  This option disables constant folding of
8195 floating point expressions at compile-time (which may be affected by
8196 rounding mode) and arithmetic transformations that are unsafe in the
8197 presence of sign-dependent rounding modes.
8198
8199 The default is @option{-fno-rounding-math}.
8200
8201 This option is experimental and does not currently guarantee to
8202 disable all GCC optimizations that are affected by rounding mode.
8203 Future versions of GCC may provide finer control of this setting
8204 using C99's @code{FENV_ACCESS} pragma.  This command line option
8205 will be used to specify the default state for @code{FENV_ACCESS}.
8206
8207 @item -fsignaling-nans
8208 @opindex fsignaling-nans
8209 Compile code assuming that IEEE signaling NaNs may generate user-visible
8210 traps during floating-point operations.  Setting this option disables
8211 optimizations that may change the number of exceptions visible with
8212 signaling NaNs.  This option implies @option{-ftrapping-math}.
8213
8214 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8215 be defined.
8216
8217 The default is @option{-fno-signaling-nans}.
8218
8219 This option is experimental and does not currently guarantee to
8220 disable all GCC optimizations that affect signaling NaN behavior.
8221
8222 @item -fsingle-precision-constant
8223 @opindex fsingle-precision-constant
8224 Treat floating point constant as single precision constant instead of
8225 implicitly converting it to double precision constant.
8226
8227 @item -fcx-limited-range
8228 @opindex fcx-limited-range
8229 When enabled, this option states that a range reduction step is not
8230 needed when performing complex division.  Also, there is no checking
8231 whether the result of a complex multiplication or division is @code{NaN
8232 + I*NaN}, with an attempt to rescue the situation in that case.  The
8233 default is @option{-fno-cx-limited-range}, but is enabled by
8234 @option{-ffast-math}.
8235
8236 This option controls the default setting of the ISO C99
8237 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8238 all languages.
8239
8240 @item -fcx-fortran-rules
8241 @opindex fcx-fortran-rules
8242 Complex multiplication and division follow Fortran rules.  Range
8243 reduction is done as part of complex division, but there is no checking
8244 whether the result of a complex multiplication or division is @code{NaN
8245 + I*NaN}, with an attempt to rescue the situation in that case.
8246
8247 The default is @option{-fno-cx-fortran-rules}.
8248
8249 @end table
8250
8251 The following options control optimizations that may improve
8252 performance, but are not enabled by any @option{-O} options.  This
8253 section includes experimental options that may produce broken code.
8254
8255 @table @gcctabopt
8256 @item -fbranch-probabilities
8257 @opindex fbranch-probabilities
8258 After running a program compiled with @option{-fprofile-arcs}
8259 (@pxref{Debugging Options,, Options for Debugging Your Program or
8260 @command{gcc}}), you can compile it a second time using
8261 @option{-fbranch-probabilities}, to improve optimizations based on
8262 the number of times each branch was taken.  When the program
8263 compiled with @option{-fprofile-arcs} exits it saves arc execution
8264 counts to a file called @file{@var{sourcename}.gcda} for each source
8265 file.  The information in this data file is very dependent on the
8266 structure of the generated code, so you must use the same source code
8267 and the same optimization options for both compilations.
8268
8269 With @option{-fbranch-probabilities}, GCC puts a
8270 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8271 These can be used to improve optimization.  Currently, they are only
8272 used in one place: in @file{reorg.c}, instead of guessing which path a
8273 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8274 exactly determine which path is taken more often.
8275
8276 @item -fprofile-values
8277 @opindex fprofile-values
8278 If combined with @option{-fprofile-arcs}, it adds code so that some
8279 data about values of expressions in the program is gathered.
8280
8281 With @option{-fbranch-probabilities}, it reads back the data gathered
8282 from profiling values of expressions for usage in optimizations.
8283
8284 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8285
8286 @item -fvpt
8287 @opindex fvpt
8288 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
8289 a code to gather information about values of expressions.
8290
8291 With @option{-fbranch-probabilities}, it reads back the data gathered
8292 and actually performs the optimizations based on them.
8293 Currently the optimizations include specialization of division operation
8294 using the knowledge about the value of the denominator.
8295
8296 @item -frename-registers
8297 @opindex frename-registers
8298 Attempt to avoid false dependencies in scheduled code by making use
8299 of registers left over after register allocation.  This optimization
8300 will most benefit processors with lots of registers.  Depending on the
8301 debug information format adopted by the target, however, it can
8302 make debugging impossible, since variables will no longer stay in
8303 a ``home register''.
8304
8305 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8306
8307 @item -ftracer
8308 @opindex ftracer
8309 Perform tail duplication to enlarge superblock size.  This transformation
8310 simplifies the control flow of the function allowing other optimizations to do
8311 better job.
8312
8313 Enabled with @option{-fprofile-use}.
8314
8315 @item -funroll-loops
8316 @opindex funroll-loops
8317 Unroll loops whose number of iterations can be determined at compile time or
8318 upon entry to the loop.  @option{-funroll-loops} implies
8319 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8320 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8321 small constant number of iterations).  This option makes code larger, and may
8322 or may not make it run faster.
8323
8324 Enabled with @option{-fprofile-use}.
8325
8326 @item -funroll-all-loops
8327 @opindex funroll-all-loops
8328 Unroll all loops, even if their number of iterations is uncertain when
8329 the loop is entered.  This usually makes programs run more slowly.
8330 @option{-funroll-all-loops} implies the same options as
8331 @option{-funroll-loops}.
8332
8333 @item -fpeel-loops
8334 @opindex fpeel-loops
8335 Peels the loops for that there is enough information that they do not
8336 roll much (from profile feedback).  It also turns on complete loop peeling
8337 (i.e.@: complete removal of loops with small constant number of iterations).
8338
8339 Enabled with @option{-fprofile-use}.
8340
8341 @item -fmove-loop-invariants
8342 @opindex fmove-loop-invariants
8343 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8344 at level @option{-O1}
8345
8346 @item -funswitch-loops
8347 @opindex funswitch-loops
8348 Move branches with loop invariant conditions out of the loop, with duplicates
8349 of the loop on both branches (modified according to result of the condition).
8350
8351 @item -ffunction-sections
8352 @itemx -fdata-sections
8353 @opindex ffunction-sections
8354 @opindex fdata-sections
8355 Place each function or data item into its own section in the output
8356 file if the target supports arbitrary sections.  The name of the
8357 function or the name of the data item determines the section's name
8358 in the output file.
8359
8360 Use these options on systems where the linker can perform optimizations
8361 to improve locality of reference in the instruction space.  Most systems
8362 using the ELF object format and SPARC processors running Solaris 2 have
8363 linkers with such optimizations.  AIX may have these optimizations in
8364 the future.
8365
8366 Only use these options when there are significant benefits from doing
8367 so.  When you specify these options, the assembler and linker will
8368 create larger object and executable files and will also be slower.
8369 You will not be able to use @code{gprof} on all systems if you
8370 specify this option and you may have problems with debugging if
8371 you specify both this option and @option{-g}.
8372
8373 @item -fbranch-target-load-optimize
8374 @opindex fbranch-target-load-optimize
8375 Perform branch target register load optimization before prologue / epilogue
8376 threading.
8377 The use of target registers can typically be exposed only during reload,
8378 thus hoisting loads out of loops and doing inter-block scheduling needs
8379 a separate optimization pass.
8380
8381 @item -fbranch-target-load-optimize2
8382 @opindex fbranch-target-load-optimize2
8383 Perform branch target register load optimization after prologue / epilogue
8384 threading.
8385
8386 @item -fbtr-bb-exclusive
8387 @opindex fbtr-bb-exclusive
8388 When performing branch target register load optimization, don't reuse
8389 branch target registers in within any basic block.
8390
8391 @item -fstack-protector
8392 @opindex fstack-protector
8393 Emit extra code to check for buffer overflows, such as stack smashing
8394 attacks.  This is done by adding a guard variable to functions with
8395 vulnerable objects.  This includes functions that call alloca, and
8396 functions with buffers larger than 8 bytes.  The guards are initialized
8397 when a function is entered and then checked when the function exits.
8398 If a guard check fails, an error message is printed and the program exits.
8399
8400 @item -fstack-protector-all
8401 @opindex fstack-protector-all
8402 Like @option{-fstack-protector} except that all functions are protected.
8403
8404 @item -fsection-anchors
8405 @opindex fsection-anchors
8406 Try to reduce the number of symbolic address calculations by using
8407 shared ``anchor'' symbols to address nearby objects.  This transformation
8408 can help to reduce the number of GOT entries and GOT accesses on some
8409 targets.
8410
8411 For example, the implementation of the following function @code{foo}:
8412
8413 @smallexample
8414 static int a, b, c;
8415 int foo (void) @{ return a + b + c; @}
8416 @end smallexample
8417
8418 would usually calculate the addresses of all three variables, but if you
8419 compile it with @option{-fsection-anchors}, it will access the variables
8420 from a common anchor point instead.  The effect is similar to the
8421 following pseudocode (which isn't valid C):
8422
8423 @smallexample
8424 int foo (void)
8425 @{
8426   register int *xr = &x;
8427   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8428 @}
8429 @end smallexample
8430
8431 Not all targets support this option.
8432
8433 @item --param @var{name}=@var{value}
8434 @opindex param
8435 In some places, GCC uses various constants to control the amount of
8436 optimization that is done.  For example, GCC will not inline functions
8437 that contain more that a certain number of instructions.  You can
8438 control some of these constants on the command-line using the
8439 @option{--param} option.
8440
8441 The names of specific parameters, and the meaning of the values, are
8442 tied to the internals of the compiler, and are subject to change
8443 without notice in future releases.
8444
8445 In each case, the @var{value} is an integer.  The allowable choices for
8446 @var{name} are given in the following table:
8447
8448 @table @gcctabopt
8449 @item predictable-branch-outcome
8450 When branch is predicted to be taken with probability lower than this threshold
8451 (in percent), then it is considered well predictable. The default is 10.
8452
8453 @item max-crossjump-edges
8454 The maximum number of incoming edges to consider for crossjumping.
8455 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8456 the number of edges incoming to each block.  Increasing values mean
8457 more aggressive optimization, making the compile time increase with
8458 probably small improvement in executable size.
8459
8460 @item min-crossjump-insns
8461 The minimum number of instructions which must be matched at the end
8462 of two blocks before crossjumping will be performed on them.  This
8463 value is ignored in the case where all instructions in the block being
8464 crossjumped from are matched.  The default value is 5.
8465
8466 @item max-grow-copy-bb-insns
8467 The maximum code size expansion factor when copying basic blocks
8468 instead of jumping.  The expansion is relative to a jump instruction.
8469 The default value is 8.
8470
8471 @item max-goto-duplication-insns
8472 The maximum number of instructions to duplicate to a block that jumps
8473 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8474 passes, GCC factors computed gotos early in the compilation process,
8475 and unfactors them as late as possible.  Only computed jumps at the
8476 end of a basic blocks with no more than max-goto-duplication-insns are
8477 unfactored.  The default value is 8.
8478
8479 @item max-delay-slot-insn-search
8480 The maximum number of instructions to consider when looking for an
8481 instruction to fill a delay slot.  If more than this arbitrary number of
8482 instructions is searched, the time savings from filling the delay slot
8483 will be minimal so stop searching.  Increasing values mean more
8484 aggressive optimization, making the compile time increase with probably
8485 small improvement in executable run time.
8486
8487 @item max-delay-slot-live-search
8488 When trying to fill delay slots, the maximum number of instructions to
8489 consider when searching for a block with valid live register
8490 information.  Increasing this arbitrarily chosen value means more
8491 aggressive optimization, increasing the compile time.  This parameter
8492 should be removed when the delay slot code is rewritten to maintain the
8493 control-flow graph.
8494
8495 @item max-gcse-memory
8496 The approximate maximum amount of memory that will be allocated in
8497 order to perform the global common subexpression elimination
8498 optimization.  If more memory than specified is required, the
8499 optimization will not be done.
8500
8501 @item max-gcse-insertion-ratio
8502 If the ratio of expression insertions to deletions is larger than this value
8503 for any expression, then RTL PRE will insert or remove the expression and thus
8504 leave partially redundant computations in the instruction stream.  The default value is 20.
8505
8506 @item max-pending-list-length
8507 The maximum number of pending dependencies scheduling will allow
8508 before flushing the current state and starting over.  Large functions
8509 with few branches or calls can create excessively large lists which
8510 needlessly consume memory and resources.
8511
8512 @item max-modulo-backtrack-attempts
8513 The maximum number of backtrack attempts the scheduler should make
8514 when modulo scheduling a loop.  Larger values can exponentially increase
8515 compile time.
8516
8517 @item max-inline-insns-single
8518 Several parameters control the tree inliner used in gcc.
8519 This number sets the maximum number of instructions (counted in GCC's
8520 internal representation) in a single function that the tree inliner
8521 will consider for inlining.  This only affects functions declared
8522 inline and methods implemented in a class declaration (C++).
8523 The default value is 400.
8524
8525 @item max-inline-insns-auto
8526 When you use @option{-finline-functions} (included in @option{-O3}),
8527 a lot of functions that would otherwise not be considered for inlining
8528 by the compiler will be investigated.  To those functions, a different
8529 (more restrictive) limit compared to functions declared inline can
8530 be applied.
8531 The default value is 40.
8532
8533 @item large-function-insns
8534 The limit specifying really large functions.  For functions larger than this
8535 limit after inlining, inlining is constrained by
8536 @option{--param large-function-growth}.  This parameter is useful primarily
8537 to avoid extreme compilation time caused by non-linear algorithms used by the
8538 backend.
8539 The default value is 2700.
8540
8541 @item large-function-growth
8542 Specifies maximal growth of large function caused by inlining in percents.
8543 The default value is 100 which limits large function growth to 2.0 times
8544 the original size.
8545
8546 @item large-unit-insns
8547 The limit specifying large translation unit.  Growth caused by inlining of
8548 units larger than this limit is limited by @option{--param inline-unit-growth}.
8549 For small units this might be too tight (consider unit consisting of function A
8550 that is inline and B that just calls A three time.  If B is small relative to
8551 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8552 large units consisting of small inlineable functions however the overall unit
8553 growth limit is needed to avoid exponential explosion of code size.  Thus for
8554 smaller units, the size is increased to @option{--param large-unit-insns}
8555 before applying @option{--param inline-unit-growth}.  The default is 10000
8556
8557 @item inline-unit-growth
8558 Specifies maximal overall growth of the compilation unit caused by inlining.
8559 The default value is 30 which limits unit growth to 1.3 times the original
8560 size.
8561
8562 @item ipcp-unit-growth
8563 Specifies maximal overall growth of the compilation unit caused by
8564 interprocedural constant propagation.  The default value is 10 which limits
8565 unit growth to 1.1 times the original size.
8566
8567 @item large-stack-frame
8568 The limit specifying large stack frames.  While inlining the algorithm is trying
8569 to not grow past this limit too much.  Default value is 256 bytes.
8570
8571 @item large-stack-frame-growth
8572 Specifies maximal growth of large stack frames caused by inlining in percents.
8573 The default value is 1000 which limits large stack frame growth to 11 times
8574 the original size.
8575
8576 @item max-inline-insns-recursive
8577 @itemx max-inline-insns-recursive-auto
8578 Specifies maximum number of instructions out-of-line copy of self recursive inline
8579 function can grow into by performing recursive inlining.
8580
8581 For functions declared inline @option{--param max-inline-insns-recursive} is
8582 taken into account.  For function not declared inline, recursive inlining
8583 happens only when @option{-finline-functions} (included in @option{-O3}) is
8584 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8585 default value is 450.
8586
8587 @item max-inline-recursive-depth
8588 @itemx max-inline-recursive-depth-auto
8589 Specifies maximum recursion depth used by the recursive inlining.
8590
8591 For functions declared inline @option{--param max-inline-recursive-depth} is
8592 taken into account.  For function not declared inline, recursive inlining
8593 happens only when @option{-finline-functions} (included in @option{-O3}) is
8594 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8595 default value is 8.
8596
8597 @item min-inline-recursive-probability
8598 Recursive inlining is profitable only for function having deep recursion
8599 in average and can hurt for function having little recursion depth by
8600 increasing the prologue size or complexity of function body to other
8601 optimizers.
8602
8603 When profile feedback is available (see @option{-fprofile-generate}) the actual
8604 recursion depth can be guessed from probability that function will recurse via
8605 given call expression.  This parameter limits inlining only to call expression
8606 whose probability exceeds given threshold (in percents).  The default value is
8607 10.
8608
8609 @item early-inlining-insns
8610 Specify growth that early inliner can make.  In effect it increases amount of
8611 inlining for code having large abstraction penalty.  The default value is 10.
8612
8613 @item max-early-inliner-iterations
8614 @itemx max-early-inliner-iterations
8615 Limit of iterations of early inliner.  This basically bounds number of nested
8616 indirect calls early inliner can resolve.  Deeper chains are still handled by
8617 late inlining.
8618
8619 @item comdat-sharing-probability
8620 @itemx comdat-sharing-probability
8621 Probability (in percent) that C++ inline function with comdat visibility
8622 will be shared across multiple compilation units.  The default value is 20.
8623
8624 @item min-vect-loop-bound
8625 The minimum number of iterations under which a loop will not get vectorized
8626 when @option{-ftree-vectorize} is used.  The number of iterations after
8627 vectorization needs to be greater than the value specified by this option
8628 to allow vectorization.  The default value is 0.
8629
8630 @item gcse-cost-distance-ratio
8631 Scaling factor in calculation of maximum distance an expression
8632 can be moved by GCSE optimizations.  This is currently supported only in the
8633 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
8634 will be with simple expressions, i.e., the expressions which have cost
8635 less than @option{gcse-unrestricted-cost}.  Specifying 0 will disable
8636 hoisting of simple expressions.  The default value is 10.
8637
8638 @item gcse-unrestricted-cost
8639 Cost, roughly measured as the cost of a single typical machine
8640 instruction, at which GCSE optimizations will not constrain
8641 the distance an expression can travel.  This is currently
8642 supported only in the code hoisting pass.  The lesser the cost,
8643 the more aggressive code hoisting will be.  Specifying 0 will
8644 allow all expressions to travel unrestricted distances.
8645 The default value is 3.
8646
8647 @item max-hoist-depth
8648 The depth of search in the dominator tree for expressions to hoist.
8649 This is used to avoid quadratic behavior in hoisting algorithm.
8650 The value of 0 will avoid limiting the search, but may slow down compilation
8651 of huge functions.  The default value is 30.
8652
8653 @item max-tail-merge-comparisons
8654 The maximum amount of similar bbs to compare a bb with.  This is used to
8655 avoid quadratic behaviour in tree tail merging.  The default value is 10.
8656
8657 @item max-tail-merge-iterations
8658 The maximum amount of iterations of the pass over the function.  This is used to
8659 limit run time in tree tail merging.  The default value is 2.
8660
8661 @item max-unrolled-insns
8662 The maximum number of instructions that a loop should have if that loop
8663 is unrolled, and if the loop is unrolled, it determines how many times
8664 the loop code is unrolled.
8665
8666 @item max-average-unrolled-insns
8667 The maximum number of instructions biased by probabilities of their execution
8668 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8669 it determines how many times the loop code is unrolled.
8670
8671 @item max-unroll-times
8672 The maximum number of unrollings of a single loop.
8673
8674 @item max-peeled-insns
8675 The maximum number of instructions that a loop should have if that loop
8676 is peeled, and if the loop is peeled, it determines how many times
8677 the loop code is peeled.
8678
8679 @item max-peel-times
8680 The maximum number of peelings of a single loop.
8681
8682 @item max-completely-peeled-insns
8683 The maximum number of insns of a completely peeled loop.
8684
8685 @item max-completely-peel-times
8686 The maximum number of iterations of a loop to be suitable for complete peeling.
8687
8688 @item max-completely-peel-loop-nest-depth
8689 The maximum depth of a loop nest suitable for complete peeling.
8690
8691 @item max-unswitch-insns
8692 The maximum number of insns of an unswitched loop.
8693
8694 @item max-unswitch-level
8695 The maximum number of branches unswitched in a single loop.
8696
8697 @item lim-expensive
8698 The minimum cost of an expensive expression in the loop invariant motion.
8699
8700 @item iv-consider-all-candidates-bound
8701 Bound on number of candidates for induction variables below that
8702 all candidates are considered for each use in induction variable
8703 optimizations.  Only the most relevant candidates are considered
8704 if there are more candidates, to avoid quadratic time complexity.
8705
8706 @item iv-max-considered-uses
8707 The induction variable optimizations give up on loops that contain more
8708 induction variable uses.
8709
8710 @item iv-always-prune-cand-set-bound
8711 If number of candidates in the set is smaller than this value,
8712 we always try to remove unnecessary ivs from the set during its
8713 optimization when a new iv is added to the set.
8714
8715 @item scev-max-expr-size
8716 Bound on size of expressions used in the scalar evolutions analyzer.
8717 Large expressions slow the analyzer.
8718
8719 @item scev-max-expr-complexity
8720 Bound on the complexity of the expressions in the scalar evolutions analyzer.
8721 Complex expressions slow the analyzer.
8722
8723 @item omega-max-vars
8724 The maximum number of variables in an Omega constraint system.
8725 The default value is 128.
8726
8727 @item omega-max-geqs
8728 The maximum number of inequalities in an Omega constraint system.
8729 The default value is 256.
8730
8731 @item omega-max-eqs
8732 The maximum number of equalities in an Omega constraint system.
8733 The default value is 128.
8734
8735 @item omega-max-wild-cards
8736 The maximum number of wildcard variables that the Omega solver will
8737 be able to insert.  The default value is 18.
8738
8739 @item omega-hash-table-size
8740 The size of the hash table in the Omega solver.  The default value is
8741 550.
8742
8743 @item omega-max-keys
8744 The maximal number of keys used by the Omega solver.  The default
8745 value is 500.
8746
8747 @item omega-eliminate-redundant-constraints
8748 When set to 1, use expensive methods to eliminate all redundant
8749 constraints.  The default value is 0.
8750
8751 @item vect-max-version-for-alignment-checks
8752 The maximum number of runtime checks that can be performed when
8753 doing loop versioning for alignment in the vectorizer.  See option
8754 ftree-vect-loop-version for more information.
8755
8756 @item vect-max-version-for-alias-checks
8757 The maximum number of runtime checks that can be performed when
8758 doing loop versioning for alias in the vectorizer.  See option
8759 ftree-vect-loop-version for more information.
8760
8761 @item max-iterations-to-track
8762
8763 The maximum number of iterations of a loop the brute force algorithm
8764 for analysis of # of iterations of the loop tries to evaluate.
8765
8766 @item hot-bb-count-fraction
8767 Select fraction of the maximal count of repetitions of basic block in program
8768 given basic block needs to have to be considered hot.
8769
8770 @item hot-bb-frequency-fraction
8771 Select fraction of the entry block frequency of executions of basic block in
8772 function given basic block needs to have to be considered hot.
8773
8774 @item max-predicted-iterations
8775 The maximum number of loop iterations we predict statically.  This is useful
8776 in cases where function contain single loop with known bound and other loop
8777 with unknown.  We predict the known number of iterations correctly, while
8778 the unknown number of iterations average to roughly 10.  This means that the
8779 loop without bounds would appear artificially cold relative to the other one.
8780
8781 @item align-threshold
8782
8783 Select fraction of the maximal frequency of executions of basic block in
8784 function given basic block will get aligned.
8785
8786 @item align-loop-iterations
8787
8788 A loop expected to iterate at lest the selected number of iterations will get
8789 aligned.
8790
8791 @item tracer-dynamic-coverage
8792 @itemx tracer-dynamic-coverage-feedback
8793
8794 This value is used to limit superblock formation once the given percentage of
8795 executed instructions is covered.  This limits unnecessary code size
8796 expansion.
8797
8798 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8799 feedback is available.  The real profiles (as opposed to statically estimated
8800 ones) are much less balanced allowing the threshold to be larger value.
8801
8802 @item tracer-max-code-growth
8803 Stop tail duplication once code growth has reached given percentage.  This is
8804 rather hokey argument, as most of the duplicates will be eliminated later in
8805 cross jumping, so it may be set to much higher values than is the desired code
8806 growth.
8807
8808 @item tracer-min-branch-ratio
8809
8810 Stop reverse growth when the reverse probability of best edge is less than this
8811 threshold (in percent).
8812
8813 @item tracer-min-branch-ratio
8814 @itemx tracer-min-branch-ratio-feedback
8815
8816 Stop forward growth if the best edge do have probability lower than this
8817 threshold.
8818
8819 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8820 compilation for profile feedback and one for compilation without.  The value
8821 for compilation with profile feedback needs to be more conservative (higher) in
8822 order to make tracer effective.
8823
8824 @item max-cse-path-length
8825
8826 Maximum number of basic blocks on path that cse considers.  The default is 10.
8827
8828 @item max-cse-insns
8829 The maximum instructions CSE process before flushing. The default is 1000.
8830
8831 @item ggc-min-expand
8832
8833 GCC uses a garbage collector to manage its own memory allocation.  This
8834 parameter specifies the minimum percentage by which the garbage
8835 collector's heap should be allowed to expand between collections.
8836 Tuning this may improve compilation speed; it has no effect on code
8837 generation.
8838
8839 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8840 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
8841 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8842 GCC is not able to calculate RAM on a particular platform, the lower
8843 bound of 30% is used.  Setting this parameter and
8844 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8845 every opportunity.  This is extremely slow, but can be useful for
8846 debugging.
8847
8848 @item ggc-min-heapsize
8849
8850 Minimum size of the garbage collector's heap before it begins bothering
8851 to collect garbage.  The first collection occurs after the heap expands
8852 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8853 tuning this may improve compilation speed, and has no effect on code
8854 generation.
8855
8856 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
8857 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8858 with a lower bound of 4096 (four megabytes) and an upper bound of
8859 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8860 particular platform, the lower bound is used.  Setting this parameter
8861 very large effectively disables garbage collection.  Setting this
8862 parameter and @option{ggc-min-expand} to zero causes a full collection
8863 to occur at every opportunity.
8864
8865 @item max-reload-search-insns
8866 The maximum number of instruction reload should look backward for equivalent
8867 register.  Increasing values mean more aggressive optimization, making the
8868 compile time increase with probably slightly better performance.  The default
8869 value is 100.
8870
8871 @item max-cselib-memory-locations
8872 The maximum number of memory locations cselib should take into account.
8873 Increasing values mean more aggressive optimization, making the compile time
8874 increase with probably slightly better performance.  The default value is 500.
8875
8876 @item reorder-blocks-duplicate
8877 @itemx reorder-blocks-duplicate-feedback
8878
8879 Used by basic block reordering pass to decide whether to use unconditional
8880 branch or duplicate the code on its destination.  Code is duplicated when its
8881 estimated size is smaller than this value multiplied by the estimated size of
8882 unconditional jump in the hot spots of the program.
8883
8884 The @option{reorder-block-duplicate-feedback} is used only when profile
8885 feedback is available and may be set to higher values than
8886 @option{reorder-block-duplicate} since information about the hot spots is more
8887 accurate.
8888
8889 @item max-sched-ready-insns
8890 The maximum number of instructions ready to be issued the scheduler should
8891 consider at any given time during the first scheduling pass.  Increasing
8892 values mean more thorough searches, making the compilation time increase
8893 with probably little benefit.  The default value is 100.
8894
8895 @item max-sched-region-blocks
8896 The maximum number of blocks in a region to be considered for
8897 interblock scheduling.  The default value is 10.
8898
8899 @item max-pipeline-region-blocks
8900 The maximum number of blocks in a region to be considered for
8901 pipelining in the selective scheduler.  The default value is 15.
8902
8903 @item max-sched-region-insns
8904 The maximum number of insns in a region to be considered for
8905 interblock scheduling.  The default value is 100.
8906
8907 @item max-pipeline-region-insns
8908 The maximum number of insns in a region to be considered for
8909 pipelining in the selective scheduler.  The default value is 200.
8910
8911 @item min-spec-prob
8912 The minimum probability (in percents) of reaching a source block
8913 for interblock speculative scheduling.  The default value is 40.
8914
8915 @item max-sched-extend-regions-iters
8916 The maximum number of iterations through CFG to extend regions.
8917 0 - disable region extension,
8918 N - do at most N iterations.
8919 The default value is 0.
8920
8921 @item max-sched-insn-conflict-delay
8922 The maximum conflict delay for an insn to be considered for speculative motion.
8923 The default value is 3.
8924
8925 @item sched-spec-prob-cutoff
8926 The minimal probability of speculation success (in percents), so that
8927 speculative insn will be scheduled.
8928 The default value is 40.
8929
8930 @item sched-mem-true-dep-cost
8931 Minimal distance (in CPU cycles) between store and load targeting same
8932 memory locations.  The default value is 1.
8933
8934 @item selsched-max-lookahead
8935 The maximum size of the lookahead window of selective scheduling.  It is a
8936 depth of search for available instructions.
8937 The default value is 50.
8938
8939 @item selsched-max-sched-times
8940 The maximum number of times that an instruction will be scheduled during
8941 selective scheduling.  This is the limit on the number of iterations
8942 through which the instruction may be pipelined.  The default value is 2.
8943
8944 @item selsched-max-insns-to-rename
8945 The maximum number of best instructions in the ready list that are considered
8946 for renaming in the selective scheduler.  The default value is 2.
8947
8948 @item sms-min-sc
8949 The minimum value of stage count that swing modulo scheduler will
8950 generate.  The default value is 2.
8951
8952 @item max-last-value-rtl
8953 The maximum size measured as number of RTLs that can be recorded in an expression
8954 in combiner for a pseudo register as last known value of that register.  The default
8955 is 10000.
8956
8957 @item integer-share-limit
8958 Small integer constants can use a shared data structure, reducing the
8959 compiler's memory usage and increasing its speed.  This sets the maximum
8960 value of a shared integer constant.  The default value is 256.
8961
8962 @item min-virtual-mappings
8963 Specifies the minimum number of virtual mappings in the incremental
8964 SSA updater that should be registered to trigger the virtual mappings
8965 heuristic defined by virtual-mappings-ratio.  The default value is
8966 100.
8967
8968 @item virtual-mappings-ratio
8969 If the number of virtual mappings is virtual-mappings-ratio bigger
8970 than the number of virtual symbols to be updated, then the incremental
8971 SSA updater switches to a full update for those symbols.  The default
8972 ratio is 3.
8973
8974 @item ssp-buffer-size
8975 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
8976 protection when @option{-fstack-protection} is used.
8977
8978 @item max-jump-thread-duplication-stmts
8979 Maximum number of statements allowed in a block that needs to be
8980 duplicated when threading jumps.
8981
8982 @item max-fields-for-field-sensitive
8983 Maximum number of fields in a structure we will treat in
8984 a field sensitive manner during pointer analysis.  The default is zero
8985 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
8986
8987 @item prefetch-latency
8988 Estimate on average number of instructions that are executed before
8989 prefetch finishes.  The distance we prefetch ahead is proportional
8990 to this constant.  Increasing this number may also lead to less
8991 streams being prefetched (see @option{simultaneous-prefetches}).
8992
8993 @item simultaneous-prefetches
8994 Maximum number of prefetches that can run at the same time.
8995
8996 @item l1-cache-line-size
8997 The size of cache line in L1 cache, in bytes.
8998
8999 @item l1-cache-size
9000 The size of L1 cache, in kilobytes.
9001
9002 @item l2-cache-size
9003 The size of L2 cache, in kilobytes.
9004
9005 @item min-insn-to-prefetch-ratio
9006 The minimum ratio between the number of instructions and the
9007 number of prefetches to enable prefetching in a loop.
9008
9009 @item prefetch-min-insn-to-mem-ratio
9010 The minimum ratio between the number of instructions and the
9011 number of memory references to enable prefetching in a loop.
9012
9013 @item use-canonical-types
9014 Whether the compiler should use the ``canonical'' type system.  By
9015 default, this should always be 1, which uses a more efficient internal
9016 mechanism for comparing types in C++ and Objective-C++.  However, if
9017 bugs in the canonical type system are causing compilation failures,
9018 set this value to 0 to disable canonical types.
9019
9020 @item switch-conversion-max-branch-ratio
9021 Switch initialization conversion will refuse to create arrays that are
9022 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9023 branches in the switch.
9024
9025 @item max-partial-antic-length
9026 Maximum length of the partial antic set computed during the tree
9027 partial redundancy elimination optimization (@option{-ftree-pre}) when
9028 optimizing at @option{-O3} and above.  For some sorts of source code
9029 the enhanced partial redundancy elimination optimization can run away,
9030 consuming all of the memory available on the host machine.  This
9031 parameter sets a limit on the length of the sets that are computed,
9032 which prevents the runaway behavior.  Setting a value of 0 for
9033 this parameter will allow an unlimited set length.
9034
9035 @item sccvn-max-scc-size
9036 Maximum size of a strongly connected component (SCC) during SCCVN
9037 processing.  If this limit is hit, SCCVN processing for the whole
9038 function will not be done and optimizations depending on it will
9039 be disabled.  The default maximum SCC size is 10000.
9040
9041 @item ira-max-loops-num
9042 IRA uses a regional register allocation by default.  If a function
9043 contains loops more than number given by the parameter, only at most
9044 given number of the most frequently executed loops will form regions
9045 for the regional register allocation.  The default value of the
9046 parameter is 100.
9047
9048 @item ira-max-conflict-table-size
9049 Although IRA uses a sophisticated algorithm of compression conflict
9050 table, the table can be still big for huge functions.  If the conflict
9051 table for a function could be more than size in MB given by the
9052 parameter, the conflict table is not built and faster, simpler, and
9053 lower quality register allocation algorithm will be used.  The
9054 algorithm do not use pseudo-register conflicts.  The default value of
9055 the parameter is 2000.
9056
9057 @item ira-loop-reserved-regs
9058 IRA can be used to evaluate more accurate register pressure in loops
9059 for decision to move loop invariants (see @option{-O3}).  The number
9060 of available registers reserved for some other purposes is described
9061 by this parameter.  The default value of the parameter is 2 which is
9062 minimal number of registers needed for execution of typical
9063 instruction.  This value is the best found from numerous experiments.
9064
9065 @item loop-invariant-max-bbs-in-loop
9066 Loop invariant motion can be very expensive, both in compile time and
9067 in amount of needed compile time memory, with very large loops.  Loops
9068 with more basic blocks than this parameter won't have loop invariant
9069 motion optimization performed on them.  The default value of the
9070 parameter is 1000 for -O1 and 10000 for -O2 and above.
9071
9072 @item max-vartrack-size
9073 Sets a maximum number of hash table slots to use during variable
9074 tracking dataflow analysis of any function.  If this limit is exceeded
9075 with variable tracking at assignments enabled, analysis for that
9076 function is retried without it, after removing all debug insns from
9077 the function.  If the limit is exceeded even without debug insns, var
9078 tracking analysis is completely disabled for the function.  Setting
9079 the parameter to zero makes it unlimited.
9080
9081 @item max-vartrack-expr-depth
9082 Sets a maximum number of recursion levels when attempting to map
9083 variable names or debug temporaries to value expressions.  This trades
9084 compile time for more complete debug information.  If this is set too
9085 low, value expressions that are available and could be represented in
9086 debug information may end up not being used; setting this higher may
9087 enable the compiler to find more complex debug expressions, but compile
9088 time and memory use may grow.  The default is 12.
9089
9090 @item min-nondebug-insn-uid
9091 Use uids starting at this parameter for nondebug insns.  The range below
9092 the parameter is reserved exclusively for debug insns created by
9093 @option{-fvar-tracking-assignments}, but debug insns may get
9094 (non-overlapping) uids above it if the reserved range is exhausted.
9095
9096 @item ipa-sra-ptr-growth-factor
9097 IPA-SRA will replace a pointer to an aggregate with one or more new
9098 parameters only when their cumulative size is less or equal to
9099 @option{ipa-sra-ptr-growth-factor} times the size of the original
9100 pointer parameter.
9101
9102 @item graphite-max-nb-scop-params
9103 To avoid exponential effects in the Graphite loop transforms, the
9104 number of parameters in a Static Control Part (SCoP) is bounded.  The
9105 default value is 10 parameters.  A variable whose value is unknown at
9106 compile time and defined outside a SCoP is a parameter of the SCoP.
9107
9108 @item graphite-max-bbs-per-function
9109 To avoid exponential effects in the detection of SCoPs, the size of
9110 the functions analyzed by Graphite is bounded.  The default value is
9111 100 basic blocks.
9112
9113 @item loop-block-tile-size
9114 Loop blocking or strip mining transforms, enabled with
9115 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9116 loop in the loop nest by a given number of iterations.  The strip
9117 length can be changed using the @option{loop-block-tile-size}
9118 parameter.  The default value is 51 iterations.
9119
9120 @item ipa-cp-value-list-size
9121 IPA-CP attempts to track all possible values and types passed to a function's
9122 parameter in order to propagate them and perform devirtualization.
9123 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9124 stores per one formal parameter of a function.
9125
9126 @item lto-partitions
9127 Specify desired number of partitions produced during WHOPR compilation.
9128 The number of partitions should exceed the number of CPUs used for compilation.
9129 The default value is 32.
9130
9131 @item lto-minpartition
9132 Size of minimal partition for WHOPR (in estimated instructions).
9133 This prevents expenses of splitting very small programs into too many
9134 partitions.
9135
9136 @item cxx-max-namespaces-for-diagnostic-help
9137 The maximum number of namespaces to consult for suggestions when C++
9138 name lookup fails for an identifier.  The default is 1000.
9139
9140 @item sink-frequency-threshold
9141 The maximum relative execution frequency (in percents) of the target block
9142 relative to a statement's original block to allow statement sinking of a
9143 statement.  Larger numbers result in more aggressive statement sinking.
9144 The default value is 75.  A small positive adjustment is applied for
9145 statements with memory operands as those are even more profitable so sink.
9146
9147 @item max-stores-to-sink
9148 The maximum number of conditional stores paires that can be sunk.  Set to 0
9149 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9150 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9151
9152 @item allow-store-data-races
9153 Allow optimizers to introduce new data races on stores.
9154 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9155 unless implicitly set by the @option{-fmemory-model=} option.
9156
9157 @item case-values-threshold
9158 The smallest number of different values for which it is best to use a
9159 jump-table instead of a tree of conditional branches.  If the value is
9160 0, use the default for the machine.  The default is 0.
9161
9162 @item tree-reassoc-width
9163 Set the maximum number of instructions executed in parallel in
9164 reassociated tree. This parameter overrides target dependent
9165 heuristics used by default if has non zero value.
9166
9167 @end table
9168 @end table
9169
9170 @node Preprocessor Options
9171 @section Options Controlling the Preprocessor
9172 @cindex preprocessor options
9173 @cindex options, preprocessor
9174
9175 These options control the C preprocessor, which is run on each C source
9176 file before actual compilation.
9177
9178 If you use the @option{-E} option, nothing is done except preprocessing.
9179 Some of these options make sense only together with @option{-E} because
9180 they cause the preprocessor output to be unsuitable for actual
9181 compilation.
9182
9183 @table @gcctabopt
9184 @item -Wp,@var{option}
9185 @opindex Wp
9186 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9187 and pass @var{option} directly through to the preprocessor.  If
9188 @var{option} contains commas, it is split into multiple options at the
9189 commas.  However, many options are modified, translated or interpreted
9190 by the compiler driver before being passed to the preprocessor, and
9191 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9192 interface is undocumented and subject to change, so whenever possible
9193 you should avoid using @option{-Wp} and let the driver handle the
9194 options instead.
9195
9196 @item -Xpreprocessor @var{option}
9197 @opindex Xpreprocessor
9198 Pass @var{option} as an option to the preprocessor.  You can use this to
9199 supply system-specific preprocessor options which GCC does not know how to
9200 recognize.
9201
9202 If you want to pass an option that takes an argument, you must use
9203 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9204 @end table
9205
9206 @include cppopts.texi
9207
9208 @node Assembler Options
9209 @section Passing Options to the Assembler
9210
9211 @c prevent bad page break with this line
9212 You can pass options to the assembler.
9213
9214 @table @gcctabopt
9215 @item -Wa,@var{option}
9216 @opindex Wa
9217 Pass @var{option} as an option to the assembler.  If @var{option}
9218 contains commas, it is split into multiple options at the commas.
9219
9220 @item -Xassembler @var{option}
9221 @opindex Xassembler
9222 Pass @var{option} as an option to the assembler.  You can use this to
9223 supply system-specific assembler options which GCC does not know how to
9224 recognize.
9225
9226 If you want to pass an option that takes an argument, you must use
9227 @option{-Xassembler} twice, once for the option and once for the argument.
9228
9229 @end table
9230
9231 @node Link Options
9232 @section Options for Linking
9233 @cindex link options
9234 @cindex options, linking
9235
9236 These options come into play when the compiler links object files into
9237 an executable output file.  They are meaningless if the compiler is
9238 not doing a link step.
9239
9240 @table @gcctabopt
9241 @cindex file names
9242 @item @var{object-file-name}
9243 A file name that does not end in a special recognized suffix is
9244 considered to name an object file or library.  (Object files are
9245 distinguished from libraries by the linker according to the file
9246 contents.)  If linking is done, these object files are used as input
9247 to the linker.
9248
9249 @item -c
9250 @itemx -S
9251 @itemx -E
9252 @opindex c
9253 @opindex S
9254 @opindex E
9255 If any of these options is used, then the linker is not run, and
9256 object file names should not be used as arguments.  @xref{Overall
9257 Options}.
9258
9259 @cindex Libraries
9260 @item -l@var{library}
9261 @itemx -l @var{library}
9262 @opindex l
9263 Search the library named @var{library} when linking.  (The second
9264 alternative with the library as a separate argument is only for
9265 POSIX compliance and is not recommended.)
9266
9267 It makes a difference where in the command you write this option; the
9268 linker searches and processes libraries and object files in the order they
9269 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9270 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9271 to functions in @samp{z}, those functions may not be loaded.
9272
9273 The linker searches a standard list of directories for the library,
9274 which is actually a file named @file{lib@var{library}.a}.  The linker
9275 then uses this file as if it had been specified precisely by name.
9276
9277 The directories searched include several standard system directories
9278 plus any that you specify with @option{-L}.
9279
9280 Normally the files found this way are library files---archive files
9281 whose members are object files.  The linker handles an archive file by
9282 scanning through it for members which define symbols that have so far
9283 been referenced but not defined.  But if the file that is found is an
9284 ordinary object file, it is linked in the usual fashion.  The only
9285 difference between using an @option{-l} option and specifying a file name
9286 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9287 and searches several directories.
9288
9289 @item -lobjc
9290 @opindex lobjc
9291 You need this special case of the @option{-l} option in order to
9292 link an Objective-C or Objective-C++ program.
9293
9294 @item -nostartfiles
9295 @opindex nostartfiles
9296 Do not use the standard system startup files when linking.
9297 The standard system libraries are used normally, unless @option{-nostdlib}
9298 or @option{-nodefaultlibs} is used.
9299
9300 @item -nodefaultlibs
9301 @opindex nodefaultlibs
9302 Do not use the standard system libraries when linking.
9303 Only the libraries you specify will be passed to the linker, options
9304 specifying linkage of the system libraries, such as @code{-static-libgcc}
9305 or @code{-shared-libgcc}, will be ignored.
9306 The standard startup files are used normally, unless @option{-nostartfiles}
9307 is used.  The compiler may generate calls to @code{memcmp},
9308 @code{memset}, @code{memcpy} and @code{memmove}.
9309 These entries are usually resolved by entries in
9310 libc.  These entry points should be supplied through some other
9311 mechanism when this option is specified.
9312
9313 @item -nostdlib
9314 @opindex nostdlib
9315 Do not use the standard system startup files or libraries when linking.
9316 No startup files and only the libraries you specify will be passed to
9317 the linker, options specifying linkage of the system libraries, such as
9318 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
9319 The compiler may generate calls to @code{memcmp}, @code{memset},
9320 @code{memcpy} and @code{memmove}.
9321 These entries are usually resolved by entries in
9322 libc.  These entry points should be supplied through some other
9323 mechanism when this option is specified.
9324
9325 @cindex @option{-lgcc}, use with @option{-nostdlib}
9326 @cindex @option{-nostdlib} and unresolved references
9327 @cindex unresolved references and @option{-nostdlib}
9328 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9329 @cindex @option{-nodefaultlibs} and unresolved references
9330 @cindex unresolved references and @option{-nodefaultlibs}
9331 One of the standard libraries bypassed by @option{-nostdlib} and
9332 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9333 that GCC uses to overcome shortcomings of particular machines, or special
9334 needs for some languages.
9335 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9336 Collection (GCC) Internals},
9337 for more discussion of @file{libgcc.a}.)
9338 In most cases, you need @file{libgcc.a} even when you want to avoid
9339 other standard libraries.  In other words, when you specify @option{-nostdlib}
9340 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9341 This ensures that you have no unresolved references to internal GCC
9342 library subroutines.  (For example, @samp{__main}, used to ensure C++
9343 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
9344 GNU Compiler Collection (GCC) Internals}.)
9345
9346 @item -pie
9347 @opindex pie
9348 Produce a position independent executable on targets which support it.
9349 For predictable results, you must also specify the same set of options
9350 that were used to generate code (@option{-fpie}, @option{-fPIE},
9351 or model suboptions) when you specify this option.
9352
9353 @item -rdynamic
9354 @opindex rdynamic
9355 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9356 that support it. This instructs the linker to add all symbols, not
9357 only used ones, to the dynamic symbol table. This option is needed
9358 for some uses of @code{dlopen} or to allow obtaining backtraces
9359 from within a program.
9360
9361 @item -s
9362 @opindex s
9363 Remove all symbol table and relocation information from the executable.
9364
9365 @item -static
9366 @opindex static
9367 On systems that support dynamic linking, this prevents linking with the shared
9368 libraries.  On other systems, this option has no effect.
9369
9370 @item -shared
9371 @opindex shared
9372 Produce a shared object which can then be linked with other objects to
9373 form an executable.  Not all systems support this option.  For predictable
9374 results, you must also specify the same set of options that were used to
9375 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
9376 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
9377 needs to build supplementary stub code for constructors to work.  On
9378 multi-libbed systems, @samp{gcc -shared} must select the correct support
9379 libraries to link against.  Failing to supply the correct flags may lead
9380 to subtle defects.  Supplying them in cases where they are not necessary
9381 is innocuous.}
9382
9383 @item -shared-libgcc
9384 @itemx -static-libgcc
9385 @opindex shared-libgcc
9386 @opindex static-libgcc
9387 On systems that provide @file{libgcc} as a shared library, these options
9388 force the use of either the shared or static version respectively.
9389 If no shared version of @file{libgcc} was built when the compiler was
9390 configured, these options have no effect.
9391
9392 There are several situations in which an application should use the
9393 shared @file{libgcc} instead of the static version.  The most common
9394 of these is when the application wishes to throw and catch exceptions
9395 across different shared libraries.  In that case, each of the libraries
9396 as well as the application itself should use the shared @file{libgcc}.
9397
9398 Therefore, the G++ and GCJ drivers automatically add
9399 @option{-shared-libgcc} whenever you build a shared library or a main
9400 executable, because C++ and Java programs typically use exceptions, so
9401 this is the right thing to do.
9402
9403 If, instead, you use the GCC driver to create shared libraries, you may
9404 find that they will not always be linked with the shared @file{libgcc}.
9405 If GCC finds, at its configuration time, that you have a non-GNU linker
9406 or a GNU linker that does not support option @option{--eh-frame-hdr},
9407 it will link the shared version of @file{libgcc} into shared libraries
9408 by default.  Otherwise, it will take advantage of the linker and optimize
9409 away the linking with the shared version of @file{libgcc}, linking with
9410 the static version of libgcc by default.  This allows exceptions to
9411 propagate through such shared libraries, without incurring relocation
9412 costs at library load time.
9413
9414 However, if a library or main executable is supposed to throw or catch
9415 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9416 for the languages used in the program, or using the option
9417 @option{-shared-libgcc}, such that it is linked with the shared
9418 @file{libgcc}.
9419
9420 @item -static-libstdc++
9421 When the @command{g++} program is used to link a C++ program, it will
9422 normally automatically link against @option{libstdc++}.  If
9423 @file{libstdc++} is available as a shared library, and the
9424 @option{-static} option is not used, then this will link against the
9425 shared version of @file{libstdc++}.  That is normally fine.  However, it
9426 is sometimes useful to freeze the version of @file{libstdc++} used by
9427 the program without going all the way to a fully static link.  The
9428 @option{-static-libstdc++} option directs the @command{g++} driver to
9429 link @file{libstdc++} statically, without necessarily linking other
9430 libraries statically.
9431
9432 @item -symbolic
9433 @opindex symbolic
9434 Bind references to global symbols when building a shared object.  Warn
9435 about any unresolved references (unless overridden by the link editor
9436 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
9437 this option.
9438
9439 @item -T @var{script}
9440 @opindex T
9441 @cindex linker script
9442 Use @var{script} as the linker script.  This option is supported by most
9443 systems using the GNU linker.  On some targets, such as bare-board
9444 targets without an operating system, the @option{-T} option may be required
9445 when linking to avoid references to undefined symbols.
9446
9447 @item -Xlinker @var{option}
9448 @opindex Xlinker
9449 Pass @var{option} as an option to the linker.  You can use this to
9450 supply system-specific linker options which GCC does not know how to
9451 recognize.
9452
9453 If you want to pass an option that takes a separate argument, you must use
9454 @option{-Xlinker} twice, once for the option and once for the argument.
9455 For example, to pass @option{-assert definitions}, you must write
9456 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9457 @option{-Xlinker "-assert definitions"}, because this passes the entire
9458 string as a single argument, which is not what the linker expects.
9459
9460 When using the GNU linker, it is usually more convenient to pass
9461 arguments to linker options using the @option{@var{option}=@var{value}}
9462 syntax than as separate arguments.  For example, you can specify
9463 @samp{-Xlinker -Map=output.map} rather than
9464 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9465 this syntax for command-line options.
9466
9467 @item -Wl,@var{option}
9468 @opindex Wl
9469 Pass @var{option} as an option to the linker.  If @var{option} contains
9470 commas, it is split into multiple options at the commas.  You can use this
9471 syntax to pass an argument to the option.
9472 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
9473 linker.  When using the GNU linker, you can also get the same effect with
9474 @samp{-Wl,-Map=output.map}.
9475
9476 @item -u @var{symbol}
9477 @opindex u
9478 Pretend the symbol @var{symbol} is undefined, to force linking of
9479 library modules to define it.  You can use @option{-u} multiple times with
9480 different symbols to force loading of additional library modules.
9481 @end table
9482
9483 @node Directory Options
9484 @section Options for Directory Search
9485 @cindex directory options
9486 @cindex options, directory search
9487 @cindex search path
9488
9489 These options specify directories to search for header files, for
9490 libraries and for parts of the compiler:
9491
9492 @table @gcctabopt
9493 @item -I@var{dir}
9494 @opindex I
9495 Add the directory @var{dir} to the head of the list of directories to be
9496 searched for header files.  This can be used to override a system header
9497 file, substituting your own version, since these directories are
9498 searched before the system header file directories.  However, you should
9499 not use this option to add directories that contain vendor-supplied
9500 system header files (use @option{-isystem} for that).  If you use more than
9501 one @option{-I} option, the directories are scanned in left-to-right
9502 order; the standard system directories come after.
9503
9504 If a standard system include directory, or a directory specified with
9505 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9506 option will be ignored.  The directory will still be searched but as a
9507 system directory at its normal position in the system include chain.
9508 This is to ensure that GCC's procedure to fix buggy system headers and
9509 the ordering for the include_next directive are not inadvertently changed.
9510 If you really need to change the search order for system directories,
9511 use the @option{-nostdinc} and/or @option{-isystem} options.
9512
9513 @item -iplugindir=@var{dir}
9514 Set the directory to search for plugins which are passed
9515 by @option{-fplugin=@var{name}} instead of
9516 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9517 to be used by the user, but only passed by the driver.
9518
9519 @item -iquote@var{dir}
9520 @opindex iquote
9521 Add the directory @var{dir} to the head of the list of directories to
9522 be searched for header files only for the case of @samp{#include
9523 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9524 otherwise just like @option{-I}.
9525
9526 @item -L@var{dir}
9527 @opindex L
9528 Add directory @var{dir} to the list of directories to be searched
9529 for @option{-l}.
9530
9531 @item -B@var{prefix}
9532 @opindex B
9533 This option specifies where to find the executables, libraries,
9534 include files, and data files of the compiler itself.
9535
9536 The compiler driver program runs one or more of the subprograms
9537 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
9538 @var{prefix} as a prefix for each program it tries to run, both with and
9539 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9540
9541 For each subprogram to be run, the compiler driver first tries the
9542 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9543 was not specified, the driver tries two standard prefixes, which are
9544 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9545 those results in a file name that is found, the unmodified program
9546 name is searched for using the directories specified in your
9547 @env{PATH} environment variable.
9548
9549 The compiler will check to see if the path provided by the @option{-B}
9550 refers to a directory, and if necessary it will add a directory
9551 separator character at the end of the path.
9552
9553 @option{-B} prefixes that effectively specify directory names also apply
9554 to libraries in the linker, because the compiler translates these
9555 options into @option{-L} options for the linker.  They also apply to
9556 includes files in the preprocessor, because the compiler translates these
9557 options into @option{-isystem} options for the preprocessor.  In this case,
9558 the compiler appends @samp{include} to the prefix.
9559
9560 The run-time support file @file{libgcc.a} can also be searched for using
9561 the @option{-B} prefix, if needed.  If it is not found there, the two
9562 standard prefixes above are tried, and that is all.  The file is left
9563 out of the link if it is not found by those means.
9564
9565 Another way to specify a prefix much like the @option{-B} prefix is to use
9566 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9567 Variables}.
9568
9569 As a special kludge, if the path provided by @option{-B} is
9570 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9571 9, then it will be replaced by @file{[dir/]include}.  This is to help
9572 with boot-strapping the compiler.
9573
9574 @item -specs=@var{file}
9575 @opindex specs
9576 Process @var{file} after the compiler reads in the standard @file{specs}
9577 file, in order to override the defaults that the @file{gcc} driver
9578 program uses when determining what switches to pass to @file{cc1},
9579 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
9580 @option{-specs=@var{file}} can be specified on the command line, and they
9581 are processed in order, from left to right.
9582
9583 @item --sysroot=@var{dir}
9584 @opindex sysroot
9585 Use @var{dir} as the logical root directory for headers and libraries.
9586 For example, if the compiler would normally search for headers in
9587 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
9588 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9589
9590 If you use both this option and the @option{-isysroot} option, then
9591 the @option{--sysroot} option will apply to libraries, but the
9592 @option{-isysroot} option will apply to header files.
9593
9594 The GNU linker (beginning with version 2.16) has the necessary support
9595 for this option.  If your linker does not support this option, the
9596 header file aspect of @option{--sysroot} will still work, but the
9597 library aspect will not.
9598
9599 @item -I-
9600 @opindex I-
9601 This option has been deprecated.  Please use @option{-iquote} instead for
9602 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9603 Any directories you specify with @option{-I} options before the @option{-I-}
9604 option are searched only for the case of @samp{#include "@var{file}"};
9605 they are not searched for @samp{#include <@var{file}>}.
9606
9607 If additional directories are specified with @option{-I} options after
9608 the @option{-I-}, these directories are searched for all @samp{#include}
9609 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9610 this way.)
9611
9612 In addition, the @option{-I-} option inhibits the use of the current
9613 directory (where the current input file came from) as the first search
9614 directory for @samp{#include "@var{file}"}.  There is no way to
9615 override this effect of @option{-I-}.  With @option{-I.} you can specify
9616 searching the directory which was current when the compiler was
9617 invoked.  That is not exactly the same as what the preprocessor does
9618 by default, but it is often satisfactory.
9619
9620 @option{-I-} does not inhibit the use of the standard system directories
9621 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9622 independent.
9623 @end table
9624
9625 @c man end
9626
9627 @node Spec Files
9628 @section Specifying subprocesses and the switches to pass to them
9629 @cindex Spec Files
9630
9631 @command{gcc} is a driver program.  It performs its job by invoking a
9632 sequence of other programs to do the work of compiling, assembling and
9633 linking.  GCC interprets its command-line parameters and uses these to
9634 deduce which programs it should invoke, and which command-line options
9635 it ought to place on their command lines.  This behavior is controlled
9636 by @dfn{spec strings}.  In most cases there is one spec string for each
9637 program that GCC can invoke, but a few programs have multiple spec
9638 strings to control their behavior.  The spec strings built into GCC can
9639 be overridden by using the @option{-specs=} command-line switch to specify
9640 a spec file.
9641
9642 @dfn{Spec files} are plaintext files that are used to construct spec
9643 strings.  They consist of a sequence of directives separated by blank
9644 lines.  The type of directive is determined by the first non-whitespace
9645 character on the line and it can be one of the following:
9646
9647 @table @code
9648 @item %@var{command}
9649 Issues a @var{command} to the spec file processor.  The commands that can
9650 appear here are:
9651
9652 @table @code
9653 @item %include <@var{file}>
9654 @cindex @code{%include}
9655 Search for @var{file} and insert its text at the current point in the
9656 specs file.
9657
9658 @item %include_noerr <@var{file}>
9659 @cindex @code{%include_noerr}
9660 Just like @samp{%include}, but do not generate an error message if the include
9661 file cannot be found.
9662
9663 @item %rename @var{old_name} @var{new_name}
9664 @cindex @code{%rename}
9665 Rename the spec string @var{old_name} to @var{new_name}.
9666
9667 @end table
9668
9669 @item *[@var{spec_name}]:
9670 This tells the compiler to create, override or delete the named spec
9671 string.  All lines after this directive up to the next directive or
9672 blank line are considered to be the text for the spec string.  If this
9673 results in an empty string then the spec will be deleted.  (Or, if the
9674 spec did not exist, then nothing will happen.)  Otherwise, if the spec
9675 does not currently exist a new spec will be created.  If the spec does
9676 exist then its contents will be overridden by the text of this
9677 directive, unless the first character of that text is the @samp{+}
9678 character, in which case the text will be appended to the spec.
9679
9680 @item [@var{suffix}]:
9681 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9682 and up to the next directive or blank line are considered to make up the
9683 spec string for the indicated suffix.  When the compiler encounters an
9684 input file with the named suffix, it will processes the spec string in
9685 order to work out how to compile that file.  For example:
9686
9687 @smallexample
9688 .ZZ:
9689 z-compile -input %i
9690 @end smallexample
9691
9692 This says that any input file whose name ends in @samp{.ZZ} should be
9693 passed to the program @samp{z-compile}, which should be invoked with the
9694 command-line switch @option{-input} and with the result of performing the
9695 @samp{%i} substitution.  (See below.)
9696
9697 As an alternative to providing a spec string, the text that follows a
9698 suffix directive can be one of the following:
9699
9700 @table @code
9701 @item @@@var{language}
9702 This says that the suffix is an alias for a known @var{language}.  This is
9703 similar to using the @option{-x} command-line switch to GCC to specify a
9704 language explicitly.  For example:
9705
9706 @smallexample
9707 .ZZ:
9708 @@c++
9709 @end smallexample
9710
9711 Says that .ZZ files are, in fact, C++ source files.
9712
9713 @item #@var{name}
9714 This causes an error messages saying:
9715
9716 @smallexample
9717 @var{name} compiler not installed on this system.
9718 @end smallexample
9719 @end table
9720
9721 GCC already has an extensive list of suffixes built into it.
9722 This directive will add an entry to the end of the list of suffixes, but
9723 since the list is searched from the end backwards, it is effectively
9724 possible to override earlier entries using this technique.
9725
9726 @end table
9727
9728 GCC has the following spec strings built into it.  Spec files can
9729 override these strings or create their own.  Note that individual
9730 targets can also add their own spec strings to this list.
9731
9732 @smallexample
9733 asm          Options to pass to the assembler
9734 asm_final    Options to pass to the assembler post-processor
9735 cpp          Options to pass to the C preprocessor
9736 cc1          Options to pass to the C compiler
9737 cc1plus      Options to pass to the C++ compiler
9738 endfile      Object files to include at the end of the link
9739 link         Options to pass to the linker
9740 lib          Libraries to include on the command line to the linker
9741 libgcc       Decides which GCC support library to pass to the linker
9742 linker       Sets the name of the linker
9743 predefines   Defines to be passed to the C preprocessor
9744 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9745              by default
9746 startfile    Object files to include at the start of the link
9747 @end smallexample
9748
9749 Here is a small example of a spec file:
9750
9751 @smallexample
9752 %rename lib                 old_lib
9753
9754 *lib:
9755 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9756 @end smallexample
9757
9758 This example renames the spec called @samp{lib} to @samp{old_lib} and
9759 then overrides the previous definition of @samp{lib} with a new one.
9760 The new definition adds in some extra command-line options before
9761 including the text of the old definition.
9762
9763 @dfn{Spec strings} are a list of command-line options to be passed to their
9764 corresponding program.  In addition, the spec strings can contain
9765 @samp{%}-prefixed sequences to substitute variable text or to
9766 conditionally insert text into the command line.  Using these constructs
9767 it is possible to generate quite complex command lines.
9768
9769 Here is a table of all defined @samp{%}-sequences for spec
9770 strings.  Note that spaces are not generated automatically around the
9771 results of expanding these sequences.  Therefore you can concatenate them
9772 together or combine them with constant text in a single argument.
9773
9774 @table @code
9775 @item %%
9776 Substitute one @samp{%} into the program name or argument.
9777
9778 @item %i
9779 Substitute the name of the input file being processed.
9780
9781 @item %b
9782 Substitute the basename of the input file being processed.
9783 This is the substring up to (and not including) the last period
9784 and not including the directory.
9785
9786 @item %B
9787 This is the same as @samp{%b}, but include the file suffix (text after
9788 the last period).
9789
9790 @item %d
9791 Marks the argument containing or following the @samp{%d} as a
9792 temporary file name, so that that file will be deleted if GCC exits
9793 successfully.  Unlike @samp{%g}, this contributes no text to the
9794 argument.
9795
9796 @item %g@var{suffix}
9797 Substitute a file name that has suffix @var{suffix} and is chosen
9798 once per compilation, and mark the argument in the same way as
9799 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9800 name is now chosen in a way that is hard to predict even when previously
9801 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9802 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9803 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9804 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9805 was simply substituted with a file name chosen once per compilation,
9806 without regard to any appended suffix (which was therefore treated
9807 just like ordinary text), making such attacks more likely to succeed.
9808
9809 @item %u@var{suffix}
9810 Like @samp{%g}, but generates a new temporary file name even if
9811 @samp{%u@var{suffix}} was already seen.
9812
9813 @item %U@var{suffix}
9814 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9815 new one if there is no such last file name.  In the absence of any
9816 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9817 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9818 would involve the generation of two distinct file names, one
9819 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9820 simply substituted with a file name chosen for the previous @samp{%u},
9821 without regard to any appended suffix.
9822
9823 @item %j@var{suffix}
9824 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9825 writable, and if save-temps is off; otherwise, substitute the name
9826 of a temporary file, just like @samp{%u}.  This temporary file is not
9827 meant for communication between processes, but rather as a junk
9828 disposal mechanism.
9829
9830 @item %|@var{suffix}
9831 @itemx %m@var{suffix}
9832 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9833 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9834 all.  These are the two most common ways to instruct a program that it
9835 should read from standard input or write to standard output.  If you
9836 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9837 construct: see for example @file{f/lang-specs.h}.
9838
9839 @item %.@var{SUFFIX}
9840 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9841 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9842 terminated by the next space or %.
9843
9844 @item %w
9845 Marks the argument containing or following the @samp{%w} as the
9846 designated output file of this compilation.  This puts the argument
9847 into the sequence of arguments that @samp{%o} will substitute later.
9848
9849 @item %o
9850 Substitutes the names of all the output files, with spaces
9851 automatically placed around them.  You should write spaces
9852 around the @samp{%o} as well or the results are undefined.
9853 @samp{%o} is for use in the specs for running the linker.
9854 Input files whose names have no recognized suffix are not compiled
9855 at all, but they are included among the output files, so they will
9856 be linked.
9857
9858 @item %O
9859 Substitutes the suffix for object files.  Note that this is
9860 handled specially when it immediately follows @samp{%g, %u, or %U},
9861 because of the need for those to form complete file names.  The
9862 handling is such that @samp{%O} is treated exactly as if it had already
9863 been substituted, except that @samp{%g, %u, and %U} do not currently
9864 support additional @var{suffix} characters following @samp{%O} as they would
9865 following, for example, @samp{.o}.
9866
9867 @item %p
9868 Substitutes the standard macro predefinitions for the
9869 current target machine.  Use this when running @code{cpp}.
9870
9871 @item %P
9872 Like @samp{%p}, but puts @samp{__} before and after the name of each
9873 predefined macro, except for macros that start with @samp{__} or with
9874 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
9875 C@.
9876
9877 @item %I
9878 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
9879 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
9880 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
9881 and @option{-imultilib} as necessary.
9882
9883 @item %s
9884 Current argument is the name of a library or startup file of some sort.
9885 Search for that file in a standard list of directories and substitute
9886 the full name found.  The current working directory is included in the
9887 list of directories scanned.
9888
9889 @item %T
9890 Current argument is the name of a linker script.  Search for that file
9891 in the current list of directories to scan for libraries. If the file
9892 is located insert a @option{--script} option into the command line
9893 followed by the full path name found.  If the file is not found then
9894 generate an error message.  Note: the current working directory is not
9895 searched.
9896
9897 @item %e@var{str}
9898 Print @var{str} as an error message.  @var{str} is terminated by a newline.
9899 Use this when inconsistent options are detected.
9900
9901 @item %(@var{name})
9902 Substitute the contents of spec string @var{name} at this point.
9903
9904 @item %x@{@var{option}@}
9905 Accumulate an option for @samp{%X}.
9906
9907 @item %X
9908 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
9909 spec string.
9910
9911 @item %Y
9912 Output the accumulated assembler options specified by @option{-Wa}.
9913
9914 @item %Z
9915 Output the accumulated preprocessor options specified by @option{-Wp}.
9916
9917 @item %a
9918 Process the @code{asm} spec.  This is used to compute the
9919 switches to be passed to the assembler.
9920
9921 @item %A
9922 Process the @code{asm_final} spec.  This is a spec string for
9923 passing switches to an assembler post-processor, if such a program is
9924 needed.
9925
9926 @item %l
9927 Process the @code{link} spec.  This is the spec for computing the
9928 command line passed to the linker.  Typically it will make use of the
9929 @samp{%L %G %S %D and %E} sequences.
9930
9931 @item %D
9932 Dump out a @option{-L} option for each directory that GCC believes might
9933 contain startup files.  If the target supports multilibs then the
9934 current multilib directory will be prepended to each of these paths.
9935
9936 @item %L
9937 Process the @code{lib} spec.  This is a spec string for deciding which
9938 libraries should be included on the command line to the linker.
9939
9940 @item %G
9941 Process the @code{libgcc} spec.  This is a spec string for deciding
9942 which GCC support library should be included on the command line to the linker.
9943
9944 @item %S
9945 Process the @code{startfile} spec.  This is a spec for deciding which
9946 object files should be the first ones passed to the linker.  Typically
9947 this might be a file named @file{crt0.o}.
9948
9949 @item %E
9950 Process the @code{endfile} spec.  This is a spec string that specifies
9951 the last object files that will be passed to the linker.
9952
9953 @item %C
9954 Process the @code{cpp} spec.  This is used to construct the arguments
9955 to be passed to the C preprocessor.
9956
9957 @item %1
9958 Process the @code{cc1} spec.  This is used to construct the options to be
9959 passed to the actual C compiler (@samp{cc1}).
9960
9961 @item %2
9962 Process the @code{cc1plus} spec.  This is used to construct the options to be
9963 passed to the actual C++ compiler (@samp{cc1plus}).
9964
9965 @item %*
9966 Substitute the variable part of a matched option.  See below.
9967 Note that each comma in the substituted string is replaced by
9968 a single space.
9969
9970 @item %<@code{S}
9971 Remove all occurrences of @code{-S} from the command line.  Note---this
9972 command is position dependent.  @samp{%} commands in the spec string
9973 before this one will see @code{-S}, @samp{%} commands in the spec string
9974 after this one will not.
9975
9976 @item %:@var{function}(@var{args})
9977 Call the named function @var{function}, passing it @var{args}.
9978 @var{args} is first processed as a nested spec string, then split
9979 into an argument vector in the usual fashion.  The function returns
9980 a string which is processed as if it had appeared literally as part
9981 of the current spec.
9982
9983 The following built-in spec functions are provided:
9984
9985 @table @code
9986 @item @code{getenv}
9987 The @code{getenv} spec function takes two arguments: an environment
9988 variable name and a string.  If the environment variable is not
9989 defined, a fatal error is issued.  Otherwise, the return value is the
9990 value of the environment variable concatenated with the string.  For
9991 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
9992
9993 @smallexample
9994 %:getenv(TOPDIR /include)
9995 @end smallexample
9996
9997 expands to @file{/path/to/top/include}.
9998
9999 @item @code{if-exists}
10000 The @code{if-exists} spec function takes one argument, an absolute
10001 pathname to a file.  If the file exists, @code{if-exists} returns the
10002 pathname.  Here is a small example of its usage:
10003
10004 @smallexample
10005 *startfile:
10006 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10007 @end smallexample
10008
10009 @item @code{if-exists-else}
10010 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10011 spec function, except that it takes two arguments.  The first argument is
10012 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10013 returns the pathname.  If it does not exist, it returns the second argument.
10014 This way, @code{if-exists-else} can be used to select one file or another,
10015 based on the existence of the first.  Here is a small example of its usage:
10016
10017 @smallexample
10018 *startfile:
10019 crt0%O%s %:if-exists(crti%O%s) \
10020 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10021 @end smallexample
10022
10023 @item @code{replace-outfile}
10024 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10025 first argument in the outfiles array and replaces it with the second argument.  Here
10026 is a small example of its usage:
10027
10028 @smallexample
10029 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10030 @end smallexample
10031
10032 @item @code{remove-outfile}
10033 The @code{remove-outfile} spec function takes one argument.  It looks for the
10034 first argument in the outfiles array and removes it.  Here is a small example
10035 its usage:
10036
10037 @smallexample
10038 %:remove-outfile(-lm)
10039 @end smallexample
10040
10041 @item @code{pass-through-libs}
10042 The @code{pass-through-libs} spec function takes any number of arguments.  It
10043 finds any @option{-l} options and any non-options ending in ".a" (which it
10044 assumes are the names of linker input library archive files) and returns a
10045 result containing all the found arguments each prepended by
10046 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10047 intended to be passed to the LTO linker plugin.
10048
10049 @smallexample
10050 %:pass-through-libs(%G %L %G)
10051 @end smallexample
10052
10053 @item @code{print-asm-header}
10054 The @code{print-asm-header} function takes no arguments and simply
10055 prints a banner like:
10056
10057 @smallexample
10058 Assembler options
10059 =================
10060
10061 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10062 @end smallexample
10063
10064 It is used to separate compiler options from assembler options
10065 in the @option{--target-help} output.
10066 @end table
10067
10068 @item %@{@code{S}@}
10069 Substitutes the @code{-S} switch, if that switch was given to GCC@.
10070 If that switch was not specified, this substitutes nothing.  Note that
10071 the leading dash is omitted when specifying this option, and it is
10072 automatically inserted if the substitution is performed.  Thus the spec
10073 string @samp{%@{foo@}} would match the command-line option @option{-foo}
10074 and would output the command line option @option{-foo}.
10075
10076 @item %W@{@code{S}@}
10077 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10078 deleted on failure.
10079
10080 @item %@{@code{S}*@}
10081 Substitutes all the switches specified to GCC whose names start
10082 with @code{-S}, but which also take an argument.  This is used for
10083 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10084 GCC considers @option{-o foo} as being
10085 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
10086 text, including the space.  Thus two arguments would be generated.
10087
10088 @item %@{@code{S}*&@code{T}*@}
10089 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10090 (the order of @code{S} and @code{T} in the spec is not significant).
10091 There can be any number of ampersand-separated variables; for each the
10092 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10093
10094 @item %@{@code{S}:@code{X}@}
10095 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
10096
10097 @item %@{!@code{S}:@code{X}@}
10098 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
10099
10100 @item %@{@code{S}*:@code{X}@}
10101 Substitutes @code{X} if one or more switches whose names start with
10102 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10103 once, no matter how many such switches appeared.  However, if @code{%*}
10104 appears somewhere in @code{X}, then @code{X} will be substituted once
10105 for each matching switch, with the @code{%*} replaced by the part of
10106 that switch that matched the @code{*}.
10107
10108 @item %@{.@code{S}:@code{X}@}
10109 Substitutes @code{X}, if processing a file with suffix @code{S}.
10110
10111 @item %@{!.@code{S}:@code{X}@}
10112 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10113
10114 @item %@{,@code{S}:@code{X}@}
10115 Substitutes @code{X}, if processing a file for language @code{S}.
10116
10117 @item %@{!,@code{S}:@code{X}@}
10118 Substitutes @code{X}, if not processing a file for language @code{S}.
10119
10120 @item %@{@code{S}|@code{P}:@code{X}@}
10121 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
10122 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10123 @code{*} sequences as well, although they have a stronger binding than
10124 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10125 alternatives must be starred, and only the first matching alternative
10126 is substituted.
10127
10128 For example, a spec string like this:
10129
10130 @smallexample
10131 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10132 @end smallexample
10133
10134 will output the following command-line options from the following input
10135 command-line options:
10136
10137 @smallexample
10138 fred.c        -foo -baz
10139 jim.d         -bar -boggle
10140 -d fred.c     -foo -baz -boggle
10141 -d jim.d      -bar -baz -boggle
10142 @end smallexample
10143
10144 @item %@{S:X; T:Y; :D@}
10145
10146 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
10147 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10148 be as many clauses as you need.  This may be combined with @code{.},
10149 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10150
10151
10152 @end table
10153
10154 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10155 construct may contain other nested @samp{%} constructs or spaces, or
10156 even newlines.  They are processed as usual, as described above.
10157 Trailing white space in @code{X} is ignored.  White space may also
10158 appear anywhere on the left side of the colon in these constructs,
10159 except between @code{.} or @code{*} and the corresponding word.
10160
10161 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10162 handled specifically in these constructs.  If another value of
10163 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10164 @option{-W} switch is found later in the command line, the earlier
10165 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10166 just one letter, which passes all matching options.
10167
10168 The character @samp{|} at the beginning of the predicate text is used to
10169 indicate that a command should be piped to the following command, but
10170 only if @option{-pipe} is specified.
10171
10172 It is built into GCC which switches take arguments and which do not.
10173 (You might think it would be useful to generalize this to allow each
10174 compiler's spec to say which switches take arguments.  But this cannot
10175 be done in a consistent fashion.  GCC cannot even decide which input
10176 files have been specified without knowing which switches take arguments,
10177 and it must know which input files to compile in order to tell which
10178 compilers to run).
10179
10180 GCC also knows implicitly that arguments starting in @option{-l} are to be
10181 treated as compiler output files, and passed to the linker in their
10182 proper position among the other output files.
10183
10184 @c man begin OPTIONS
10185
10186 @node Target Options
10187 @section Specifying Target Machine and Compiler Version
10188 @cindex target options
10189 @cindex cross compiling
10190 @cindex specifying machine version
10191 @cindex specifying compiler version and target machine
10192 @cindex compiler version, specifying
10193 @cindex target machine, specifying
10194
10195 The usual way to run GCC is to run the executable called @command{gcc}, or
10196 @command{@var{machine}-gcc} when cross-compiling, or
10197 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10198 one that was installed last.
10199
10200 @node Submodel Options
10201 @section Hardware Models and Configurations
10202 @cindex submodel options
10203 @cindex specifying hardware config
10204 @cindex hardware models and configurations, specifying
10205 @cindex machine dependent options
10206
10207 Each target machine types can have its own
10208 special options, starting with @samp{-m}, to choose among various
10209 hardware models or configurations---for example, 68010 vs 68020,
10210 floating coprocessor or none.  A single installed version of the
10211 compiler can compile for any model or configuration, according to the
10212 options specified.
10213
10214 Some configurations of the compiler also support additional special
10215 options, usually for compatibility with other compilers on the same
10216 platform.
10217
10218 @c This list is ordered alphanumerically by subsection name.
10219 @c It should be the same order and spelling as these options are listed
10220 @c in Machine Dependent Options
10221
10222 @menu
10223 * ARM Options::
10224 * AVR Options::
10225 * Blackfin Options::
10226 * C6X Options::
10227 * CRIS Options::
10228 * Darwin Options::
10229 * DEC Alpha Options::
10230 * DEC Alpha/VMS Options::
10231 * FR30 Options::
10232 * FRV Options::
10233 * GNU/Linux Options::
10234 * H8/300 Options::
10235 * HPPA Options::
10236 * i386 and x86-64 Options::
10237 * i386 and x86-64 Windows Options::
10238 * IA-64 Options::
10239 * IA-64/VMS Options::
10240 * LM32 Options::
10241 * M32C Options::
10242 * M32R/D Options::
10243 * M680x0 Options::
10244 * MCore Options::
10245 * MeP Options::
10246 * MicroBlaze Options::
10247 * MIPS Options::
10248 * MMIX Options::
10249 * MN10300 Options::
10250 * PDP-11 Options::
10251 * picoChip Options::
10252 * PowerPC Options::
10253 * RS/6000 and PowerPC Options::
10254 * RX Options::
10255 * S/390 and zSeries Options::
10256 * Score Options::
10257 * SH Options::
10258 * Solaris 2 Options::
10259 * SPARC Options::
10260 * SPU Options::
10261 * System V Options::
10262 * V850 Options::
10263 * VAX Options::
10264 * VxWorks Options::
10265 * x86-64 Options::
10266 * Xstormy16 Options::
10267 * Xtensa Options::
10268 * zSeries Options::
10269 @end menu
10270
10271 @node ARM Options
10272 @subsection ARM Options
10273 @cindex ARM options
10274
10275 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
10276 architectures:
10277
10278 @table @gcctabopt
10279 @item -mabi=@var{name}
10280 @opindex mabi
10281 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
10282 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
10283
10284 @item -mapcs-frame
10285 @opindex mapcs-frame
10286 Generate a stack frame that is compliant with the ARM Procedure Call
10287 Standard for all functions, even if this is not strictly necessary for
10288 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
10289 with this option will cause the stack frames not to be generated for
10290 leaf functions.  The default is @option{-mno-apcs-frame}.
10291
10292 @item -mapcs
10293 @opindex mapcs
10294 This is a synonym for @option{-mapcs-frame}.
10295
10296 @ignore
10297 @c not currently implemented
10298 @item -mapcs-stack-check
10299 @opindex mapcs-stack-check
10300 Generate code to check the amount of stack space available upon entry to
10301 every function (that actually uses some stack space).  If there is
10302 insufficient space available then either the function
10303 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
10304 called, depending upon the amount of stack space required.  The run time
10305 system is required to provide these functions.  The default is
10306 @option{-mno-apcs-stack-check}, since this produces smaller code.
10307
10308 @c not currently implemented
10309 @item -mapcs-float
10310 @opindex mapcs-float
10311 Pass floating point arguments using the float point registers.  This is
10312 one of the variants of the APCS@.  This option is recommended if the
10313 target hardware has a floating point unit or if a lot of floating point
10314 arithmetic is going to be performed by the code.  The default is
10315 @option{-mno-apcs-float}, since integer only code is slightly increased in
10316 size if @option{-mapcs-float} is used.
10317
10318 @c not currently implemented
10319 @item -mapcs-reentrant
10320 @opindex mapcs-reentrant
10321 Generate reentrant, position independent code.  The default is
10322 @option{-mno-apcs-reentrant}.
10323 @end ignore
10324
10325 @item -mthumb-interwork
10326 @opindex mthumb-interwork
10327 Generate code which supports calling between the ARM and Thumb
10328 instruction sets.  Without this option, on pre-v5 architectures, the
10329 two instruction sets cannot be reliably used inside one program.  The
10330 default is @option{-mno-thumb-interwork}, since slightly larger code
10331 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
10332 configurations this option is meaningless.
10333
10334 @item -mno-sched-prolog
10335 @opindex mno-sched-prolog
10336 Prevent the reordering of instructions in the function prolog, or the
10337 merging of those instruction with the instructions in the function's
10338 body.  This means that all functions will start with a recognizable set
10339 of instructions (or in fact one of a choice from a small set of
10340 different function prologues), and this information can be used to
10341 locate the start if functions inside an executable piece of code.  The
10342 default is @option{-msched-prolog}.
10343
10344 @item -mfloat-abi=@var{name}
10345 @opindex mfloat-abi
10346 Specifies which floating-point ABI to use.  Permissible values
10347 are: @samp{soft}, @samp{softfp} and @samp{hard}.
10348
10349 Specifying @samp{soft} causes GCC to generate output containing
10350 library calls for floating-point operations.
10351 @samp{softfp} allows the generation of code using hardware floating-point
10352 instructions, but still uses the soft-float calling conventions.
10353 @samp{hard} allows generation of floating-point instructions
10354 and uses FPU-specific calling conventions.
10355
10356 The default depends on the specific target configuration.  Note that
10357 the hard-float and soft-float ABIs are not link-compatible; you must
10358 compile your entire program with the same ABI, and link with a
10359 compatible set of libraries.
10360
10361 @item -mlittle-endian
10362 @opindex mlittle-endian
10363 Generate code for a processor running in little-endian mode.  This is
10364 the default for all standard configurations.
10365
10366 @item -mbig-endian
10367 @opindex mbig-endian
10368 Generate code for a processor running in big-endian mode; the default is
10369 to compile code for a little-endian processor.
10370
10371 @item -mwords-little-endian
10372 @opindex mwords-little-endian
10373 This option only applies when generating code for big-endian processors.
10374 Generate code for a little-endian word order but a big-endian byte
10375 order.  That is, a byte order of the form @samp{32107654}.  Note: this
10376 option should only be used if you require compatibility with code for
10377 big-endian ARM processors generated by versions of the compiler prior to
10378 2.8.  This option is now deprecated.
10379
10380 @item -mcpu=@var{name}
10381 @opindex mcpu
10382 This specifies the name of the target ARM processor.  GCC uses this name
10383 to determine what kind of instructions it can emit when generating
10384 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
10385 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
10386 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
10387 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
10388 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
10389 @samp{arm720},
10390 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
10391 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
10392 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
10393 @samp{strongarm1110},
10394 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
10395 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
10396 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
10397 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
10398 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
10399 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
10400 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
10401 @samp{cortex-a5}, @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a15},
10402 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
10403 @samp{cortex-m4}, @samp{cortex-m3},
10404 @samp{cortex-m1},
10405 @samp{cortex-m0},
10406 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
10407 @samp{fa526}, @samp{fa626},
10408 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
10409
10410
10411 @option{-mcpu=generic-@var{arch}} is also permissible, and is
10412 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
10413 See @option{-mtune} for more information.
10414
10415 @option{-mcpu=native} causes the compiler to auto-detect the CPU
10416 of the build computer.  At present, this feature is only supported on
10417 Linux, and not all architectures are recognised.  If the auto-detect is
10418 unsuccessful the option has no effect.
10419
10420 @item -mtune=@var{name}
10421 @opindex mtune
10422 This option is very similar to the @option{-mcpu=} option, except that
10423 instead of specifying the actual target processor type, and hence
10424 restricting which instructions can be used, it specifies that GCC should
10425 tune the performance of the code as if the target were of the type
10426 specified in this option, but still choosing the instructions that it
10427 will generate based on the CPU specified by a @option{-mcpu=} option.
10428 For some ARM implementations better performance can be obtained by using
10429 this option.
10430
10431 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
10432 performance for a blend of processors within architecture @var{arch}.
10433 The aim is to generate code that run well on the current most popular
10434 processors, balancing between optimizations that benefit some CPUs in the
10435 range, and avoiding performance pitfalls of other CPUs.  The effects of
10436 this option may change in future GCC versions as CPU models come and go.
10437
10438 @option{-mtune=native} causes the compiler to auto-detect the CPU
10439 of the build computer.  At present, this feature is only supported on
10440 Linux, and not all architectures are recognised.  If the auto-detect is
10441 unsuccessful the option has no effect.
10442
10443 @item -march=@var{name}
10444 @opindex march
10445 This specifies the name of the target ARM architecture.  GCC uses this
10446 name to determine what kind of instructions it can emit when generating
10447 assembly code.  This option can be used in conjunction with or instead
10448 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
10449 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
10450 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
10451 @samp{armv6}, @samp{armv6j},
10452 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
10453 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
10454 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10455
10456 @option{-march=native} causes the compiler to auto-detect the architecture
10457 of the build computer.  At present, this feature is only supported on
10458 Linux, and not all architectures are recognised.  If the auto-detect is
10459 unsuccessful the option has no effect.
10460
10461 @item -mfpu=@var{name}
10462 @itemx -mfpe=@var{number}
10463 @itemx -mfp=@var{number}
10464 @opindex mfpu
10465 @opindex mfpe
10466 @opindex mfp
10467 This specifies what floating point hardware (or hardware emulation) is
10468 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
10469 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
10470 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
10471 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
10472 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
10473 @option{-mfp} and @option{-mfpe} are synonyms for
10474 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
10475 of GCC@.
10476
10477 If @option{-msoft-float} is specified this specifies the format of
10478 floating point values.
10479
10480 If the selected floating-point hardware includes the NEON extension
10481 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
10482 operations will not be used by GCC's auto-vectorization pass unless
10483 @option{-funsafe-math-optimizations} is also specified.  This is
10484 because NEON hardware does not fully implement the IEEE 754 standard for
10485 floating-point arithmetic (in particular denormal values are treated as
10486 zero), so the use of NEON instructions may lead to a loss of precision.
10487
10488 @item -mfp16-format=@var{name}
10489 @opindex mfp16-format
10490 Specify the format of the @code{__fp16} half-precision floating-point type.
10491 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
10492 the default is @samp{none}, in which case the @code{__fp16} type is not
10493 defined.  @xref{Half-Precision}, for more information.
10494
10495 @item -mstructure-size-boundary=@var{n}
10496 @opindex mstructure-size-boundary
10497 The size of all structures and unions will be rounded up to a multiple
10498 of the number of bits set by this option.  Permissible values are 8, 32
10499 and 64.  The default value varies for different toolchains.  For the COFF
10500 targeted toolchain the default value is 8.  A value of 64 is only allowed
10501 if the underlying ABI supports it.
10502
10503 Specifying the larger number can produce faster, more efficient code, but
10504 can also increase the size of the program.  Different values are potentially
10505 incompatible.  Code compiled with one value cannot necessarily expect to
10506 work with code or libraries compiled with another value, if they exchange
10507 information using structures or unions.
10508
10509 @item -mabort-on-noreturn
10510 @opindex mabort-on-noreturn
10511 Generate a call to the function @code{abort} at the end of a
10512 @code{noreturn} function.  It will be executed if the function tries to
10513 return.
10514
10515 @item -mlong-calls
10516 @itemx -mno-long-calls
10517 @opindex mlong-calls
10518 @opindex mno-long-calls
10519 Tells the compiler to perform function calls by first loading the
10520 address of the function into a register and then performing a subroutine
10521 call on this register.  This switch is needed if the target function
10522 will lie outside of the 64 megabyte addressing range of the offset based
10523 version of subroutine call instruction.
10524
10525 Even if this switch is enabled, not all function calls will be turned
10526 into long calls.  The heuristic is that static functions, functions
10527 which have the @samp{short-call} attribute, functions that are inside
10528 the scope of a @samp{#pragma no_long_calls} directive and functions whose
10529 definitions have already been compiled within the current compilation
10530 unit, will not be turned into long calls.  The exception to this rule is
10531 that weak function definitions, functions with the @samp{long-call}
10532 attribute or the @samp{section} attribute, and functions that are within
10533 the scope of a @samp{#pragma long_calls} directive, will always be
10534 turned into long calls.
10535
10536 This feature is not enabled by default.  Specifying
10537 @option{-mno-long-calls} will restore the default behavior, as will
10538 placing the function calls within the scope of a @samp{#pragma
10539 long_calls_off} directive.  Note these switches have no effect on how
10540 the compiler generates code to handle function calls via function
10541 pointers.
10542
10543 @item -msingle-pic-base
10544 @opindex msingle-pic-base
10545 Treat the register used for PIC addressing as read-only, rather than
10546 loading it in the prologue for each function.  The run-time system is
10547 responsible for initializing this register with an appropriate value
10548 before execution begins.
10549
10550 @item -mpic-register=@var{reg}
10551 @opindex mpic-register
10552 Specify the register to be used for PIC addressing.  The default is R10
10553 unless stack-checking is enabled, when R9 is used.
10554
10555 @item -mcirrus-fix-invalid-insns
10556 @opindex mcirrus-fix-invalid-insns
10557 @opindex mno-cirrus-fix-invalid-insns
10558 Insert NOPs into the instruction stream to in order to work around
10559 problems with invalid Maverick instruction combinations.  This option
10560 is only valid if the @option{-mcpu=ep9312} option has been used to
10561 enable generation of instructions for the Cirrus Maverick floating
10562 point co-processor.  This option is not enabled by default, since the
10563 problem is only present in older Maverick implementations.  The default
10564 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10565 switch.
10566
10567 @item -mpoke-function-name
10568 @opindex mpoke-function-name
10569 Write the name of each function into the text section, directly
10570 preceding the function prologue.  The generated code is similar to this:
10571
10572 @smallexample
10573      t0
10574          .ascii "arm_poke_function_name", 0
10575          .align
10576      t1
10577          .word 0xff000000 + (t1 - t0)
10578      arm_poke_function_name
10579          mov     ip, sp
10580          stmfd   sp!, @{fp, ip, lr, pc@}
10581          sub     fp, ip, #4
10582 @end smallexample
10583
10584 When performing a stack backtrace, code can inspect the value of
10585 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10586 location @code{pc - 12} and the top 8 bits are set, then we know that
10587 there is a function name embedded immediately preceding this location
10588 and has length @code{((pc[-3]) & 0xff000000)}.
10589
10590 @item -mthumb
10591 @itemx -marm
10592 @opindex marm
10593 @opindex mthumb
10594
10595 Select between generating code that executes in ARM and Thumb
10596 states.  The default for most configurations is to generate code
10597 that executes in ARM state, but the default can be changed by
10598 configuring GCC with the @option{--with-mode=}@var{state}
10599 configure option.
10600
10601 @item -mtpcs-frame
10602 @opindex mtpcs-frame
10603 Generate a stack frame that is compliant with the Thumb Procedure Call
10604 Standard for all non-leaf functions.  (A leaf function is one that does
10605 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10606
10607 @item -mtpcs-leaf-frame
10608 @opindex mtpcs-leaf-frame
10609 Generate a stack frame that is compliant with the Thumb Procedure Call
10610 Standard for all leaf functions.  (A leaf function is one that does
10611 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10612
10613 @item -mcallee-super-interworking
10614 @opindex mcallee-super-interworking
10615 Gives all externally visible functions in the file being compiled an ARM
10616 instruction set header which switches to Thumb mode before executing the
10617 rest of the function.  This allows these functions to be called from
10618 non-interworking code.  This option is not valid in AAPCS configurations
10619 because interworking is enabled by default.
10620
10621 @item -mcaller-super-interworking
10622 @opindex mcaller-super-interworking
10623 Allows calls via function pointers (including virtual functions) to
10624 execute correctly regardless of whether the target code has been
10625 compiled for interworking or not.  There is a small overhead in the cost
10626 of executing a function pointer if this option is enabled.  This option
10627 is not valid in AAPCS configurations because interworking is enabled
10628 by default.
10629
10630 @item -mtp=@var{name}
10631 @opindex mtp
10632 Specify the access model for the thread local storage pointer.  The valid
10633 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10634 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10635 (supported in the arm6k architecture), and @option{auto}, which uses the
10636 best available method for the selected processor.  The default setting is
10637 @option{auto}.
10638
10639 @item -mtls-dialect=@var{dialect}
10640 @opindex mtls-dialect
10641 Specify the dialect to use for accessing thread local storage.  Two
10642 dialects are supported --- @option{gnu} and @option{gnu2}.  The
10643 @option{gnu} dialect selects the original GNU scheme for supporting
10644 local and global dynamic TLS models.  The @option{gnu2} dialect
10645 selects the GNU descriptor scheme, which provides better performance
10646 for shared libraries.  The GNU descriptor scheme is compatible with
10647 the original scheme, but does require new assembler, linker and
10648 library support.  Initial and local exec TLS models are unaffected by
10649 this option and always use the original scheme.
10650
10651 @item -mword-relocations
10652 @opindex mword-relocations
10653 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
10654 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10655 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10656 is specified.
10657
10658 @item -mfix-cortex-m3-ldrd
10659 @opindex mfix-cortex-m3-ldrd
10660 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10661 with overlapping destination and base registers are used.  This option avoids
10662 generating these instructions.  This option is enabled by default when
10663 @option{-mcpu=cortex-m3} is specified.
10664
10665 @end table
10666
10667 @node AVR Options
10668 @subsection AVR Options
10669 @cindex AVR Options
10670
10671 These options are defined for AVR implementations:
10672
10673 @table @gcctabopt
10674 @item -mmcu=@var{mcu}
10675 @opindex mmcu
10676 Specify ATMEL AVR instruction set or MCU type.
10677
10678 Instruction set avr1 is for the minimal AVR core, not supported by the C
10679 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
10680 attiny11, attiny12, attiny15, attiny28).
10681
10682 Instruction set avr2 (default) is for the classic AVR core with up to
10683 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
10684 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
10685 at90c8534, at90s8535).
10686
10687 Instruction set avr3 is for the classic AVR core with up to 128K program
10688 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
10689
10690 Instruction set avr4 is for the enhanced AVR core with up to 8K program
10691 memory space (MCU types: atmega8, atmega83, atmega85).
10692
10693 Instruction set avr5 is for the enhanced AVR core with up to 128K program
10694 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
10695 atmega64, atmega128, at43usb355, at94k).
10696
10697 @item -mno-interrupts
10698 @opindex mno-interrupts
10699 Generated code is not compatible with hardware interrupts.
10700 Code size will be smaller.
10701
10702 @item -mcall-prologues
10703 @opindex mcall-prologues
10704 Functions prologues/epilogues expanded as call to appropriate
10705 subroutines.  Code size will be smaller.
10706
10707 @item -mtiny-stack
10708 @opindex mtiny-stack
10709 Change only the low 8 bits of the stack pointer.
10710
10711 @item -mint8
10712 @opindex mint8
10713 Assume int to be 8 bit integer.  This affects the sizes of all types: A
10714 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
10715 and long long will be 4 bytes.  Please note that this option does not
10716 comply to the C standards, but it will provide you with smaller code
10717 size.
10718
10719 @item -mstrict-X
10720 @opindex mstrict-X
10721 Use register @code{X} in a way proposed by the hardware.  This means
10722 that @code{X} will only be used in indirect, post-increment or
10723 pre-decrement addressing.
10724
10725 Without this option, the @code{X} register may be used in the same way
10726 as @code{Y} or @code{Z} which then is emulated by additional
10727 instructions.  
10728 For example, loading a value with @code{X+const} addressing with a
10729 small @code{const <= 63} to a register @var{Rn} will be printed as
10730 @example
10731 adiw r26, const
10732 ld   @var{Rn}, X
10733 sbiw r26, const
10734 @end example
10735 @end table
10736
10737 @subsubsection @code{EIND} and Devices with more than 128k Bytes of Flash
10738
10739 Pointers in the implementation are 16 bits wide.
10740 The address of a function or label is represented as word address so
10741 that indirect jumps and calls can address any code address in the
10742 range of 64k words.
10743
10744 In order to faciliate indirect jump on devices with more than 128k
10745 bytes of program memory space, there is a special function register called
10746 @code{EIND} that serves as most significant part of the target address
10747 when @code{EICALL} or @code{EIJMP} instructions are used.
10748
10749 Indirect jumps and calls on these devices are handled as follows and
10750 are subject to some limitations:
10751
10752 @itemize @bullet
10753
10754 @item
10755 The compiler never sets @code{EIND}.
10756
10757 @item
10758 The startup code from libgcc never sets @code{EIND}.
10759 Notice that startup code is a blend of code from libgcc and avr-libc.
10760 For the impact of avr-libc on @code{EIND}, see the
10761 @w{@uref{http://nongnu.org/avr-libc/user-manual,avr-libc user manual}}.
10762
10763 @item
10764 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
10765 instructions or might read @code{EIND} directly.
10766
10767 @item
10768 The compiler assumes that @code{EIND} never changes during the startup
10769 code or run of the application. In particular, @code{EIND} is not
10770 saved/restored in function or interrupt service routine
10771 prologue/epilogue.
10772
10773 @item
10774 It is legitimate for user-specific startup code to set up @code{EIND}
10775 early, for example by means of initialization code located in
10776 section @code{.init3}, and thus prior to general startup code that
10777 initializes RAM and calls constructors.
10778
10779 @item
10780 For indirect calls to functions and computed goto, the linker will
10781 generate @emph{stubs}. Stubs are jump pads sometimes also called
10782 @emph{trampolines}. Thus, the indirect call/jump will jump to such a stub.
10783 The stub contains a direct jump to the desired address.
10784
10785 @item
10786 Stubs will be generated automatically by the linker if
10787 the following two conditions are met:
10788 @itemize @minus
10789
10790 @item The address of a label is taken by means of the @code{gs} modifier
10791 (short for @emph{generate stubs}) like so:
10792 @example
10793 LDI r24, lo8(gs(@var{func}))
10794 LDI r25, hi8(gs(@var{func}))
10795 @end example
10796 @item The final location of that label is in a code segment
10797 @emph{outside} the segment where the stubs are located.
10798 @end itemize
10799
10800 @item
10801 The compiler will emit such @code{gs} modifiers for code labels in the
10802 following situations:
10803 @itemize @minus
10804 @item Taking address of a function or code label.
10805 @item Computed goto.
10806 @item If prologue-save function is used, see @option{-mcall-prologues}
10807 command line option.
10808 @item Switch/case dispatch tables. If you do not want such dispatch
10809 tables you can specify the @option{-fno-jump-tables} command line option.
10810 @item C and C++ constructors/destructors called during startup/shutdown.
10811 @item If the tools hit a @code{gs()} modifier explained above.
10812 @end itemize
10813
10814 @item
10815 The default linker script is arranged for code with @code{EIND = 0}.
10816 If code is supposed to work for a setup with @code{EIND != 0}, a custom
10817 linker script has to be used in order to place the sections whose
10818 name start with @code{.trampolines} into the segment where @code{EIND}
10819 points to.
10820
10821 @item
10822 Jumping to non-symbolic addresses like so is @emph{not} supported:
10823
10824 @example
10825 int main (void)
10826 @{
10827     /* Call function at word address 0x2 */
10828     return ((int(*)(void)) 0x2)();
10829 @}
10830 @end example
10831
10832 Instead, a stub has to be set up:
10833
10834 @example
10835 int main (void)
10836 @{
10837     extern int func_4 (void);
10838
10839     /* Call function at byte address 0x4 */
10840     return func_4();
10841 @}
10842 @end example
10843
10844 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
10845 Alternatively, @code{func_4} can be defined in the linker script.
10846 @end itemize
10847
10848 @node Blackfin Options
10849 @subsection Blackfin Options
10850 @cindex Blackfin Options
10851
10852 @table @gcctabopt
10853 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
10854 @opindex mcpu=
10855 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
10856 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
10857 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
10858 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
10859 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
10860 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
10861 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
10862 @samp{bf561}, @samp{bf592}.
10863 The optional @var{sirevision} specifies the silicon revision of the target
10864 Blackfin processor.  Any workarounds available for the targeted silicon revision
10865 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
10866 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
10867 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
10868 hexadecimal digits representing the major and minor numbers in the silicon
10869 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
10870 is not defined.  If @var{sirevision} is @samp{any}, the
10871 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
10872 If this optional @var{sirevision} is not used, GCC assumes the latest known
10873 silicon revision of the targeted Blackfin processor.
10874
10875 Support for @samp{bf561} is incomplete.  For @samp{bf561},
10876 Only the processor macro is defined.
10877 Without this option, @samp{bf532} is used as the processor by default.
10878 The corresponding predefined processor macros for @var{cpu} is to
10879 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
10880 provided by libgloss to be linked in if @option{-msim} is not given.
10881
10882 @item -msim
10883 @opindex msim
10884 Specifies that the program will be run on the simulator.  This causes
10885 the simulator BSP provided by libgloss to be linked in.  This option
10886 has effect only for @samp{bfin-elf} toolchain.
10887 Certain other options, such as @option{-mid-shared-library} and
10888 @option{-mfdpic}, imply @option{-msim}.
10889
10890 @item -momit-leaf-frame-pointer
10891 @opindex momit-leaf-frame-pointer
10892 Don't keep the frame pointer in a register for leaf functions.  This
10893 avoids the instructions to save, set up and restore frame pointers and
10894 makes an extra register available in leaf functions.  The option
10895 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10896 which might make debugging harder.
10897
10898 @item -mspecld-anomaly
10899 @opindex mspecld-anomaly
10900 When enabled, the compiler will ensure that the generated code does not
10901 contain speculative loads after jump instructions. If this option is used,
10902 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
10903
10904 @item -mno-specld-anomaly
10905 @opindex mno-specld-anomaly
10906 Don't generate extra code to prevent speculative loads from occurring.
10907
10908 @item -mcsync-anomaly
10909 @opindex mcsync-anomaly
10910 When enabled, the compiler will ensure that the generated code does not
10911 contain CSYNC or SSYNC instructions too soon after conditional branches.
10912 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
10913
10914 @item -mno-csync-anomaly
10915 @opindex mno-csync-anomaly
10916 Don't generate extra code to prevent CSYNC or SSYNC instructions from
10917 occurring too soon after a conditional branch.
10918
10919 @item -mlow-64k
10920 @opindex mlow-64k
10921 When enabled, the compiler is free to take advantage of the knowledge that
10922 the entire program fits into the low 64k of memory.
10923
10924 @item -mno-low-64k
10925 @opindex mno-low-64k
10926 Assume that the program is arbitrarily large.  This is the default.
10927
10928 @item -mstack-check-l1
10929 @opindex mstack-check-l1
10930 Do stack checking using information placed into L1 scratchpad memory by the
10931 uClinux kernel.
10932
10933 @item -mid-shared-library
10934 @opindex mid-shared-library
10935 Generate code that supports shared libraries via the library ID method.
10936 This allows for execute in place and shared libraries in an environment
10937 without virtual memory management.  This option implies @option{-fPIC}.
10938 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10939
10940 @item -mno-id-shared-library
10941 @opindex mno-id-shared-library
10942 Generate code that doesn't assume ID based shared libraries are being used.
10943 This is the default.
10944
10945 @item -mleaf-id-shared-library
10946 @opindex mleaf-id-shared-library
10947 Generate code that supports shared libraries via the library ID method,
10948 but assumes that this library or executable won't link against any other
10949 ID shared libraries.  That allows the compiler to use faster code for jumps
10950 and calls.
10951
10952 @item -mno-leaf-id-shared-library
10953 @opindex mno-leaf-id-shared-library
10954 Do not assume that the code being compiled won't link against any ID shared
10955 libraries.  Slower code will be generated for jump and call insns.
10956
10957 @item -mshared-library-id=n
10958 @opindex mshared-library-id
10959 Specified the identification number of the ID based shared library being
10960 compiled.  Specifying a value of 0 will generate more compact code, specifying
10961 other values will force the allocation of that number to the current
10962 library but is no more space or time efficient than omitting this option.
10963
10964 @item -msep-data
10965 @opindex msep-data
10966 Generate code that allows the data segment to be located in a different
10967 area of memory from the text segment.  This allows for execute in place in
10968 an environment without virtual memory management by eliminating relocations
10969 against the text section.
10970
10971 @item -mno-sep-data
10972 @opindex mno-sep-data
10973 Generate code that assumes that the data segment follows the text segment.
10974 This is the default.
10975
10976 @item -mlong-calls
10977 @itemx -mno-long-calls
10978 @opindex mlong-calls
10979 @opindex mno-long-calls
10980 Tells the compiler to perform function calls by first loading the
10981 address of the function into a register and then performing a subroutine
10982 call on this register.  This switch is needed if the target function
10983 will lie outside of the 24 bit addressing range of the offset based
10984 version of subroutine call instruction.
10985
10986 This feature is not enabled by default.  Specifying
10987 @option{-mno-long-calls} will restore the default behavior.  Note these
10988 switches have no effect on how the compiler generates code to handle
10989 function calls via function pointers.
10990
10991 @item -mfast-fp
10992 @opindex mfast-fp
10993 Link with the fast floating-point library. This library relaxes some of
10994 the IEEE floating-point standard's rules for checking inputs against
10995 Not-a-Number (NAN), in the interest of performance.
10996
10997 @item -minline-plt
10998 @opindex minline-plt
10999 Enable inlining of PLT entries in function calls to functions that are
11000 not known to bind locally.  It has no effect without @option{-mfdpic}.
11001
11002 @item -mmulticore
11003 @opindex mmulticore
11004 Build standalone application for multicore Blackfin processor. Proper
11005 start files and link scripts will be used to support multicore.
11006 This option defines @code{__BFIN_MULTICORE}. It can only be used with
11007 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
11008 @option{-mcorea} or @option{-mcoreb}. If it's used without
11009 @option{-mcorea} or @option{-mcoreb}, single application/dual core
11010 programming model is used. In this model, the main function of Core B
11011 should be named as coreb_main. If it's used with @option{-mcorea} or
11012 @option{-mcoreb}, one application per core programming model is used.
11013 If this option is not used, single core application programming
11014 model is used.
11015
11016 @item -mcorea
11017 @opindex mcorea
11018 Build standalone application for Core A of BF561 when using
11019 one application per core programming model. Proper start files
11020 and link scripts will be used to support Core A. This option
11021 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
11022
11023 @item -mcoreb
11024 @opindex mcoreb
11025 Build standalone application for Core B of BF561 when using
11026 one application per core programming model. Proper start files
11027 and link scripts will be used to support Core B. This option
11028 defines @code{__BFIN_COREB}. When this option is used, coreb_main
11029 should be used instead of main. It must be used with
11030 @option{-mmulticore}.
11031
11032 @item -msdram
11033 @opindex msdram
11034 Build standalone application for SDRAM. Proper start files and
11035 link scripts will be used to put the application into SDRAM.
11036 Loader should initialize SDRAM before loading the application
11037 into SDRAM. This option defines @code{__BFIN_SDRAM}.
11038
11039 @item -micplb
11040 @opindex micplb
11041 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
11042 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
11043 are enabled; for standalone applications the default is off.
11044 @end table
11045
11046 @node C6X Options
11047 @subsection C6X Options
11048 @cindex C6X Options
11049
11050 @table @gcctabopt
11051 @item -march=@var{name}
11052 @opindex march
11053 This specifies the name of the target architecture.  GCC uses this
11054 name to determine what kind of instructions it can emit when generating
11055 assembly code.  Permissible names are: @samp{c62x},
11056 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
11057
11058 @item -mbig-endian
11059 @opindex mbig-endian
11060 Generate code for a big endian target.
11061
11062 @item -mlittle-endian
11063 @opindex mlittle-endian
11064 Generate code for a little endian target.  This is the default.
11065
11066 @item -msim
11067 @opindex msim
11068 Choose startup files and linker script suitable for the simulator.
11069
11070 @item -msdata=default
11071 @opindex msdata=default
11072 Put small global and static data in the @samp{.neardata} section,
11073 which is pointed to by register @code{B14}.  Put small uninitialized
11074 global and static data in the @samp{.bss} section, which is adjacent
11075 to the @samp{.neardata} section.  Put small read-only data into the
11076 @samp{.rodata} section.  The corresponding sections used for large
11077 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
11078
11079 @item -msdata=all
11080 @opindex msdata=all
11081 Put all data, not just small objets, into the sections reserved for
11082 small data, and use addressing relative to the @code{B14} register to
11083 access them.
11084
11085 @item -msdata=none
11086 @opindex msdata=none
11087 Make no use of the sections reserved for small data, and use absolute
11088 addresses to access all data.  Put all initialized global and static
11089 data in the @samp{.fardata} section, and all uninitialized data in the
11090 @samp{.far} section.  Put all constant data into the @samp{.const}
11091 section.
11092 @end table
11093
11094 @node CRIS Options
11095 @subsection CRIS Options
11096 @cindex CRIS Options
11097
11098 These options are defined specifically for the CRIS ports.
11099
11100 @table @gcctabopt
11101 @item -march=@var{architecture-type}
11102 @itemx -mcpu=@var{architecture-type}
11103 @opindex march
11104 @opindex mcpu
11105 Generate code for the specified architecture.  The choices for
11106 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
11107 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
11108 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
11109 @samp{v10}.
11110
11111 @item -mtune=@var{architecture-type}
11112 @opindex mtune
11113 Tune to @var{architecture-type} everything applicable about the generated
11114 code, except for the ABI and the set of available instructions.  The
11115 choices for @var{architecture-type} are the same as for
11116 @option{-march=@var{architecture-type}}.
11117
11118 @item -mmax-stack-frame=@var{n}
11119 @opindex mmax-stack-frame
11120 Warn when the stack frame of a function exceeds @var{n} bytes.
11121
11122 @item -metrax4
11123 @itemx -metrax100
11124 @opindex metrax4
11125 @opindex metrax100
11126 The options @option{-metrax4} and @option{-metrax100} are synonyms for
11127 @option{-march=v3} and @option{-march=v8} respectively.
11128
11129 @item -mmul-bug-workaround
11130 @itemx -mno-mul-bug-workaround
11131 @opindex mmul-bug-workaround
11132 @opindex mno-mul-bug-workaround
11133 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
11134 models where it applies.  This option is active by default.
11135
11136 @item -mpdebug
11137 @opindex mpdebug
11138 Enable CRIS-specific verbose debug-related information in the assembly
11139 code.  This option also has the effect to turn off the @samp{#NO_APP}
11140 formatted-code indicator to the assembler at the beginning of the
11141 assembly file.
11142
11143 @item -mcc-init
11144 @opindex mcc-init
11145 Do not use condition-code results from previous instruction; always emit
11146 compare and test instructions before use of condition codes.
11147
11148 @item -mno-side-effects
11149 @opindex mno-side-effects
11150 Do not emit instructions with side-effects in addressing modes other than
11151 post-increment.
11152
11153 @item -mstack-align
11154 @itemx -mno-stack-align
11155 @itemx -mdata-align
11156 @itemx -mno-data-align
11157 @itemx -mconst-align
11158 @itemx -mno-const-align
11159 @opindex mstack-align
11160 @opindex mno-stack-align
11161 @opindex mdata-align
11162 @opindex mno-data-align
11163 @opindex mconst-align
11164 @opindex mno-const-align
11165 These options (no-options) arranges (eliminate arrangements) for the
11166 stack-frame, individual data and constants to be aligned for the maximum
11167 single data access size for the chosen CPU model.  The default is to
11168 arrange for 32-bit alignment.  ABI details such as structure layout are
11169 not affected by these options.
11170
11171 @item -m32-bit
11172 @itemx -m16-bit
11173 @itemx -m8-bit
11174 @opindex m32-bit
11175 @opindex m16-bit
11176 @opindex m8-bit
11177 Similar to the stack- data- and const-align options above, these options
11178 arrange for stack-frame, writable data and constants to all be 32-bit,
11179 16-bit or 8-bit aligned.  The default is 32-bit alignment.
11180
11181 @item -mno-prologue-epilogue
11182 @itemx -mprologue-epilogue
11183 @opindex mno-prologue-epilogue
11184 @opindex mprologue-epilogue
11185 With @option{-mno-prologue-epilogue}, the normal function prologue and
11186 epilogue that sets up the stack-frame are omitted and no return
11187 instructions or return sequences are generated in the code.  Use this
11188 option only together with visual inspection of the compiled code: no
11189 warnings or errors are generated when call-saved registers must be saved,
11190 or storage for local variable needs to be allocated.
11191
11192 @item -mno-gotplt
11193 @itemx -mgotplt
11194 @opindex mno-gotplt
11195 @opindex mgotplt
11196 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
11197 instruction sequences that load addresses for functions from the PLT part
11198 of the GOT rather than (traditional on other architectures) calls to the
11199 PLT@.  The default is @option{-mgotplt}.
11200
11201 @item -melf
11202 @opindex melf
11203 Legacy no-op option only recognized with the cris-axis-elf and
11204 cris-axis-linux-gnu targets.
11205
11206 @item -mlinux
11207 @opindex mlinux
11208 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
11209
11210 @item -sim
11211 @opindex sim
11212 This option, recognized for the cris-axis-elf arranges
11213 to link with input-output functions from a simulator library.  Code,
11214 initialized data and zero-initialized data are allocated consecutively.
11215
11216 @item -sim2
11217 @opindex sim2
11218 Like @option{-sim}, but pass linker options to locate initialized data at
11219 0x40000000 and zero-initialized data at 0x80000000.
11220 @end table
11221
11222 @node Darwin Options
11223 @subsection Darwin Options
11224 @cindex Darwin options
11225
11226 These options are defined for all architectures running the Darwin operating
11227 system.
11228
11229 FSF GCC on Darwin does not create ``fat'' object files; it will create
11230 an object file for the single architecture that it was built to
11231 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
11232 @option{-arch} options are used; it does so by running the compiler or
11233 linker multiple times and joining the results together with
11234 @file{lipo}.
11235
11236 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
11237 @samp{i686}) is determined by the flags that specify the ISA
11238 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
11239 @option{-force_cpusubtype_ALL} option can be used to override this.
11240
11241 The Darwin tools vary in their behavior when presented with an ISA
11242 mismatch.  The assembler, @file{as}, will only permit instructions to
11243 be used that are valid for the subtype of the file it is generating,
11244 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
11245 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
11246 and print an error if asked to create a shared library with a less
11247 restrictive subtype than its input files (for instance, trying to put
11248 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
11249 for executables, @file{ld}, will quietly give the executable the most
11250 restrictive subtype of any of its input files.
11251
11252 @table @gcctabopt
11253 @item -F@var{dir}
11254 @opindex F
11255 Add the framework directory @var{dir} to the head of the list of
11256 directories to be searched for header files.  These directories are
11257 interleaved with those specified by @option{-I} options and are
11258 scanned in a left-to-right order.
11259
11260 A framework directory is a directory with frameworks in it.  A
11261 framework is a directory with a @samp{"Headers"} and/or
11262 @samp{"PrivateHeaders"} directory contained directly in it that ends
11263 in @samp{".framework"}.  The name of a framework is the name of this
11264 directory excluding the @samp{".framework"}.  Headers associated with
11265 the framework are found in one of those two directories, with
11266 @samp{"Headers"} being searched first.  A subframework is a framework
11267 directory that is in a framework's @samp{"Frameworks"} directory.
11268 Includes of subframework headers can only appear in a header of a
11269 framework that contains the subframework, or in a sibling subframework
11270 header.  Two subframeworks are siblings if they occur in the same
11271 framework.  A subframework should not have the same name as a
11272 framework, a warning will be issued if this is violated.  Currently a
11273 subframework cannot have subframeworks, in the future, the mechanism
11274 may be extended to support this.  The standard frameworks can be found
11275 in @samp{"/System/Library/Frameworks"} and
11276 @samp{"/Library/Frameworks"}.  An example include looks like
11277 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
11278 the name of the framework and header.h is found in the
11279 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
11280
11281 @item -iframework@var{dir}
11282 @opindex iframework
11283 Like @option{-F} except the directory is a treated as a system
11284 directory.  The main difference between this @option{-iframework} and
11285 @option{-F} is that with @option{-iframework} the compiler does not
11286 warn about constructs contained within header files found via
11287 @var{dir}.  This option is valid only for the C family of languages.
11288
11289 @item -gused
11290 @opindex gused
11291 Emit debugging information for symbols that are used.  For STABS
11292 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
11293 This is by default ON@.
11294
11295 @item -gfull
11296 @opindex gfull
11297 Emit debugging information for all symbols and types.
11298
11299 @item -mmacosx-version-min=@var{version}
11300 The earliest version of MacOS X that this executable will run on
11301 is @var{version}.  Typical values of @var{version} include @code{10.1},
11302 @code{10.2}, and @code{10.3.9}.
11303
11304 If the compiler was built to use the system's headers by default,
11305 then the default for this option is the system version on which the
11306 compiler is running, otherwise the default is to make choices which
11307 are compatible with as many systems and code bases as possible.
11308
11309 @item -mkernel
11310 @opindex mkernel
11311 Enable kernel development mode.  The @option{-mkernel} option sets
11312 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
11313 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
11314 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
11315 applicable.  This mode also sets @option{-mno-altivec},
11316 @option{-msoft-float}, @option{-fno-builtin} and
11317 @option{-mlong-branch} for PowerPC targets.
11318
11319 @item -mone-byte-bool
11320 @opindex mone-byte-bool
11321 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
11322 By default @samp{sizeof(bool)} is @samp{4} when compiling for
11323 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
11324 option has no effect on x86.
11325
11326 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
11327 to generate code that is not binary compatible with code generated
11328 without that switch.  Using this switch may require recompiling all
11329 other modules in a program, including system libraries.  Use this
11330 switch to conform to a non-default data model.
11331
11332 @item -mfix-and-continue
11333 @itemx -ffix-and-continue
11334 @itemx -findirect-data
11335 @opindex mfix-and-continue
11336 @opindex ffix-and-continue
11337 @opindex findirect-data
11338 Generate code suitable for fast turn around development.  Needed to
11339 enable gdb to dynamically load @code{.o} files into already running
11340 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
11341 are provided for backwards compatibility.
11342
11343 @item -all_load
11344 @opindex all_load
11345 Loads all members of static archive libraries.
11346 See man ld(1) for more information.
11347
11348 @item -arch_errors_fatal
11349 @opindex arch_errors_fatal
11350 Cause the errors having to do with files that have the wrong architecture
11351 to be fatal.
11352
11353 @item -bind_at_load
11354 @opindex bind_at_load
11355 Causes the output file to be marked such that the dynamic linker will
11356 bind all undefined references when the file is loaded or launched.
11357
11358 @item -bundle
11359 @opindex bundle
11360 Produce a Mach-o bundle format file.
11361 See man ld(1) for more information.
11362
11363 @item -bundle_loader @var{executable}
11364 @opindex bundle_loader
11365 This option specifies the @var{executable} that will be loading the build
11366 output file being linked.  See man ld(1) for more information.
11367
11368 @item -dynamiclib
11369 @opindex dynamiclib
11370 When passed this option, GCC will produce a dynamic library instead of
11371 an executable when linking, using the Darwin @file{libtool} command.
11372
11373 @item -force_cpusubtype_ALL
11374 @opindex force_cpusubtype_ALL
11375 This causes GCC's output file to have the @var{ALL} subtype, instead of
11376 one controlled by the @option{-mcpu} or @option{-march} option.
11377
11378 @item -allowable_client  @var{client_name}
11379 @itemx -client_name
11380 @itemx -compatibility_version
11381 @itemx -current_version
11382 @itemx -dead_strip
11383 @itemx -dependency-file
11384 @itemx -dylib_file
11385 @itemx -dylinker_install_name
11386 @itemx -dynamic
11387 @itemx -exported_symbols_list
11388 @itemx -filelist
11389 @need 800
11390 @itemx -flat_namespace
11391 @itemx -force_flat_namespace
11392 @itemx -headerpad_max_install_names
11393 @itemx -image_base
11394 @itemx -init
11395 @itemx -install_name
11396 @itemx -keep_private_externs
11397 @itemx -multi_module
11398 @itemx -multiply_defined
11399 @itemx -multiply_defined_unused
11400 @need 800
11401 @itemx -noall_load
11402 @itemx -no_dead_strip_inits_and_terms
11403 @itemx -nofixprebinding
11404 @itemx -nomultidefs
11405 @itemx -noprebind
11406 @itemx -noseglinkedit
11407 @itemx -pagezero_size
11408 @itemx -prebind
11409 @itemx -prebind_all_twolevel_modules
11410 @itemx -private_bundle
11411 @need 800
11412 @itemx -read_only_relocs
11413 @itemx -sectalign
11414 @itemx -sectobjectsymbols
11415 @itemx -whyload
11416 @itemx -seg1addr
11417 @itemx -sectcreate
11418 @itemx -sectobjectsymbols
11419 @itemx -sectorder
11420 @itemx -segaddr
11421 @itemx -segs_read_only_addr
11422 @need 800
11423 @itemx -segs_read_write_addr
11424 @itemx -seg_addr_table
11425 @itemx -seg_addr_table_filename
11426 @itemx -seglinkedit
11427 @itemx -segprot
11428 @itemx -segs_read_only_addr
11429 @itemx -segs_read_write_addr
11430 @itemx -single_module
11431 @itemx -static
11432 @itemx -sub_library
11433 @need 800
11434 @itemx -sub_umbrella
11435 @itemx -twolevel_namespace
11436 @itemx -umbrella
11437 @itemx -undefined
11438 @itemx -unexported_symbols_list
11439 @itemx -weak_reference_mismatches
11440 @itemx -whatsloaded
11441 @opindex allowable_client
11442 @opindex client_name
11443 @opindex compatibility_version
11444 @opindex current_version
11445 @opindex dead_strip
11446 @opindex dependency-file
11447 @opindex dylib_file
11448 @opindex dylinker_install_name
11449 @opindex dynamic
11450 @opindex exported_symbols_list
11451 @opindex filelist
11452 @opindex flat_namespace
11453 @opindex force_flat_namespace
11454 @opindex headerpad_max_install_names
11455 @opindex image_base
11456 @opindex init
11457 @opindex install_name
11458 @opindex keep_private_externs
11459 @opindex multi_module
11460 @opindex multiply_defined
11461 @opindex multiply_defined_unused
11462 @opindex noall_load
11463 @opindex no_dead_strip_inits_and_terms
11464 @opindex nofixprebinding
11465 @opindex nomultidefs
11466 @opindex noprebind
11467 @opindex noseglinkedit
11468 @opindex pagezero_size
11469 @opindex prebind
11470 @opindex prebind_all_twolevel_modules
11471 @opindex private_bundle
11472 @opindex read_only_relocs
11473 @opindex sectalign
11474 @opindex sectobjectsymbols
11475 @opindex whyload
11476 @opindex seg1addr
11477 @opindex sectcreate
11478 @opindex sectobjectsymbols
11479 @opindex sectorder
11480 @opindex segaddr
11481 @opindex segs_read_only_addr
11482 @opindex segs_read_write_addr
11483 @opindex seg_addr_table
11484 @opindex seg_addr_table_filename
11485 @opindex seglinkedit
11486 @opindex segprot
11487 @opindex segs_read_only_addr
11488 @opindex segs_read_write_addr
11489 @opindex single_module
11490 @opindex static
11491 @opindex sub_library
11492 @opindex sub_umbrella
11493 @opindex twolevel_namespace
11494 @opindex umbrella
11495 @opindex undefined
11496 @opindex unexported_symbols_list
11497 @opindex weak_reference_mismatches
11498 @opindex whatsloaded
11499 These options are passed to the Darwin linker.  The Darwin linker man page
11500 describes them in detail.
11501 @end table
11502
11503 @node DEC Alpha Options
11504 @subsection DEC Alpha Options
11505
11506 These @samp{-m} options are defined for the DEC Alpha implementations:
11507
11508 @table @gcctabopt
11509 @item -mno-soft-float
11510 @itemx -msoft-float
11511 @opindex mno-soft-float
11512 @opindex msoft-float
11513 Use (do not use) the hardware floating-point instructions for
11514 floating-point operations.  When @option{-msoft-float} is specified,
11515 functions in @file{libgcc.a} will be used to perform floating-point
11516 operations.  Unless they are replaced by routines that emulate the
11517 floating-point operations, or compiled in such a way as to call such
11518 emulations routines, these routines will issue floating-point
11519 operations.   If you are compiling for an Alpha without floating-point
11520 operations, you must ensure that the library is built so as not to call
11521 them.
11522
11523 Note that Alpha implementations without floating-point operations are
11524 required to have floating-point registers.
11525
11526 @item -mfp-reg
11527 @itemx -mno-fp-regs
11528 @opindex mfp-reg
11529 @opindex mno-fp-regs
11530 Generate code that uses (does not use) the floating-point register set.
11531 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
11532 register set is not used, floating point operands are passed in integer
11533 registers as if they were integers and floating-point results are passed
11534 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
11535 so any function with a floating-point argument or return value called by code
11536 compiled with @option{-mno-fp-regs} must also be compiled with that
11537 option.
11538
11539 A typical use of this option is building a kernel that does not use,
11540 and hence need not save and restore, any floating-point registers.
11541
11542 @item -mieee
11543 @opindex mieee
11544 The Alpha architecture implements floating-point hardware optimized for
11545 maximum performance.  It is mostly compliant with the IEEE floating
11546 point standard.  However, for full compliance, software assistance is
11547 required.  This option generates code fully IEEE compliant code
11548 @emph{except} that the @var{inexact-flag} is not maintained (see below).
11549 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
11550 defined during compilation.  The resulting code is less efficient but is
11551 able to correctly support denormalized numbers and exceptional IEEE
11552 values such as not-a-number and plus/minus infinity.  Other Alpha
11553 compilers call this option @option{-ieee_with_no_inexact}.
11554
11555 @item -mieee-with-inexact
11556 @opindex mieee-with-inexact
11557 This is like @option{-mieee} except the generated code also maintains
11558 the IEEE @var{inexact-flag}.  Turning on this option causes the
11559 generated code to implement fully-compliant IEEE math.  In addition to
11560 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
11561 macro.  On some Alpha implementations the resulting code may execute
11562 significantly slower than the code generated by default.  Since there is
11563 very little code that depends on the @var{inexact-flag}, you should
11564 normally not specify this option.  Other Alpha compilers call this
11565 option @option{-ieee_with_inexact}.
11566
11567 @item -mfp-trap-mode=@var{trap-mode}
11568 @opindex mfp-trap-mode
11569 This option controls what floating-point related traps are enabled.
11570 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
11571 The trap mode can be set to one of four values:
11572
11573 @table @samp
11574 @item n
11575 This is the default (normal) setting.  The only traps that are enabled
11576 are the ones that cannot be disabled in software (e.g., division by zero
11577 trap).
11578
11579 @item u
11580 In addition to the traps enabled by @samp{n}, underflow traps are enabled
11581 as well.
11582
11583 @item su
11584 Like @samp{u}, but the instructions are marked to be safe for software
11585 completion (see Alpha architecture manual for details).
11586
11587 @item sui
11588 Like @samp{su}, but inexact traps are enabled as well.
11589 @end table
11590
11591 @item -mfp-rounding-mode=@var{rounding-mode}
11592 @opindex mfp-rounding-mode
11593 Selects the IEEE rounding mode.  Other Alpha compilers call this option
11594 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
11595 of:
11596
11597 @table @samp
11598 @item n
11599 Normal IEEE rounding mode.  Floating point numbers are rounded towards
11600 the nearest machine number or towards the even machine number in case
11601 of a tie.
11602
11603 @item m
11604 Round towards minus infinity.
11605
11606 @item c
11607 Chopped rounding mode.  Floating point numbers are rounded towards zero.
11608
11609 @item d
11610 Dynamic rounding mode.  A field in the floating point control register
11611 (@var{fpcr}, see Alpha architecture reference manual) controls the
11612 rounding mode in effect.  The C library initializes this register for
11613 rounding towards plus infinity.  Thus, unless your program modifies the
11614 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
11615 @end table
11616
11617 @item -mtrap-precision=@var{trap-precision}
11618 @opindex mtrap-precision
11619 In the Alpha architecture, floating point traps are imprecise.  This
11620 means without software assistance it is impossible to recover from a
11621 floating trap and program execution normally needs to be terminated.
11622 GCC can generate code that can assist operating system trap handlers
11623 in determining the exact location that caused a floating point trap.
11624 Depending on the requirements of an application, different levels of
11625 precisions can be selected:
11626
11627 @table @samp
11628 @item p
11629 Program precision.  This option is the default and means a trap handler
11630 can only identify which program caused a floating point exception.
11631
11632 @item f
11633 Function precision.  The trap handler can determine the function that
11634 caused a floating point exception.
11635
11636 @item i
11637 Instruction precision.  The trap handler can determine the exact
11638 instruction that caused a floating point exception.
11639 @end table
11640
11641 Other Alpha compilers provide the equivalent options called
11642 @option{-scope_safe} and @option{-resumption_safe}.
11643
11644 @item -mieee-conformant
11645 @opindex mieee-conformant
11646 This option marks the generated code as IEEE conformant.  You must not
11647 use this option unless you also specify @option{-mtrap-precision=i} and either
11648 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
11649 is to emit the line @samp{.eflag 48} in the function prologue of the
11650 generated assembly file.  Under DEC Unix, this has the effect that
11651 IEEE-conformant math library routines will be linked in.
11652
11653 @item -mbuild-constants
11654 @opindex mbuild-constants
11655 Normally GCC examines a 32- or 64-bit integer constant to
11656 see if it can construct it from smaller constants in two or three
11657 instructions.  If it cannot, it will output the constant as a literal and
11658 generate code to load it from the data segment at runtime.
11659
11660 Use this option to require GCC to construct @emph{all} integer constants
11661 using code, even if it takes more instructions (the maximum is six).
11662
11663 You would typically use this option to build a shared library dynamic
11664 loader.  Itself a shared library, it must relocate itself in memory
11665 before it can find the variables and constants in its own data segment.
11666
11667 @item -malpha-as
11668 @itemx -mgas
11669 @opindex malpha-as
11670 @opindex mgas
11671 Select whether to generate code to be assembled by the vendor-supplied
11672 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
11673
11674 @item -mbwx
11675 @itemx -mno-bwx
11676 @itemx -mcix
11677 @itemx -mno-cix
11678 @itemx -mfix
11679 @itemx -mno-fix
11680 @itemx -mmax
11681 @itemx -mno-max
11682 @opindex mbwx
11683 @opindex mno-bwx
11684 @opindex mcix
11685 @opindex mno-cix
11686 @opindex mfix
11687 @opindex mno-fix
11688 @opindex mmax
11689 @opindex mno-max
11690 Indicate whether GCC should generate code to use the optional BWX,
11691 CIX, FIX and MAX instruction sets.  The default is to use the instruction
11692 sets supported by the CPU type specified via @option{-mcpu=} option or that
11693 of the CPU on which GCC was built if none was specified.
11694
11695 @item -mfloat-vax
11696 @itemx -mfloat-ieee
11697 @opindex mfloat-vax
11698 @opindex mfloat-ieee
11699 Generate code that uses (does not use) VAX F and G floating point
11700 arithmetic instead of IEEE single and double precision.
11701
11702 @item -mexplicit-relocs
11703 @itemx -mno-explicit-relocs
11704 @opindex mexplicit-relocs
11705 @opindex mno-explicit-relocs
11706 Older Alpha assemblers provided no way to generate symbol relocations
11707 except via assembler macros.  Use of these macros does not allow
11708 optimal instruction scheduling.  GNU binutils as of version 2.12
11709 supports a new syntax that allows the compiler to explicitly mark
11710 which relocations should apply to which instructions.  This option
11711 is mostly useful for debugging, as GCC detects the capabilities of
11712 the assembler when it is built and sets the default accordingly.
11713
11714 @item -msmall-data
11715 @itemx -mlarge-data
11716 @opindex msmall-data
11717 @opindex mlarge-data
11718 When @option{-mexplicit-relocs} is in effect, static data is
11719 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
11720 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
11721 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
11722 16-bit relocations off of the @code{$gp} register.  This limits the
11723 size of the small data area to 64KB, but allows the variables to be
11724 directly accessed via a single instruction.
11725
11726 The default is @option{-mlarge-data}.  With this option the data area
11727 is limited to just below 2GB@.  Programs that require more than 2GB of
11728 data must use @code{malloc} or @code{mmap} to allocate the data in the
11729 heap instead of in the program's data segment.
11730
11731 When generating code for shared libraries, @option{-fpic} implies
11732 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
11733
11734 @item -msmall-text
11735 @itemx -mlarge-text
11736 @opindex msmall-text
11737 @opindex mlarge-text
11738 When @option{-msmall-text} is used, the compiler assumes that the
11739 code of the entire program (or shared library) fits in 4MB, and is
11740 thus reachable with a branch instruction.  When @option{-msmall-data}
11741 is used, the compiler can assume that all local symbols share the
11742 same @code{$gp} value, and thus reduce the number of instructions
11743 required for a function call from 4 to 1.
11744
11745 The default is @option{-mlarge-text}.
11746
11747 @item -mcpu=@var{cpu_type}
11748 @opindex mcpu
11749 Set the instruction set and instruction scheduling parameters for
11750 machine type @var{cpu_type}.  You can specify either the @samp{EV}
11751 style name or the corresponding chip number.  GCC supports scheduling
11752 parameters for the EV4, EV5 and EV6 family of processors and will
11753 choose the default values for the instruction set from the processor
11754 you specify.  If you do not specify a processor type, GCC will default
11755 to the processor on which the compiler was built.
11756
11757 Supported values for @var{cpu_type} are
11758
11759 @table @samp
11760 @item ev4
11761 @itemx ev45
11762 @itemx 21064
11763 Schedules as an EV4 and has no instruction set extensions.
11764
11765 @item ev5
11766 @itemx 21164
11767 Schedules as an EV5 and has no instruction set extensions.
11768
11769 @item ev56
11770 @itemx 21164a
11771 Schedules as an EV5 and supports the BWX extension.
11772
11773 @item pca56
11774 @itemx 21164pc
11775 @itemx 21164PC
11776 Schedules as an EV5 and supports the BWX and MAX extensions.
11777
11778 @item ev6
11779 @itemx 21264
11780 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
11781
11782 @item ev67
11783 @itemx 21264a
11784 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
11785 @end table
11786
11787 Native toolchains also support the value @samp{native},
11788 which selects the best architecture option for the host processor.
11789 @option{-mcpu=native} has no effect if GCC does not recognize
11790 the processor.
11791
11792 @item -mtune=@var{cpu_type}
11793 @opindex mtune
11794 Set only the instruction scheduling parameters for machine type
11795 @var{cpu_type}.  The instruction set is not changed.
11796
11797 Native toolchains also support the value @samp{native},
11798 which selects the best architecture option for the host processor.
11799 @option{-mtune=native} has no effect if GCC does not recognize
11800 the processor.
11801
11802 @item -mmemory-latency=@var{time}
11803 @opindex mmemory-latency
11804 Sets the latency the scheduler should assume for typical memory
11805 references as seen by the application.  This number is highly
11806 dependent on the memory access patterns used by the application
11807 and the size of the external cache on the machine.
11808
11809 Valid options for @var{time} are
11810
11811 @table @samp
11812 @item @var{number}
11813 A decimal number representing clock cycles.
11814
11815 @item L1
11816 @itemx L2
11817 @itemx L3
11818 @itemx main
11819 The compiler contains estimates of the number of clock cycles for
11820 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
11821 (also called Dcache, Scache, and Bcache), as well as to main memory.
11822 Note that L3 is only valid for EV5.
11823
11824 @end table
11825 @end table
11826
11827 @node DEC Alpha/VMS Options
11828 @subsection DEC Alpha/VMS Options
11829
11830 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
11831
11832 @table @gcctabopt
11833 @item -mvms-return-codes
11834 @opindex mvms-return-codes
11835 Return VMS condition codes from main.  The default is to return POSIX
11836 style condition (e.g.@: error) codes.
11837
11838 @item -mdebug-main=@var{prefix}
11839 @opindex mdebug-main=@var{prefix}
11840 Flag the first routine whose name starts with @var{prefix} as the main
11841 routine for the debugger.
11842
11843 @item -mmalloc64
11844 @opindex mmalloc64
11845 Default to 64bit memory allocation routines.
11846 @end table
11847
11848 @node FR30 Options
11849 @subsection FR30 Options
11850 @cindex FR30 Options
11851
11852 These options are defined specifically for the FR30 port.
11853
11854 @table @gcctabopt
11855
11856 @item -msmall-model
11857 @opindex msmall-model
11858 Use the small address space model.  This can produce smaller code, but
11859 it does assume that all symbolic values and addresses will fit into a
11860 20-bit range.
11861
11862 @item -mno-lsim
11863 @opindex mno-lsim
11864 Assume that run-time support has been provided and so there is no need
11865 to include the simulator library (@file{libsim.a}) on the linker
11866 command line.
11867
11868 @end table
11869
11870 @node FRV Options
11871 @subsection FRV Options
11872 @cindex FRV Options
11873
11874 @table @gcctabopt
11875 @item -mgpr-32
11876 @opindex mgpr-32
11877
11878 Only use the first 32 general purpose registers.
11879
11880 @item -mgpr-64
11881 @opindex mgpr-64
11882
11883 Use all 64 general purpose registers.
11884
11885 @item -mfpr-32
11886 @opindex mfpr-32
11887
11888 Use only the first 32 floating point registers.
11889
11890 @item -mfpr-64
11891 @opindex mfpr-64
11892
11893 Use all 64 floating point registers
11894
11895 @item -mhard-float
11896 @opindex mhard-float
11897
11898 Use hardware instructions for floating point operations.
11899
11900 @item -msoft-float
11901 @opindex msoft-float
11902
11903 Use library routines for floating point operations.
11904
11905 @item -malloc-cc
11906 @opindex malloc-cc
11907
11908 Dynamically allocate condition code registers.
11909
11910 @item -mfixed-cc
11911 @opindex mfixed-cc
11912
11913 Do not try to dynamically allocate condition code registers, only
11914 use @code{icc0} and @code{fcc0}.
11915
11916 @item -mdword
11917 @opindex mdword
11918
11919 Change ABI to use double word insns.
11920
11921 @item -mno-dword
11922 @opindex mno-dword
11923
11924 Do not use double word instructions.
11925
11926 @item -mdouble
11927 @opindex mdouble
11928
11929 Use floating point double instructions.
11930
11931 @item -mno-double
11932 @opindex mno-double
11933
11934 Do not use floating point double instructions.
11935
11936 @item -mmedia
11937 @opindex mmedia
11938
11939 Use media instructions.
11940
11941 @item -mno-media
11942 @opindex mno-media
11943
11944 Do not use media instructions.
11945
11946 @item -mmuladd
11947 @opindex mmuladd
11948
11949 Use multiply and add/subtract instructions.
11950
11951 @item -mno-muladd
11952 @opindex mno-muladd
11953
11954 Do not use multiply and add/subtract instructions.
11955
11956 @item -mfdpic
11957 @opindex mfdpic
11958
11959 Select the FDPIC ABI, that uses function descriptors to represent
11960 pointers to functions.  Without any PIC/PIE-related options, it
11961 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
11962 assumes GOT entries and small data are within a 12-bit range from the
11963 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
11964 are computed with 32 bits.
11965 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11966
11967 @item -minline-plt
11968 @opindex minline-plt
11969
11970 Enable inlining of PLT entries in function calls to functions that are
11971 not known to bind locally.  It has no effect without @option{-mfdpic}.
11972 It's enabled by default if optimizing for speed and compiling for
11973 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
11974 optimization option such as @option{-O3} or above is present in the
11975 command line.
11976
11977 @item -mTLS
11978 @opindex mTLS
11979
11980 Assume a large TLS segment when generating thread-local code.
11981
11982 @item -mtls
11983 @opindex mtls
11984
11985 Do not assume a large TLS segment when generating thread-local code.
11986
11987 @item -mgprel-ro
11988 @opindex mgprel-ro
11989
11990 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
11991 that is known to be in read-only sections.  It's enabled by default,
11992 except for @option{-fpic} or @option{-fpie}: even though it may help
11993 make the global offset table smaller, it trades 1 instruction for 4.
11994 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
11995 one of which may be shared by multiple symbols, and it avoids the need
11996 for a GOT entry for the referenced symbol, so it's more likely to be a
11997 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
11998
11999 @item -multilib-library-pic
12000 @opindex multilib-library-pic
12001
12002 Link with the (library, not FD) pic libraries.  It's implied by
12003 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
12004 @option{-fpic} without @option{-mfdpic}.  You should never have to use
12005 it explicitly.
12006
12007 @item -mlinked-fp
12008 @opindex mlinked-fp
12009
12010 Follow the EABI requirement of always creating a frame pointer whenever
12011 a stack frame is allocated.  This option is enabled by default and can
12012 be disabled with @option{-mno-linked-fp}.
12013
12014 @item -mlong-calls
12015 @opindex mlong-calls
12016
12017 Use indirect addressing to call functions outside the current
12018 compilation unit.  This allows the functions to be placed anywhere
12019 within the 32-bit address space.
12020
12021 @item -malign-labels
12022 @opindex malign-labels
12023
12024 Try to align labels to an 8-byte boundary by inserting nops into the
12025 previous packet.  This option only has an effect when VLIW packing
12026 is enabled.  It doesn't create new packets; it merely adds nops to
12027 existing ones.
12028
12029 @item -mlibrary-pic
12030 @opindex mlibrary-pic
12031
12032 Generate position-independent EABI code.
12033
12034 @item -macc-4
12035 @opindex macc-4
12036
12037 Use only the first four media accumulator registers.
12038
12039 @item -macc-8
12040 @opindex macc-8
12041
12042 Use all eight media accumulator registers.
12043
12044 @item -mpack
12045 @opindex mpack
12046
12047 Pack VLIW instructions.
12048
12049 @item -mno-pack
12050 @opindex mno-pack
12051
12052 Do not pack VLIW instructions.
12053
12054 @item -mno-eflags
12055 @opindex mno-eflags
12056
12057 Do not mark ABI switches in e_flags.
12058
12059 @item -mcond-move
12060 @opindex mcond-move
12061
12062 Enable the use of conditional-move instructions (default).
12063
12064 This switch is mainly for debugging the compiler and will likely be removed
12065 in a future version.
12066
12067 @item -mno-cond-move
12068 @opindex mno-cond-move
12069
12070 Disable the use of conditional-move instructions.
12071
12072 This switch is mainly for debugging the compiler and will likely be removed
12073 in a future version.
12074
12075 @item -mscc
12076 @opindex mscc
12077
12078 Enable the use of conditional set instructions (default).
12079
12080 This switch is mainly for debugging the compiler and will likely be removed
12081 in a future version.
12082
12083 @item -mno-scc
12084 @opindex mno-scc
12085
12086 Disable the use of conditional set instructions.
12087
12088 This switch is mainly for debugging the compiler and will likely be removed
12089 in a future version.
12090
12091 @item -mcond-exec
12092 @opindex mcond-exec
12093
12094 Enable the use of conditional execution (default).
12095
12096 This switch is mainly for debugging the compiler and will likely be removed
12097 in a future version.
12098
12099 @item -mno-cond-exec
12100 @opindex mno-cond-exec
12101
12102 Disable the use of conditional execution.
12103
12104 This switch is mainly for debugging the compiler and will likely be removed
12105 in a future version.
12106
12107 @item -mvliw-branch
12108 @opindex mvliw-branch
12109
12110 Run a pass to pack branches into VLIW instructions (default).
12111
12112 This switch is mainly for debugging the compiler and will likely be removed
12113 in a future version.
12114
12115 @item -mno-vliw-branch
12116 @opindex mno-vliw-branch
12117
12118 Do not run a pass to pack branches into VLIW instructions.
12119
12120 This switch is mainly for debugging the compiler and will likely be removed
12121 in a future version.
12122
12123 @item -mmulti-cond-exec
12124 @opindex mmulti-cond-exec
12125
12126 Enable optimization of @code{&&} and @code{||} in conditional execution
12127 (default).
12128
12129 This switch is mainly for debugging the compiler and will likely be removed
12130 in a future version.
12131
12132 @item -mno-multi-cond-exec
12133 @opindex mno-multi-cond-exec
12134
12135 Disable optimization of @code{&&} and @code{||} in conditional execution.
12136
12137 This switch is mainly for debugging the compiler and will likely be removed
12138 in a future version.
12139
12140 @item -mnested-cond-exec
12141 @opindex mnested-cond-exec
12142
12143 Enable nested conditional execution optimizations (default).
12144
12145 This switch is mainly for debugging the compiler and will likely be removed
12146 in a future version.
12147
12148 @item -mno-nested-cond-exec
12149 @opindex mno-nested-cond-exec
12150
12151 Disable nested conditional execution optimizations.
12152
12153 This switch is mainly for debugging the compiler and will likely be removed
12154 in a future version.
12155
12156 @item -moptimize-membar
12157 @opindex moptimize-membar
12158
12159 This switch removes redundant @code{membar} instructions from the
12160 compiler generated code.  It is enabled by default.
12161
12162 @item -mno-optimize-membar
12163 @opindex mno-optimize-membar
12164
12165 This switch disables the automatic removal of redundant @code{membar}
12166 instructions from the generated code.
12167
12168 @item -mtomcat-stats
12169 @opindex mtomcat-stats
12170
12171 Cause gas to print out tomcat statistics.
12172
12173 @item -mcpu=@var{cpu}
12174 @opindex mcpu
12175
12176 Select the processor type for which to generate code.  Possible values are
12177 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
12178 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
12179
12180 @end table
12181
12182 @node GNU/Linux Options
12183 @subsection GNU/Linux Options
12184
12185 These @samp{-m} options are defined for GNU/Linux targets:
12186
12187 @table @gcctabopt
12188 @item -mglibc
12189 @opindex mglibc
12190 Use the GNU C library.  This is the default except
12191 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
12192
12193 @item -muclibc
12194 @opindex muclibc
12195 Use uClibc C library.  This is the default on
12196 @samp{*-*-linux-*uclibc*} targets.
12197
12198 @item -mbionic
12199 @opindex mbionic
12200 Use Bionic C library.  This is the default on
12201 @samp{*-*-linux-*android*} targets.
12202
12203 @item -mandroid
12204 @opindex mandroid
12205 Compile code compatible with Android platform.  This is the default on
12206 @samp{*-*-linux-*android*} targets.
12207
12208 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
12209 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
12210 this option makes the GCC driver pass Android-specific options to the linker.
12211 Finally, this option causes the preprocessor macro @code{__ANDROID__}
12212 to be defined.
12213
12214 @item -tno-android-cc
12215 @opindex tno-android-cc
12216 Disable compilation effects of @option{-mandroid}, i.e., do not enable
12217 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
12218 @option{-fno-rtti} by default.
12219
12220 @item -tno-android-ld
12221 @opindex tno-android-ld
12222 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
12223 linking options to the linker.
12224
12225 @end table
12226
12227 @node H8/300 Options
12228 @subsection H8/300 Options
12229
12230 These @samp{-m} options are defined for the H8/300 implementations:
12231
12232 @table @gcctabopt
12233 @item -mrelax
12234 @opindex mrelax
12235 Shorten some address references at link time, when possible; uses the
12236 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
12237 ld, Using ld}, for a fuller description.
12238
12239 @item -mh
12240 @opindex mh
12241 Generate code for the H8/300H@.
12242
12243 @item -ms
12244 @opindex ms
12245 Generate code for the H8S@.
12246
12247 @item -mn
12248 @opindex mn
12249 Generate code for the H8S and H8/300H in the normal mode.  This switch
12250 must be used either with @option{-mh} or @option{-ms}.
12251
12252 @item -ms2600
12253 @opindex ms2600
12254 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
12255
12256 @item -mint32
12257 @opindex mint32
12258 Make @code{int} data 32 bits by default.
12259
12260 @item -malign-300
12261 @opindex malign-300
12262 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
12263 The default for the H8/300H and H8S is to align longs and floats on 4
12264 byte boundaries.
12265 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
12266 This option has no effect on the H8/300.
12267 @end table
12268
12269 @node HPPA Options
12270 @subsection HPPA Options
12271 @cindex HPPA Options
12272
12273 These @samp{-m} options are defined for the HPPA family of computers:
12274
12275 @table @gcctabopt
12276 @item -march=@var{architecture-type}
12277 @opindex march
12278 Generate code for the specified architecture.  The choices for
12279 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
12280 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
12281 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
12282 architecture option for your machine.  Code compiled for lower numbered
12283 architectures will run on higher numbered architectures, but not the
12284 other way around.
12285
12286 @item -mpa-risc-1-0
12287 @itemx -mpa-risc-1-1
12288 @itemx -mpa-risc-2-0
12289 @opindex mpa-risc-1-0
12290 @opindex mpa-risc-1-1
12291 @opindex mpa-risc-2-0
12292 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
12293
12294 @item -mbig-switch
12295 @opindex mbig-switch
12296 Generate code suitable for big switch tables.  Use this option only if
12297 the assembler/linker complain about out of range branches within a switch
12298 table.
12299
12300 @item -mjump-in-delay
12301 @opindex mjump-in-delay
12302 Fill delay slots of function calls with unconditional jump instructions
12303 by modifying the return pointer for the function call to be the target
12304 of the conditional jump.
12305
12306 @item -mdisable-fpregs
12307 @opindex mdisable-fpregs
12308 Prevent floating point registers from being used in any manner.  This is
12309 necessary for compiling kernels which perform lazy context switching of
12310 floating point registers.  If you use this option and attempt to perform
12311 floating point operations, the compiler will abort.
12312
12313 @item -mdisable-indexing
12314 @opindex mdisable-indexing
12315 Prevent the compiler from using indexing address modes.  This avoids some
12316 rather obscure problems when compiling MIG generated code under MACH@.
12317
12318 @item -mno-space-regs
12319 @opindex mno-space-regs
12320 Generate code that assumes the target has no space registers.  This allows
12321 GCC to generate faster indirect calls and use unscaled index address modes.
12322
12323 Such code is suitable for level 0 PA systems and kernels.
12324
12325 @item -mfast-indirect-calls
12326 @opindex mfast-indirect-calls
12327 Generate code that assumes calls never cross space boundaries.  This
12328 allows GCC to emit code which performs faster indirect calls.
12329
12330 This option will not work in the presence of shared libraries or nested
12331 functions.
12332
12333 @item -mfixed-range=@var{register-range}
12334 @opindex mfixed-range
12335 Generate code treating the given register range as fixed registers.
12336 A fixed register is one that the register allocator can not use.  This is
12337 useful when compiling kernel code.  A register range is specified as
12338 two registers separated by a dash.  Multiple register ranges can be
12339 specified separated by a comma.
12340
12341 @item -mlong-load-store
12342 @opindex mlong-load-store
12343 Generate 3-instruction load and store sequences as sometimes required by
12344 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
12345 the HP compilers.
12346
12347 @item -mportable-runtime
12348 @opindex mportable-runtime
12349 Use the portable calling conventions proposed by HP for ELF systems.
12350
12351 @item -mgas
12352 @opindex mgas
12353 Enable the use of assembler directives only GAS understands.
12354
12355 @item -mschedule=@var{cpu-type}
12356 @opindex mschedule
12357 Schedule code according to the constraints for the machine type
12358 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
12359 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
12360 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
12361 proper scheduling option for your machine.  The default scheduling is
12362 @samp{8000}.
12363
12364 @item -mlinker-opt
12365 @opindex mlinker-opt
12366 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
12367 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
12368 linkers in which they give bogus error messages when linking some programs.
12369
12370 @item -msoft-float
12371 @opindex msoft-float
12372 Generate output containing library calls for floating point.
12373 @strong{Warning:} the requisite libraries are not available for all HPPA
12374 targets.  Normally the facilities of the machine's usual C compiler are
12375 used, but this cannot be done directly in cross-compilation.  You must make
12376 your own arrangements to provide suitable library functions for
12377 cross-compilation.
12378
12379 @option{-msoft-float} changes the calling convention in the output file;
12380 therefore, it is only useful if you compile @emph{all} of a program with
12381 this option.  In particular, you need to compile @file{libgcc.a}, the
12382 library that comes with GCC, with @option{-msoft-float} in order for
12383 this to work.
12384
12385 @item -msio
12386 @opindex msio
12387 Generate the predefine, @code{_SIO}, for server IO@.  The default is
12388 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
12389 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
12390 options are available under HP-UX and HI-UX@.
12391
12392 @item -mgnu-ld
12393 @opindex mgnu-ld
12394 Use GNU ld specific options.  This passes @option{-shared} to ld when
12395 building a shared library.  It is the default when GCC is configured,
12396 explicitly or implicitly, with the GNU linker.  This option does not
12397 have any affect on which ld is called, it only changes what parameters
12398 are passed to that ld.  The ld that is called is determined by the
12399 @option{--with-ld} configure option, GCC's program search path, and
12400 finally by the user's @env{PATH}.  The linker used by GCC can be printed
12401 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
12402 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12403
12404 @item -mhp-ld
12405 @opindex mhp-ld
12406 Use HP ld specific options.  This passes @option{-b} to ld when building
12407 a shared library and passes @option{+Accept TypeMismatch} to ld on all
12408 links.  It is the default when GCC is configured, explicitly or
12409 implicitly, with the HP linker.  This option does not have any affect on
12410 which ld is called, it only changes what parameters are passed to that
12411 ld.  The ld that is called is determined by the @option{--with-ld}
12412 configure option, GCC's program search path, and finally by the user's
12413 @env{PATH}.  The linker used by GCC can be printed using @samp{which
12414 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
12415 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12416
12417 @item -mlong-calls
12418 @opindex mno-long-calls
12419 Generate code that uses long call sequences.  This ensures that a call
12420 is always able to reach linker generated stubs.  The default is to generate
12421 long calls only when the distance from the call site to the beginning
12422 of the function or translation unit, as the case may be, exceeds a
12423 predefined limit set by the branch type being used.  The limits for
12424 normal calls are 7,600,000 and 240,000 bytes, respectively for the
12425 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
12426 240,000 bytes.
12427
12428 Distances are measured from the beginning of functions when using the
12429 @option{-ffunction-sections} option, or when using the @option{-mgas}
12430 and @option{-mno-portable-runtime} options together under HP-UX with
12431 the SOM linker.
12432
12433 It is normally not desirable to use this option as it will degrade
12434 performance.  However, it may be useful in large applications,
12435 particularly when partial linking is used to build the application.
12436
12437 The types of long calls used depends on the capabilities of the
12438 assembler and linker, and the type of code being generated.  The
12439 impact on systems that support long absolute calls, and long pic
12440 symbol-difference or pc-relative calls should be relatively small.
12441 However, an indirect call is used on 32-bit ELF systems in pic code
12442 and it is quite long.
12443
12444 @item -munix=@var{unix-std}
12445 @opindex march
12446 Generate compiler predefines and select a startfile for the specified
12447 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
12448 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
12449 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
12450 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
12451 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
12452 and later.
12453
12454 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
12455 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
12456 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
12457 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
12458 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
12459 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
12460
12461 It is @emph{important} to note that this option changes the interfaces
12462 for various library routines.  It also affects the operational behavior
12463 of the C library.  Thus, @emph{extreme} care is needed in using this
12464 option.
12465
12466 Library code that is intended to operate with more than one UNIX
12467 standard must test, set and restore the variable @var{__xpg4_extended_mask}
12468 as appropriate.  Most GNU software doesn't provide this capability.
12469
12470 @item -nolibdld
12471 @opindex nolibdld
12472 Suppress the generation of link options to search libdld.sl when the
12473 @option{-static} option is specified on HP-UX 10 and later.
12474
12475 @item -static
12476 @opindex static
12477 The HP-UX implementation of setlocale in libc has a dependency on
12478 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
12479 when the @option{-static} option is specified, special link options
12480 are needed to resolve this dependency.
12481
12482 On HP-UX 10 and later, the GCC driver adds the necessary options to
12483 link with libdld.sl when the @option{-static} option is specified.
12484 This causes the resulting binary to be dynamic.  On the 64-bit port,
12485 the linkers generate dynamic binaries by default in any case.  The
12486 @option{-nolibdld} option can be used to prevent the GCC driver from
12487 adding these link options.
12488
12489 @item -threads
12490 @opindex threads
12491 Add support for multithreading with the @dfn{dce thread} library
12492 under HP-UX@.  This option sets flags for both the preprocessor and
12493 linker.
12494 @end table
12495
12496 @node i386 and x86-64 Options
12497 @subsection Intel 386 and AMD x86-64 Options
12498 @cindex i386 Options
12499 @cindex x86-64 Options
12500 @cindex Intel 386 Options
12501 @cindex AMD x86-64 Options
12502
12503 These @samp{-m} options are defined for the i386 and x86-64 family of
12504 computers:
12505
12506 @table @gcctabopt
12507 @item -mtune=@var{cpu-type}
12508 @opindex mtune
12509 Tune to @var{cpu-type} everything applicable about the generated code, except
12510 for the ABI and the set of available instructions.  The choices for
12511 @var{cpu-type} are:
12512 @table @emph
12513 @item generic
12514 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
12515 If you know the CPU on which your code will run, then you should use
12516 the corresponding @option{-mtune} option instead of
12517 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
12518 of your application will have, then you should use this option.
12519
12520 As new processors are deployed in the marketplace, the behavior of this
12521 option will change.  Therefore, if you upgrade to a newer version of
12522 GCC, the code generated option will change to reflect the processors
12523 that were most common when that version of GCC was released.
12524
12525 There is no @option{-march=generic} option because @option{-march}
12526 indicates the instruction set the compiler can use, and there is no
12527 generic instruction set applicable to all processors.  In contrast,
12528 @option{-mtune} indicates the processor (or, in this case, collection of
12529 processors) for which the code is optimized.
12530 @item native
12531 This selects the CPU to tune for at compilation time by determining
12532 the processor type of the compiling machine.  Using @option{-mtune=native}
12533 will produce code optimized for the local machine under the constraints
12534 of the selected instruction set.  Using @option{-march=native} will
12535 enable all instruction subsets supported by the local machine (hence
12536 the result might not run on different machines).
12537 @item i386
12538 Original Intel's i386 CPU@.
12539 @item i486
12540 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
12541 @item i586, pentium
12542 Intel Pentium CPU with no MMX support.
12543 @item pentium-mmx
12544 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
12545 @item pentiumpro
12546 Intel PentiumPro CPU@.
12547 @item i686
12548 Same as @code{generic}, but when used as @code{march} option, PentiumPro
12549 instruction set will be used, so the code will run on all i686 family chips.
12550 @item pentium2
12551 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
12552 @item pentium3, pentium3m
12553 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
12554 support.
12555 @item pentium-m
12556 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
12557 support.  Used by Centrino notebooks.
12558 @item pentium4, pentium4m
12559 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
12560 @item prescott
12561 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
12562 set support.
12563 @item nocona
12564 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
12565 SSE2 and SSE3 instruction set support.
12566 @item core2
12567 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12568 instruction set support.
12569 @item corei7
12570 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
12571 and SSE4.2 instruction set support.
12572 @item corei7-avx
12573 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
12574 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
12575 @item core-avx-i
12576 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
12577 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
12578 set support.
12579 @item atom
12580 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12581 instruction set support.
12582 @item k6
12583 AMD K6 CPU with MMX instruction set support.
12584 @item k6-2, k6-3
12585 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
12586 @item athlon, athlon-tbird
12587 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
12588 support.
12589 @item athlon-4, athlon-xp, athlon-mp
12590 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
12591 instruction set support.
12592 @item k8, opteron, athlon64, athlon-fx
12593 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
12594 MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit instruction set extensions.)
12595 @item k8-sse3, opteron-sse3, athlon64-sse3
12596 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
12597 @item amdfam10, barcelona
12598 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
12599 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
12600 instruction set extensions.)
12601 @item winchip-c6
12602 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
12603 set support.
12604 @item winchip2
12605 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
12606 instruction set support.
12607 @item c3
12608 Via C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
12609 implemented for this chip.)
12610 @item c3-2
12611 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
12612 implemented for this chip.)
12613 @item geode
12614 Embedded AMD CPU with MMX and 3DNow!@: instruction set support.
12615 @end table
12616
12617 While picking a specific @var{cpu-type} will schedule things appropriately
12618 for that particular chip, the compiler will not generate any code that
12619 does not run on the i386 without the @option{-march=@var{cpu-type}} option
12620 being used.
12621
12622 @item -march=@var{cpu-type}
12623 @opindex march
12624 Generate instructions for the machine type @var{cpu-type}.  The choices
12625 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
12626 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
12627
12628 @item -mcpu=@var{cpu-type}
12629 @opindex mcpu
12630 A deprecated synonym for @option{-mtune}.
12631
12632 @item -mfpmath=@var{unit}
12633 @opindex mfpmath
12634 Generate floating point arithmetics for selected unit @var{unit}.  The choices
12635 for @var{unit} are:
12636
12637 @table @samp
12638 @item 387
12639 Use the standard 387 floating point coprocessor present majority of chips and
12640 emulated otherwise.  Code compiled with this option will run almost everywhere.
12641 The temporary results are computed in 80bit precision instead of precision
12642 specified by the type resulting in slightly different results compared to most
12643 of other chips.  See @option{-ffloat-store} for more detailed description.
12644
12645 This is the default choice for i386 compiler.
12646
12647 @item sse
12648 Use scalar floating point instructions present in the SSE instruction set.
12649 This instruction set is supported by Pentium3 and newer chips, in the AMD line
12650 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
12651 instruction set supports only single precision arithmetics, thus the double and
12652 extended precision arithmetics is still done using 387.  Later version, present
12653 only in Pentium4 and the future AMD x86-64 chips supports double precision
12654 arithmetics too.
12655
12656 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
12657 or @option{-msse2} switches to enable SSE extensions and make this option
12658 effective.  For the x86-64 compiler, these extensions are enabled by default.
12659
12660 The resulting code should be considerably faster in the majority of cases and avoid
12661 the numerical instability problems of 387 code, but may break some existing
12662 code that expects temporaries to be 80bit.
12663
12664 This is the default choice for the x86-64 compiler.
12665
12666 @item sse,387
12667 @itemx sse+387
12668 @itemx both
12669 Attempt to utilize both instruction sets at once.  This effectively double the
12670 amount of available registers and on chips with separate execution units for
12671 387 and SSE the execution resources too.  Use this option with care, as it is
12672 still experimental, because the GCC register allocator does not model separate
12673 functional units well resulting in instable performance.
12674 @end table
12675
12676 @item -masm=@var{dialect}
12677 @opindex masm=@var{dialect}
12678 Output asm instructions using selected @var{dialect}.  Supported
12679 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
12680 not support @samp{intel}.
12681
12682 @item -mieee-fp
12683 @itemx -mno-ieee-fp
12684 @opindex mieee-fp
12685 @opindex mno-ieee-fp
12686 Control whether or not the compiler uses IEEE floating point
12687 comparisons.  These handle correctly the case where the result of a
12688 comparison is unordered.
12689
12690 @item -msoft-float
12691 @opindex msoft-float
12692 Generate output containing library calls for floating point.
12693 @strong{Warning:} the requisite libraries are not part of GCC@.
12694 Normally the facilities of the machine's usual C compiler are used, but
12695 this can't be done directly in cross-compilation.  You must make your
12696 own arrangements to provide suitable library functions for
12697 cross-compilation.
12698
12699 On machines where a function returns floating point results in the 80387
12700 register stack, some floating point opcodes may be emitted even if
12701 @option{-msoft-float} is used.
12702
12703 @item -mno-fp-ret-in-387
12704 @opindex mno-fp-ret-in-387
12705 Do not use the FPU registers for return values of functions.
12706
12707 The usual calling convention has functions return values of types
12708 @code{float} and @code{double} in an FPU register, even if there
12709 is no FPU@.  The idea is that the operating system should emulate
12710 an FPU@.
12711
12712 The option @option{-mno-fp-ret-in-387} causes such values to be returned
12713 in ordinary CPU registers instead.
12714
12715 @item -mno-fancy-math-387
12716 @opindex mno-fancy-math-387
12717 Some 387 emulators do not support the @code{sin}, @code{cos} and
12718 @code{sqrt} instructions for the 387.  Specify this option to avoid
12719 generating those instructions.  This option is the default on FreeBSD,
12720 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
12721 indicates that the target CPU will always have an FPU and so the
12722 instruction will not need emulation.  As of revision 2.6.1, these
12723 instructions are not generated unless you also use the
12724 @option{-funsafe-math-optimizations} switch.
12725
12726 @item -malign-double
12727 @itemx -mno-align-double
12728 @opindex malign-double
12729 @opindex mno-align-double
12730 Control whether GCC aligns @code{double}, @code{long double}, and
12731 @code{long long} variables on a two word boundary or a one word
12732 boundary.  Aligning @code{double} variables on a two word boundary will
12733 produce code that runs somewhat faster on a @samp{Pentium} at the
12734 expense of more memory.
12735
12736 On x86-64, @option{-malign-double} is enabled by default.
12737
12738 @strong{Warning:} if you use the @option{-malign-double} switch,
12739 structures containing the above types will be aligned differently than
12740 the published application binary interface specifications for the 386
12741 and will not be binary compatible with structures in code compiled
12742 without that switch.
12743
12744 @item -m96bit-long-double
12745 @itemx -m128bit-long-double
12746 @opindex m96bit-long-double
12747 @opindex m128bit-long-double
12748 These switches control the size of @code{long double} type.  The i386
12749 application binary interface specifies the size to be 96 bits,
12750 so @option{-m96bit-long-double} is the default in 32 bit mode.
12751
12752 Modern architectures (Pentium and newer) would prefer @code{long double}
12753 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
12754 conforming to the ABI, this would not be possible.  So specifying a
12755 @option{-m128bit-long-double} will align @code{long double}
12756 to a 16 byte boundary by padding the @code{long double} with an additional
12757 32 bit zero.
12758
12759 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
12760 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
12761
12762 Notice that neither of these options enable any extra precision over the x87
12763 standard of 80 bits for a @code{long double}.
12764
12765 @strong{Warning:} if you override the default value for your target ABI, the
12766 structures and arrays containing @code{long double} variables will change
12767 their size as well as function calling convention for function taking
12768 @code{long double} will be modified.  Hence they will not be binary
12769 compatible with arrays or structures in code compiled without that switch.
12770
12771 @item -mlarge-data-threshold=@var{number}
12772 @opindex mlarge-data-threshold=@var{number}
12773 When @option{-mcmodel=medium} is specified, the data greater than
12774 @var{threshold} are placed in large data section.  This value must be the
12775 same across all object linked into the binary and defaults to 65535.
12776
12777 @item -mrtd
12778 @opindex mrtd
12779 Use a different function-calling convention, in which functions that
12780 take a fixed number of arguments return with the @code{ret} @var{num}
12781 instruction, which pops their arguments while returning.  This saves one
12782 instruction in the caller since there is no need to pop the arguments
12783 there.
12784
12785 You can specify that an individual function is called with this calling
12786 sequence with the function attribute @samp{stdcall}.  You can also
12787 override the @option{-mrtd} option by using the function attribute
12788 @samp{cdecl}.  @xref{Function Attributes}.
12789
12790 @strong{Warning:} this calling convention is incompatible with the one
12791 normally used on Unix, so you cannot use it if you need to call
12792 libraries compiled with the Unix compiler.
12793
12794 Also, you must provide function prototypes for all functions that
12795 take variable numbers of arguments (including @code{printf});
12796 otherwise incorrect code will be generated for calls to those
12797 functions.
12798
12799 In addition, seriously incorrect code will result if you call a
12800 function with too many arguments.  (Normally, extra arguments are
12801 harmlessly ignored.)
12802
12803 @item -mregparm=@var{num}
12804 @opindex mregparm
12805 Control how many registers are used to pass integer arguments.  By
12806 default, no registers are used to pass arguments, and at most 3
12807 registers can be used.  You can control this behavior for a specific
12808 function by using the function attribute @samp{regparm}.
12809 @xref{Function Attributes}.
12810
12811 @strong{Warning:} if you use this switch, and
12812 @var{num} is nonzero, then you must build all modules with the same
12813 value, including any libraries.  This includes the system libraries and
12814 startup modules.
12815
12816 @item -msseregparm
12817 @opindex msseregparm
12818 Use SSE register passing conventions for float and double arguments
12819 and return values.  You can control this behavior for a specific
12820 function by using the function attribute @samp{sseregparm}.
12821 @xref{Function Attributes}.
12822
12823 @strong{Warning:} if you use this switch then you must build all
12824 modules with the same value, including any libraries.  This includes
12825 the system libraries and startup modules.
12826
12827 @item -mvect8-ret-in-mem
12828 @opindex mvect8-ret-in-mem
12829 Return 8-byte vectors in memory instead of MMX registers.  This is the
12830 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
12831 Studio compilers until version 12.  Later compiler versions (starting
12832 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
12833 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
12834 you need to remain compatible with existing code produced by those
12835 previous compiler versions or older versions of GCC.
12836
12837 @item -mpc32
12838 @itemx -mpc64
12839 @itemx -mpc80
12840 @opindex mpc32
12841 @opindex mpc64
12842 @opindex mpc80
12843
12844 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
12845 is specified, the significands of results of floating-point operations are
12846 rounded to 24 bits (single precision); @option{-mpc64} rounds the
12847 significands of results of floating-point operations to 53 bits (double
12848 precision) and @option{-mpc80} rounds the significands of results of
12849 floating-point operations to 64 bits (extended double precision), which is
12850 the default.  When this option is used, floating-point operations in higher
12851 precisions are not available to the programmer without setting the FPU
12852 control word explicitly.
12853
12854 Setting the rounding of floating-point operations to less than the default
12855 80 bits can speed some programs by 2% or more.  Note that some mathematical
12856 libraries assume that extended precision (80 bit) floating-point operations
12857 are enabled by default; routines in such libraries could suffer significant
12858 loss of accuracy, typically through so-called "catastrophic cancellation",
12859 when this option is used to set the precision to less than extended precision.
12860
12861 @item -mstackrealign
12862 @opindex mstackrealign
12863 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
12864 option will generate an alternate prologue and epilogue that realigns the
12865 runtime stack if necessary.  This supports mixing legacy codes that keep
12866 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
12867 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
12868 applicable to individual functions.
12869
12870 @item -mpreferred-stack-boundary=@var{num}
12871 @opindex mpreferred-stack-boundary
12872 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
12873 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
12874 the default is 4 (16 bytes or 128 bits).
12875
12876 @item -mincoming-stack-boundary=@var{num}
12877 @opindex mincoming-stack-boundary
12878 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
12879 boundary.  If @option{-mincoming-stack-boundary} is not specified,
12880 the one specified by @option{-mpreferred-stack-boundary} will be used.
12881
12882 On Pentium and PentiumPro, @code{double} and @code{long double} values
12883 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
12884 suffer significant run time performance penalties.  On Pentium III, the
12885 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
12886 properly if it is not 16 byte aligned.
12887
12888 To ensure proper alignment of this values on the stack, the stack boundary
12889 must be as aligned as that required by any value stored on the stack.
12890 Further, every function must be generated such that it keeps the stack
12891 aligned.  Thus calling a function compiled with a higher preferred
12892 stack boundary from a function compiled with a lower preferred stack
12893 boundary will most likely misalign the stack.  It is recommended that
12894 libraries that use callbacks always use the default setting.
12895
12896 This extra alignment does consume extra stack space, and generally
12897 increases code size.  Code that is sensitive to stack space usage, such
12898 as embedded systems and operating system kernels, may want to reduce the
12899 preferred alignment to @option{-mpreferred-stack-boundary=2}.
12900
12901 @item -mmmx
12902 @itemx -mno-mmx
12903 @itemx -msse
12904 @itemx -mno-sse
12905 @itemx -msse2
12906 @itemx -mno-sse2
12907 @itemx -msse3
12908 @itemx -mno-sse3
12909 @itemx -mssse3
12910 @itemx -mno-ssse3
12911 @itemx -msse4.1
12912 @need 800
12913 @itemx -mno-sse4.1
12914 @itemx -msse4.2
12915 @itemx -mno-sse4.2
12916 @itemx -msse4
12917 @itemx -mno-sse4
12918 @itemx -mavx
12919 @itemx -mno-avx
12920 @itemx -mavx2
12921 @itemx -mno-avx2
12922 @itemx -maes
12923 @itemx -mno-aes
12924 @itemx -mpclmul
12925 @need 800
12926 @itemx -mno-pclmul
12927 @itemx -mfsgsbase
12928 @itemx -mno-fsgsbase
12929 @itemx -mrdrnd
12930 @itemx -mno-rdrnd
12931 @itemx -mf16c
12932 @itemx -mno-f16c
12933 @itemx -mfma
12934 @itemx -mno-fma
12935 @itemx -msse4a
12936 @itemx -mno-sse4a
12937 @itemx -mfma4
12938 @need 800
12939 @itemx -mno-fma4
12940 @itemx -mxop
12941 @itemx -mno-xop
12942 @itemx -mlwp
12943 @itemx -mno-lwp
12944 @itemx -m3dnow
12945 @itemx -mno-3dnow
12946 @itemx -mpopcnt
12947 @itemx -mno-popcnt
12948 @itemx -mabm
12949 @itemx -mno-abm
12950 @itemx -mbmi
12951 @itemx -mbmi2
12952 @itemx -mno-bmi
12953 @itemx -mno-bmi2
12954 @itemx -mlzcnt
12955 @itemx -mno-lzcnt
12956 @itemx -mtbm
12957 @itemx -mno-tbm
12958 @opindex mmmx
12959 @opindex mno-mmx
12960 @opindex msse
12961 @opindex mno-sse
12962 @opindex m3dnow
12963 @opindex mno-3dnow
12964 These switches enable or disable the use of instructions in the MMX, SSE,
12965 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, F16C,
12966 FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2, LZCNT or 3DNow!
12967 @: extended instruction sets.
12968 These extensions are also available as built-in functions: see
12969 @ref{X86 Built-in Functions}, for details of the functions enabled and
12970 disabled by these switches.
12971
12972 To have SSE/SSE2 instructions generated automatically from floating-point
12973 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
12974
12975 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
12976 generates new AVX instructions or AVX equivalence for all SSEx instructions
12977 when needed.
12978
12979 These options will enable GCC to use these extended instructions in
12980 generated code, even without @option{-mfpmath=sse}.  Applications which
12981 perform runtime CPU detection must compile separate files for each
12982 supported architecture, using the appropriate flags.  In particular,
12983 the file containing the CPU detection code should be compiled without
12984 these options.
12985
12986 @item -mcld
12987 @opindex mcld
12988 This option instructs GCC to emit a @code{cld} instruction in the prologue
12989 of functions that use string instructions.  String instructions depend on
12990 the DF flag to select between autoincrement or autodecrement mode.  While the
12991 ABI specifies the DF flag to be cleared on function entry, some operating
12992 systems violate this specification by not clearing the DF flag in their
12993 exception dispatchers.  The exception handler can be invoked with the DF flag
12994 set which leads to wrong direction mode, when string instructions are used.
12995 This option can be enabled by default on 32-bit x86 targets by configuring
12996 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
12997 instructions can be suppressed with the @option{-mno-cld} compiler option
12998 in this case.
12999
13000 @item -mvzeroupper
13001 @opindex mvzeroupper
13002 This option instructs GCC to emit a @code{vzeroupper} instruction
13003 before a transfer of control flow out of the function to minimize
13004 AVX to SSE transition penalty as well as remove unnecessary zeroupper
13005 intrinsics.
13006
13007 @item -mcx16
13008 @opindex mcx16
13009 This option will enable GCC to use CMPXCHG16B instruction in generated code.
13010 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
13011 data types.  This is useful for high resolution counters that could be updated
13012 by multiple processors (or cores).  This instruction is generated as part of
13013 atomic built-in functions: see @ref{Atomic Builtins} for details.
13014
13015 @item -msahf
13016 @opindex msahf
13017 This option will enable GCC to use SAHF instruction in generated 64-bit code.
13018 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
13019 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
13020 SAHF are load and store instructions, respectively, for certain status flags.
13021 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
13022 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
13023
13024 @item -mmovbe
13025 @opindex mmovbe
13026 This option will enable GCC to use movbe instruction to implement
13027 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
13028
13029 @item -mcrc32
13030 @opindex mcrc32
13031 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
13032 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
13033 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
13034
13035 @item -mrecip
13036 @opindex mrecip
13037 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
13038 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
13039 to increase precision instead of DIVSS and SQRTSS (and their vectorized
13040 variants) for single precision floating point arguments.  These instructions
13041 are generated only when @option{-funsafe-math-optimizations} is enabled
13042 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
13043 Note that while the throughput of the sequence is higher than the throughput
13044 of the non-reciprocal instruction, the precision of the sequence can be
13045 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
13046
13047 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of RSQRTSS
13048 (or RSQRTPS) already with @option{-ffast-math} (or the above option
13049 combination), and doesn't need @option{-mrecip}.
13050
13051 Also note that GCC emits the above sequence with additional Newton-Raphson step
13052 for vectorized single float division and vectorized @code{sqrtf(@var{x})}
13053 already with @option{-ffast-math} (or the above option combination), and
13054 doesn't need @option{-mrecip}.
13055
13056 @item -mrecip=@var{opt}
13057 @opindex mrecip=opt
13058 This option allows to control which reciprocal estimate instructions
13059 may be used.  @var{opt} is a comma separated list of options, that may
13060 be preceded by a @code{!} to invert the option:
13061 @code{all}: enable all estimate instructions,
13062 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
13063 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip},
13064 @code{div}: enable the approximation for scalar division,
13065 @code{vec-div}: enable the approximation for vectorized division,
13066 @code{sqrt}: enable the approximation for scalar square root,
13067 @code{vec-sqrt}: enable the approximation for vectorized square root.
13068
13069 So for example, @option{-mrecip=all,!sqrt} would enable
13070 all of the reciprocal approximations, except for square root.
13071
13072 @item -mveclibabi=@var{type}
13073 @opindex mveclibabi
13074 Specifies the ABI type to use for vectorizing intrinsics using an
13075 external library.  Supported types are @code{svml} for the Intel short
13076 vector math library and @code{acml} for the AMD math core library style
13077 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
13078 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
13079 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
13080 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
13081 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
13082 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
13083 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
13084 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
13085 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
13086 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
13087 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
13088 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
13089 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
13090 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
13091 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
13092 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
13093 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
13094 compatible library will have to be specified at link time.
13095
13096 @item -mabi=@var{name}
13097 @opindex mabi
13098 Generate code for the specified calling convention.  Permissible values
13099 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
13100 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
13101 ABI when targeting Windows.  On all other systems, the default is the
13102 SYSV ABI.  You can control this behavior for a specific function by
13103 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
13104 @xref{Function Attributes}.
13105
13106 @item -mtls-dialect=@var{type}
13107 @opindex mtls-dialect
13108 Generate code to access thread-local storage using the @samp{gnu} or
13109 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
13110 @samp{gnu2} is more efficient, but it may add compile- and run-time
13111 requirements that cannot be satisfied on all systems.
13112
13113 @item -mpush-args
13114 @itemx -mno-push-args
13115 @opindex mpush-args
13116 @opindex mno-push-args
13117 Use PUSH operations to store outgoing parameters.  This method is shorter
13118 and usually equally fast as method using SUB/MOV operations and is enabled
13119 by default.  In some cases disabling it may improve performance because of
13120 improved scheduling and reduced dependencies.
13121
13122 @item -maccumulate-outgoing-args
13123 @opindex maccumulate-outgoing-args
13124 If enabled, the maximum amount of space required for outgoing arguments will be
13125 computed in the function prologue.  This is faster on most modern CPUs
13126 because of reduced dependencies, improved scheduling and reduced stack usage
13127 when preferred stack boundary is not equal to 2.  The drawback is a notable
13128 increase in code size.  This switch implies @option{-mno-push-args}.
13129
13130 @item -mthreads
13131 @opindex mthreads
13132 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
13133 on thread-safe exception handling must compile and link all code with the
13134 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
13135 @option{-D_MT}; when linking, it links in a special thread helper library
13136 @option{-lmingwthrd} which cleans up per thread exception handling data.
13137
13138 @item -mno-align-stringops
13139 @opindex mno-align-stringops
13140 Do not align destination of inlined string operations.  This switch reduces
13141 code size and improves performance in case the destination is already aligned,
13142 but GCC doesn't know about it.
13143
13144 @item -minline-all-stringops
13145 @opindex minline-all-stringops
13146 By default GCC inlines string operations only when destination is known to be
13147 aligned at least to 4 byte boundary.  This enables more inlining, increase code
13148 size, but may improve performance of code that depends on fast memcpy, strlen
13149 and memset for short lengths.
13150
13151 @item -minline-stringops-dynamically
13152 @opindex minline-stringops-dynamically
13153 For string operation of unknown size, inline runtime checks so for small
13154 blocks inline code is used, while for large blocks library call is used.
13155
13156 @item -mstringop-strategy=@var{alg}
13157 @opindex mstringop-strategy=@var{alg}
13158 Overwrite internal decision heuristic about particular algorithm to inline
13159 string operation with.  The allowed values are @code{rep_byte},
13160 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
13161 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
13162 expanding inline loop, @code{libcall} for always expanding library call.
13163
13164 @item -momit-leaf-frame-pointer
13165 @opindex momit-leaf-frame-pointer
13166 Don't keep the frame pointer in a register for leaf functions.  This
13167 avoids the instructions to save, set up and restore frame pointers and
13168 makes an extra register available in leaf functions.  The option
13169 @option{-fomit-frame-pointer} removes the frame pointer for all functions
13170 which might make debugging harder.
13171
13172 @item -mtls-direct-seg-refs
13173 @itemx -mno-tls-direct-seg-refs
13174 @opindex mtls-direct-seg-refs
13175 Controls whether TLS variables may be accessed with offsets from the
13176 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
13177 or whether the thread base pointer must be added.  Whether or not this
13178 is legal depends on the operating system, and whether it maps the
13179 segment to cover the entire TLS area.
13180
13181 For systems that use GNU libc, the default is on.
13182
13183 @item -msse2avx
13184 @itemx -mno-sse2avx
13185 @opindex msse2avx
13186 Specify that the assembler should encode SSE instructions with VEX
13187 prefix.  The option @option{-mavx} turns this on by default.
13188
13189 @item -mfentry
13190 @itemx -mno-fentry
13191 @opindex mfentry
13192 If profiling is active @option{-pg} put the profiling
13193 counter call before prologue.
13194 Note: On x86 architectures the attribute @code{ms_hook_prologue}
13195 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
13196
13197 @item -m8bit-idiv
13198 @itemx -mno-8bit-idiv
13199 @opindex 8bit-idiv
13200 On some processors, like Intel Atom, 8bit unsigned integer divide is
13201 much faster than 32bit/64bit integer divide.  This option will generate a
13202 runt-time check.  If both dividend and divisor are within range of 0
13203 to 255, 8bit unsigned integer divide will be used instead of
13204 32bit/64bit integer divide.
13205
13206 @item -mavx256-split-unaligned-load
13207 @item -mavx256-split-unaligned-store
13208 @opindex avx256-split-unaligned-load
13209 @opindex avx256-split-unaligned-store
13210 Split 32-byte AVX unaligned load and store.
13211
13212 @end table
13213
13214 These @samp{-m} switches are supported in addition to the above
13215 on AMD x86-64 processors in 64-bit environments.
13216
13217 @table @gcctabopt
13218 @item -m32
13219 @itemx -m64
13220 @itemx -mx32
13221 @opindex m32
13222 @opindex m64
13223 @opindex mx32
13224 Generate code for a 32-bit or 64-bit environment.
13225 The @option{-m32} option sets int, long and pointer to 32 bits and
13226 generates code that runs on any i386 system.
13227 The @option{-m64} option sets int to 32 bits and long and pointer
13228 to 64 bits and generates code for AMD's x86-64 architecture.
13229 The @option{-mx32} option sets int, long and pointer to 32 bits and
13230 generates code for AMD's x86-64 architecture.
13231 For darwin only the @option{-m64} option turns off the @option{-fno-pic}
13232 and @option{-mdynamic-no-pic} options.
13233
13234 @item -mno-red-zone
13235 @opindex mno-red-zone
13236 Do not use a so called red zone for x86-64 code.  The red zone is mandated
13237 by the x86-64 ABI, it is a 128-byte area beyond the location of the
13238 stack pointer that will not be modified by signal or interrupt handlers
13239 and therefore can be used for temporary data without adjusting the stack
13240 pointer.  The flag @option{-mno-red-zone} disables this red zone.
13241
13242 @item -mcmodel=small
13243 @opindex mcmodel=small
13244 Generate code for the small code model: the program and its symbols must
13245 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
13246 Programs can be statically or dynamically linked.  This is the default
13247 code model.
13248
13249 @item -mcmodel=kernel
13250 @opindex mcmodel=kernel
13251 Generate code for the kernel code model.  The kernel runs in the
13252 negative 2 GB of the address space.
13253 This model has to be used for Linux kernel code.
13254
13255 @item -mcmodel=medium
13256 @opindex mcmodel=medium
13257 Generate code for the medium model: The program is linked in the lower 2
13258 GB of the address space.  Small symbols are also placed there.  Symbols
13259 with sizes larger than @option{-mlarge-data-threshold} are put into
13260 large data or bss sections and can be located above 2GB.  Programs can
13261 be statically or dynamically linked.
13262
13263 @item -mcmodel=large
13264 @opindex mcmodel=large
13265 Generate code for the large model: This model makes no assumptions
13266 about addresses and sizes of sections.
13267 @end table
13268
13269 @node i386 and x86-64 Windows Options
13270 @subsection i386 and x86-64 Windows Options
13271 @cindex i386 and x86-64 Windows Options
13272
13273 These additional options are available for Windows targets:
13274
13275 @table @gcctabopt
13276 @item -mconsole
13277 @opindex mconsole
13278 This option is available for Cygwin and MinGW targets.  It
13279 specifies that a console application is to be generated, by
13280 instructing the linker to set the PE header subsystem type
13281 required for console applications.
13282 This is the default behavior for Cygwin and MinGW targets.
13283
13284 @item -mdll
13285 @opindex mdll
13286 This option is available for Cygwin and MinGW targets.  It
13287 specifies that a DLL - a dynamic link library - is to be
13288 generated, enabling the selection of the required runtime
13289 startup object and entry point.
13290
13291 @item -mnop-fun-dllimport
13292 @opindex mnop-fun-dllimport
13293 This option is available for Cygwin and MinGW targets.  It
13294 specifies that the dllimport attribute should be ignored.
13295
13296 @item -mthread
13297 @opindex mthread
13298 This option is available for MinGW targets. It specifies
13299 that MinGW-specific thread support is to be used.
13300
13301 @item -municode
13302 @opindex municode
13303 This option is available for mingw-w64 targets.  It specifies
13304 that the UNICODE macro is getting pre-defined and that the
13305 unicode capable runtime startup code is chosen.
13306
13307 @item -mwin32
13308 @opindex mwin32
13309 This option is available for Cygwin and MinGW targets.  It
13310 specifies that the typical Windows pre-defined macros are to
13311 be set in the pre-processor, but does not influence the choice
13312 of runtime library/startup code.
13313
13314 @item -mwindows
13315 @opindex mwindows
13316 This option is available for Cygwin and MinGW targets.  It
13317 specifies that a GUI application is to be generated by
13318 instructing the linker to set the PE header subsystem type
13319 appropriately.
13320
13321 @item -fno-set-stack-executable
13322 @opindex fno-set-stack-executable
13323 This option is available for MinGW targets. It specifies that
13324 the executable flag for stack used by nested functions isn't
13325 set. This is necessary for binaries running in kernel mode of
13326 Windows, as there the user32 API, which is used to set executable
13327 privileges, isn't available.
13328
13329 @item -mpe-aligned-commons
13330 @opindex mpe-aligned-commons
13331 This option is available for Cygwin and MinGW targets.  It
13332 specifies that the GNU extension to the PE file format that
13333 permits the correct alignment of COMMON variables should be
13334 used when generating code.  It will be enabled by default if
13335 GCC detects that the target assembler found during configuration
13336 supports the feature.
13337 @end table
13338
13339 See also under @ref{i386 and x86-64 Options} for standard options.
13340
13341 @node IA-64 Options
13342 @subsection IA-64 Options
13343 @cindex IA-64 Options
13344
13345 These are the @samp{-m} options defined for the Intel IA-64 architecture.
13346
13347 @table @gcctabopt
13348 @item -mbig-endian
13349 @opindex mbig-endian
13350 Generate code for a big endian target.  This is the default for HP-UX@.
13351
13352 @item -mlittle-endian
13353 @opindex mlittle-endian
13354 Generate code for a little endian target.  This is the default for AIX5
13355 and GNU/Linux.
13356
13357 @item -mgnu-as
13358 @itemx -mno-gnu-as
13359 @opindex mgnu-as
13360 @opindex mno-gnu-as
13361 Generate (or don't) code for the GNU assembler.  This is the default.
13362 @c Also, this is the default if the configure option @option{--with-gnu-as}
13363 @c is used.
13364
13365 @item -mgnu-ld
13366 @itemx -mno-gnu-ld
13367 @opindex mgnu-ld
13368 @opindex mno-gnu-ld
13369 Generate (or don't) code for the GNU linker.  This is the default.
13370 @c Also, this is the default if the configure option @option{--with-gnu-ld}
13371 @c is used.
13372
13373 @item -mno-pic
13374 @opindex mno-pic
13375 Generate code that does not use a global pointer register.  The result
13376 is not position independent code, and violates the IA-64 ABI@.
13377
13378 @item -mvolatile-asm-stop
13379 @itemx -mno-volatile-asm-stop
13380 @opindex mvolatile-asm-stop
13381 @opindex mno-volatile-asm-stop
13382 Generate (or don't) a stop bit immediately before and after volatile asm
13383 statements.
13384
13385 @item -mregister-names
13386 @itemx -mno-register-names
13387 @opindex mregister-names
13388 @opindex mno-register-names
13389 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
13390 the stacked registers.  This may make assembler output more readable.
13391
13392 @item -mno-sdata
13393 @itemx -msdata
13394 @opindex mno-sdata
13395 @opindex msdata
13396 Disable (or enable) optimizations that use the small data section.  This may
13397 be useful for working around optimizer bugs.
13398
13399 @item -mconstant-gp
13400 @opindex mconstant-gp
13401 Generate code that uses a single constant global pointer value.  This is
13402 useful when compiling kernel code.
13403
13404 @item -mauto-pic
13405 @opindex mauto-pic
13406 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
13407 This is useful when compiling firmware code.
13408
13409 @item -minline-float-divide-min-latency
13410 @opindex minline-float-divide-min-latency
13411 Generate code for inline divides of floating point values
13412 using the minimum latency algorithm.
13413
13414 @item -minline-float-divide-max-throughput
13415 @opindex minline-float-divide-max-throughput
13416 Generate code for inline divides of floating point values
13417 using the maximum throughput algorithm.
13418
13419 @item -mno-inline-float-divide
13420 @opindex mno-inline-float-divide
13421 Do not generate inline code for divides of floating point values.
13422
13423 @item -minline-int-divide-min-latency
13424 @opindex minline-int-divide-min-latency
13425 Generate code for inline divides of integer values
13426 using the minimum latency algorithm.
13427
13428 @item -minline-int-divide-max-throughput
13429 @opindex minline-int-divide-max-throughput
13430 Generate code for inline divides of integer values
13431 using the maximum throughput algorithm.
13432
13433 @item -mno-inline-int-divide
13434 @opindex mno-inline-int-divide
13435 Do not generate inline code for divides of integer values.
13436
13437 @item -minline-sqrt-min-latency
13438 @opindex minline-sqrt-min-latency
13439 Generate code for inline square roots
13440 using the minimum latency algorithm.
13441
13442 @item -minline-sqrt-max-throughput
13443 @opindex minline-sqrt-max-throughput
13444 Generate code for inline square roots
13445 using the maximum throughput algorithm.
13446
13447 @item -mno-inline-sqrt
13448 @opindex mno-inline-sqrt
13449 Do not generate inline code for sqrt.
13450
13451 @item -mfused-madd
13452 @itemx -mno-fused-madd
13453 @opindex mfused-madd
13454 @opindex mno-fused-madd
13455 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
13456 instructions.  The default is to use these instructions.
13457
13458 @item -mno-dwarf2-asm
13459 @itemx -mdwarf2-asm
13460 @opindex mno-dwarf2-asm
13461 @opindex mdwarf2-asm
13462 Don't (or do) generate assembler code for the DWARF2 line number debugging
13463 info.  This may be useful when not using the GNU assembler.
13464
13465 @item -mearly-stop-bits
13466 @itemx -mno-early-stop-bits
13467 @opindex mearly-stop-bits
13468 @opindex mno-early-stop-bits
13469 Allow stop bits to be placed earlier than immediately preceding the
13470 instruction that triggered the stop bit.  This can improve instruction
13471 scheduling, but does not always do so.
13472
13473 @item -mfixed-range=@var{register-range}
13474 @opindex mfixed-range
13475 Generate code treating the given register range as fixed registers.
13476 A fixed register is one that the register allocator can not use.  This is
13477 useful when compiling kernel code.  A register range is specified as
13478 two registers separated by a dash.  Multiple register ranges can be
13479 specified separated by a comma.
13480
13481 @item -mtls-size=@var{tls-size}
13482 @opindex mtls-size
13483 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
13484 64.
13485
13486 @item -mtune=@var{cpu-type}
13487 @opindex mtune
13488 Tune the instruction scheduling for a particular CPU, Valid values are
13489 itanium, itanium1, merced, itanium2, and mckinley.
13490
13491 @item -milp32
13492 @itemx -mlp64
13493 @opindex milp32
13494 @opindex mlp64
13495 Generate code for a 32-bit or 64-bit environment.
13496 The 32-bit environment sets int, long and pointer to 32 bits.
13497 The 64-bit environment sets int to 32 bits and long and pointer
13498 to 64 bits.  These are HP-UX specific flags.
13499
13500 @item -mno-sched-br-data-spec
13501 @itemx -msched-br-data-spec
13502 @opindex mno-sched-br-data-spec
13503 @opindex msched-br-data-spec
13504 (Dis/En)able data speculative scheduling before reload.
13505 This will result in generation of the ld.a instructions and
13506 the corresponding check instructions (ld.c / chk.a).
13507 The default is 'disable'.
13508
13509 @item -msched-ar-data-spec
13510 @itemx -mno-sched-ar-data-spec
13511 @opindex msched-ar-data-spec
13512 @opindex mno-sched-ar-data-spec
13513 (En/Dis)able data speculative scheduling after reload.
13514 This will result in generation of the ld.a instructions and
13515 the corresponding check instructions (ld.c / chk.a).
13516 The default is 'enable'.
13517
13518 @item -mno-sched-control-spec
13519 @itemx -msched-control-spec
13520 @opindex mno-sched-control-spec
13521 @opindex msched-control-spec
13522 (Dis/En)able control speculative scheduling.  This feature is
13523 available only during region scheduling (i.e.@: before reload).
13524 This will result in generation of the ld.s instructions and
13525 the corresponding check instructions chk.s .
13526 The default is 'disable'.
13527
13528 @item -msched-br-in-data-spec
13529 @itemx -mno-sched-br-in-data-spec
13530 @opindex msched-br-in-data-spec
13531 @opindex mno-sched-br-in-data-spec
13532 (En/Dis)able speculative scheduling of the instructions that
13533 are dependent on the data speculative loads before reload.
13534 This is effective only with @option{-msched-br-data-spec} enabled.
13535 The default is 'enable'.
13536
13537 @item -msched-ar-in-data-spec
13538 @itemx -mno-sched-ar-in-data-spec
13539 @opindex msched-ar-in-data-spec
13540 @opindex mno-sched-ar-in-data-spec
13541 (En/Dis)able speculative scheduling of the instructions that
13542 are dependent on the data speculative loads after reload.
13543 This is effective only with @option{-msched-ar-data-spec} enabled.
13544 The default is 'enable'.
13545
13546 @item -msched-in-control-spec
13547 @itemx -mno-sched-in-control-spec
13548 @opindex msched-in-control-spec
13549 @opindex mno-sched-in-control-spec
13550 (En/Dis)able speculative scheduling of the instructions that
13551 are dependent on the control speculative loads.
13552 This is effective only with @option{-msched-control-spec} enabled.
13553 The default is 'enable'.
13554
13555 @item -mno-sched-prefer-non-data-spec-insns
13556 @itemx -msched-prefer-non-data-spec-insns
13557 @opindex mno-sched-prefer-non-data-spec-insns
13558 @opindex msched-prefer-non-data-spec-insns
13559 If enabled, data speculative instructions will be chosen for schedule
13560 only if there are no other choices at the moment.  This will make
13561 the use of the data speculation much more conservative.
13562 The default is 'disable'.
13563
13564 @item -mno-sched-prefer-non-control-spec-insns
13565 @itemx -msched-prefer-non-control-spec-insns
13566 @opindex mno-sched-prefer-non-control-spec-insns
13567 @opindex msched-prefer-non-control-spec-insns
13568 If enabled, control speculative instructions will be chosen for schedule
13569 only if there are no other choices at the moment.  This will make
13570 the use of the control speculation much more conservative.
13571 The default is 'disable'.
13572
13573 @item -mno-sched-count-spec-in-critical-path
13574 @itemx -msched-count-spec-in-critical-path
13575 @opindex mno-sched-count-spec-in-critical-path
13576 @opindex msched-count-spec-in-critical-path
13577 If enabled, speculative dependencies will be considered during
13578 computation of the instructions priorities.  This will make the use of the
13579 speculation a bit more conservative.
13580 The default is 'disable'.
13581
13582 @item -msched-spec-ldc
13583 @opindex msched-spec-ldc
13584 Use a simple data speculation check.  This option is on by default.
13585
13586 @item -msched-control-spec-ldc
13587 @opindex msched-spec-ldc
13588 Use a simple check for control speculation.  This option is on by default.
13589
13590 @item -msched-stop-bits-after-every-cycle
13591 @opindex msched-stop-bits-after-every-cycle
13592 Place a stop bit after every cycle when scheduling.  This option is on
13593 by default.
13594
13595 @item -msched-fp-mem-deps-zero-cost
13596 @opindex msched-fp-mem-deps-zero-cost
13597 Assume that floating-point stores and loads are not likely to cause a conflict
13598 when placed into the same instruction group.  This option is disabled by
13599 default.
13600
13601 @item -msel-sched-dont-check-control-spec
13602 @opindex msel-sched-dont-check-control-spec
13603 Generate checks for control speculation in selective scheduling.
13604 This flag is disabled by default.
13605
13606 @item -msched-max-memory-insns=@var{max-insns}
13607 @opindex msched-max-memory-insns
13608 Limit on the number of memory insns per instruction group, giving lower
13609 priority to subsequent memory insns attempting to schedule in the same
13610 instruction group. Frequently useful to prevent cache bank conflicts.
13611 The default value is 1.
13612
13613 @item -msched-max-memory-insns-hard-limit
13614 @opindex msched-max-memory-insns-hard-limit
13615 Disallow more than `msched-max-memory-insns' in instruction group.
13616 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
13617 when limit is reached but may still schedule memory operations.
13618
13619 @end table
13620
13621 @node IA-64/VMS Options
13622 @subsection IA-64/VMS Options
13623
13624 These @samp{-m} options are defined for the IA-64/VMS implementations:
13625
13626 @table @gcctabopt
13627 @item -mvms-return-codes
13628 @opindex mvms-return-codes
13629 Return VMS condition codes from main. The default is to return POSIX
13630 style condition (e.g.@ error) codes.
13631
13632 @item -mdebug-main=@var{prefix}
13633 @opindex mdebug-main=@var{prefix}
13634 Flag the first routine whose name starts with @var{prefix} as the main
13635 routine for the debugger.
13636
13637 @item -mmalloc64
13638 @opindex mmalloc64
13639 Default to 64bit memory allocation routines.
13640 @end table
13641
13642 @node LM32 Options
13643 @subsection LM32 Options
13644 @cindex LM32 options
13645
13646 These @option{-m} options are defined for the Lattice Mico32 architecture:
13647
13648 @table @gcctabopt
13649 @item -mbarrel-shift-enabled
13650 @opindex mbarrel-shift-enabled
13651 Enable barrel-shift instructions.
13652
13653 @item -mdivide-enabled
13654 @opindex mdivide-enabled
13655 Enable divide and modulus instructions.
13656
13657 @item -mmultiply-enabled
13658 @opindex multiply-enabled
13659 Enable multiply instructions.
13660
13661 @item -msign-extend-enabled
13662 @opindex msign-extend-enabled
13663 Enable sign extend instructions.
13664
13665 @item -muser-enabled
13666 @opindex muser-enabled
13667 Enable user-defined instructions.
13668
13669 @end table
13670
13671 @node M32C Options
13672 @subsection M32C Options
13673 @cindex M32C options
13674
13675 @table @gcctabopt
13676 @item -mcpu=@var{name}
13677 @opindex mcpu=
13678 Select the CPU for which code is generated.  @var{name} may be one of
13679 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
13680 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
13681 the M32C/80 series.
13682
13683 @item -msim
13684 @opindex msim
13685 Specifies that the program will be run on the simulator.  This causes
13686 an alternate runtime library to be linked in which supports, for
13687 example, file I/O@.  You must not use this option when generating
13688 programs that will run on real hardware; you must provide your own
13689 runtime library for whatever I/O functions are needed.
13690
13691 @item -memregs=@var{number}
13692 @opindex memregs=
13693 Specifies the number of memory-based pseudo-registers GCC will use
13694 during code generation.  These pseudo-registers will be used like real
13695 registers, so there is a tradeoff between GCC's ability to fit the
13696 code into available registers, and the performance penalty of using
13697 memory instead of registers.  Note that all modules in a program must
13698 be compiled with the same value for this option.  Because of that, you
13699 must not use this option with the default runtime libraries gcc
13700 builds.
13701
13702 @end table
13703
13704 @node M32R/D Options
13705 @subsection M32R/D Options
13706 @cindex M32R/D options
13707
13708 These @option{-m} options are defined for Renesas M32R/D architectures:
13709
13710 @table @gcctabopt
13711 @item -m32r2
13712 @opindex m32r2
13713 Generate code for the M32R/2@.
13714
13715 @item -m32rx
13716 @opindex m32rx
13717 Generate code for the M32R/X@.
13718
13719 @item -m32r
13720 @opindex m32r
13721 Generate code for the M32R@.  This is the default.
13722
13723 @item -mmodel=small
13724 @opindex mmodel=small
13725 Assume all objects live in the lower 16MB of memory (so that their addresses
13726 can be loaded with the @code{ld24} instruction), and assume all subroutines
13727 are reachable with the @code{bl} instruction.
13728 This is the default.
13729
13730 The addressability of a particular object can be set with the
13731 @code{model} attribute.
13732
13733 @item -mmodel=medium
13734 @opindex mmodel=medium
13735 Assume objects may be anywhere in the 32-bit address space (the compiler
13736 will generate @code{seth/add3} instructions to load their addresses), and
13737 assume all subroutines are reachable with the @code{bl} instruction.
13738
13739 @item -mmodel=large
13740 @opindex mmodel=large
13741 Assume objects may be anywhere in the 32-bit address space (the compiler
13742 will generate @code{seth/add3} instructions to load their addresses), and
13743 assume subroutines may not be reachable with the @code{bl} instruction
13744 (the compiler will generate the much slower @code{seth/add3/jl}
13745 instruction sequence).
13746
13747 @item -msdata=none
13748 @opindex msdata=none
13749 Disable use of the small data area.  Variables will be put into
13750 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
13751 @code{section} attribute has been specified).
13752 This is the default.
13753
13754 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
13755 Objects may be explicitly put in the small data area with the
13756 @code{section} attribute using one of these sections.
13757
13758 @item -msdata=sdata
13759 @opindex msdata=sdata
13760 Put small global and static data in the small data area, but do not
13761 generate special code to reference them.
13762
13763 @item -msdata=use
13764 @opindex msdata=use
13765 Put small global and static data in the small data area, and generate
13766 special instructions to reference them.
13767
13768 @item -G @var{num}
13769 @opindex G
13770 @cindex smaller data references
13771 Put global and static objects less than or equal to @var{num} bytes
13772 into the small data or bss sections instead of the normal data or bss
13773 sections.  The default value of @var{num} is 8.
13774 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
13775 for this option to have any effect.
13776
13777 All modules should be compiled with the same @option{-G @var{num}} value.
13778 Compiling with different values of @var{num} may or may not work; if it
13779 doesn't the linker will give an error message---incorrect code will not be
13780 generated.
13781
13782 @item -mdebug
13783 @opindex mdebug
13784 Makes the M32R specific code in the compiler display some statistics
13785 that might help in debugging programs.
13786
13787 @item -malign-loops
13788 @opindex malign-loops
13789 Align all loops to a 32-byte boundary.
13790
13791 @item -mno-align-loops
13792 @opindex mno-align-loops
13793 Do not enforce a 32-byte alignment for loops.  This is the default.
13794
13795 @item -missue-rate=@var{number}
13796 @opindex missue-rate=@var{number}
13797 Issue @var{number} instructions per cycle.  @var{number} can only be 1
13798 or 2.
13799
13800 @item -mbranch-cost=@var{number}
13801 @opindex mbranch-cost=@var{number}
13802 @var{number} can only be 1 or 2.  If it is 1 then branches will be
13803 preferred over conditional code, if it is 2, then the opposite will
13804 apply.
13805
13806 @item -mflush-trap=@var{number}
13807 @opindex mflush-trap=@var{number}
13808 Specifies the trap number to use to flush the cache.  The default is
13809 12.  Valid numbers are between 0 and 15 inclusive.
13810
13811 @item -mno-flush-trap
13812 @opindex mno-flush-trap
13813 Specifies that the cache cannot be flushed by using a trap.
13814
13815 @item -mflush-func=@var{name}
13816 @opindex mflush-func=@var{name}
13817 Specifies the name of the operating system function to call to flush
13818 the cache.  The default is @emph{_flush_cache}, but a function call
13819 will only be used if a trap is not available.
13820
13821 @item -mno-flush-func
13822 @opindex mno-flush-func
13823 Indicates that there is no OS function for flushing the cache.
13824
13825 @end table
13826
13827 @node M680x0 Options
13828 @subsection M680x0 Options
13829 @cindex M680x0 options
13830
13831 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
13832 The default settings depend on which architecture was selected when
13833 the compiler was configured; the defaults for the most common choices
13834 are given below.
13835
13836 @table @gcctabopt
13837 @item -march=@var{arch}
13838 @opindex march
13839 Generate code for a specific M680x0 or ColdFire instruction set
13840 architecture.  Permissible values of @var{arch} for M680x0
13841 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
13842 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
13843 architectures are selected according to Freescale's ISA classification
13844 and the permissible values are: @samp{isaa}, @samp{isaaplus},
13845 @samp{isab} and @samp{isac}.
13846
13847 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
13848 code for a ColdFire target.  The @var{arch} in this macro is one of the
13849 @option{-march} arguments given above.
13850
13851 When used together, @option{-march} and @option{-mtune} select code
13852 that runs on a family of similar processors but that is optimized
13853 for a particular microarchitecture.
13854
13855 @item -mcpu=@var{cpu}
13856 @opindex mcpu
13857 Generate code for a specific M680x0 or ColdFire processor.
13858 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
13859 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
13860 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
13861 below, which also classifies the CPUs into families:
13862
13863 @multitable @columnfractions 0.20 0.80
13864 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
13865 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
13866 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
13867 @item @samp{5206e} @tab @samp{5206e}
13868 @item @samp{5208} @tab @samp{5207} @samp{5208}
13869 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
13870 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
13871 @item @samp{5216} @tab @samp{5214} @samp{5216}
13872 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
13873 @item @samp{5225} @tab @samp{5224} @samp{5225}
13874 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
13875 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
13876 @item @samp{5249} @tab @samp{5249}
13877 @item @samp{5250} @tab @samp{5250}
13878 @item @samp{5271} @tab @samp{5270} @samp{5271}
13879 @item @samp{5272} @tab @samp{5272}
13880 @item @samp{5275} @tab @samp{5274} @samp{5275}
13881 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
13882 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
13883 @item @samp{5307} @tab @samp{5307}
13884 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
13885 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
13886 @item @samp{5407} @tab @samp{5407}
13887 @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}
13888 @end multitable
13889
13890 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
13891 @var{arch} is compatible with @var{cpu}.  Other combinations of
13892 @option{-mcpu} and @option{-march} are rejected.
13893
13894 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
13895 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
13896 where the value of @var{family} is given by the table above.
13897
13898 @item -mtune=@var{tune}
13899 @opindex mtune
13900 Tune the code for a particular microarchitecture, within the
13901 constraints set by @option{-march} and @option{-mcpu}.
13902 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
13903 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
13904 and @samp{cpu32}.  The ColdFire microarchitectures
13905 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
13906
13907 You can also use @option{-mtune=68020-40} for code that needs
13908 to run relatively well on 68020, 68030 and 68040 targets.
13909 @option{-mtune=68020-60} is similar but includes 68060 targets
13910 as well.  These two options select the same tuning decisions as
13911 @option{-m68020-40} and @option{-m68020-60} respectively.
13912
13913 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
13914 when tuning for 680x0 architecture @var{arch}.  It also defines
13915 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
13916 option is used.  If gcc is tuning for a range of architectures,
13917 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
13918 it defines the macros for every architecture in the range.
13919
13920 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
13921 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
13922 of the arguments given above.
13923
13924 @item -m68000
13925 @itemx -mc68000
13926 @opindex m68000
13927 @opindex mc68000
13928 Generate output for a 68000.  This is the default
13929 when the compiler is configured for 68000-based systems.
13930 It is equivalent to @option{-march=68000}.
13931
13932 Use this option for microcontrollers with a 68000 or EC000 core,
13933 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
13934
13935 @item -m68010
13936 @opindex m68010
13937 Generate output for a 68010.  This is the default
13938 when the compiler is configured for 68010-based systems.
13939 It is equivalent to @option{-march=68010}.
13940
13941 @item -m68020
13942 @itemx -mc68020
13943 @opindex m68020
13944 @opindex mc68020
13945 Generate output for a 68020.  This is the default
13946 when the compiler is configured for 68020-based systems.
13947 It is equivalent to @option{-march=68020}.
13948
13949 @item -m68030
13950 @opindex m68030
13951 Generate output for a 68030.  This is the default when the compiler is
13952 configured for 68030-based systems.  It is equivalent to
13953 @option{-march=68030}.
13954
13955 @item -m68040
13956 @opindex m68040
13957 Generate output for a 68040.  This is the default when the compiler is
13958 configured for 68040-based systems.  It is equivalent to
13959 @option{-march=68040}.
13960
13961 This option inhibits the use of 68881/68882 instructions that have to be
13962 emulated by software on the 68040.  Use this option if your 68040 does not
13963 have code to emulate those instructions.
13964
13965 @item -m68060
13966 @opindex m68060
13967 Generate output for a 68060.  This is the default when the compiler is
13968 configured for 68060-based systems.  It is equivalent to
13969 @option{-march=68060}.
13970
13971 This option inhibits the use of 68020 and 68881/68882 instructions that
13972 have to be emulated by software on the 68060.  Use this option if your 68060
13973 does not have code to emulate those instructions.
13974
13975 @item -mcpu32
13976 @opindex mcpu32
13977 Generate output for a CPU32.  This is the default
13978 when the compiler is configured for CPU32-based systems.
13979 It is equivalent to @option{-march=cpu32}.
13980
13981 Use this option for microcontrollers with a
13982 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
13983 68336, 68340, 68341, 68349 and 68360.
13984
13985 @item -m5200
13986 @opindex m5200
13987 Generate output for a 520X ColdFire CPU@.  This is the default
13988 when the compiler is configured for 520X-based systems.
13989 It is equivalent to @option{-mcpu=5206}, and is now deprecated
13990 in favor of that option.
13991
13992 Use this option for microcontroller with a 5200 core, including
13993 the MCF5202, MCF5203, MCF5204 and MCF5206.
13994
13995 @item -m5206e
13996 @opindex m5206e
13997 Generate output for a 5206e ColdFire CPU@.  The option is now
13998 deprecated in favor of the equivalent @option{-mcpu=5206e}.
13999
14000 @item -m528x
14001 @opindex m528x
14002 Generate output for a member of the ColdFire 528X family.
14003 The option is now deprecated in favor of the equivalent
14004 @option{-mcpu=528x}.
14005
14006 @item -m5307
14007 @opindex m5307
14008 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
14009 in favor of the equivalent @option{-mcpu=5307}.
14010
14011 @item -m5407
14012 @opindex m5407
14013 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
14014 in favor of the equivalent @option{-mcpu=5407}.
14015
14016 @item -mcfv4e
14017 @opindex mcfv4e
14018 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
14019 This includes use of hardware floating point instructions.
14020 The option is equivalent to @option{-mcpu=547x}, and is now
14021 deprecated in favor of that option.
14022
14023 @item -m68020-40
14024 @opindex m68020-40
14025 Generate output for a 68040, without using any of the new instructions.
14026 This results in code which can run relatively efficiently on either a
14027 68020/68881 or a 68030 or a 68040.  The generated code does use the
14028 68881 instructions that are emulated on the 68040.
14029
14030 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
14031
14032 @item -m68020-60
14033 @opindex m68020-60
14034 Generate output for a 68060, without using any of the new instructions.
14035 This results in code which can run relatively efficiently on either a
14036 68020/68881 or a 68030 or a 68040.  The generated code does use the
14037 68881 instructions that are emulated on the 68060.
14038
14039 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
14040
14041 @item -mhard-float
14042 @itemx -m68881
14043 @opindex mhard-float
14044 @opindex m68881
14045 Generate floating-point instructions.  This is the default for 68020
14046 and above, and for ColdFire devices that have an FPU@.  It defines the
14047 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
14048 on ColdFire targets.
14049
14050 @item -msoft-float
14051 @opindex msoft-float
14052 Do not generate floating-point instructions; use library calls instead.
14053 This is the default for 68000, 68010, and 68832 targets.  It is also
14054 the default for ColdFire devices that have no FPU.
14055
14056 @item -mdiv
14057 @itemx -mno-div
14058 @opindex mdiv
14059 @opindex mno-div
14060 Generate (do not generate) ColdFire hardware divide and remainder
14061 instructions.  If @option{-march} is used without @option{-mcpu},
14062 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
14063 architectures.  Otherwise, the default is taken from the target CPU
14064 (either the default CPU, or the one specified by @option{-mcpu}).  For
14065 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
14066 @option{-mcpu=5206e}.
14067
14068 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
14069
14070 @item -mshort
14071 @opindex mshort
14072 Consider type @code{int} to be 16 bits wide, like @code{short int}.
14073 Additionally, parameters passed on the stack are also aligned to a
14074 16-bit boundary even on targets whose API mandates promotion to 32-bit.
14075
14076 @item -mno-short
14077 @opindex mno-short
14078 Do not consider type @code{int} to be 16 bits wide.  This is the default.
14079
14080 @item -mnobitfield
14081 @itemx -mno-bitfield
14082 @opindex mnobitfield
14083 @opindex mno-bitfield
14084 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
14085 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
14086
14087 @item -mbitfield
14088 @opindex mbitfield
14089 Do use the bit-field instructions.  The @option{-m68020} option implies
14090 @option{-mbitfield}.  This is the default if you use a configuration
14091 designed for a 68020.
14092
14093 @item -mrtd
14094 @opindex mrtd
14095 Use a different function-calling convention, in which functions
14096 that take a fixed number of arguments return with the @code{rtd}
14097 instruction, which pops their arguments while returning.  This
14098 saves one instruction in the caller since there is no need to pop
14099 the arguments there.
14100
14101 This calling convention is incompatible with the one normally
14102 used on Unix, so you cannot use it if you need to call libraries
14103 compiled with the Unix compiler.
14104
14105 Also, you must provide function prototypes for all functions that
14106 take variable numbers of arguments (including @code{printf});
14107 otherwise incorrect code will be generated for calls to those
14108 functions.
14109
14110 In addition, seriously incorrect code will result if you call a
14111 function with too many arguments.  (Normally, extra arguments are
14112 harmlessly ignored.)
14113
14114 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
14115 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
14116
14117 @item -mno-rtd
14118 @opindex mno-rtd
14119 Do not use the calling conventions selected by @option{-mrtd}.
14120 This is the default.
14121
14122 @item -malign-int
14123 @itemx -mno-align-int
14124 @opindex malign-int
14125 @opindex mno-align-int
14126 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
14127 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
14128 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
14129 Aligning variables on 32-bit boundaries produces code that runs somewhat
14130 faster on processors with 32-bit busses at the expense of more memory.
14131
14132 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
14133 align structures containing the above types  differently than
14134 most published application binary interface specifications for the m68k.
14135
14136 @item -mpcrel
14137 @opindex mpcrel
14138 Use the pc-relative addressing mode of the 68000 directly, instead of
14139 using a global offset table.  At present, this option implies @option{-fpic},
14140 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
14141 not presently supported with @option{-mpcrel}, though this could be supported for
14142 68020 and higher processors.
14143
14144 @item -mno-strict-align
14145 @itemx -mstrict-align
14146 @opindex mno-strict-align
14147 @opindex mstrict-align
14148 Do not (do) assume that unaligned memory references will be handled by
14149 the system.
14150
14151 @item -msep-data
14152 Generate code that allows the data segment to be located in a different
14153 area of memory from the text segment.  This allows for execute in place in
14154 an environment without virtual memory management.  This option implies
14155 @option{-fPIC}.
14156
14157 @item -mno-sep-data
14158 Generate code that assumes that the data segment follows the text segment.
14159 This is the default.
14160
14161 @item -mid-shared-library
14162 Generate code that supports shared libraries via the library ID method.
14163 This allows for execute in place and shared libraries in an environment
14164 without virtual memory management.  This option implies @option{-fPIC}.
14165
14166 @item -mno-id-shared-library
14167 Generate code that doesn't assume ID based shared libraries are being used.
14168 This is the default.
14169
14170 @item -mshared-library-id=n
14171 Specified the identification number of the ID based shared library being
14172 compiled.  Specifying a value of 0 will generate more compact code, specifying
14173 other values will force the allocation of that number to the current
14174 library but is no more space or time efficient than omitting this option.
14175
14176 @item -mxgot
14177 @itemx -mno-xgot
14178 @opindex mxgot
14179 @opindex mno-xgot
14180 When generating position-independent code for ColdFire, generate code
14181 that works if the GOT has more than 8192 entries.  This code is
14182 larger and slower than code generated without this option.  On M680x0
14183 processors, this option is not needed; @option{-fPIC} suffices.
14184
14185 GCC normally uses a single instruction to load values from the GOT@.
14186 While this is relatively efficient, it only works if the GOT
14187 is smaller than about 64k.  Anything larger causes the linker
14188 to report an error such as:
14189
14190 @cindex relocation truncated to fit (ColdFire)
14191 @smallexample
14192 relocation truncated to fit: R_68K_GOT16O foobar
14193 @end smallexample
14194
14195 If this happens, you should recompile your code with @option{-mxgot}.
14196 It should then work with very large GOTs.  However, code generated with
14197 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
14198 the value of a global symbol.
14199
14200 Note that some linkers, including newer versions of the GNU linker,
14201 can create multiple GOTs and sort GOT entries.  If you have such a linker,
14202 you should only need to use @option{-mxgot} when compiling a single
14203 object file that accesses more than 8192 GOT entries.  Very few do.
14204
14205 These options have no effect unless GCC is generating
14206 position-independent code.
14207
14208 @end table
14209
14210 @node MCore Options
14211 @subsection MCore Options
14212 @cindex MCore options
14213
14214 These are the @samp{-m} options defined for the Motorola M*Core
14215 processors.
14216
14217 @table @gcctabopt
14218
14219 @item -mhardlit
14220 @itemx -mno-hardlit
14221 @opindex mhardlit
14222 @opindex mno-hardlit
14223 Inline constants into the code stream if it can be done in two
14224 instructions or less.
14225
14226 @item -mdiv
14227 @itemx -mno-div
14228 @opindex mdiv
14229 @opindex mno-div
14230 Use the divide instruction.  (Enabled by default).
14231
14232 @item -mrelax-immediate
14233 @itemx -mno-relax-immediate
14234 @opindex mrelax-immediate
14235 @opindex mno-relax-immediate
14236 Allow arbitrary sized immediates in bit operations.
14237
14238 @item -mwide-bitfields
14239 @itemx -mno-wide-bitfields
14240 @opindex mwide-bitfields
14241 @opindex mno-wide-bitfields
14242 Always treat bit-fields as int-sized.
14243
14244 @item -m4byte-functions
14245 @itemx -mno-4byte-functions
14246 @opindex m4byte-functions
14247 @opindex mno-4byte-functions
14248 Force all functions to be aligned to a four byte boundary.
14249
14250 @item -mcallgraph-data
14251 @itemx -mno-callgraph-data
14252 @opindex mcallgraph-data
14253 @opindex mno-callgraph-data
14254 Emit callgraph information.
14255
14256 @item -mslow-bytes
14257 @itemx -mno-slow-bytes
14258 @opindex mslow-bytes
14259 @opindex mno-slow-bytes
14260 Prefer word access when reading byte quantities.
14261
14262 @item -mlittle-endian
14263 @itemx -mbig-endian
14264 @opindex mlittle-endian
14265 @opindex mbig-endian
14266 Generate code for a little endian target.
14267
14268 @item -m210
14269 @itemx -m340
14270 @opindex m210
14271 @opindex m340
14272 Generate code for the 210 processor.
14273
14274 @item -mno-lsim
14275 @opindex mno-lsim
14276 Assume that run-time support has been provided and so omit the
14277 simulator library (@file{libsim.a)} from the linker command line.
14278
14279 @item -mstack-increment=@var{size}
14280 @opindex mstack-increment
14281 Set the maximum amount for a single stack increment operation.  Large
14282 values can increase the speed of programs which contain functions
14283 that need a large amount of stack space, but they can also trigger a
14284 segmentation fault if the stack is extended too much.  The default
14285 value is 0x1000.
14286
14287 @end table
14288
14289 @node MeP Options
14290 @subsection MeP Options
14291 @cindex MeP options
14292
14293 @table @gcctabopt
14294
14295 @item -mabsdiff
14296 @opindex mabsdiff
14297 Enables the @code{abs} instruction, which is the absolute difference
14298 between two registers.
14299
14300 @item -mall-opts
14301 @opindex mall-opts
14302 Enables all the optional instructions - average, multiply, divide, bit
14303 operations, leading zero, absolute difference, min/max, clip, and
14304 saturation.
14305
14306
14307 @item -maverage
14308 @opindex maverage
14309 Enables the @code{ave} instruction, which computes the average of two
14310 registers.
14311
14312 @item -mbased=@var{n}
14313 @opindex mbased=
14314 Variables of size @var{n} bytes or smaller will be placed in the
14315 @code{.based} section by default.  Based variables use the @code{$tp}
14316 register as a base register, and there is a 128 byte limit to the
14317 @code{.based} section.
14318
14319 @item -mbitops
14320 @opindex mbitops
14321 Enables the bit operation instructions - bit test (@code{btstm}), set
14322 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
14323 test-and-set (@code{tas}).
14324
14325 @item -mc=@var{name}
14326 @opindex mc=
14327 Selects which section constant data will be placed in.  @var{name} may
14328 be @code{tiny}, @code{near}, or @code{far}.
14329
14330 @item -mclip
14331 @opindex mclip
14332 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
14333 useful unless you also provide @code{-mminmax}.
14334
14335 @item -mconfig=@var{name}
14336 @opindex mconfig=
14337 Selects one of the build-in core configurations.  Each MeP chip has
14338 one or more modules in it; each module has a core CPU and a variety of
14339 coprocessors, optional instructions, and peripherals.  The
14340 @code{MeP-Integrator} tool, not part of GCC, provides these
14341 configurations through this option; using this option is the same as
14342 using all the corresponding command line options.  The default
14343 configuration is @code{default}.
14344
14345 @item -mcop
14346 @opindex mcop
14347 Enables the coprocessor instructions.  By default, this is a 32-bit
14348 coprocessor.  Note that the coprocessor is normally enabled via the
14349 @code{-mconfig=} option.
14350
14351 @item -mcop32
14352 @opindex mcop32
14353 Enables the 32-bit coprocessor's instructions.
14354
14355 @item -mcop64
14356 @opindex mcop64
14357 Enables the 64-bit coprocessor's instructions.
14358
14359 @item -mivc2
14360 @opindex mivc2
14361 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
14362
14363 @item -mdc
14364 @opindex mdc
14365 Causes constant variables to be placed in the @code{.near} section.
14366
14367 @item -mdiv
14368 @opindex mdiv
14369 Enables the @code{div} and @code{divu} instructions.
14370
14371 @item -meb
14372 @opindex meb
14373 Generate big-endian code.
14374
14375 @item -mel
14376 @opindex mel
14377 Generate little-endian code.
14378
14379 @item -mio-volatile
14380 @opindex mio-volatile
14381 Tells the compiler that any variable marked with the @code{io}
14382 attribute is to be considered volatile.
14383
14384 @item -ml
14385 @opindex ml
14386 Causes variables to be assigned to the @code{.far} section by default.
14387
14388 @item -mleadz
14389 @opindex mleadz
14390 Enables the @code{leadz} (leading zero) instruction.
14391
14392 @item -mm
14393 @opindex mm
14394 Causes variables to be assigned to the @code{.near} section by default.
14395
14396 @item -mminmax
14397 @opindex mminmax
14398 Enables the @code{min} and @code{max} instructions.
14399
14400 @item -mmult
14401 @opindex mmult
14402 Enables the multiplication and multiply-accumulate instructions.
14403
14404 @item -mno-opts
14405 @opindex mno-opts
14406 Disables all the optional instructions enabled by @code{-mall-opts}.
14407
14408 @item -mrepeat
14409 @opindex mrepeat
14410 Enables the @code{repeat} and @code{erepeat} instructions, used for
14411 low-overhead looping.
14412
14413 @item -ms
14414 @opindex ms
14415 Causes all variables to default to the @code{.tiny} section.  Note
14416 that there is a 65536 byte limit to this section.  Accesses to these
14417 variables use the @code{%gp} base register.
14418
14419 @item -msatur
14420 @opindex msatur
14421 Enables the saturation instructions.  Note that the compiler does not
14422 currently generate these itself, but this option is included for
14423 compatibility with other tools, like @code{as}.
14424
14425 @item -msdram
14426 @opindex msdram
14427 Link the SDRAM-based runtime instead of the default ROM-based runtime.
14428
14429 @item -msim
14430 @opindex msim
14431 Link the simulator runtime libraries.
14432
14433 @item -msimnovec
14434 @opindex msimnovec
14435 Link the simulator runtime libraries, excluding built-in support
14436 for reset and exception vectors and tables.
14437
14438 @item -mtf
14439 @opindex mtf
14440 Causes all functions to default to the @code{.far} section.  Without
14441 this option, functions default to the @code{.near} section.
14442
14443 @item -mtiny=@var{n}
14444 @opindex mtiny=
14445 Variables that are @var{n} bytes or smaller will be allocated to the
14446 @code{.tiny} section.  These variables use the @code{$gp} base
14447 register.  The default for this option is 4, but note that there's a
14448 65536 byte limit to the @code{.tiny} section.
14449
14450 @end table
14451
14452 @node MicroBlaze Options
14453 @subsection MicroBlaze Options
14454 @cindex MicroBlaze Options
14455
14456 @table @gcctabopt
14457
14458 @item -msoft-float
14459 @opindex msoft-float
14460 Use software emulation for floating point (default).
14461
14462 @item -mhard-float
14463 @opindex mhard-float
14464 Use hardware floating point instructions.
14465
14466 @item -mmemcpy
14467 @opindex mmemcpy
14468 Do not optimize block moves, use @code{memcpy}.
14469
14470 @item -mno-clearbss
14471 @opindex mno-clearbss
14472 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
14473
14474 @item -mcpu=@var{cpu-type}
14475 @opindex mcpu=
14476 Use features of and schedule code for given CPU.
14477 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
14478 where @var{X} is a major version, @var{YY} is the minor version, and
14479 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
14480 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
14481
14482 @item -mxl-soft-mul
14483 @opindex mxl-soft-mul
14484 Use software multiply emulation (default).
14485
14486 @item -mxl-soft-div
14487 @opindex mxl-soft-div
14488 Use software emulation for divides (default).
14489
14490 @item -mxl-barrel-shift
14491 @opindex mxl-barrel-shift
14492 Use the hardware barrel shifter.
14493
14494 @item -mxl-pattern-compare
14495 @opindex mxl-pattern-compare
14496 Use pattern compare instructions.
14497
14498 @item -msmall-divides
14499 @opindex msmall-divides
14500 Use table lookup optimization for small signed integer divisions.
14501
14502 @item -mxl-stack-check
14503 @opindex mxl-stack-check
14504 This option is deprecated.  Use -fstack-check instead.
14505
14506 @item -mxl-gp-opt
14507 @opindex mxl-gp-opt
14508 Use GP relative sdata/sbss sections.
14509
14510 @item -mxl-multiply-high
14511 @opindex mxl-multiply-high
14512 Use multiply high instructions for high part of 32x32 multiply.
14513
14514 @item -mxl-float-convert
14515 @opindex mxl-float-convert
14516 Use hardware floating point conversion instructions.
14517
14518 @item -mxl-float-sqrt
14519 @opindex mxl-float-sqrt
14520 Use hardware floating point square root instruction.
14521
14522 @item -mxl-mode-@var{app-model}
14523 Select application model @var{app-model}.  Valid models are
14524 @table @samp
14525 @item executable
14526 normal executable (default), uses startup code @file{crt0.o}.
14527
14528 @item xmdstub
14529 for use with Xilinx Microprocessor Debugger (XMD) based
14530 software intrusive debug agent called xmdstub. This uses startup file
14531 @file{crt1.o} and sets the start address of the program to be 0x800.
14532
14533 @item bootstrap
14534 for applications that are loaded using a bootloader.
14535 This model uses startup file @file{crt2.o} which does not contain a processor
14536 reset vector handler. This is suitable for transferring control on a
14537 processor reset to the bootloader rather than the application.
14538
14539 @item novectors
14540 for applications that do not require any of the
14541 MicroBlaze vectors. This option may be useful for applications running
14542 within a monitoring application. This model uses @file{crt3.o} as a startup file.
14543 @end table
14544
14545 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
14546 @option{-mxl-mode-@var{app-model}}.
14547
14548 @end table
14549
14550 @node MIPS Options
14551 @subsection MIPS Options
14552 @cindex MIPS options
14553
14554 @table @gcctabopt
14555
14556 @item -EB
14557 @opindex EB
14558 Generate big-endian code.
14559
14560 @item -EL
14561 @opindex EL
14562 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
14563 configurations.
14564
14565 @item -march=@var{arch}
14566 @opindex march
14567 Generate code that will run on @var{arch}, which can be the name of a
14568 generic MIPS ISA, or the name of a particular processor.
14569 The ISA names are:
14570 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
14571 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
14572 The processor names are:
14573 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
14574 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
14575 @samp{5kc}, @samp{5kf},
14576 @samp{20kc},
14577 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
14578 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
14579 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
14580 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
14581 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
14582 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
14583 @samp{m4k},
14584 @samp{octeon},
14585 @samp{orion},
14586 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
14587 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
14588 @samp{rm7000}, @samp{rm9000},
14589 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
14590 @samp{sb1},
14591 @samp{sr71000},
14592 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
14593 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
14594 and @samp{xlr}.
14595 The special value @samp{from-abi} selects the
14596 most compatible architecture for the selected ABI (that is,
14597 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
14598
14599 Native Linux/GNU and IRIX toolchains also support the value @samp{native},
14600 which selects the best architecture option for the host processor.
14601 @option{-march=native} has no effect if GCC does not recognize
14602 the processor.
14603
14604 In processor names, a final @samp{000} can be abbreviated as @samp{k}
14605 (for example, @samp{-march=r2k}).  Prefixes are optional, and
14606 @samp{vr} may be written @samp{r}.
14607
14608 Names of the form @samp{@var{n}f2_1} refer to processors with
14609 FPUs clocked at half the rate of the core, names of the form
14610 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
14611 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
14612 processors with FPUs clocked a ratio of 3:2 with respect to the core.
14613 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
14614 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
14615 accepted as synonyms for @samp{@var{n}f1_1}.
14616
14617 GCC defines two macros based on the value of this option.  The first
14618 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
14619 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
14620 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
14621 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
14622 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
14623
14624 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
14625 above.  In other words, it will have the full prefix and will not
14626 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
14627 the macro names the resolved architecture (either @samp{"mips1"} or
14628 @samp{"mips3"}).  It names the default architecture when no
14629 @option{-march} option is given.
14630
14631 @item -mtune=@var{arch}
14632 @opindex mtune
14633 Optimize for @var{arch}.  Among other things, this option controls
14634 the way instructions are scheduled, and the perceived cost of arithmetic
14635 operations.  The list of @var{arch} values is the same as for
14636 @option{-march}.
14637
14638 When this option is not used, GCC will optimize for the processor
14639 specified by @option{-march}.  By using @option{-march} and
14640 @option{-mtune} together, it is possible to generate code that will
14641 run on a family of processors, but optimize the code for one
14642 particular member of that family.
14643
14644 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
14645 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
14646 @samp{-march} ones described above.
14647
14648 @item -mips1
14649 @opindex mips1
14650 Equivalent to @samp{-march=mips1}.
14651
14652 @item -mips2
14653 @opindex mips2
14654 Equivalent to @samp{-march=mips2}.
14655
14656 @item -mips3
14657 @opindex mips3
14658 Equivalent to @samp{-march=mips3}.
14659
14660 @item -mips4
14661 @opindex mips4
14662 Equivalent to @samp{-march=mips4}.
14663
14664 @item -mips32
14665 @opindex mips32
14666 Equivalent to @samp{-march=mips32}.
14667
14668 @item -mips32r2
14669 @opindex mips32r2
14670 Equivalent to @samp{-march=mips32r2}.
14671
14672 @item -mips64
14673 @opindex mips64
14674 Equivalent to @samp{-march=mips64}.
14675
14676 @item -mips64r2
14677 @opindex mips64r2
14678 Equivalent to @samp{-march=mips64r2}.
14679
14680 @item -mips16
14681 @itemx -mno-mips16
14682 @opindex mips16
14683 @opindex mno-mips16
14684 Generate (do not generate) MIPS16 code.  If GCC is targetting a
14685 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
14686
14687 MIPS16 code generation can also be controlled on a per-function basis
14688 by means of @code{mips16} and @code{nomips16} attributes.
14689 @xref{Function Attributes}, for more information.
14690
14691 @item -mflip-mips16
14692 @opindex mflip-mips16
14693 Generate MIPS16 code on alternating functions.  This option is provided
14694 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
14695 not intended for ordinary use in compiling user code.
14696
14697 @item -minterlink-mips16
14698 @itemx -mno-interlink-mips16
14699 @opindex minterlink-mips16
14700 @opindex mno-interlink-mips16
14701 Require (do not require) that non-MIPS16 code be link-compatible with
14702 MIPS16 code.
14703
14704 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
14705 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
14706 therefore disables direct jumps unless GCC knows that the target of the
14707 jump is not MIPS16.
14708
14709 @item -mabi=32
14710 @itemx -mabi=o64
14711 @itemx -mabi=n32
14712 @itemx -mabi=64
14713 @itemx -mabi=eabi
14714 @opindex mabi=32
14715 @opindex mabi=o64
14716 @opindex mabi=n32
14717 @opindex mabi=64
14718 @opindex mabi=eabi
14719 Generate code for the given ABI@.
14720
14721 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
14722 generates 64-bit code when you select a 64-bit architecture, but you
14723 can use @option{-mgp32} to get 32-bit code instead.
14724
14725 For information about the O64 ABI, see
14726 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
14727
14728 GCC supports a variant of the o32 ABI in which floating-point registers
14729 are 64 rather than 32 bits wide.  You can select this combination with
14730 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
14731 and @samp{mfhc1} instructions and is therefore only supported for
14732 MIPS32R2 processors.
14733
14734 The register assignments for arguments and return values remain the
14735 same, but each scalar value is passed in a single 64-bit register
14736 rather than a pair of 32-bit registers.  For example, scalar
14737 floating-point values are returned in @samp{$f0} only, not a
14738 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
14739 remains the same, but all 64 bits are saved.
14740
14741 @item -mabicalls
14742 @itemx -mno-abicalls
14743 @opindex mabicalls
14744 @opindex mno-abicalls
14745 Generate (do not generate) code that is suitable for SVR4-style
14746 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
14747 systems.
14748
14749 @item -mshared
14750 @itemx -mno-shared
14751 Generate (do not generate) code that is fully position-independent,
14752 and that can therefore be linked into shared libraries.  This option
14753 only affects @option{-mabicalls}.
14754
14755 All @option{-mabicalls} code has traditionally been position-independent,
14756 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
14757 as an extension, the GNU toolchain allows executables to use absolute
14758 accesses for locally-binding symbols.  It can also use shorter GP
14759 initialization sequences and generate direct calls to locally-defined
14760 functions.  This mode is selected by @option{-mno-shared}.
14761
14762 @option{-mno-shared} depends on binutils 2.16 or higher and generates
14763 objects that can only be linked by the GNU linker.  However, the option
14764 does not affect the ABI of the final executable; it only affects the ABI
14765 of relocatable objects.  Using @option{-mno-shared} will generally make
14766 executables both smaller and quicker.
14767
14768 @option{-mshared} is the default.
14769
14770 @item -mplt
14771 @itemx -mno-plt
14772 @opindex mplt
14773 @opindex mno-plt
14774 Assume (do not assume) that the static and dynamic linkers
14775 support PLTs and copy relocations.  This option only affects
14776 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
14777 has no effect without @samp{-msym32}.
14778
14779 You can make @option{-mplt} the default by configuring
14780 GCC with @option{--with-mips-plt}.  The default is
14781 @option{-mno-plt} otherwise.
14782
14783 @item -mxgot
14784 @itemx -mno-xgot
14785 @opindex mxgot
14786 @opindex mno-xgot
14787 Lift (do not lift) the usual restrictions on the size of the global
14788 offset table.
14789
14790 GCC normally uses a single instruction to load values from the GOT@.
14791 While this is relatively efficient, it will only work if the GOT
14792 is smaller than about 64k.  Anything larger will cause the linker
14793 to report an error such as:
14794
14795 @cindex relocation truncated to fit (MIPS)
14796 @smallexample
14797 relocation truncated to fit: R_MIPS_GOT16 foobar
14798 @end smallexample
14799
14800 If this happens, you should recompile your code with @option{-mxgot}.
14801 It should then work with very large GOTs, although it will also be
14802 less efficient, since it will take three instructions to fetch the
14803 value of a global symbol.
14804
14805 Note that some linkers can create multiple GOTs.  If you have such a
14806 linker, you should only need to use @option{-mxgot} when a single object
14807 file accesses more than 64k's worth of GOT entries.  Very few do.
14808
14809 These options have no effect unless GCC is generating position
14810 independent code.
14811
14812 @item -mgp32
14813 @opindex mgp32
14814 Assume that general-purpose registers are 32 bits wide.
14815
14816 @item -mgp64
14817 @opindex mgp64
14818 Assume that general-purpose registers are 64 bits wide.
14819
14820 @item -mfp32
14821 @opindex mfp32
14822 Assume that floating-point registers are 32 bits wide.
14823
14824 @item -mfp64
14825 @opindex mfp64
14826 Assume that floating-point registers are 64 bits wide.
14827
14828 @item -mhard-float
14829 @opindex mhard-float
14830 Use floating-point coprocessor instructions.
14831
14832 @item -msoft-float
14833 @opindex msoft-float
14834 Do not use floating-point coprocessor instructions.  Implement
14835 floating-point calculations using library calls instead.
14836
14837 @item -msingle-float
14838 @opindex msingle-float
14839 Assume that the floating-point coprocessor only supports single-precision
14840 operations.
14841
14842 @item -mdouble-float
14843 @opindex mdouble-float
14844 Assume that the floating-point coprocessor supports double-precision
14845 operations.  This is the default.
14846
14847 @item -mllsc
14848 @itemx -mno-llsc
14849 @opindex mllsc
14850 @opindex mno-llsc
14851 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
14852 implement atomic memory built-in functions.  When neither option is
14853 specified, GCC will use the instructions if the target architecture
14854 supports them.
14855
14856 @option{-mllsc} is useful if the runtime environment can emulate the
14857 instructions and @option{-mno-llsc} can be useful when compiling for
14858 nonstandard ISAs.  You can make either option the default by
14859 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
14860 respectively.  @option{--with-llsc} is the default for some
14861 configurations; see the installation documentation for details.
14862
14863 @item -mdsp
14864 @itemx -mno-dsp
14865 @opindex mdsp
14866 @opindex mno-dsp
14867 Use (do not use) revision 1 of the MIPS DSP ASE@.
14868 @xref{MIPS DSP Built-in Functions}.  This option defines the
14869 preprocessor macro @samp{__mips_dsp}.  It also defines
14870 @samp{__mips_dsp_rev} to 1.
14871
14872 @item -mdspr2
14873 @itemx -mno-dspr2
14874 @opindex mdspr2
14875 @opindex mno-dspr2
14876 Use (do not use) revision 2 of the MIPS DSP ASE@.
14877 @xref{MIPS DSP Built-in Functions}.  This option defines the
14878 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
14879 It also defines @samp{__mips_dsp_rev} to 2.
14880
14881 @item -msmartmips
14882 @itemx -mno-smartmips
14883 @opindex msmartmips
14884 @opindex mno-smartmips
14885 Use (do not use) the MIPS SmartMIPS ASE.
14886
14887 @item -mpaired-single
14888 @itemx -mno-paired-single
14889 @opindex mpaired-single
14890 @opindex mno-paired-single
14891 Use (do not use) paired-single floating-point instructions.
14892 @xref{MIPS Paired-Single Support}.  This option requires
14893 hardware floating-point support to be enabled.
14894
14895 @item -mdmx
14896 @itemx -mno-mdmx
14897 @opindex mdmx
14898 @opindex mno-mdmx
14899 Use (do not use) MIPS Digital Media Extension instructions.
14900 This option can only be used when generating 64-bit code and requires
14901 hardware floating-point support to be enabled.
14902
14903 @item -mips3d
14904 @itemx -mno-mips3d
14905 @opindex mips3d
14906 @opindex mno-mips3d
14907 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
14908 The option @option{-mips3d} implies @option{-mpaired-single}.
14909
14910 @item -mmt
14911 @itemx -mno-mt
14912 @opindex mmt
14913 @opindex mno-mt
14914 Use (do not use) MT Multithreading instructions.
14915
14916 @item -mlong64
14917 @opindex mlong64
14918 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
14919 an explanation of the default and the way that the pointer size is
14920 determined.
14921
14922 @item -mlong32
14923 @opindex mlong32
14924 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
14925
14926 The default size of @code{int}s, @code{long}s and pointers depends on
14927 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
14928 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
14929 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
14930 or the same size as integer registers, whichever is smaller.
14931
14932 @item -msym32
14933 @itemx -mno-sym32
14934 @opindex msym32
14935 @opindex mno-sym32
14936 Assume (do not assume) that all symbols have 32-bit values, regardless
14937 of the selected ABI@.  This option is useful in combination with
14938 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
14939 to generate shorter and faster references to symbolic addresses.
14940
14941 @item -G @var{num}
14942 @opindex G
14943 Put definitions of externally-visible data in a small data section
14944 if that data is no bigger than @var{num} bytes.  GCC can then access
14945 the data more efficiently; see @option{-mgpopt} for details.
14946
14947 The default @option{-G} option depends on the configuration.
14948
14949 @item -mlocal-sdata
14950 @itemx -mno-local-sdata
14951 @opindex mlocal-sdata
14952 @opindex mno-local-sdata
14953 Extend (do not extend) the @option{-G} behavior to local data too,
14954 such as to static variables in C@.  @option{-mlocal-sdata} is the
14955 default for all configurations.
14956
14957 If the linker complains that an application is using too much small data,
14958 you might want to try rebuilding the less performance-critical parts with
14959 @option{-mno-local-sdata}.  You might also want to build large
14960 libraries with @option{-mno-local-sdata}, so that the libraries leave
14961 more room for the main program.
14962
14963 @item -mextern-sdata
14964 @itemx -mno-extern-sdata
14965 @opindex mextern-sdata
14966 @opindex mno-extern-sdata
14967 Assume (do not assume) that externally-defined data will be in
14968 a small data section if that data is within the @option{-G} limit.
14969 @option{-mextern-sdata} is the default for all configurations.
14970
14971 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
14972 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
14973 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
14974 is placed in a small data section.  If @var{Var} is defined by another
14975 module, you must either compile that module with a high-enough
14976 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
14977 definition.  If @var{Var} is common, you must link the application
14978 with a high-enough @option{-G} setting.
14979
14980 The easiest way of satisfying these restrictions is to compile
14981 and link every module with the same @option{-G} option.  However,
14982 you may wish to build a library that supports several different
14983 small data limits.  You can do this by compiling the library with
14984 the highest supported @option{-G} setting and additionally using
14985 @option{-mno-extern-sdata} to stop the library from making assumptions
14986 about externally-defined data.
14987
14988 @item -mgpopt
14989 @itemx -mno-gpopt
14990 @opindex mgpopt
14991 @opindex mno-gpopt
14992 Use (do not use) GP-relative accesses for symbols that are known to be
14993 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
14994 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
14995 configurations.
14996
14997 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
14998 might not hold the value of @code{_gp}.  For example, if the code is
14999 part of a library that might be used in a boot monitor, programs that
15000 call boot monitor routines will pass an unknown value in @code{$gp}.
15001 (In such situations, the boot monitor itself would usually be compiled
15002 with @option{-G0}.)
15003
15004 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
15005 @option{-mno-extern-sdata}.
15006
15007 @item -membedded-data
15008 @itemx -mno-embedded-data
15009 @opindex membedded-data
15010 @opindex mno-embedded-data
15011 Allocate variables to the read-only data section first if possible, then
15012 next in the small data section if possible, otherwise in data.  This gives
15013 slightly slower code than the default, but reduces the amount of RAM required
15014 when executing, and thus may be preferred for some embedded systems.
15015
15016 @item -muninit-const-in-rodata
15017 @itemx -mno-uninit-const-in-rodata
15018 @opindex muninit-const-in-rodata
15019 @opindex mno-uninit-const-in-rodata
15020 Put uninitialized @code{const} variables in the read-only data section.
15021 This option is only meaningful in conjunction with @option{-membedded-data}.
15022
15023 @item -mcode-readable=@var{setting}
15024 @opindex mcode-readable
15025 Specify whether GCC may generate code that reads from executable sections.
15026 There are three possible settings:
15027
15028 @table @gcctabopt
15029 @item -mcode-readable=yes
15030 Instructions may freely access executable sections.  This is the
15031 default setting.
15032
15033 @item -mcode-readable=pcrel
15034 MIPS16 PC-relative load instructions can access executable sections,
15035 but other instructions must not do so.  This option is useful on 4KSc
15036 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
15037 It is also useful on processors that can be configured to have a dual
15038 instruction/data SRAM interface and that, like the M4K, automatically
15039 redirect PC-relative loads to the instruction RAM.
15040
15041 @item -mcode-readable=no
15042 Instructions must not access executable sections.  This option can be
15043 useful on targets that are configured to have a dual instruction/data
15044 SRAM interface but that (unlike the M4K) do not automatically redirect
15045 PC-relative loads to the instruction RAM.
15046 @end table
15047
15048 @item -msplit-addresses
15049 @itemx -mno-split-addresses
15050 @opindex msplit-addresses
15051 @opindex mno-split-addresses
15052 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
15053 relocation operators.  This option has been superseded by
15054 @option{-mexplicit-relocs} but is retained for backwards compatibility.
15055
15056 @item -mexplicit-relocs
15057 @itemx -mno-explicit-relocs
15058 @opindex mexplicit-relocs
15059 @opindex mno-explicit-relocs
15060 Use (do not use) assembler relocation operators when dealing with symbolic
15061 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
15062 is to use assembler macros instead.
15063
15064 @option{-mexplicit-relocs} is the default if GCC was configured
15065 to use an assembler that supports relocation operators.
15066
15067 @item -mcheck-zero-division
15068 @itemx -mno-check-zero-division
15069 @opindex mcheck-zero-division
15070 @opindex mno-check-zero-division
15071 Trap (do not trap) on integer division by zero.
15072
15073 The default is @option{-mcheck-zero-division}.
15074
15075 @item -mdivide-traps
15076 @itemx -mdivide-breaks
15077 @opindex mdivide-traps
15078 @opindex mdivide-breaks
15079 MIPS systems check for division by zero by generating either a
15080 conditional trap or a break instruction.  Using traps results in
15081 smaller code, but is only supported on MIPS II and later.  Also, some
15082 versions of the Linux kernel have a bug that prevents trap from
15083 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
15084 allow conditional traps on architectures that support them and
15085 @option{-mdivide-breaks} to force the use of breaks.
15086
15087 The default is usually @option{-mdivide-traps}, but this can be
15088 overridden at configure time using @option{--with-divide=breaks}.
15089 Divide-by-zero checks can be completely disabled using
15090 @option{-mno-check-zero-division}.
15091
15092 @item -mmemcpy
15093 @itemx -mno-memcpy
15094 @opindex mmemcpy
15095 @opindex mno-memcpy
15096 Force (do not force) the use of @code{memcpy()} for non-trivial block
15097 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
15098 most constant-sized copies.
15099
15100 @item -mlong-calls
15101 @itemx -mno-long-calls
15102 @opindex mlong-calls
15103 @opindex mno-long-calls
15104 Disable (do not disable) use of the @code{jal} instruction.  Calling
15105 functions using @code{jal} is more efficient but requires the caller
15106 and callee to be in the same 256 megabyte segment.
15107
15108 This option has no effect on abicalls code.  The default is
15109 @option{-mno-long-calls}.
15110
15111 @item -mmad
15112 @itemx -mno-mad
15113 @opindex mmad
15114 @opindex mno-mad
15115 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
15116 instructions, as provided by the R4650 ISA@.
15117
15118 @item -mfused-madd
15119 @itemx -mno-fused-madd
15120 @opindex mfused-madd
15121 @opindex mno-fused-madd
15122 Enable (disable) use of the floating point multiply-accumulate
15123 instructions, when they are available.  The default is
15124 @option{-mfused-madd}.
15125
15126 When multiply-accumulate instructions are used, the intermediate
15127 product is calculated to infinite precision and is not subject to
15128 the FCSR Flush to Zero bit.  This may be undesirable in some
15129 circumstances.
15130
15131 @item -nocpp
15132 @opindex nocpp
15133 Tell the MIPS assembler to not run its preprocessor over user
15134 assembler files (with a @samp{.s} suffix) when assembling them.
15135
15136 @item -mfix-24k
15137 @item -mno-fix-24k
15138 @opindex mfix-24k
15139 @opindex mno-fix-24k
15140 Work around the 24K E48 (lost data on stores during refill) errata.
15141 The workarounds are implemented by the assembler rather than by GCC.
15142
15143 @item -mfix-r4000
15144 @itemx -mno-fix-r4000
15145 @opindex mfix-r4000
15146 @opindex mno-fix-r4000
15147 Work around certain R4000 CPU errata:
15148 @itemize @minus
15149 @item
15150 A double-word or a variable shift may give an incorrect result if executed
15151 immediately after starting an integer division.
15152 @item
15153 A double-word or a variable shift may give an incorrect result if executed
15154 while an integer multiplication is in progress.
15155 @item
15156 An integer division may give an incorrect result if started in a delay slot
15157 of a taken branch or a jump.
15158 @end itemize
15159
15160 @item -mfix-r4400
15161 @itemx -mno-fix-r4400
15162 @opindex mfix-r4400
15163 @opindex mno-fix-r4400
15164 Work around certain R4400 CPU errata:
15165 @itemize @minus
15166 @item
15167 A double-word or a variable shift may give an incorrect result if executed
15168 immediately after starting an integer division.
15169 @end itemize
15170
15171 @item -mfix-r10000
15172 @itemx -mno-fix-r10000
15173 @opindex mfix-r10000
15174 @opindex mno-fix-r10000
15175 Work around certain R10000 errata:
15176 @itemize @minus
15177 @item
15178 @code{ll}/@code{sc} sequences may not behave atomically on revisions
15179 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
15180 @end itemize
15181
15182 This option can only be used if the target architecture supports
15183 branch-likely instructions.  @option{-mfix-r10000} is the default when
15184 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
15185 otherwise.
15186
15187 @item -mfix-vr4120
15188 @itemx -mno-fix-vr4120
15189 @opindex mfix-vr4120
15190 Work around certain VR4120 errata:
15191 @itemize @minus
15192 @item
15193 @code{dmultu} does not always produce the correct result.
15194 @item
15195 @code{div} and @code{ddiv} do not always produce the correct result if one
15196 of the operands is negative.
15197 @end itemize
15198 The workarounds for the division errata rely on special functions in
15199 @file{libgcc.a}.  At present, these functions are only provided by
15200 the @code{mips64vr*-elf} configurations.
15201
15202 Other VR4120 errata require a nop to be inserted between certain pairs of
15203 instructions.  These errata are handled by the assembler, not by GCC itself.
15204
15205 @item -mfix-vr4130
15206 @opindex mfix-vr4130
15207 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
15208 workarounds are implemented by the assembler rather than by GCC,
15209 although GCC will avoid using @code{mflo} and @code{mfhi} if the
15210 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
15211 instructions are available instead.
15212
15213 @item -mfix-sb1
15214 @itemx -mno-fix-sb1
15215 @opindex mfix-sb1
15216 Work around certain SB-1 CPU core errata.
15217 (This flag currently works around the SB-1 revision 2
15218 ``F1'' and ``F2'' floating point errata.)
15219
15220 @item -mr10k-cache-barrier=@var{setting}
15221 @opindex mr10k-cache-barrier
15222 Specify whether GCC should insert cache barriers to avoid the
15223 side-effects of speculation on R10K processors.
15224
15225 In common with many processors, the R10K tries to predict the outcome
15226 of a conditional branch and speculatively executes instructions from
15227 the ``taken'' branch.  It later aborts these instructions if the
15228 predicted outcome was wrong.  However, on the R10K, even aborted
15229 instructions can have side effects.
15230
15231 This problem only affects kernel stores and, depending on the system,
15232 kernel loads.  As an example, a speculatively-executed store may load
15233 the target memory into cache and mark the cache line as dirty, even if
15234 the store itself is later aborted.  If a DMA operation writes to the
15235 same area of memory before the ``dirty'' line is flushed, the cached
15236 data will overwrite the DMA-ed data.  See the R10K processor manual
15237 for a full description, including other potential problems.
15238
15239 One workaround is to insert cache barrier instructions before every memory
15240 access that might be speculatively executed and that might have side
15241 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
15242 controls GCC's implementation of this workaround.  It assumes that
15243 aborted accesses to any byte in the following regions will not have
15244 side effects:
15245
15246 @enumerate
15247 @item
15248 the memory occupied by the current function's stack frame;
15249
15250 @item
15251 the memory occupied by an incoming stack argument;
15252
15253 @item
15254 the memory occupied by an object with a link-time-constant address.
15255 @end enumerate
15256
15257 It is the kernel's responsibility to ensure that speculative
15258 accesses to these regions are indeed safe.
15259
15260 If the input program contains a function declaration such as:
15261
15262 @smallexample
15263 void foo (void);
15264 @end smallexample
15265
15266 then the implementation of @code{foo} must allow @code{j foo} and
15267 @code{jal foo} to be executed speculatively.  GCC honors this
15268 restriction for functions it compiles itself.  It expects non-GCC
15269 functions (such as hand-written assembly code) to do the same.
15270
15271 The option has three forms:
15272
15273 @table @gcctabopt
15274 @item -mr10k-cache-barrier=load-store
15275 Insert a cache barrier before a load or store that might be
15276 speculatively executed and that might have side effects even
15277 if aborted.
15278
15279 @item -mr10k-cache-barrier=store
15280 Insert a cache barrier before a store that might be speculatively
15281 executed and that might have side effects even if aborted.
15282
15283 @item -mr10k-cache-barrier=none
15284 Disable the insertion of cache barriers.  This is the default setting.
15285 @end table
15286
15287 @item -mflush-func=@var{func}
15288 @itemx -mno-flush-func
15289 @opindex mflush-func
15290 Specifies the function to call to flush the I and D caches, or to not
15291 call any such function.  If called, the function must take the same
15292 arguments as the common @code{_flush_func()}, that is, the address of the
15293 memory range for which the cache is being flushed, the size of the
15294 memory range, and the number 3 (to flush both caches).  The default
15295 depends on the target GCC was configured for, but commonly is either
15296 @samp{_flush_func} or @samp{__cpu_flush}.
15297
15298 @item mbranch-cost=@var{num}
15299 @opindex mbranch-cost
15300 Set the cost of branches to roughly @var{num} ``simple'' instructions.
15301 This cost is only a heuristic and is not guaranteed to produce
15302 consistent results across releases.  A zero cost redundantly selects
15303 the default, which is based on the @option{-mtune} setting.
15304
15305 @item -mbranch-likely
15306 @itemx -mno-branch-likely
15307 @opindex mbranch-likely
15308 @opindex mno-branch-likely
15309 Enable or disable use of Branch Likely instructions, regardless of the
15310 default for the selected architecture.  By default, Branch Likely
15311 instructions may be generated if they are supported by the selected
15312 architecture.  An exception is for the MIPS32 and MIPS64 architectures
15313 and processors which implement those architectures; for those, Branch
15314 Likely instructions will not be generated by default because the MIPS32
15315 and MIPS64 architectures specifically deprecate their use.
15316
15317 @item -mfp-exceptions
15318 @itemx -mno-fp-exceptions
15319 @opindex mfp-exceptions
15320 Specifies whether FP exceptions are enabled.  This affects how we schedule
15321 FP instructions for some processors.  The default is that FP exceptions are
15322 enabled.
15323
15324 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
15325 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
15326 FP pipe.
15327
15328 @item -mvr4130-align
15329 @itemx -mno-vr4130-align
15330 @opindex mvr4130-align
15331 The VR4130 pipeline is two-way superscalar, but can only issue two
15332 instructions together if the first one is 8-byte aligned.  When this
15333 option is enabled, GCC will align pairs of instructions that it
15334 thinks should execute in parallel.
15335
15336 This option only has an effect when optimizing for the VR4130.
15337 It normally makes code faster, but at the expense of making it bigger.
15338 It is enabled by default at optimization level @option{-O3}.
15339
15340 @item -msynci
15341 @itemx -mno-synci
15342 @opindex msynci
15343 Enable (disable) generation of @code{synci} instructions on
15344 architectures that support it.  The @code{synci} instructions (if
15345 enabled) will be generated when @code{__builtin___clear_cache()} is
15346 compiled.
15347
15348 This option defaults to @code{-mno-synci}, but the default can be
15349 overridden by configuring with @code{--with-synci}.
15350
15351 When compiling code for single processor systems, it is generally safe
15352 to use @code{synci}.  However, on many multi-core (SMP) systems, it
15353 will not invalidate the instruction caches on all cores and may lead
15354 to undefined behavior.
15355
15356 @item -mrelax-pic-calls
15357 @itemx -mno-relax-pic-calls
15358 @opindex mrelax-pic-calls
15359 Try to turn PIC calls that are normally dispatched via register
15360 @code{$25} into direct calls.  This is only possible if the linker can
15361 resolve the destination at link-time and if the destination is within
15362 range for a direct call.
15363
15364 @option{-mrelax-pic-calls} is the default if GCC was configured to use
15365 an assembler and a linker that supports the @code{.reloc} assembly
15366 directive and @code{-mexplicit-relocs} is in effect.  With
15367 @code{-mno-explicit-relocs}, this optimization can be performed by the
15368 assembler and the linker alone without help from the compiler.
15369
15370 @item -mmcount-ra-address
15371 @itemx -mno-mcount-ra-address
15372 @opindex mmcount-ra-address
15373 @opindex mno-mcount-ra-address
15374 Emit (do not emit) code that allows @code{_mcount} to modify the
15375 calling function's return address.  When enabled, this option extends
15376 the usual @code{_mcount} interface with a new @var{ra-address}
15377 parameter, which has type @code{intptr_t *} and is passed in register
15378 @code{$12}.  @code{_mcount} can then modify the return address by
15379 doing both of the following:
15380 @itemize
15381 @item
15382 Returning the new address in register @code{$31}.
15383 @item
15384 Storing the new address in @code{*@var{ra-address}},
15385 if @var{ra-address} is nonnull.
15386 @end itemize
15387
15388 The default is @option{-mno-mcount-ra-address}.
15389
15390 @end table
15391
15392 @node MMIX Options
15393 @subsection MMIX Options
15394 @cindex MMIX Options
15395
15396 These options are defined for the MMIX:
15397
15398 @table @gcctabopt
15399 @item -mlibfuncs
15400 @itemx -mno-libfuncs
15401 @opindex mlibfuncs
15402 @opindex mno-libfuncs
15403 Specify that intrinsic library functions are being compiled, passing all
15404 values in registers, no matter the size.
15405
15406 @item -mepsilon
15407 @itemx -mno-epsilon
15408 @opindex mepsilon
15409 @opindex mno-epsilon
15410 Generate floating-point comparison instructions that compare with respect
15411 to the @code{rE} epsilon register.
15412
15413 @item -mabi=mmixware
15414 @itemx -mabi=gnu
15415 @opindex mabi=mmixware
15416 @opindex mabi=gnu
15417 Generate code that passes function parameters and return values that (in
15418 the called function) are seen as registers @code{$0} and up, as opposed to
15419 the GNU ABI which uses global registers @code{$231} and up.
15420
15421 @item -mzero-extend
15422 @itemx -mno-zero-extend
15423 @opindex mzero-extend
15424 @opindex mno-zero-extend
15425 When reading data from memory in sizes shorter than 64 bits, use (do not
15426 use) zero-extending load instructions by default, rather than
15427 sign-extending ones.
15428
15429 @item -mknuthdiv
15430 @itemx -mno-knuthdiv
15431 @opindex mknuthdiv
15432 @opindex mno-knuthdiv
15433 Make the result of a division yielding a remainder have the same sign as
15434 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
15435 remainder follows the sign of the dividend.  Both methods are
15436 arithmetically valid, the latter being almost exclusively used.
15437
15438 @item -mtoplevel-symbols
15439 @itemx -mno-toplevel-symbols
15440 @opindex mtoplevel-symbols
15441 @opindex mno-toplevel-symbols
15442 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
15443 code can be used with the @code{PREFIX} assembly directive.
15444
15445 @item -melf
15446 @opindex melf
15447 Generate an executable in the ELF format, rather than the default
15448 @samp{mmo} format used by the @command{mmix} simulator.
15449
15450 @item -mbranch-predict
15451 @itemx -mno-branch-predict
15452 @opindex mbranch-predict
15453 @opindex mno-branch-predict
15454 Use (do not use) the probable-branch instructions, when static branch
15455 prediction indicates a probable branch.
15456
15457 @item -mbase-addresses
15458 @itemx -mno-base-addresses
15459 @opindex mbase-addresses
15460 @opindex mno-base-addresses
15461 Generate (do not generate) code that uses @emph{base addresses}.  Using a
15462 base address automatically generates a request (handled by the assembler
15463 and the linker) for a constant to be set up in a global register.  The
15464 register is used for one or more base address requests within the range 0
15465 to 255 from the value held in the register.  The generally leads to short
15466 and fast code, but the number of different data items that can be
15467 addressed is limited.  This means that a program that uses lots of static
15468 data may require @option{-mno-base-addresses}.
15469
15470 @item -msingle-exit
15471 @itemx -mno-single-exit
15472 @opindex msingle-exit
15473 @opindex mno-single-exit
15474 Force (do not force) generated code to have a single exit point in each
15475 function.
15476 @end table
15477
15478 @node MN10300 Options
15479 @subsection MN10300 Options
15480 @cindex MN10300 options
15481
15482 These @option{-m} options are defined for Matsushita MN10300 architectures:
15483
15484 @table @gcctabopt
15485 @item -mmult-bug
15486 @opindex mmult-bug
15487 Generate code to avoid bugs in the multiply instructions for the MN10300
15488 processors.  This is the default.
15489
15490 @item -mno-mult-bug
15491 @opindex mno-mult-bug
15492 Do not generate code to avoid bugs in the multiply instructions for the
15493 MN10300 processors.
15494
15495 @item -mam33
15496 @opindex mam33
15497 Generate code which uses features specific to the AM33 processor.
15498
15499 @item -mno-am33
15500 @opindex mno-am33
15501 Do not generate code which uses features specific to the AM33 processor.  This
15502 is the default.
15503
15504 @item -mam33-2
15505 @opindex mam33-2
15506 Generate code which uses features specific to the AM33/2.0 processor.
15507
15508 @item -mam34
15509 @opindex mam34
15510 Generate code which uses features specific to the AM34 processor.
15511
15512 @item -mtune=@var{cpu-type}
15513 @opindex mtune
15514 Use the timing characteristics of the indicated CPU type when
15515 scheduling instructions.  This does not change the targeted processor
15516 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
15517 @samp{am33-2} or @samp{am34}.
15518
15519 @item -mreturn-pointer-on-d0
15520 @opindex mreturn-pointer-on-d0
15521 When generating a function which returns a pointer, return the pointer
15522 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
15523 only in a0, and attempts to call such functions without a prototype
15524 would result in errors.  Note that this option is on by default; use
15525 @option{-mno-return-pointer-on-d0} to disable it.
15526
15527 @item -mno-crt0
15528 @opindex mno-crt0
15529 Do not link in the C run-time initialization object file.
15530
15531 @item -mrelax
15532 @opindex mrelax
15533 Indicate to the linker that it should perform a relaxation optimization pass
15534 to shorten branches, calls and absolute memory addresses.  This option only
15535 has an effect when used on the command line for the final link step.
15536
15537 This option makes symbolic debugging impossible.
15538
15539 @item -mliw
15540 @opindex mliw
15541 Allow the compiler to generate @emph{Long Instruction Word}
15542 instructions if the target is the @samp{AM33} or later.  This is the
15543 default.  This option defines the preprocessor macro @samp{__LIW__}.
15544
15545 @item -mnoliw
15546 @opindex mnoliw
15547 Do not allow the compiler to generate @emph{Long Instruction Word}
15548 instructions.  This option defines the preprocessor macro
15549 @samp{__NO_LIW__}.
15550
15551 @item -msetlb
15552 @opindex msetlb
15553 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
15554 instructions if the target is the @samp{AM33} or later.  This is the
15555 default.  This option defines the preprocessor macro @samp{__SETLB__}.
15556
15557 @item -mnosetlb
15558 @opindex mnosetlb
15559 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
15560 instructions.  This option defines the preprocessor macro
15561 @samp{__NO_SETLB__}.
15562
15563 @end table
15564
15565 @node PDP-11 Options
15566 @subsection PDP-11 Options
15567 @cindex PDP-11 Options
15568
15569 These options are defined for the PDP-11:
15570
15571 @table @gcctabopt
15572 @item -mfpu
15573 @opindex mfpu
15574 Use hardware FPP floating point.  This is the default.  (FIS floating
15575 point on the PDP-11/40 is not supported.)
15576
15577 @item -msoft-float
15578 @opindex msoft-float
15579 Do not use hardware floating point.
15580
15581 @item -mac0
15582 @opindex mac0
15583 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
15584
15585 @item -mno-ac0
15586 @opindex mno-ac0
15587 Return floating-point results in memory.  This is the default.
15588
15589 @item -m40
15590 @opindex m40
15591 Generate code for a PDP-11/40.
15592
15593 @item -m45
15594 @opindex m45
15595 Generate code for a PDP-11/45.  This is the default.
15596
15597 @item -m10
15598 @opindex m10
15599 Generate code for a PDP-11/10.
15600
15601 @item -mbcopy-builtin
15602 @opindex mbcopy-builtin
15603 Use inline @code{movmemhi} patterns for copying memory.  This is the
15604 default.
15605
15606 @item -mbcopy
15607 @opindex mbcopy
15608 Do not use inline @code{movmemhi} patterns for copying memory.
15609
15610 @item -mint16
15611 @itemx -mno-int32
15612 @opindex mint16
15613 @opindex mno-int32
15614 Use 16-bit @code{int}.  This is the default.
15615
15616 @item -mint32
15617 @itemx -mno-int16
15618 @opindex mint32
15619 @opindex mno-int16
15620 Use 32-bit @code{int}.
15621
15622 @item -mfloat64
15623 @itemx -mno-float32
15624 @opindex mfloat64
15625 @opindex mno-float32
15626 Use 64-bit @code{float}.  This is the default.
15627
15628 @item -mfloat32
15629 @itemx -mno-float64
15630 @opindex mfloat32
15631 @opindex mno-float64
15632 Use 32-bit @code{float}.
15633
15634 @item -mabshi
15635 @opindex mabshi
15636 Use @code{abshi2} pattern.  This is the default.
15637
15638 @item -mno-abshi
15639 @opindex mno-abshi
15640 Do not use @code{abshi2} pattern.
15641
15642 @item -mbranch-expensive
15643 @opindex mbranch-expensive
15644 Pretend that branches are expensive.  This is for experimenting with
15645 code generation only.
15646
15647 @item -mbranch-cheap
15648 @opindex mbranch-cheap
15649 Do not pretend that branches are expensive.  This is the default.
15650
15651 @item -munix-asm
15652 @opindex munix-asm
15653 Use Unix assembler syntax.  This is the default when configured for
15654 @samp{pdp11-*-bsd}.
15655
15656 @item -mdec-asm
15657 @opindex mdec-asm
15658 Use DEC assembler syntax.  This is the default when configured for any
15659 PDP-11 target other than @samp{pdp11-*-bsd}.
15660 @end table
15661
15662 @node picoChip Options
15663 @subsection picoChip Options
15664 @cindex picoChip options
15665
15666 These @samp{-m} options are defined for picoChip implementations:
15667
15668 @table @gcctabopt
15669
15670 @item -mae=@var{ae_type}
15671 @opindex mcpu
15672 Set the instruction set, register set, and instruction scheduling
15673 parameters for array element type @var{ae_type}.  Supported values
15674 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
15675
15676 @option{-mae=ANY} selects a completely generic AE type.  Code
15677 generated with this option will run on any of the other AE types.  The
15678 code will not be as efficient as it would be if compiled for a specific
15679 AE type, and some types of operation (e.g., multiplication) will not
15680 work properly on all types of AE.
15681
15682 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
15683 for compiled code, and is the default.
15684
15685 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
15686 option may suffer from poor performance of byte (char) manipulation,
15687 since the DSP AE does not provide hardware support for byte load/stores.
15688
15689 @item -msymbol-as-address
15690 Enable the compiler to directly use a symbol name as an address in a
15691 load/store instruction, without first loading it into a
15692 register.  Typically, the use of this option will generate larger
15693 programs, which run faster than when the option isn't used.  However, the
15694 results vary from program to program, so it is left as a user option,
15695 rather than being permanently enabled.
15696
15697 @item -mno-inefficient-warnings
15698 Disables warnings about the generation of inefficient code.  These
15699 warnings can be generated, for example, when compiling code which
15700 performs byte-level memory operations on the MAC AE type.  The MAC AE has
15701 no hardware support for byte-level memory operations, so all byte
15702 load/stores must be synthesized from word load/store operations.  This is
15703 inefficient and a warning will be generated indicating to the programmer
15704 that they should rewrite the code to avoid byte operations, or to target
15705 an AE type which has the necessary hardware support.  This option enables
15706 the warning to be turned off.
15707
15708 @end table
15709
15710 @node PowerPC Options
15711 @subsection PowerPC Options
15712 @cindex PowerPC options
15713
15714 These are listed under @xref{RS/6000 and PowerPC Options}.
15715
15716 @node RS/6000 and PowerPC Options
15717 @subsection IBM RS/6000 and PowerPC Options
15718 @cindex RS/6000 and PowerPC Options
15719 @cindex IBM RS/6000 and PowerPC Options
15720
15721 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
15722 @table @gcctabopt
15723 @item -mpower
15724 @itemx -mno-power
15725 @itemx -mpower2
15726 @itemx -mno-power2
15727 @itemx -mpowerpc
15728 @itemx -mno-powerpc
15729 @itemx -mpowerpc-gpopt
15730 @itemx -mno-powerpc-gpopt
15731 @itemx -mpowerpc-gfxopt
15732 @itemx -mno-powerpc-gfxopt
15733 @need 800
15734 @itemx -mpowerpc64
15735 @itemx -mno-powerpc64
15736 @itemx -mmfcrf
15737 @itemx -mno-mfcrf
15738 @itemx -mpopcntb
15739 @itemx -mno-popcntb
15740 @itemx -mpopcntd
15741 @itemx -mno-popcntd
15742 @itemx -mfprnd
15743 @itemx -mno-fprnd
15744 @need 800
15745 @itemx -mcmpb
15746 @itemx -mno-cmpb
15747 @itemx -mmfpgpr
15748 @itemx -mno-mfpgpr
15749 @itemx -mhard-dfp
15750 @itemx -mno-hard-dfp
15751 @opindex mpower
15752 @opindex mno-power
15753 @opindex mpower2
15754 @opindex mno-power2
15755 @opindex mpowerpc
15756 @opindex mno-powerpc
15757 @opindex mpowerpc-gpopt
15758 @opindex mno-powerpc-gpopt
15759 @opindex mpowerpc-gfxopt
15760 @opindex mno-powerpc-gfxopt
15761 @opindex mpowerpc64
15762 @opindex mno-powerpc64
15763 @opindex mmfcrf
15764 @opindex mno-mfcrf
15765 @opindex mpopcntb
15766 @opindex mno-popcntb
15767 @opindex mpopcntd
15768 @opindex mno-popcntd
15769 @opindex mfprnd
15770 @opindex mno-fprnd
15771 @opindex mcmpb
15772 @opindex mno-cmpb
15773 @opindex mmfpgpr
15774 @opindex mno-mfpgpr
15775 @opindex mhard-dfp
15776 @opindex mno-hard-dfp
15777 GCC supports two related instruction set architectures for the
15778 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
15779 instructions supported by the @samp{rios} chip set used in the original
15780 RS/6000 systems and the @dfn{PowerPC} instruction set is the
15781 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
15782 the IBM 4xx, 6xx, and follow-on microprocessors.
15783
15784 Neither architecture is a subset of the other.  However there is a
15785 large common subset of instructions supported by both.  An MQ
15786 register is included in processors supporting the POWER architecture.
15787
15788 You use these options to specify which instructions are available on the
15789 processor you are using.  The default value of these options is
15790 determined when configuring GCC@.  Specifying the
15791 @option{-mcpu=@var{cpu_type}} overrides the specification of these
15792 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
15793 rather than the options listed above.
15794
15795 The @option{-mpower} option allows GCC to generate instructions that
15796 are found only in the POWER architecture and to use the MQ register.
15797 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
15798 to generate instructions that are present in the POWER2 architecture but
15799 not the original POWER architecture.
15800
15801 The @option{-mpowerpc} option allows GCC to generate instructions that
15802 are found only in the 32-bit subset of the PowerPC architecture.
15803 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
15804 GCC to use the optional PowerPC architecture instructions in the
15805 General Purpose group, including floating-point square root.  Specifying
15806 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
15807 use the optional PowerPC architecture instructions in the Graphics
15808 group, including floating-point select.
15809
15810 The @option{-mmfcrf} option allows GCC to generate the move from
15811 condition register field instruction implemented on the POWER4
15812 processor and other processors that support the PowerPC V2.01
15813 architecture.
15814 The @option{-mpopcntb} option allows GCC to generate the popcount and
15815 double precision FP reciprocal estimate instruction implemented on the
15816 POWER5 processor and other processors that support the PowerPC V2.02
15817 architecture.
15818 The @option{-mpopcntd} option allows GCC to generate the popcount
15819 instruction implemented on the POWER7 processor and other processors
15820 that support the PowerPC V2.06 architecture.
15821 The @option{-mfprnd} option allows GCC to generate the FP round to
15822 integer instructions implemented on the POWER5+ processor and other
15823 processors that support the PowerPC V2.03 architecture.
15824 The @option{-mcmpb} option allows GCC to generate the compare bytes
15825 instruction implemented on the POWER6 processor and other processors
15826 that support the PowerPC V2.05 architecture.
15827 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
15828 general purpose register instructions implemented on the POWER6X
15829 processor and other processors that support the extended PowerPC V2.05
15830 architecture.
15831 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
15832 point instructions implemented on some POWER processors.
15833
15834 The @option{-mpowerpc64} option allows GCC to generate the additional
15835 64-bit instructions that are found in the full PowerPC64 architecture
15836 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
15837 @option{-mno-powerpc64}.
15838
15839 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
15840 will use only the instructions in the common subset of both
15841 architectures plus some special AIX common-mode calls, and will not use
15842 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
15843 permits GCC to use any instruction from either architecture and to
15844 allow use of the MQ register; specify this for the Motorola MPC601.
15845
15846 @item -mnew-mnemonics
15847 @itemx -mold-mnemonics
15848 @opindex mnew-mnemonics
15849 @opindex mold-mnemonics
15850 Select which mnemonics to use in the generated assembler code.  With
15851 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
15852 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
15853 assembler mnemonics defined for the POWER architecture.  Instructions
15854 defined in only one architecture have only one mnemonic; GCC uses that
15855 mnemonic irrespective of which of these options is specified.
15856
15857 GCC defaults to the mnemonics appropriate for the architecture in
15858 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
15859 value of these option.  Unless you are building a cross-compiler, you
15860 should normally not specify either @option{-mnew-mnemonics} or
15861 @option{-mold-mnemonics}, but should instead accept the default.
15862
15863 @item -mcpu=@var{cpu_type}
15864 @opindex mcpu
15865 Set architecture type, register usage, choice of mnemonics, and
15866 instruction scheduling parameters for machine type @var{cpu_type}.
15867 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
15868 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
15869 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
15870 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
15871 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
15872 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
15873 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
15874 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
15875 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
15876 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
15877 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
15878
15879 @option{-mcpu=common} selects a completely generic processor.  Code
15880 generated under this option will run on any POWER or PowerPC processor.
15881 GCC will use only the instructions in the common subset of both
15882 architectures, and will not use the MQ register.  GCC assumes a generic
15883 processor model for scheduling purposes.
15884
15885 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
15886 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
15887 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
15888 types, with an appropriate, generic processor model assumed for
15889 scheduling purposes.
15890
15891 The other options specify a specific processor.  Code generated under
15892 those options will run best on that processor, and may not run at all on
15893 others.
15894
15895 The @option{-mcpu} options automatically enable or disable the
15896 following options:
15897
15898 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
15899 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
15900 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
15901 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
15902
15903 The particular options set for any particular CPU will vary between
15904 compiler versions, depending on what setting seems to produce optimal
15905 code for that CPU; it doesn't necessarily reflect the actual hardware's
15906 capabilities.  If you wish to set an individual option to a particular
15907 value, you may specify it after the @option{-mcpu} option, like
15908 @samp{-mcpu=970 -mno-altivec}.
15909
15910 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
15911 not enabled or disabled by the @option{-mcpu} option at present because
15912 AIX does not have full support for these options.  You may still
15913 enable or disable them individually if you're sure it'll work in your
15914 environment.
15915
15916 @item -mtune=@var{cpu_type}
15917 @opindex mtune
15918 Set the instruction scheduling parameters for machine type
15919 @var{cpu_type}, but do not set the architecture type, register usage, or
15920 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
15921 values for @var{cpu_type} are used for @option{-mtune} as for
15922 @option{-mcpu}.  If both are specified, the code generated will use the
15923 architecture, registers, and mnemonics set by @option{-mcpu}, but the
15924 scheduling parameters set by @option{-mtune}.
15925
15926 @item -mcmodel=small
15927 @opindex mcmodel=small
15928 Generate PowerPC64 code for the small model: The TOC is limited to
15929 64k.
15930
15931 @item -mcmodel=medium
15932 @opindex mcmodel=medium
15933 Generate PowerPC64 code for the medium model: The TOC and other static
15934 data may be up to a total of 4G in size.
15935
15936 @item -mcmodel=large
15937 @opindex mcmodel=large
15938 Generate PowerPC64 code for the large model: The TOC may be up to 4G
15939 in size.  Other data and code is only limited by the 64-bit address
15940 space.
15941
15942 @item -maltivec
15943 @itemx -mno-altivec
15944 @opindex maltivec
15945 @opindex mno-altivec
15946 Generate code that uses (does not use) AltiVec instructions, and also
15947 enable the use of built-in functions that allow more direct access to
15948 the AltiVec instruction set.  You may also need to set
15949 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
15950 enhancements.
15951
15952 @item -mvrsave
15953 @itemx -mno-vrsave
15954 @opindex mvrsave
15955 @opindex mno-vrsave
15956 Generate VRSAVE instructions when generating AltiVec code.
15957
15958 @item -mgen-cell-microcode
15959 @opindex mgen-cell-microcode
15960 Generate Cell microcode instructions
15961
15962 @item -mwarn-cell-microcode
15963 @opindex mwarn-cell-microcode
15964 Warning when a Cell microcode instruction is going to emitted.  An example
15965 of a Cell microcode instruction is a variable shift.
15966
15967 @item -msecure-plt
15968 @opindex msecure-plt
15969 Generate code that allows ld and ld.so to build executables and shared
15970 libraries with non-exec .plt and .got sections.  This is a PowerPC
15971 32-bit SYSV ABI option.
15972
15973 @item -mbss-plt
15974 @opindex mbss-plt
15975 Generate code that uses a BSS .plt section that ld.so fills in, and
15976 requires .plt and .got sections that are both writable and executable.
15977 This is a PowerPC 32-bit SYSV ABI option.
15978
15979 @item -misel
15980 @itemx -mno-isel
15981 @opindex misel
15982 @opindex mno-isel
15983 This switch enables or disables the generation of ISEL instructions.
15984
15985 @item -misel=@var{yes/no}
15986 This switch has been deprecated.  Use @option{-misel} and
15987 @option{-mno-isel} instead.
15988
15989 @item -mspe
15990 @itemx -mno-spe
15991 @opindex mspe
15992 @opindex mno-spe
15993 This switch enables or disables the generation of SPE simd
15994 instructions.
15995
15996 @item -mpaired
15997 @itemx -mno-paired
15998 @opindex mpaired
15999 @opindex mno-paired
16000 This switch enables or disables the generation of PAIRED simd
16001 instructions.
16002
16003 @item -mspe=@var{yes/no}
16004 This option has been deprecated.  Use @option{-mspe} and
16005 @option{-mno-spe} instead.
16006
16007 @item -mvsx
16008 @itemx -mno-vsx
16009 @opindex mvsx
16010 @opindex mno-vsx
16011 Generate code that uses (does not use) vector/scalar (VSX)
16012 instructions, and also enable the use of built-in functions that allow
16013 more direct access to the VSX instruction set.
16014
16015 @item -mfloat-gprs=@var{yes/single/double/no}
16016 @itemx -mfloat-gprs
16017 @opindex mfloat-gprs
16018 This switch enables or disables the generation of floating point
16019 operations on the general purpose registers for architectures that
16020 support it.
16021
16022 The argument @var{yes} or @var{single} enables the use of
16023 single-precision floating point operations.
16024
16025 The argument @var{double} enables the use of single and
16026 double-precision floating point operations.
16027
16028 The argument @var{no} disables floating point operations on the
16029 general purpose registers.
16030
16031 This option is currently only available on the MPC854x.
16032
16033 @item -m32
16034 @itemx -m64
16035 @opindex m32
16036 @opindex m64
16037 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
16038 targets (including GNU/Linux).  The 32-bit environment sets int, long
16039 and pointer to 32 bits and generates code that runs on any PowerPC
16040 variant.  The 64-bit environment sets int to 32 bits and long and
16041 pointer to 64 bits, and generates code for PowerPC64, as for
16042 @option{-mpowerpc64}.
16043
16044 @item -mfull-toc
16045 @itemx -mno-fp-in-toc
16046 @itemx -mno-sum-in-toc
16047 @itemx -mminimal-toc
16048 @opindex mfull-toc
16049 @opindex mno-fp-in-toc
16050 @opindex mno-sum-in-toc
16051 @opindex mminimal-toc
16052 Modify generation of the TOC (Table Of Contents), which is created for
16053 every executable file.  The @option{-mfull-toc} option is selected by
16054 default.  In that case, GCC will allocate at least one TOC entry for
16055 each unique non-automatic variable reference in your program.  GCC
16056 will also place floating-point constants in the TOC@.  However, only
16057 16,384 entries are available in the TOC@.
16058
16059 If you receive a linker error message that saying you have overflowed
16060 the available TOC space, you can reduce the amount of TOC space used
16061 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
16062 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
16063 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
16064 generate code to calculate the sum of an address and a constant at
16065 run-time instead of putting that sum into the TOC@.  You may specify one
16066 or both of these options.  Each causes GCC to produce very slightly
16067 slower and larger code at the expense of conserving TOC space.
16068
16069 If you still run out of space in the TOC even when you specify both of
16070 these options, specify @option{-mminimal-toc} instead.  This option causes
16071 GCC to make only one TOC entry for every file.  When you specify this
16072 option, GCC will produce code that is slower and larger but which
16073 uses extremely little TOC space.  You may wish to use this option
16074 only on files that contain less frequently executed code.
16075
16076 @item -maix64
16077 @itemx -maix32
16078 @opindex maix64
16079 @opindex maix32
16080 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
16081 @code{long} type, and the infrastructure needed to support them.
16082 Specifying @option{-maix64} implies @option{-mpowerpc64} and
16083 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
16084 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
16085
16086 @item -mxl-compat
16087 @itemx -mno-xl-compat
16088 @opindex mxl-compat
16089 @opindex mno-xl-compat
16090 Produce code that conforms more closely to IBM XL compiler semantics
16091 when using AIX-compatible ABI@.  Pass floating-point arguments to
16092 prototyped functions beyond the register save area (RSA) on the stack
16093 in addition to argument FPRs.  Do not assume that most significant
16094 double in 128-bit long double value is properly rounded when comparing
16095 values and converting to double.  Use XL symbol names for long double
16096 support routines.
16097
16098 The AIX calling convention was extended but not initially documented to
16099 handle an obscure K&R C case of calling a function that takes the
16100 address of its arguments with fewer arguments than declared.  IBM XL
16101 compilers access floating point arguments which do not fit in the
16102 RSA from the stack when a subroutine is compiled without
16103 optimization.  Because always storing floating-point arguments on the
16104 stack is inefficient and rarely needed, this option is not enabled by
16105 default and only is necessary when calling subroutines compiled by IBM
16106 XL compilers without optimization.
16107
16108 @item -mpe
16109 @opindex mpe
16110 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
16111 application written to use message passing with special startup code to
16112 enable the application to run.  The system must have PE installed in the
16113 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
16114 must be overridden with the @option{-specs=} option to specify the
16115 appropriate directory location.  The Parallel Environment does not
16116 support threads, so the @option{-mpe} option and the @option{-pthread}
16117 option are incompatible.
16118
16119 @item -malign-natural
16120 @itemx -malign-power
16121 @opindex malign-natural
16122 @opindex malign-power
16123 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
16124 @option{-malign-natural} overrides the ABI-defined alignment of larger
16125 types, such as floating-point doubles, on their natural size-based boundary.
16126 The option @option{-malign-power} instructs GCC to follow the ABI-specified
16127 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
16128
16129 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
16130 is not supported.
16131
16132 @item -msoft-float
16133 @itemx -mhard-float
16134 @opindex msoft-float
16135 @opindex mhard-float
16136 Generate code that does not use (uses) the floating-point register set.
16137 Software floating point emulation is provided if you use the
16138 @option{-msoft-float} option, and pass the option to GCC when linking.
16139
16140 @item -msingle-float
16141 @itemx -mdouble-float
16142 @opindex msingle-float
16143 @opindex mdouble-float
16144 Generate code for single or double-precision floating point operations.
16145 @option{-mdouble-float} implies @option{-msingle-float}.
16146
16147 @item -msimple-fpu
16148 @opindex msimple-fpu
16149 Do not generate sqrt and div instructions for hardware floating point unit.
16150
16151 @item -mfpu
16152 @opindex mfpu
16153 Specify type of floating point unit.  Valid values are @var{sp_lite}
16154 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
16155 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
16156 and @var{dp_full} (equivalent to -mdouble-float).
16157
16158 @item -mxilinx-fpu
16159 @opindex mxilinx-fpu
16160 Perform optimizations for floating point unit on Xilinx PPC 405/440.
16161
16162 @item -mmultiple
16163 @itemx -mno-multiple
16164 @opindex mmultiple
16165 @opindex mno-multiple
16166 Generate code that uses (does not use) the load multiple word
16167 instructions and the store multiple word instructions.  These
16168 instructions are generated by default on POWER systems, and not
16169 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
16170 endian PowerPC systems, since those instructions do not work when the
16171 processor is in little endian mode.  The exceptions are PPC740 and
16172 PPC750 which permit the instructions usage in little endian mode.
16173
16174 @item -mstring
16175 @itemx -mno-string
16176 @opindex mstring
16177 @opindex mno-string
16178 Generate code that uses (does not use) the load string instructions
16179 and the store string word instructions to save multiple registers and
16180 do small block moves.  These instructions are generated by default on
16181 POWER systems, and not generated on PowerPC systems.  Do not use
16182 @option{-mstring} on little endian PowerPC systems, since those
16183 instructions do not work when the processor is in little endian mode.
16184 The exceptions are PPC740 and PPC750 which permit the instructions
16185 usage in little endian mode.
16186
16187 @item -mupdate
16188 @itemx -mno-update
16189 @opindex mupdate
16190 @opindex mno-update
16191 Generate code that uses (does not use) the load or store instructions
16192 that update the base register to the address of the calculated memory
16193 location.  These instructions are generated by default.  If you use
16194 @option{-mno-update}, there is a small window between the time that the
16195 stack pointer is updated and the address of the previous frame is
16196 stored, which means code that walks the stack frame across interrupts or
16197 signals may get corrupted data.
16198
16199 @item -mavoid-indexed-addresses
16200 @itemx -mno-avoid-indexed-addresses
16201 @opindex mavoid-indexed-addresses
16202 @opindex mno-avoid-indexed-addresses
16203 Generate code that tries to avoid (not avoid) the use of indexed load
16204 or store instructions. These instructions can incur a performance
16205 penalty on Power6 processors in certain situations, such as when
16206 stepping through large arrays that cross a 16M boundary.  This option
16207 is enabled by default when targetting Power6 and disabled otherwise.
16208
16209 @item -mfused-madd
16210 @itemx -mno-fused-madd
16211 @opindex mfused-madd
16212 @opindex mno-fused-madd
16213 Generate code that uses (does not use) the floating point multiply and
16214 accumulate instructions.  These instructions are generated by default
16215 if hardware floating point is used.  The machine dependent
16216 @option{-mfused-madd} option is now mapped to the machine independent
16217 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
16218 mapped to @option{-ffp-contract=off}.
16219
16220 @item -mmulhw
16221 @itemx -mno-mulhw
16222 @opindex mmulhw
16223 @opindex mno-mulhw
16224 Generate code that uses (does not use) the half-word multiply and
16225 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
16226 These instructions are generated by default when targetting those
16227 processors.
16228
16229 @item -mdlmzb
16230 @itemx -mno-dlmzb
16231 @opindex mdlmzb
16232 @opindex mno-dlmzb
16233 Generate code that uses (does not use) the string-search @samp{dlmzb}
16234 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
16235 generated by default when targetting those processors.
16236
16237 @item -mno-bit-align
16238 @itemx -mbit-align
16239 @opindex mno-bit-align
16240 @opindex mbit-align
16241 On System V.4 and embedded PowerPC systems do not (do) force structures
16242 and unions that contain bit-fields to be aligned to the base type of the
16243 bit-field.
16244
16245 For example, by default a structure containing nothing but 8
16246 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
16247 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
16248 the structure would be aligned to a 1 byte boundary and be one byte in
16249 size.
16250
16251 @item -mno-strict-align
16252 @itemx -mstrict-align
16253 @opindex mno-strict-align
16254 @opindex mstrict-align
16255 On System V.4 and embedded PowerPC systems do not (do) assume that
16256 unaligned memory references will be handled by the system.
16257
16258 @item -mrelocatable
16259 @itemx -mno-relocatable
16260 @opindex mrelocatable
16261 @opindex mno-relocatable
16262 Generate code that allows (does not allow) a static executable to be
16263 relocated to a different address at runtime.  A simple embedded
16264 PowerPC system loader should relocate the entire contents of
16265 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
16266 a table of 32-bit addresses generated by this option.  For this to
16267 work, all objects linked together must be compiled with
16268 @option{-mrelocatable} or @option{-mrelocatable-lib}.
16269 @option{-mrelocatable} code aligns the stack to an 8 byte boundary.
16270
16271 @item -mrelocatable-lib
16272 @itemx -mno-relocatable-lib
16273 @opindex mrelocatable-lib
16274 @opindex mno-relocatable-lib
16275 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
16276 @code{.fixup} section to allow static executables to be relocated at
16277 runtime, but @option{-mrelocatable-lib} does not use the smaller stack
16278 alignment of @option{-mrelocatable}.  Objects compiled with
16279 @option{-mrelocatable-lib} may be linked with objects compiled with
16280 any combination of the @option{-mrelocatable} options.
16281
16282 @item -mno-toc
16283 @itemx -mtoc
16284 @opindex mno-toc
16285 @opindex mtoc
16286 On System V.4 and embedded PowerPC systems do not (do) assume that
16287 register 2 contains a pointer to a global area pointing to the addresses
16288 used in the program.
16289
16290 @item -mlittle
16291 @itemx -mlittle-endian
16292 @opindex mlittle
16293 @opindex mlittle-endian
16294 On System V.4 and embedded PowerPC systems compile code for the
16295 processor in little endian mode.  The @option{-mlittle-endian} option is
16296 the same as @option{-mlittle}.
16297
16298 @item -mbig
16299 @itemx -mbig-endian
16300 @opindex mbig
16301 @opindex mbig-endian
16302 On System V.4 and embedded PowerPC systems compile code for the
16303 processor in big endian mode.  The @option{-mbig-endian} option is
16304 the same as @option{-mbig}.
16305
16306 @item -mdynamic-no-pic
16307 @opindex mdynamic-no-pic
16308 On Darwin and Mac OS X systems, compile code so that it is not
16309 relocatable, but that its external references are relocatable.  The
16310 resulting code is suitable for applications, but not shared
16311 libraries.
16312
16313 @item -msingle-pic-base
16314 @opindex msingle-pic-base
16315 Treat the register used for PIC addressing as read-only, rather than
16316 loading it in the prologue for each function.  The run-time system is
16317 responsible for initializing this register with an appropriate value
16318 before execution begins.
16319
16320 @item -mprioritize-restricted-insns=@var{priority}
16321 @opindex mprioritize-restricted-insns
16322 This option controls the priority that is assigned to
16323 dispatch-slot restricted instructions during the second scheduling
16324 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
16325 @var{no/highest/second-highest} priority to dispatch slot restricted
16326 instructions.
16327
16328 @item -msched-costly-dep=@var{dependence_type}
16329 @opindex msched-costly-dep
16330 This option controls which dependences are considered costly
16331 by the target during instruction scheduling.  The argument
16332 @var{dependence_type} takes one of the following values:
16333 @var{no}: no dependence is costly,
16334 @var{all}: all dependences are costly,
16335 @var{true_store_to_load}: a true dependence from store to load is costly,
16336 @var{store_to_load}: any dependence from store to load is costly,
16337 @var{number}: any dependence which latency >= @var{number} is costly.
16338
16339 @item -minsert-sched-nops=@var{scheme}
16340 @opindex minsert-sched-nops
16341 This option controls which nop insertion scheme will be used during
16342 the second scheduling pass.  The argument @var{scheme} takes one of the
16343 following values:
16344 @var{no}: Don't insert nops.
16345 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
16346 according to the scheduler's grouping.
16347 @var{regroup_exact}: Insert nops to force costly dependent insns into
16348 separate groups.  Insert exactly as many nops as needed to force an insn
16349 to a new group, according to the estimated processor grouping.
16350 @var{number}: Insert nops to force costly dependent insns into
16351 separate groups.  Insert @var{number} nops to force an insn to a new group.
16352
16353 @item -mcall-sysv
16354 @opindex mcall-sysv
16355 On System V.4 and embedded PowerPC systems compile code using calling
16356 conventions that adheres to the March 1995 draft of the System V
16357 Application Binary Interface, PowerPC processor supplement.  This is the
16358 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
16359
16360 @item -mcall-sysv-eabi
16361 @itemx -mcall-eabi
16362 @opindex mcall-sysv-eabi
16363 @opindex mcall-eabi
16364 Specify both @option{-mcall-sysv} and @option{-meabi} options.
16365
16366 @item -mcall-sysv-noeabi
16367 @opindex mcall-sysv-noeabi
16368 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
16369
16370 @item -mcall-aixdesc
16371 @opindex m
16372 On System V.4 and embedded PowerPC systems compile code for the AIX
16373 operating system.
16374
16375 @item -mcall-linux
16376 @opindex mcall-linux
16377 On System V.4 and embedded PowerPC systems compile code for the
16378 Linux-based GNU system.
16379
16380 @item -mcall-freebsd
16381 @opindex mcall-freebsd
16382 On System V.4 and embedded PowerPC systems compile code for the
16383 FreeBSD operating system.
16384
16385 @item -mcall-netbsd
16386 @opindex mcall-netbsd
16387 On System V.4 and embedded PowerPC systems compile code for the
16388 NetBSD operating system.
16389
16390 @item -mcall-openbsd
16391 @opindex mcall-netbsd
16392 On System V.4 and embedded PowerPC systems compile code for the
16393 OpenBSD operating system.
16394
16395 @item -maix-struct-return
16396 @opindex maix-struct-return
16397 Return all structures in memory (as specified by the AIX ABI)@.
16398
16399 @item -msvr4-struct-return
16400 @opindex msvr4-struct-return
16401 Return structures smaller than 8 bytes in registers (as specified by the
16402 SVR4 ABI)@.
16403
16404 @item -mabi=@var{abi-type}
16405 @opindex mabi
16406 Extend the current ABI with a particular extension, or remove such extension.
16407 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
16408 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
16409
16410 @item -mabi=spe
16411 @opindex mabi=spe
16412 Extend the current ABI with SPE ABI extensions.  This does not change
16413 the default ABI, instead it adds the SPE ABI extensions to the current
16414 ABI@.
16415
16416 @item -mabi=no-spe
16417 @opindex mabi=no-spe
16418 Disable Booke SPE ABI extensions for the current ABI@.
16419
16420 @item -mabi=ibmlongdouble
16421 @opindex mabi=ibmlongdouble
16422 Change the current ABI to use IBM extended precision long double.
16423 This is a PowerPC 32-bit SYSV ABI option.
16424
16425 @item -mabi=ieeelongdouble
16426 @opindex mabi=ieeelongdouble
16427 Change the current ABI to use IEEE extended precision long double.
16428 This is a PowerPC 32-bit Linux ABI option.
16429
16430 @item -mprototype
16431 @itemx -mno-prototype
16432 @opindex mprototype
16433 @opindex mno-prototype
16434 On System V.4 and embedded PowerPC systems assume that all calls to
16435 variable argument functions are properly prototyped.  Otherwise, the
16436 compiler must insert an instruction before every non prototyped call to
16437 set or clear bit 6 of the condition code register (@var{CR}) to
16438 indicate whether floating point values were passed in the floating point
16439 registers in case the function takes a variable arguments.  With
16440 @option{-mprototype}, only calls to prototyped variable argument functions
16441 will set or clear the bit.
16442
16443 @item -msim
16444 @opindex msim
16445 On embedded PowerPC systems, assume that the startup module is called
16446 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
16447 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
16448 configurations.
16449
16450 @item -mmvme
16451 @opindex mmvme
16452 On embedded PowerPC systems, assume that the startup module is called
16453 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
16454 @file{libc.a}.
16455
16456 @item -mads
16457 @opindex mads
16458 On embedded PowerPC systems, assume that the startup module is called
16459 @file{crt0.o} and the standard C libraries are @file{libads.a} and
16460 @file{libc.a}.
16461
16462 @item -myellowknife
16463 @opindex myellowknife
16464 On embedded PowerPC systems, assume that the startup module is called
16465 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
16466 @file{libc.a}.
16467
16468 @item -mvxworks
16469 @opindex mvxworks
16470 On System V.4 and embedded PowerPC systems, specify that you are
16471 compiling for a VxWorks system.
16472
16473 @item -memb
16474 @opindex memb
16475 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
16476 header to indicate that @samp{eabi} extended relocations are used.
16477
16478 @item -meabi
16479 @itemx -mno-eabi
16480 @opindex meabi
16481 @opindex mno-eabi
16482 On System V.4 and embedded PowerPC systems do (do not) adhere to the
16483 Embedded Applications Binary Interface (eabi) which is a set of
16484 modifications to the System V.4 specifications.  Selecting @option{-meabi}
16485 means that the stack is aligned to an 8 byte boundary, a function
16486 @code{__eabi} is called to from @code{main} to set up the eabi
16487 environment, and the @option{-msdata} option can use both @code{r2} and
16488 @code{r13} to point to two separate small data areas.  Selecting
16489 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
16490 do not call an initialization function from @code{main}, and the
16491 @option{-msdata} option will only use @code{r13} to point to a single
16492 small data area.  The @option{-meabi} option is on by default if you
16493 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
16494
16495 @item -msdata=eabi
16496 @opindex msdata=eabi
16497 On System V.4 and embedded PowerPC systems, put small initialized
16498 @code{const} global and static data in the @samp{.sdata2} section, which
16499 is pointed to by register @code{r2}.  Put small initialized
16500 non-@code{const} global and static data in the @samp{.sdata} section,
16501 which is pointed to by register @code{r13}.  Put small uninitialized
16502 global and static data in the @samp{.sbss} section, which is adjacent to
16503 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
16504 incompatible with the @option{-mrelocatable} option.  The
16505 @option{-msdata=eabi} option also sets the @option{-memb} option.
16506
16507 @item -msdata=sysv
16508 @opindex msdata=sysv
16509 On System V.4 and embedded PowerPC systems, put small global and static
16510 data in the @samp{.sdata} section, which is pointed to by register
16511 @code{r13}.  Put small uninitialized global and static data in the
16512 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
16513 The @option{-msdata=sysv} option is incompatible with the
16514 @option{-mrelocatable} option.
16515
16516 @item -msdata=default
16517 @itemx -msdata
16518 @opindex msdata=default
16519 @opindex msdata
16520 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
16521 compile code the same as @option{-msdata=eabi}, otherwise compile code the
16522 same as @option{-msdata=sysv}.
16523
16524 @item -msdata=data
16525 @opindex msdata=data
16526 On System V.4 and embedded PowerPC systems, put small global
16527 data in the @samp{.sdata} section.  Put small uninitialized global
16528 data in the @samp{.sbss} section.  Do not use register @code{r13}
16529 to address small data however.  This is the default behavior unless
16530 other @option{-msdata} options are used.
16531
16532 @item -msdata=none
16533 @itemx -mno-sdata
16534 @opindex msdata=none
16535 @opindex mno-sdata
16536 On embedded PowerPC systems, put all initialized global and static data
16537 in the @samp{.data} section, and all uninitialized data in the
16538 @samp{.bss} section.
16539
16540 @item -mblock-move-inline-limit=@var{num}
16541 @opindex mblock-move-inline-limit
16542 Inline all block moves (such as calls to @code{memcpy} or structure
16543 copies) less than or equal to @var{num} bytes.  The minimum value for
16544 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
16545 targets.  The default value is target-specific.
16546
16547 @item -G @var{num}
16548 @opindex G
16549 @cindex smaller data references (PowerPC)
16550 @cindex .sdata/.sdata2 references (PowerPC)
16551 On embedded PowerPC systems, put global and static items less than or
16552 equal to @var{num} bytes into the small data or bss sections instead of
16553 the normal data or bss section.  By default, @var{num} is 8.  The
16554 @option{-G @var{num}} switch is also passed to the linker.
16555 All modules should be compiled with the same @option{-G @var{num}} value.
16556
16557 @item -mregnames
16558 @itemx -mno-regnames
16559 @opindex mregnames
16560 @opindex mno-regnames
16561 On System V.4 and embedded PowerPC systems do (do not) emit register
16562 names in the assembly language output using symbolic forms.
16563
16564 @item -mlongcall
16565 @itemx -mno-longcall
16566 @opindex mlongcall
16567 @opindex mno-longcall
16568 By default assume that all calls are far away so that a longer more
16569 expensive calling sequence is required.  This is required for calls
16570 further than 32 megabytes (33,554,432 bytes) from the current location.
16571 A short call will be generated if the compiler knows
16572 the call cannot be that far away.  This setting can be overridden by
16573 the @code{shortcall} function attribute, or by @code{#pragma
16574 longcall(0)}.
16575
16576 Some linkers are capable of detecting out-of-range calls and generating
16577 glue code on the fly.  On these systems, long calls are unnecessary and
16578 generate slower code.  As of this writing, the AIX linker can do this,
16579 as can the GNU linker for PowerPC/64.  It is planned to add this feature
16580 to the GNU linker for 32-bit PowerPC systems as well.
16581
16582 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
16583 callee, L42'', plus a ``branch island'' (glue code).  The two target
16584 addresses represent the callee and the ``branch island''.  The
16585 Darwin/PPC linker will prefer the first address and generate a ``bl
16586 callee'' if the PPC ``bl'' instruction will reach the callee directly;
16587 otherwise, the linker will generate ``bl L42'' to call the ``branch
16588 island''.  The ``branch island'' is appended to the body of the
16589 calling function; it computes the full 32-bit address of the callee
16590 and jumps to it.
16591
16592 On Mach-O (Darwin) systems, this option directs the compiler emit to
16593 the glue for every direct call, and the Darwin linker decides whether
16594 to use or discard it.
16595
16596 In the future, we may cause GCC to ignore all longcall specifications
16597 when the linker is known to generate glue.
16598
16599 @item -mtls-markers
16600 @itemx -mno-tls-markers
16601 @opindex mtls-markers
16602 @opindex mno-tls-markers
16603 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
16604 specifying the function argument.  The relocation allows ld to
16605 reliably associate function call with argument setup instructions for
16606 TLS optimization, which in turn allows gcc to better schedule the
16607 sequence.
16608
16609 @item -pthread
16610 @opindex pthread
16611 Adds support for multithreading with the @dfn{pthreads} library.
16612 This option sets flags for both the preprocessor and linker.
16613
16614 @item -mrecip
16615 @itemx -mno-recip
16616 @opindex mrecip
16617 This option will enable GCC to use the reciprocal estimate and
16618 reciprocal square root estimate instructions with additional
16619 Newton-Raphson steps to increase precision instead of doing a divide or
16620 square root and divide for floating point arguments.  You should use
16621 the @option{-ffast-math} option when using @option{-mrecip} (or at
16622 least @option{-funsafe-math-optimizations},
16623 @option{-finite-math-only}, @option{-freciprocal-math} and
16624 @option{-fno-trapping-math}).  Note that while the throughput of the
16625 sequence is generally higher than the throughput of the non-reciprocal
16626 instruction, the precision of the sequence can be decreased by up to 2
16627 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
16628 roots.
16629
16630 @item -mrecip=@var{opt}
16631 @opindex mrecip=opt
16632 This option allows to control which reciprocal estimate instructions
16633 may be used.  @var{opt} is a comma separated list of options, that may
16634 be preceded by a @code{!} to invert the option:
16635 @code{all}: enable all estimate instructions,
16636 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
16637 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
16638 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
16639 @code{divf}: enable the single precision reciprocal approximation instructions;
16640 @code{divd}: enable the double precision reciprocal approximation instructions;
16641 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
16642 @code{rsqrtf}: enable the single precision reciprocal square root approximation instructions;
16643 @code{rsqrtd}: enable the double precision reciprocal square root approximation instructions;
16644
16645 So for example, @option{-mrecip=all,!rsqrtd} would enable the
16646 all of the reciprocal estimate instructions, except for the
16647 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
16648 which handle the double precision reciprocal square root calculations.
16649
16650 @item -mrecip-precision
16651 @itemx -mno-recip-precision
16652 @opindex mrecip-precision
16653 Assume (do not assume) that the reciprocal estimate instructions
16654 provide higher precision estimates than is mandated by the powerpc
16655 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
16656 automatically selects @option{-mrecip-precision}.  The double
16657 precision square root estimate instructions are not generated by
16658 default on low precision machines, since they do not provide an
16659 estimate that converges after three steps.
16660
16661 @item -mveclibabi=@var{type}
16662 @opindex mveclibabi
16663 Specifies the ABI type to use for vectorizing intrinsics using an
16664 external library.  The only type supported at present is @code{mass},
16665 which specifies to use IBM's Mathematical Acceleration Subsystem
16666 (MASS) libraries for vectorizing intrinsics using external libraries.
16667 GCC will currently emit calls to @code{acosd2}, @code{acosf4},
16668 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
16669 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
16670 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
16671 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
16672 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
16673 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
16674 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
16675 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
16676 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
16677 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
16678 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
16679 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
16680 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
16681 for power7.  Both @option{-ftree-vectorize} and
16682 @option{-funsafe-math-optimizations} have to be enabled.  The MASS
16683 libraries will have to be specified at link time.
16684
16685 @item -mfriz
16686 @itemx -mno-friz
16687 @opindex mfriz
16688 Generate (do not generate) the @code{friz} instruction when the
16689 @option{-funsafe-math-optimizations} option is used to optimize
16690 rounding a floating point value to 64-bit integer and back to floating
16691 point.  The @code{friz} instruction does not return the same value if
16692 the floating point number is too large to fit in an integer.
16693
16694 @item -mpointers-to-nested-functions
16695 @itemx -mno-pointers-to-nested-functions
16696 @opindex mpointers-to-nested-functions
16697 Generate (do not generate) code to load up the static chain register
16698 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
16699 systems where a function pointer points to a 3 word descriptor giving
16700 the function address, TOC value to be loaded in register @var{r2}, and
16701 static chain value to be loaded in register @var{r11}.  The
16702 @option{-mpointers-to-nested-functions} is on by default.  You will
16703 not be able to call through pointers to nested functions or pointers
16704 to functions compiled in other languages that use the static chain if
16705 you use the @option{-mno-pointers-to-nested-functions}.
16706
16707 @item -msave-toc-indirect
16708 @itemx -mno-save-toc-indirect
16709 @opindex msave-toc-indirect
16710 Generate (do not generate) code to save the TOC value in the reserved
16711 stack location in the function prologue if the function calls through
16712 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
16713 saved in the prologue, it is saved just before the call through the
16714 pointer.  The @option{-mno-save-toc-indirect} option is the default.
16715 @end table
16716
16717 @node RX Options
16718 @subsection RX Options
16719 @cindex RX Options
16720
16721 These command line options are defined for RX targets:
16722
16723 @table @gcctabopt
16724 @item -m64bit-doubles
16725 @itemx -m32bit-doubles
16726 @opindex m64bit-doubles
16727 @opindex m32bit-doubles
16728 Make the @code{double} data type be 64-bits (@option{-m64bit-doubles})
16729 or 32-bits (@option{-m32bit-doubles}) in size.  The default is
16730 @option{-m32bit-doubles}.  @emph{Note} RX floating point hardware only
16731 works on 32-bit values, which is why the default is
16732 @option{-m32bit-doubles}.
16733
16734 @item -fpu
16735 @itemx -nofpu
16736 @opindex fpu
16737 @opindex nofpu
16738 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
16739 floating point hardware.  The default is enabled for the @var{RX600}
16740 series and disabled for the @var{RX200} series.
16741
16742 Floating point instructions will only be generated for 32-bit floating
16743 point values however, so if the @option{-m64bit-doubles} option is in
16744 use then the FPU hardware will not be used for doubles.
16745
16746 @emph{Note} If the @option{-fpu} option is enabled then
16747 @option{-funsafe-math-optimizations} is also enabled automatically.
16748 This is because the RX FPU instructions are themselves unsafe.
16749
16750 @item -mcpu=@var{name}
16751 @opindex -mcpu
16752 Selects the type of RX CPU to be targeted.  Currently three types are
16753 supported, the generic @var{RX600} and @var{RX200} series hardware and
16754 the specific @var{RX610} CPU.  The default is @var{RX600}.
16755
16756 The only difference between @var{RX600} and @var{RX610} is that the
16757 @var{RX610} does not support the @code{MVTIPL} instruction.
16758
16759 The @var{RX200} series does not have a hardware floating point unit
16760 and so @option{-nofpu} is enabled by default when this type is
16761 selected.
16762
16763 @item -mbig-endian-data
16764 @itemx -mlittle-endian-data
16765 @opindex mbig-endian-data
16766 @opindex mlittle-endian-data
16767 Store data (but not code) in the big-endian format.  The default is
16768 @option{-mlittle-endian-data}, i.e.@: to store data in the little endian
16769 format.
16770
16771 @item -msmall-data-limit=@var{N}
16772 @opindex msmall-data-limit
16773 Specifies the maximum size in bytes of global and static variables
16774 which can be placed into the small data area.  Using the small data
16775 area can lead to smaller and faster code, but the size of area is
16776 limited and it is up to the programmer to ensure that the area does
16777 not overflow.  Also when the small data area is used one of the RX's
16778 registers (usually @code{r13}) is reserved for use pointing to this
16779 area, so it is no longer available for use by the compiler.  This
16780 could result in slower and/or larger code if variables which once
16781 could have been held in the reserved register are now pushed onto the
16782 stack.
16783
16784 Note, common variables (variables which have not been initialised) and
16785 constants are not placed into the small data area as they are assigned
16786 to other sections in the output executable.
16787
16788 The default value is zero, which disables this feature.  Note, this
16789 feature is not enabled by default with higher optimization levels
16790 (@option{-O2} etc) because of the potentially detrimental effects of
16791 reserving a register.  It is up to the programmer to experiment and
16792 discover whether this feature is of benefit to their program.  See the
16793 description of the @option{-mpid} option for a description of how the
16794 actual register to hold the small data area pointer is chosen.
16795
16796 @item -msim
16797 @itemx -mno-sim
16798 @opindex msim
16799 @opindex mno-sim
16800 Use the simulator runtime.  The default is to use the libgloss board
16801 specific runtime.
16802
16803 @item -mas100-syntax
16804 @itemx -mno-as100-syntax
16805 @opindex mas100-syntax
16806 @opindex mno-as100-syntax
16807 When generating assembler output use a syntax that is compatible with
16808 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
16809 assembler but it has some restrictions so generating it is not the
16810 default option.
16811
16812 @item -mmax-constant-size=@var{N}
16813 @opindex mmax-constant-size
16814 Specifies the maximum size, in bytes, of a constant that can be used as
16815 an operand in a RX instruction.  Although the RX instruction set does
16816 allow constants of up to 4 bytes in length to be used in instructions,
16817 a longer value equates to a longer instruction.  Thus in some
16818 circumstances it can be beneficial to restrict the size of constants
16819 that are used in instructions.  Constants that are too big are instead
16820 placed into a constant pool and referenced via register indirection.
16821
16822 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
16823 or 4 means that constants of any size are allowed.
16824
16825 @item -mrelax
16826 @opindex mrelax
16827 Enable linker relaxation.  Linker relaxation is a process whereby the
16828 linker will attempt to reduce the size of a program by finding shorter
16829 versions of various instructions.  Disabled by default.
16830
16831 @item -mint-register=@var{N}
16832 @opindex mint-register
16833 Specify the number of registers to reserve for fast interrupt handler
16834 functions.  The value @var{N} can be between 0 and 4.  A value of 1
16835 means that register @code{r13} will be reserved for the exclusive use
16836 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
16837 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
16838 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
16839 A value of 0, the default, does not reserve any registers.
16840
16841 @item -msave-acc-in-interrupts
16842 @opindex msave-acc-in-interrupts
16843 Specifies that interrupt handler functions should preserve the
16844 accumulator register.  This is only necessary if normal code might use
16845 the accumulator register, for example because it performs 64-bit
16846 multiplications.  The default is to ignore the accumulator as this
16847 makes the interrupt handlers faster.
16848
16849 @item -mpid
16850 @itemx -mno-pid
16851 @opindex mpid
16852 @opindex mno-pid
16853 Enables the generation of position independent data.  When enabled any
16854 access to constant data will done via an offset from a base address
16855 held in a register.  This allows the location of constant data to be
16856 determined at run-time without requiring the executable to be
16857 relocated, which is a benefit to embedded applications with tight
16858 memory constraints.  Data that can be modified is not affected by this
16859 option.
16860
16861 Note, using this feature reserves a register, usually @code{r13}, for
16862 the constant data base address.  This can result in slower and/or
16863 larger code, especially in complicated functions.
16864
16865 The actual register chosen to hold the constant data base address
16866 depends upon whether the @option{-msmall-data-limit} and/or the
16867 @option{-mint-register} command line options are enabled.  Starting
16868 with register @code{r13} and proceeding downwards, registers are
16869 allocated first to satisfy the requirements of @option{-mint-register},
16870 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
16871 is possible for the small data area register to be @code{r8} if both
16872 @option{-mint-register=4} and @option{-mpid} are specified on the
16873 command line.
16874
16875 By default this feature is not enabled.  The default can be restored
16876 via the @option{-mno-pid} command line option.
16877
16878 @end table
16879
16880 @emph{Note:} The generic GCC command line @option{-ffixed-@var{reg}}
16881 has special significance to the RX port when used with the
16882 @code{interrupt} function attribute.  This attribute indicates a
16883 function intended to process fast interrupts.  GCC will will ensure
16884 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
16885 and/or @code{r13} and only provided that the normal use of the
16886 corresponding registers have been restricted via the
16887 @option{-ffixed-@var{reg}} or @option{-mint-register} command line
16888 options.
16889
16890 @node S/390 and zSeries Options
16891 @subsection S/390 and zSeries Options
16892 @cindex S/390 and zSeries Options
16893
16894 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
16895
16896 @table @gcctabopt
16897 @item -mhard-float
16898 @itemx -msoft-float
16899 @opindex mhard-float
16900 @opindex msoft-float
16901 Use (do not use) the hardware floating-point instructions and registers
16902 for floating-point operations.  When @option{-msoft-float} is specified,
16903 functions in @file{libgcc.a} will be used to perform floating-point
16904 operations.  When @option{-mhard-float} is specified, the compiler
16905 generates IEEE floating-point instructions.  This is the default.
16906
16907 @item -mhard-dfp
16908 @itemx -mno-hard-dfp
16909 @opindex mhard-dfp
16910 @opindex mno-hard-dfp
16911 Use (do not use) the hardware decimal-floating-point instructions for
16912 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
16913 specified, functions in @file{libgcc.a} will be used to perform
16914 decimal-floating-point operations.  When @option{-mhard-dfp} is
16915 specified, the compiler generates decimal-floating-point hardware
16916 instructions.  This is the default for @option{-march=z9-ec} or higher.
16917
16918 @item -mlong-double-64
16919 @itemx -mlong-double-128
16920 @opindex mlong-double-64
16921 @opindex mlong-double-128
16922 These switches control the size of @code{long double} type. A size
16923 of 64bit makes the @code{long double} type equivalent to the @code{double}
16924 type. This is the default.
16925
16926 @item -mbackchain
16927 @itemx -mno-backchain
16928 @opindex mbackchain
16929 @opindex mno-backchain
16930 Store (do not store) the address of the caller's frame as backchain pointer
16931 into the callee's stack frame.
16932 A backchain may be needed to allow debugging using tools that do not understand
16933 DWARF-2 call frame information.
16934 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
16935 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
16936 the backchain is placed into the topmost word of the 96/160 byte register
16937 save area.
16938
16939 In general, code compiled with @option{-mbackchain} is call-compatible with
16940 code compiled with @option{-mmo-backchain}; however, use of the backchain
16941 for debugging purposes usually requires that the whole binary is built with
16942 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
16943 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16944 to build a linux kernel use @option{-msoft-float}.
16945
16946 The default is to not maintain the backchain.
16947
16948 @item -mpacked-stack
16949 @itemx -mno-packed-stack
16950 @opindex mpacked-stack
16951 @opindex mno-packed-stack
16952 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
16953 specified, the compiler uses the all fields of the 96/160 byte register save
16954 area only for their default purpose; unused fields still take up stack space.
16955 When @option{-mpacked-stack} is specified, register save slots are densely
16956 packed at the top of the register save area; unused space is reused for other
16957 purposes, allowing for more efficient use of the available stack space.
16958 However, when @option{-mbackchain} is also in effect, the topmost word of
16959 the save area is always used to store the backchain, and the return address
16960 register is always saved two words below the backchain.
16961
16962 As long as the stack frame backchain is not used, code generated with
16963 @option{-mpacked-stack} is call-compatible with code generated with
16964 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
16965 S/390 or zSeries generated code that uses the stack frame backchain at run
16966 time, not just for debugging purposes.  Such code is not call-compatible
16967 with code compiled with @option{-mpacked-stack}.  Also, note that the
16968 combination of @option{-mbackchain},
16969 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16970 to build a linux kernel use @option{-msoft-float}.
16971
16972 The default is to not use the packed stack layout.
16973
16974 @item -msmall-exec
16975 @itemx -mno-small-exec
16976 @opindex msmall-exec
16977 @opindex mno-small-exec
16978 Generate (or do not generate) code using the @code{bras} instruction
16979 to do subroutine calls.
16980 This only works reliably if the total executable size does not
16981 exceed 64k.  The default is to use the @code{basr} instruction instead,
16982 which does not have this limitation.
16983
16984 @item -m64
16985 @itemx -m31
16986 @opindex m64
16987 @opindex m31
16988 When @option{-m31} is specified, generate code compliant to the
16989 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
16990 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
16991 particular to generate 64-bit instructions.  For the @samp{s390}
16992 targets, the default is @option{-m31}, while the @samp{s390x}
16993 targets default to @option{-m64}.
16994
16995 @item -mzarch
16996 @itemx -mesa
16997 @opindex mzarch
16998 @opindex mesa
16999 When @option{-mzarch} is specified, generate code using the
17000 instructions available on z/Architecture.
17001 When @option{-mesa} is specified, generate code using the
17002 instructions available on ESA/390.  Note that @option{-mesa} is
17003 not possible with @option{-m64}.
17004 When generating code compliant to the GNU/Linux for S/390 ABI,
17005 the default is @option{-mesa}.  When generating code compliant
17006 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
17007
17008 @item -mmvcle
17009 @itemx -mno-mvcle
17010 @opindex mmvcle
17011 @opindex mno-mvcle
17012 Generate (or do not generate) code using the @code{mvcle} instruction
17013 to perform block moves.  When @option{-mno-mvcle} is specified,
17014 use a @code{mvc} loop instead.  This is the default unless optimizing for
17015 size.
17016
17017 @item -mdebug
17018 @itemx -mno-debug
17019 @opindex mdebug
17020 @opindex mno-debug
17021 Print (or do not print) additional debug information when compiling.
17022 The default is to not print debug information.
17023
17024 @item -march=@var{cpu-type}
17025 @opindex march
17026 Generate code that will run on @var{cpu-type}, which is the name of a system
17027 representing a certain processor type.  Possible values for
17028 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
17029 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
17030 When generating code using the instructions available on z/Architecture,
17031 the default is @option{-march=z900}.  Otherwise, the default is
17032 @option{-march=g5}.
17033
17034 @item -mtune=@var{cpu-type}
17035 @opindex mtune
17036 Tune to @var{cpu-type} everything applicable about the generated code,
17037 except for the ABI and the set of available instructions.
17038 The list of @var{cpu-type} values is the same as for @option{-march}.
17039 The default is the value used for @option{-march}.
17040
17041 @item -mtpf-trace
17042 @itemx -mno-tpf-trace
17043 @opindex mtpf-trace
17044 @opindex mno-tpf-trace
17045 Generate code that adds (does not add) in TPF OS specific branches to trace
17046 routines in the operating system.  This option is off by default, even
17047 when compiling for the TPF OS@.
17048
17049 @item -mfused-madd
17050 @itemx -mno-fused-madd
17051 @opindex mfused-madd
17052 @opindex mno-fused-madd
17053 Generate code that uses (does not use) the floating point multiply and
17054 accumulate instructions.  These instructions are generated by default if
17055 hardware floating point is used.
17056
17057 @item -mwarn-framesize=@var{framesize}
17058 @opindex mwarn-framesize
17059 Emit a warning if the current function exceeds the given frame size.  Because
17060 this is a compile time check it doesn't need to be a real problem when the program
17061 runs.  It is intended to identify functions which most probably cause
17062 a stack overflow.  It is useful to be used in an environment with limited stack
17063 size e.g.@: the linux kernel.
17064
17065 @item -mwarn-dynamicstack
17066 @opindex mwarn-dynamicstack
17067 Emit a warning if the function calls alloca or uses dynamically
17068 sized arrays.  This is generally a bad idea with a limited stack size.
17069
17070 @item -mstack-guard=@var{stack-guard}
17071 @itemx -mstack-size=@var{stack-size}
17072 @opindex mstack-guard
17073 @opindex mstack-size
17074 If these options are provided the s390 back end emits additional instructions in
17075 the function prologue which trigger a trap if the stack size is @var{stack-guard}
17076 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
17077 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
17078 the frame size of the compiled function is chosen.
17079 These options are intended to be used to help debugging stack overflow problems.
17080 The additionally emitted code causes only little overhead and hence can also be
17081 used in production like systems without greater performance degradation.  The given
17082 values have to be exact powers of 2 and @var{stack-size} has to be greater than
17083 @var{stack-guard} without exceeding 64k.
17084 In order to be efficient the extra code makes the assumption that the stack starts
17085 at an address aligned to the value given by @var{stack-size}.
17086 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
17087 @end table
17088
17089 @node Score Options
17090 @subsection Score Options
17091 @cindex Score Options
17092
17093 These options are defined for Score implementations:
17094
17095 @table @gcctabopt
17096 @item -meb
17097 @opindex meb
17098 Compile code for big endian mode.  This is the default.
17099
17100 @item -mel
17101 @opindex mel
17102 Compile code for little endian mode.
17103
17104 @item -mnhwloop
17105 @opindex mnhwloop
17106 Disable generate bcnz instruction.
17107
17108 @item -muls
17109 @opindex muls
17110 Enable generate unaligned load and store instruction.
17111
17112 @item -mmac
17113 @opindex mmac
17114 Enable the use of multiply-accumulate instructions. Disabled by default.
17115
17116 @item -mscore5
17117 @opindex mscore5
17118 Specify the SCORE5 as the target architecture.
17119
17120 @item -mscore5u
17121 @opindex mscore5u
17122 Specify the SCORE5U of the target architecture.
17123
17124 @item -mscore7
17125 @opindex mscore7
17126 Specify the SCORE7 as the target architecture. This is the default.
17127
17128 @item -mscore7d
17129 @opindex mscore7d
17130 Specify the SCORE7D as the target architecture.
17131 @end table
17132
17133 @node SH Options
17134 @subsection SH Options
17135
17136 These @samp{-m} options are defined for the SH implementations:
17137
17138 @table @gcctabopt
17139 @item -m1
17140 @opindex m1
17141 Generate code for the SH1.
17142
17143 @item -m2
17144 @opindex m2
17145 Generate code for the SH2.
17146
17147 @item -m2e
17148 Generate code for the SH2e.
17149
17150 @item -m2a-nofpu
17151 @opindex m2a-nofpu
17152 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
17153 that the floating-point unit is not used.
17154
17155 @item -m2a-single-only
17156 @opindex m2a-single-only
17157 Generate code for the SH2a-FPU, in such a way that no double-precision
17158 floating point operations are used.
17159
17160 @item -m2a-single
17161 @opindex m2a-single
17162 Generate code for the SH2a-FPU assuming the floating-point unit is in
17163 single-precision mode by default.
17164
17165 @item -m2a
17166 @opindex m2a
17167 Generate code for the SH2a-FPU assuming the floating-point unit is in
17168 double-precision mode by default.
17169
17170 @item -m3
17171 @opindex m3
17172 Generate code for the SH3.
17173
17174 @item -m3e
17175 @opindex m3e
17176 Generate code for the SH3e.
17177
17178 @item -m4-nofpu
17179 @opindex m4-nofpu
17180 Generate code for the SH4 without a floating-point unit.
17181
17182 @item -m4-single-only
17183 @opindex m4-single-only
17184 Generate code for the SH4 with a floating-point unit that only
17185 supports single-precision arithmetic.
17186
17187 @item -m4-single
17188 @opindex m4-single
17189 Generate code for the SH4 assuming the floating-point unit is in
17190 single-precision mode by default.
17191
17192 @item -m4
17193 @opindex m4
17194 Generate code for the SH4.
17195
17196 @item -m4a-nofpu
17197 @opindex m4a-nofpu
17198 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
17199 floating-point unit is not used.
17200
17201 @item -m4a-single-only
17202 @opindex m4a-single-only
17203 Generate code for the SH4a, in such a way that no double-precision
17204 floating point operations are used.
17205
17206 @item -m4a-single
17207 @opindex m4a-single
17208 Generate code for the SH4a assuming the floating-point unit is in
17209 single-precision mode by default.
17210
17211 @item -m4a
17212 @opindex m4a
17213 Generate code for the SH4a.
17214
17215 @item -m4al
17216 @opindex m4al
17217 Same as @option{-m4a-nofpu}, except that it implicitly passes
17218 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
17219 instructions at the moment.
17220
17221 @item -mb
17222 @opindex mb
17223 Compile code for the processor in big endian mode.
17224
17225 @item -ml
17226 @opindex ml
17227 Compile code for the processor in little endian mode.
17228
17229 @item -mdalign
17230 @opindex mdalign
17231 Align doubles at 64-bit boundaries.  Note that this changes the calling
17232 conventions, and thus some functions from the standard C library will
17233 not work unless you recompile it first with @option{-mdalign}.
17234
17235 @item -mrelax
17236 @opindex mrelax
17237 Shorten some address references at link time, when possible; uses the
17238 linker option @option{-relax}.
17239
17240 @item -mbigtable
17241 @opindex mbigtable
17242 Use 32-bit offsets in @code{switch} tables.  The default is to use
17243 16-bit offsets.
17244
17245 @item -mbitops
17246 @opindex mbitops
17247 Enable the use of bit manipulation instructions on SH2A.
17248
17249 @item -mfmovd
17250 @opindex mfmovd
17251 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
17252 alignment constraints.
17253
17254 @item -mhitachi
17255 @opindex mhitachi
17256 Comply with the calling conventions defined by Renesas.
17257
17258 @item -mrenesas
17259 @opindex mhitachi
17260 Comply with the calling conventions defined by Renesas.
17261
17262 @item -mno-renesas
17263 @opindex mhitachi
17264 Comply with the calling conventions defined for GCC before the Renesas
17265 conventions were available.  This option is the default for all
17266 targets of the SH toolchain.
17267
17268 @item -mnomacsave
17269 @opindex mnomacsave
17270 Mark the @code{MAC} register as call-clobbered, even if
17271 @option{-mhitachi} is given.
17272
17273 @item -mieee
17274 @opindex mieee
17275 Increase IEEE-compliance of floating-point code.
17276 At the moment, this is equivalent to @option{-fno-finite-math-only}.
17277 When generating 16 bit SH opcodes, getting IEEE-conforming results for
17278 comparisons of NANs / infinities incurs extra overhead in every
17279 floating point comparison, therefore the default is set to
17280 @option{-ffinite-math-only}.
17281
17282 @item -minline-ic_invalidate
17283 @opindex minline-ic_invalidate
17284 Inline code to invalidate instruction cache entries after setting up
17285 nested function trampolines.
17286 This option has no effect if -musermode is in effect and the selected
17287 code generation option (e.g. -m4) does not allow the use of the icbi
17288 instruction.
17289 If the selected code generation option does not allow the use of the icbi
17290 instruction, and -musermode is not in effect, the inlined code will
17291 manipulate the instruction cache address array directly with an associative
17292 write.  This not only requires privileged mode, but it will also
17293 fail if the cache line had been mapped via the TLB and has become unmapped.
17294
17295 @item -misize
17296 @opindex misize
17297 Dump instruction size and location in the assembly code.
17298
17299 @item -mpadstruct
17300 @opindex mpadstruct
17301 This option is deprecated.  It pads structures to multiple of 4 bytes,
17302 which is incompatible with the SH ABI@.
17303
17304 @item -mspace
17305 @opindex mspace
17306 Optimize for space instead of speed.  Implied by @option{-Os}.
17307
17308 @item -mprefergot
17309 @opindex mprefergot
17310 When generating position-independent code, emit function calls using
17311 the Global Offset Table instead of the Procedure Linkage Table.
17312
17313 @item -musermode
17314 @opindex musermode
17315 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
17316 if the inlined code would not work in user mode.
17317 This is the default when the target is @code{sh-*-linux*}.
17318
17319 @item -multcost=@var{number}
17320 @opindex multcost=@var{number}
17321 Set the cost to assume for a multiply insn.
17322
17323 @item -mdiv=@var{strategy}
17324 @opindex mdiv=@var{strategy}
17325 Set the division strategy to use for SHmedia code.  @var{strategy} must be
17326 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
17327 inv:call2, inv:fp .
17328 "fp" performs the operation in floating point.  This has a very high latency,
17329 but needs only a few instructions, so it might be a good choice if
17330 your code has enough easily exploitable ILP to allow the compiler to
17331 schedule the floating point instructions together with other instructions.
17332 Division by zero causes a floating point exception.
17333 "inv" uses integer operations to calculate the inverse of the divisor,
17334 and then multiplies the dividend with the inverse.  This strategy allows
17335 cse and hoisting of the inverse calculation.  Division by zero calculates
17336 an unspecified result, but does not trap.
17337 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
17338 have been found, or if the entire operation has been hoisted to the same
17339 place, the last stages of the inverse calculation are intertwined with the
17340 final multiply to reduce the overall latency, at the expense of using a few
17341 more instructions, and thus offering fewer scheduling opportunities with
17342 other code.
17343 "call" calls a library function that usually implements the inv:minlat
17344 strategy.
17345 This gives high code density for m5-*media-nofpu compilations.
17346 "call2" uses a different entry point of the same library function, where it
17347 assumes that a pointer to a lookup table has already been set up, which
17348 exposes the pointer load to cse / code hoisting optimizations.
17349 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
17350 code generation, but if the code stays unoptimized, revert to the "call",
17351 "call2", or "fp" strategies, respectively.  Note that the
17352 potentially-trapping side effect of division by zero is carried by a
17353 separate instruction, so it is possible that all the integer instructions
17354 are hoisted out, but the marker for the side effect stays where it is.
17355 A recombination to fp operations or a call is not possible in that case.
17356 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
17357 that the inverse calculation was nor separated from the multiply, they speed
17358 up division where the dividend fits into 20 bits (plus sign where applicable),
17359 by inserting a test to skip a number of operations in this case; this test
17360 slows down the case of larger dividends.  inv20u assumes the case of a such
17361 a small dividend to be unlikely, and inv20l assumes it to be likely.
17362
17363 @item -maccumulate-outgoing-args
17364 @opindex maccumulate-outgoing-args
17365 Reserve space once for outgoing arguments in the function prologue rather
17366 than around each call.  Generally beneficial for performance and size.  Also
17367 needed for unwinding to avoid changing the stack frame around conditional code.
17368
17369 @item -mdivsi3_libfunc=@var{name}
17370 @opindex mdivsi3_libfunc=@var{name}
17371 Set the name of the library function used for 32 bit signed division to
17372 @var{name}.  This only affect the name used in the call and inv:call
17373 division strategies, and the compiler will still expect the same
17374 sets of input/output/clobbered registers as if this option was not present.
17375
17376 @item -mfixed-range=@var{register-range}
17377 @opindex mfixed-range
17378 Generate code treating the given register range as fixed registers.
17379 A fixed register is one that the register allocator can not use.  This is
17380 useful when compiling kernel code.  A register range is specified as
17381 two registers separated by a dash.  Multiple register ranges can be
17382 specified separated by a comma.
17383
17384 @item -madjust-unroll
17385 @opindex madjust-unroll
17386 Throttle unrolling to avoid thrashing target registers.
17387 This option only has an effect if the gcc code base supports the
17388 TARGET_ADJUST_UNROLL_MAX target hook.
17389
17390 @item -mindexed-addressing
17391 @opindex mindexed-addressing
17392 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
17393 This is only safe if the hardware and/or OS implement 32 bit wrap-around
17394 semantics for the indexed addressing mode.  The architecture allows the
17395 implementation of processors with 64 bit MMU, which the OS could use to
17396 get 32 bit addressing, but since no current hardware implementation supports
17397 this or any other way to make the indexed addressing mode safe to use in
17398 the 32 bit ABI, the default is -mno-indexed-addressing.
17399
17400 @item -mgettrcost=@var{number}
17401 @opindex mgettrcost=@var{number}
17402 Set the cost assumed for the gettr instruction to @var{number}.
17403 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
17404
17405 @item -mpt-fixed
17406 @opindex mpt-fixed
17407 Assume pt* instructions won't trap.  This will generally generate better
17408 scheduled code, but is unsafe on current hardware.  The current architecture
17409 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
17410 This has the unintentional effect of making it unsafe to schedule ptabs /
17411 ptrel before a branch, or hoist it out of a loop.  For example,
17412 __do_global_ctors, a part of libgcc that runs constructors at program
17413 startup, calls functions in a list which is delimited by @minus{}1.  With the
17414 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
17415 That means that all the constructors will be run a bit quicker, but when
17416 the loop comes to the end of the list, the program crashes because ptabs
17417 loads @minus{}1 into a target register.  Since this option is unsafe for any
17418 hardware implementing the current architecture specification, the default
17419 is -mno-pt-fixed.  Unless the user specifies a specific cost with
17420 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
17421 this deters register allocation using target registers for storing
17422 ordinary integers.
17423
17424 @item -minvalid-symbols
17425 @opindex minvalid-symbols
17426 Assume symbols might be invalid.  Ordinary function symbols generated by
17427 the compiler will always be valid to load with movi/shori/ptabs or
17428 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
17429 to generate symbols that will cause ptabs / ptrel to trap.
17430 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
17431 It will then prevent cross-basic-block cse, hoisting and most scheduling
17432 of symbol loads.  The default is @option{-mno-invalid-symbols}.
17433 @end table
17434
17435 @node Solaris 2 Options
17436 @subsection Solaris 2 Options
17437 @cindex Solaris 2 options
17438
17439 These @samp{-m} options are supported on Solaris 2:
17440
17441 @table @gcctabopt
17442 @item -mimpure-text
17443 @opindex mimpure-text
17444 @option{-mimpure-text}, used in addition to @option{-shared}, tells
17445 the compiler to not pass @option{-z text} to the linker when linking a
17446 shared object.  Using this option, you can link position-dependent
17447 code into a shared object.
17448
17449 @option{-mimpure-text} suppresses the ``relocations remain against
17450 allocatable but non-writable sections'' linker error message.
17451 However, the necessary relocations will trigger copy-on-write, and the
17452 shared object is not actually shared across processes.  Instead of
17453 using @option{-mimpure-text}, you should compile all source code with
17454 @option{-fpic} or @option{-fPIC}.
17455
17456 @end table
17457
17458 These switches are supported in addition to the above on Solaris 2:
17459
17460 @table @gcctabopt
17461 @item -pthreads
17462 @opindex pthreads
17463 Add support for multithreading using the POSIX threads library.  This
17464 option sets flags for both the preprocessor and linker.  This option does
17465 not affect the thread safety of object code produced  by the compiler or
17466 that of libraries supplied with it.
17467
17468 @item -pthread
17469 @opindex pthread
17470 This is a synonym for @option{-pthreads}.
17471 @end table
17472
17473 @node SPARC Options
17474 @subsection SPARC Options
17475 @cindex SPARC options
17476
17477 These @samp{-m} options are supported on the SPARC:
17478
17479 @table @gcctabopt
17480 @item -mno-app-regs
17481 @itemx -mapp-regs
17482 @opindex mno-app-regs
17483 @opindex mapp-regs
17484 Specify @option{-mapp-regs} to generate output using the global registers
17485 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
17486 is the default.
17487
17488 To be fully SVR4 ABI compliant at the cost of some performance loss,
17489 specify @option{-mno-app-regs}.  You should compile libraries and system
17490 software with this option.
17491
17492 @item -mflat
17493 @itemx -mno-flat
17494 @opindex mflat
17495 @opindex mno-flat
17496 With @option{-mflat}, the compiler does not generate save/restore instructions
17497 and uses a ``flat'' or single register window model.  This model is compatible
17498 with the regular register window model.  The local registers and the input
17499 registers (0--5) are still treated as ``call-saved'' registers and will be
17500 saved on the stack as needed.
17501
17502 With @option{-mno-flat} (the default), the compiler generates save/restore
17503 instructions (except for leaf functions).  This is the normal operating mode.
17504
17505 @item -mfpu
17506 @itemx -mhard-float
17507 @opindex mfpu
17508 @opindex mhard-float
17509 Generate output containing floating point instructions.  This is the
17510 default.
17511
17512 @item -mno-fpu
17513 @itemx -msoft-float
17514 @opindex mno-fpu
17515 @opindex msoft-float
17516 Generate output containing library calls for floating point.
17517 @strong{Warning:} the requisite libraries are not available for all SPARC
17518 targets.  Normally the facilities of the machine's usual C compiler are
17519 used, but this cannot be done directly in cross-compilation.  You must make
17520 your own arrangements to provide suitable library functions for
17521 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
17522 @samp{sparclite-*-*} do provide software floating point support.
17523
17524 @option{-msoft-float} changes the calling convention in the output file;
17525 therefore, it is only useful if you compile @emph{all} of a program with
17526 this option.  In particular, you need to compile @file{libgcc.a}, the
17527 library that comes with GCC, with @option{-msoft-float} in order for
17528 this to work.
17529
17530 @item -mhard-quad-float
17531 @opindex mhard-quad-float
17532 Generate output containing quad-word (long double) floating point
17533 instructions.
17534
17535 @item -msoft-quad-float
17536 @opindex msoft-quad-float
17537 Generate output containing library calls for quad-word (long double)
17538 floating point instructions.  The functions called are those specified
17539 in the SPARC ABI@.  This is the default.
17540
17541 As of this writing, there are no SPARC implementations that have hardware
17542 support for the quad-word floating point instructions.  They all invoke
17543 a trap handler for one of these instructions, and then the trap handler
17544 emulates the effect of the instruction.  Because of the trap handler overhead,
17545 this is much slower than calling the ABI library routines.  Thus the
17546 @option{-msoft-quad-float} option is the default.
17547
17548 @item -mno-unaligned-doubles
17549 @itemx -munaligned-doubles
17550 @opindex mno-unaligned-doubles
17551 @opindex munaligned-doubles
17552 Assume that doubles have 8 byte alignment.  This is the default.
17553
17554 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
17555 alignment only if they are contained in another type, or if they have an
17556 absolute address.  Otherwise, it assumes they have 4 byte alignment.
17557 Specifying this option avoids some rare compatibility problems with code
17558 generated by other compilers.  It is not the default because it results
17559 in a performance loss, especially for floating point code.
17560
17561 @item -mno-faster-structs
17562 @itemx -mfaster-structs
17563 @opindex mno-faster-structs
17564 @opindex mfaster-structs
17565 With @option{-mfaster-structs}, the compiler assumes that structures
17566 should have 8 byte alignment.  This enables the use of pairs of
17567 @code{ldd} and @code{std} instructions for copies in structure
17568 assignment, in place of twice as many @code{ld} and @code{st} pairs.
17569 However, the use of this changed alignment directly violates the SPARC
17570 ABI@.  Thus, it's intended only for use on targets where the developer
17571 acknowledges that their resulting code will not be directly in line with
17572 the rules of the ABI@.
17573
17574 @item -mcpu=@var{cpu_type}
17575 @opindex mcpu
17576 Set the instruction set, register set, and instruction scheduling parameters
17577 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
17578 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
17579 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
17580 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
17581 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
17582 and @samp{niagara4}.
17583
17584 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
17585 which selects the best architecture option for the host processor.
17586 @option{-mcpu=native} has no effect if GCC does not recognize
17587 the processor.
17588
17589 Default instruction scheduling parameters are used for values that select
17590 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
17591 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
17592
17593 Here is a list of each supported architecture and their supported
17594 implementations.
17595
17596 @smallexample
17597     v7:             cypress
17598     v8:             supersparc, hypersparc, leon
17599     sparclite:      f930, f934, sparclite86x
17600     sparclet:       tsc701
17601     v9:             ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
17602 @end smallexample
17603
17604 By default (unless configured otherwise), GCC generates code for the V7
17605 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
17606 additionally optimizes it for the Cypress CY7C602 chip, as used in the
17607 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
17608 SPARCStation 1, 2, IPX etc.
17609
17610 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
17611 architecture.  The only difference from V7 code is that the compiler emits
17612 the integer multiply and integer divide instructions which exist in SPARC-V8
17613 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
17614 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
17615 2000 series.
17616
17617 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
17618 the SPARC architecture.  This adds the integer multiply, integer divide step
17619 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
17620 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
17621 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
17622 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
17623 MB86934 chip, which is the more recent SPARClite with FPU@.
17624
17625 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
17626 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
17627 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
17628 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
17629 optimizes it for the TEMIC SPARClet chip.
17630
17631 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
17632 architecture.  This adds 64-bit integer and floating-point move instructions,
17633 3 additional floating-point condition code registers and conditional move
17634 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
17635 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
17636 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
17637 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
17638 @option{-mcpu=niagara}, the compiler additionally optimizes it for
17639 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
17640 additionally optimizes it for Sun UltraSPARC T2 chips. With
17641 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
17642 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
17643 additionally optimizes it for Sun UltraSPARC T4 chips.
17644
17645 @item -mtune=@var{cpu_type}
17646 @opindex mtune
17647 Set the instruction scheduling parameters for machine type
17648 @var{cpu_type}, but do not set the instruction set or register set that the
17649 option @option{-mcpu=@var{cpu_type}} would.
17650
17651 The same values for @option{-mcpu=@var{cpu_type}} can be used for
17652 @option{-mtune=@var{cpu_type}}, but the only useful values are those
17653 that select a particular CPU implementation.  Those are @samp{cypress},
17654 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
17655 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
17656 @samp{niagara}, @samp{niagara2}, @samp{niagara3} and @samp{niagara4}.  With
17657 native Solaris and GNU/Linux toolchains, @samp{native} can also be used.
17658
17659 @item -mv8plus
17660 @itemx -mno-v8plus
17661 @opindex mv8plus
17662 @opindex mno-v8plus
17663 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
17664 difference from the V8 ABI is that the global and out registers are
17665 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
17666 mode for all SPARC-V9 processors.
17667
17668 @item -mvis
17669 @itemx -mno-vis
17670 @opindex mvis
17671 @opindex mno-vis
17672 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
17673 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
17674
17675 @item -mvis2
17676 @itemx -mno-vis2
17677 @opindex mvis2
17678 @opindex mno-vis2
17679 With @option{-mvis2}, GCC generates code that takes advantage of
17680 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
17681 default is @option{-mvis2} when targetting a cpu that supports such
17682 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
17683 also sets @option{-mvis}.
17684
17685 @item -mvis3
17686 @itemx -mno-vis3
17687 @opindex mvis3
17688 @opindex mno-vis3
17689 With @option{-mvis3}, GCC generates code that takes advantage of
17690 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
17691 default is @option{-mvis3} when targetting a cpu that supports such
17692 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
17693 also sets @option{-mvis2} and @option{-mvis}.
17694
17695 @item -mpopc
17696 @itemx -mno-popc
17697 @opindex mpopc
17698 @opindex mno-popc
17699 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
17700 population count instruction.  The default is @option{-mpopc}
17701 when targetting a cpu that supports such instructions, such as Niagara-2 and
17702 later.
17703
17704 @item -mfmaf
17705 @itemx -mno-fmaf
17706 @opindex mfmaf
17707 @opindex mno-fmaf
17708 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
17709 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
17710 when targetting a cpu that supports such instructions, such as Niagara-3 and
17711 later.
17712
17713 @item -mfix-at697f
17714 @opindex mfix-at697f
17715 Enable the documented workaround for the single erratum of the Atmel AT697F
17716 processor (which corresponds to erratum #13 of the AT697E processor).
17717 @end table
17718
17719 These @samp{-m} options are supported in addition to the above
17720 on SPARC-V9 processors in 64-bit environments:
17721
17722 @table @gcctabopt
17723 @item -mlittle-endian
17724 @opindex mlittle-endian
17725 Generate code for a processor running in little-endian mode.  It is only
17726 available for a few configurations and most notably not on Solaris and Linux.
17727
17728 @item -m32
17729 @itemx -m64
17730 @opindex m32
17731 @opindex m64
17732 Generate code for a 32-bit or 64-bit environment.
17733 The 32-bit environment sets int, long and pointer to 32 bits.
17734 The 64-bit environment sets int to 32 bits and long and pointer
17735 to 64 bits.
17736
17737 @item -mcmodel=medlow
17738 @opindex mcmodel=medlow
17739 Generate code for the Medium/Low code model: 64-bit addresses, programs
17740 must be linked in the low 32 bits of memory.  Programs can be statically
17741 or dynamically linked.
17742
17743 @item -mcmodel=medmid
17744 @opindex mcmodel=medmid
17745 Generate code for the Medium/Middle code model: 64-bit addresses, programs
17746 must be linked in the low 44 bits of memory, the text and data segments must
17747 be less than 2GB in size and the data segment must be located within 2GB of
17748 the text segment.
17749
17750 @item -mcmodel=medany
17751 @opindex mcmodel=medany
17752 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
17753 may be linked anywhere in memory, the text and data segments must be less
17754 than 2GB in size and the data segment must be located within 2GB of the
17755 text segment.
17756
17757 @item -mcmodel=embmedany
17758 @opindex mcmodel=embmedany
17759 Generate code for the Medium/Anywhere code model for embedded systems:
17760 64-bit addresses, the text and data segments must be less than 2GB in
17761 size, both starting anywhere in memory (determined at link time).  The
17762 global register %g4 points to the base of the data segment.  Programs
17763 are statically linked and PIC is not supported.
17764
17765 @item -mstack-bias
17766 @itemx -mno-stack-bias
17767 @opindex mstack-bias
17768 @opindex mno-stack-bias
17769 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
17770 frame pointer if present, are offset by @minus{}2047 which must be added back
17771 when making stack frame references.  This is the default in 64-bit mode.
17772 Otherwise, assume no such offset is present.
17773 @end table
17774
17775 @node SPU Options
17776 @subsection SPU Options
17777 @cindex SPU options
17778
17779 These @samp{-m} options are supported on the SPU:
17780
17781 @table @gcctabopt
17782 @item -mwarn-reloc
17783 @itemx -merror-reloc
17784 @opindex mwarn-reloc
17785 @opindex merror-reloc
17786
17787 The loader for SPU does not handle dynamic relocations.  By default, GCC
17788 will give an error when it generates code that requires a dynamic
17789 relocation.  @option{-mno-error-reloc} disables the error,
17790 @option{-mwarn-reloc} will generate a warning instead.
17791
17792 @item -msafe-dma
17793 @itemx -munsafe-dma
17794 @opindex msafe-dma
17795 @opindex munsafe-dma
17796
17797 Instructions which initiate or test completion of DMA must not be
17798 reordered with respect to loads and stores of the memory which is being
17799 accessed.  Users typically address this problem using the volatile
17800 keyword, but that can lead to inefficient code in places where the
17801 memory is known to not change.  Rather than mark the memory as volatile
17802 we treat the DMA instructions as potentially effecting all memory.  With
17803 @option{-munsafe-dma} users must use the volatile keyword to protect
17804 memory accesses.
17805
17806 @item -mbranch-hints
17807 @opindex mbranch-hints
17808
17809 By default, GCC will generate a branch hint instruction to avoid
17810 pipeline stalls for always taken or probably taken branches.  A hint
17811 will not be generated closer than 8 instructions away from its branch.
17812 There is little reason to disable them, except for debugging purposes,
17813 or to make an object a little bit smaller.
17814
17815 @item -msmall-mem
17816 @itemx -mlarge-mem
17817 @opindex msmall-mem
17818 @opindex mlarge-mem
17819
17820 By default, GCC generates code assuming that addresses are never larger
17821 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
17822 a full 32 bit address.
17823
17824 @item -mstdmain
17825 @opindex mstdmain
17826
17827 By default, GCC links against startup code that assumes the SPU-style
17828 main function interface (which has an unconventional parameter list).
17829 With @option{-mstdmain}, GCC will link your program against startup
17830 code that assumes a C99-style interface to @code{main}, including a
17831 local copy of @code{argv} strings.
17832
17833 @item -mfixed-range=@var{register-range}
17834 @opindex mfixed-range
17835 Generate code treating the given register range as fixed registers.
17836 A fixed register is one that the register allocator can not use.  This is
17837 useful when compiling kernel code.  A register range is specified as
17838 two registers separated by a dash.  Multiple register ranges can be
17839 specified separated by a comma.
17840
17841 @item -mea32
17842 @itemx -mea64
17843 @opindex mea32
17844 @opindex mea64
17845 Compile code assuming that pointers to the PPU address space accessed
17846 via the @code{__ea} named address space qualifier are either 32 or 64
17847 bits wide.  The default is 32 bits.  As this is an ABI changing option,
17848 all object code in an executable must be compiled with the same setting.
17849
17850 @item -maddress-space-conversion
17851 @itemx -mno-address-space-conversion
17852 @opindex maddress-space-conversion
17853 @opindex mno-address-space-conversion
17854 Allow/disallow treating the @code{__ea} address space as superset
17855 of the generic address space.  This enables explicit type casts
17856 between @code{__ea} and generic pointer as well as implicit
17857 conversions of generic pointers to @code{__ea} pointers.  The
17858 default is to allow address space pointer conversions.
17859
17860 @item -mcache-size=@var{cache-size}
17861 @opindex mcache-size
17862 This option controls the version of libgcc that the compiler links to an
17863 executable and selects a software-managed cache for accessing variables
17864 in the @code{__ea} address space with a particular cache size.  Possible
17865 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
17866 and @samp{128}.  The default cache size is 64KB.
17867
17868 @item -matomic-updates
17869 @itemx -mno-atomic-updates
17870 @opindex matomic-updates
17871 @opindex mno-atomic-updates
17872 This option controls the version of libgcc that the compiler links to an
17873 executable and selects whether atomic updates to the software-managed
17874 cache of PPU-side variables are used.  If you use atomic updates, changes
17875 to a PPU variable from SPU code using the @code{__ea} named address space
17876 qualifier will not interfere with changes to other PPU variables residing
17877 in the same cache line from PPU code.  If you do not use atomic updates,
17878 such interference may occur; however, writing back cache lines will be
17879 more efficient.  The default behavior is to use atomic updates.
17880
17881 @item -mdual-nops
17882 @itemx -mdual-nops=@var{n}
17883 @opindex mdual-nops
17884 By default, GCC will insert nops to increase dual issue when it expects
17885 it to increase performance.  @var{n} can be a value from 0 to 10.  A
17886 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
17887 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
17888
17889 @item -mhint-max-nops=@var{n}
17890 @opindex mhint-max-nops
17891 Maximum number of nops to insert for a branch hint.  A branch hint must
17892 be at least 8 instructions away from the branch it is effecting.  GCC
17893 will insert up to @var{n} nops to enforce this, otherwise it will not
17894 generate the branch hint.
17895
17896 @item -mhint-max-distance=@var{n}
17897 @opindex mhint-max-distance
17898 The encoding of the branch hint instruction limits the hint to be within
17899 256 instructions of the branch it is effecting.  By default, GCC makes
17900 sure it is within 125.
17901
17902 @item -msafe-hints
17903 @opindex msafe-hints
17904 Work around a hardware bug which causes the SPU to stall indefinitely.
17905 By default, GCC will insert the @code{hbrp} instruction to make sure
17906 this stall won't happen.
17907
17908 @end table
17909
17910 @node System V Options
17911 @subsection Options for System V
17912
17913 These additional options are available on System V Release 4 for
17914 compatibility with other compilers on those systems:
17915
17916 @table @gcctabopt
17917 @item -G
17918 @opindex G
17919 Create a shared object.
17920 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
17921
17922 @item -Qy
17923 @opindex Qy
17924 Identify the versions of each tool used by the compiler, in a
17925 @code{.ident} assembler directive in the output.
17926
17927 @item -Qn
17928 @opindex Qn
17929 Refrain from adding @code{.ident} directives to the output file (this is
17930 the default).
17931
17932 @item -YP,@var{dirs}
17933 @opindex YP
17934 Search the directories @var{dirs}, and no others, for libraries
17935 specified with @option{-l}.
17936
17937 @item -Ym,@var{dir}
17938 @opindex Ym
17939 Look in the directory @var{dir} to find the M4 preprocessor.
17940 The assembler uses this option.
17941 @c This is supposed to go with a -Yd for predefined M4 macro files, but
17942 @c the generic assembler that comes with Solaris takes just -Ym.
17943 @end table
17944
17945 @node V850 Options
17946 @subsection V850 Options
17947 @cindex V850 Options
17948
17949 These @samp{-m} options are defined for V850 implementations:
17950
17951 @table @gcctabopt
17952 @item -mlong-calls
17953 @itemx -mno-long-calls
17954 @opindex mlong-calls
17955 @opindex mno-long-calls
17956 Treat all calls as being far away (near).  If calls are assumed to be
17957 far away, the compiler will always load the functions address up into a
17958 register, and call indirect through the pointer.
17959
17960 @item -mno-ep
17961 @itemx -mep
17962 @opindex mno-ep
17963 @opindex mep
17964 Do not optimize (do optimize) basic blocks that use the same index
17965 pointer 4 or more times to copy pointer into the @code{ep} register, and
17966 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
17967 option is on by default if you optimize.
17968
17969 @item -mno-prolog-function
17970 @itemx -mprolog-function
17971 @opindex mno-prolog-function
17972 @opindex mprolog-function
17973 Do not use (do use) external functions to save and restore registers
17974 at the prologue and epilogue of a function.  The external functions
17975 are slower, but use less code space if more than one function saves
17976 the same number of registers.  The @option{-mprolog-function} option
17977 is on by default if you optimize.
17978
17979 @item -mspace
17980 @opindex mspace
17981 Try to make the code as small as possible.  At present, this just turns
17982 on the @option{-mep} and @option{-mprolog-function} options.
17983
17984 @item -mtda=@var{n}
17985 @opindex mtda
17986 Put static or global variables whose size is @var{n} bytes or less into
17987 the tiny data area that register @code{ep} points to.  The tiny data
17988 area can hold up to 256 bytes in total (128 bytes for byte references).
17989
17990 @item -msda=@var{n}
17991 @opindex msda
17992 Put static or global variables whose size is @var{n} bytes or less into
17993 the small data area that register @code{gp} points to.  The small data
17994 area can hold up to 64 kilobytes.
17995
17996 @item -mzda=@var{n}
17997 @opindex mzda
17998 Put static or global variables whose size is @var{n} bytes or less into
17999 the first 32 kilobytes of memory.
18000
18001 @item -mv850
18002 @opindex mv850
18003 Specify that the target processor is the V850.
18004
18005 @item -mbig-switch
18006 @opindex mbig-switch
18007 Generate code suitable for big switch tables.  Use this option only if
18008 the assembler/linker complain about out of range branches within a switch
18009 table.
18010
18011 @item -mapp-regs
18012 @opindex mapp-regs
18013 This option will cause r2 and r5 to be used in the code generated by
18014 the compiler.  This setting is the default.
18015
18016 @item -mno-app-regs
18017 @opindex mno-app-regs
18018 This option will cause r2 and r5 to be treated as fixed registers.
18019
18020 @item -mv850e2v3
18021 @opindex mv850e2v3
18022 Specify that the target processor is the V850E2V3.  The preprocessor
18023 constants @samp{__v850e2v3__} will be defined if
18024 this option is used.
18025
18026 @item -mv850e2
18027 @opindex mv850e2
18028 Specify that the target processor is the V850E2.  The preprocessor
18029 constants @samp{__v850e2__} will be defined if this option is used.
18030
18031 @item -mv850e1
18032 @opindex mv850e1
18033 Specify that the target processor is the V850E1.  The preprocessor
18034 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
18035 this option is used.
18036
18037 @item -mv850es
18038 @opindex mv850es
18039 Specify that the target processor is the V850ES.  This is an alias for
18040 the @option{-mv850e1} option.
18041
18042 @item -mv850e
18043 @opindex mv850e
18044 Specify that the target processor is the V850E@.  The preprocessor
18045 constant @samp{__v850e__} will be defined if this option is used.
18046
18047 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
18048 nor @option{-mv850e2} nor @option{-mv850e2v3}
18049 are defined then a default target processor will be chosen and the
18050 relevant @samp{__v850*__} preprocessor constant will be defined.
18051
18052 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
18053 defined, regardless of which processor variant is the target.
18054
18055 @item -mdisable-callt
18056 @opindex mdisable-callt
18057 This option will suppress generation of the CALLT instruction for the
18058 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
18059 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
18060
18061 @end table
18062
18063 @node VAX Options
18064 @subsection VAX Options
18065 @cindex VAX options
18066
18067 These @samp{-m} options are defined for the VAX:
18068
18069 @table @gcctabopt
18070 @item -munix
18071 @opindex munix
18072 Do not output certain jump instructions (@code{aobleq} and so on)
18073 that the Unix assembler for the VAX cannot handle across long
18074 ranges.
18075
18076 @item -mgnu
18077 @opindex mgnu
18078 Do output those jump instructions, on the assumption that you
18079 will assemble with the GNU assembler.
18080
18081 @item -mg
18082 @opindex mg
18083 Output code for g-format floating point numbers instead of d-format.
18084 @end table
18085
18086 @node VxWorks Options
18087 @subsection VxWorks Options
18088 @cindex VxWorks Options
18089
18090 The options in this section are defined for all VxWorks targets.
18091 Options specific to the target hardware are listed with the other
18092 options for that target.
18093
18094 @table @gcctabopt
18095 @item -mrtp
18096 @opindex mrtp
18097 GCC can generate code for both VxWorks kernels and real time processes
18098 (RTPs).  This option switches from the former to the latter.  It also
18099 defines the preprocessor macro @code{__RTP__}.
18100
18101 @item -non-static
18102 @opindex non-static
18103 Link an RTP executable against shared libraries rather than static
18104 libraries.  The options @option{-static} and @option{-shared} can
18105 also be used for RTPs (@pxref{Link Options}); @option{-static}
18106 is the default.
18107
18108 @item -Bstatic
18109 @itemx -Bdynamic
18110 @opindex Bstatic
18111 @opindex Bdynamic
18112 These options are passed down to the linker.  They are defined for
18113 compatibility with Diab.
18114
18115 @item -Xbind-lazy
18116 @opindex Xbind-lazy
18117 Enable lazy binding of function calls.  This option is equivalent to
18118 @option{-Wl,-z,now} and is defined for compatibility with Diab.
18119
18120 @item -Xbind-now
18121 @opindex Xbind-now
18122 Disable lazy binding of function calls.  This option is the default and
18123 is defined for compatibility with Diab.
18124 @end table
18125
18126 @node x86-64 Options
18127 @subsection x86-64 Options
18128 @cindex x86-64 options
18129
18130 These are listed under @xref{i386 and x86-64 Options}.
18131
18132 @node Xstormy16 Options
18133 @subsection Xstormy16 Options
18134 @cindex Xstormy16 Options
18135
18136 These options are defined for Xstormy16:
18137
18138 @table @gcctabopt
18139 @item -msim
18140 @opindex msim
18141 Choose startup files and linker script suitable for the simulator.
18142 @end table
18143
18144 @node Xtensa Options
18145 @subsection Xtensa Options
18146 @cindex Xtensa Options
18147
18148 These options are supported for Xtensa targets:
18149
18150 @table @gcctabopt
18151 @item -mconst16
18152 @itemx -mno-const16
18153 @opindex mconst16
18154 @opindex mno-const16
18155 Enable or disable use of @code{CONST16} instructions for loading
18156 constant values.  The @code{CONST16} instruction is currently not a
18157 standard option from Tensilica.  When enabled, @code{CONST16}
18158 instructions are always used in place of the standard @code{L32R}
18159 instructions.  The use of @code{CONST16} is enabled by default only if
18160 the @code{L32R} instruction is not available.
18161
18162 @item -mfused-madd
18163 @itemx -mno-fused-madd
18164 @opindex mfused-madd
18165 @opindex mno-fused-madd
18166 Enable or disable use of fused multiply/add and multiply/subtract
18167 instructions in the floating-point option.  This has no effect if the
18168 floating-point option is not also enabled.  Disabling fused multiply/add
18169 and multiply/subtract instructions forces the compiler to use separate
18170 instructions for the multiply and add/subtract operations.  This may be
18171 desirable in some cases where strict IEEE 754-compliant results are
18172 required: the fused multiply add/subtract instructions do not round the
18173 intermediate result, thereby producing results with @emph{more} bits of
18174 precision than specified by the IEEE standard.  Disabling fused multiply
18175 add/subtract instructions also ensures that the program output is not
18176 sensitive to the compiler's ability to combine multiply and add/subtract
18177 operations.
18178
18179 @item -mserialize-volatile
18180 @itemx -mno-serialize-volatile
18181 @opindex mserialize-volatile
18182 @opindex mno-serialize-volatile
18183 When this option is enabled, GCC inserts @code{MEMW} instructions before
18184 @code{volatile} memory references to guarantee sequential consistency.
18185 The default is @option{-mserialize-volatile}.  Use
18186 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
18187
18188 @item -mforce-no-pic
18189 @opindex mforce-no-pic
18190 For targets, like GNU/Linux, where all user-mode Xtensa code must be
18191 position-independent code (PIC), this option disables PIC for compiling
18192 kernel code.
18193
18194 @item -mtext-section-literals
18195 @itemx -mno-text-section-literals
18196 @opindex mtext-section-literals
18197 @opindex mno-text-section-literals
18198 Control the treatment of literal pools.  The default is
18199 @option{-mno-text-section-literals}, which places literals in a separate
18200 section in the output file.  This allows the literal pool to be placed
18201 in a data RAM/ROM, and it also allows the linker to combine literal
18202 pools from separate object files to remove redundant literals and
18203 improve code size.  With @option{-mtext-section-literals}, the literals
18204 are interspersed in the text section in order to keep them as close as
18205 possible to their references.  This may be necessary for large assembly
18206 files.
18207
18208 @item -mtarget-align
18209 @itemx -mno-target-align
18210 @opindex mtarget-align
18211 @opindex mno-target-align
18212 When this option is enabled, GCC instructs the assembler to
18213 automatically align instructions to reduce branch penalties at the
18214 expense of some code density.  The assembler attempts to widen density
18215 instructions to align branch targets and the instructions following call
18216 instructions.  If there are not enough preceding safe density
18217 instructions to align a target, no widening will be performed.  The
18218 default is @option{-mtarget-align}.  These options do not affect the
18219 treatment of auto-aligned instructions like @code{LOOP}, which the
18220 assembler will always align, either by widening density instructions or
18221 by inserting no-op instructions.
18222
18223 @item -mlongcalls
18224 @itemx -mno-longcalls
18225 @opindex mlongcalls
18226 @opindex mno-longcalls
18227 When this option is enabled, GCC instructs the assembler to translate
18228 direct calls to indirect calls unless it can determine that the target
18229 of a direct call is in the range allowed by the call instruction.  This
18230 translation typically occurs for calls to functions in other source
18231 files.  Specifically, the assembler translates a direct @code{CALL}
18232 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
18233 The default is @option{-mno-longcalls}.  This option should be used in
18234 programs where the call target can potentially be out of range.  This
18235 option is implemented in the assembler, not the compiler, so the
18236 assembly code generated by GCC will still show direct call
18237 instructions---look at the disassembled object code to see the actual
18238 instructions.  Note that the assembler will use an indirect call for
18239 every cross-file call, not just those that really will be out of range.
18240 @end table
18241
18242 @node zSeries Options
18243 @subsection zSeries Options
18244 @cindex zSeries options
18245
18246 These are listed under @xref{S/390 and zSeries Options}.
18247
18248 @node Code Gen Options
18249 @section Options for Code Generation Conventions
18250 @cindex code generation conventions
18251 @cindex options, code generation
18252 @cindex run-time options
18253
18254 These machine-independent options control the interface conventions
18255 used in code generation.
18256
18257 Most of them have both positive and negative forms; the negative form
18258 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
18259 one of the forms is listed---the one which is not the default.  You
18260 can figure out the other form by either removing @samp{no-} or adding
18261 it.
18262
18263 @table @gcctabopt
18264 @item -fbounds-check
18265 @opindex fbounds-check
18266 For front-ends that support it, generate additional code to check that
18267 indices used to access arrays are within the declared range.  This is
18268 currently only supported by the Java and Fortran front-ends, where
18269 this option defaults to true and false respectively.
18270
18271 @item -ftrapv
18272 @opindex ftrapv
18273 This option generates traps for signed overflow on addition, subtraction,
18274 multiplication operations.
18275
18276 @item -fwrapv
18277 @opindex fwrapv
18278 This option instructs the compiler to assume that signed arithmetic
18279 overflow of addition, subtraction and multiplication wraps around
18280 using twos-complement representation.  This flag enables some optimizations
18281 and disables others.  This option is enabled by default for the Java
18282 front-end, as required by the Java language specification.
18283
18284 @item -fexceptions
18285 @opindex fexceptions
18286 Enable exception handling.  Generates extra code needed to propagate
18287 exceptions.  For some targets, this implies GCC will generate frame
18288 unwind information for all functions, which can produce significant data
18289 size overhead, although it does not affect execution.  If you do not
18290 specify this option, GCC will enable it by default for languages like
18291 C++ which normally require exception handling, and disable it for
18292 languages like C that do not normally require it.  However, you may need
18293 to enable this option when compiling C code that needs to interoperate
18294 properly with exception handlers written in C++.  You may also wish to
18295 disable this option if you are compiling older C++ programs that don't
18296 use exception handling.
18297
18298 @item -fnon-call-exceptions
18299 @opindex fnon-call-exceptions
18300 Generate code that allows trapping instructions to throw exceptions.
18301 Note that this requires platform-specific runtime support that does
18302 not exist everywhere.  Moreover, it only allows @emph{trapping}
18303 instructions to throw exceptions, i.e.@: memory references or floating
18304 point instructions.  It does not allow exceptions to be thrown from
18305 arbitrary signal handlers such as @code{SIGALRM}.
18306
18307 @item -funwind-tables
18308 @opindex funwind-tables
18309 Similar to @option{-fexceptions}, except that it will just generate any needed
18310 static data, but will not affect the generated code in any other way.
18311 You will normally not enable this option; instead, a language processor
18312 that needs this handling would enable it on your behalf.
18313
18314 @item -fasynchronous-unwind-tables
18315 @opindex fasynchronous-unwind-tables
18316 Generate unwind table in dwarf2 format, if supported by target machine.  The
18317 table is exact at each instruction boundary, so it can be used for stack
18318 unwinding from asynchronous events (such as debugger or garbage collector).
18319
18320 @item -fpcc-struct-return
18321 @opindex fpcc-struct-return
18322 Return ``short'' @code{struct} and @code{union} values in memory like
18323 longer ones, rather than in registers.  This convention is less
18324 efficient, but it has the advantage of allowing intercallability between
18325 GCC-compiled files and files compiled with other compilers, particularly
18326 the Portable C Compiler (pcc).
18327
18328 The precise convention for returning structures in memory depends
18329 on the target configuration macros.
18330
18331 Short structures and unions are those whose size and alignment match
18332 that of some integer type.
18333
18334 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
18335 switch is not binary compatible with code compiled with the
18336 @option{-freg-struct-return} switch.
18337 Use it to conform to a non-default application binary interface.
18338
18339 @item -freg-struct-return
18340 @opindex freg-struct-return
18341 Return @code{struct} and @code{union} values in registers when possible.
18342 This is more efficient for small structures than
18343 @option{-fpcc-struct-return}.
18344
18345 If you specify neither @option{-fpcc-struct-return} nor
18346 @option{-freg-struct-return}, GCC defaults to whichever convention is
18347 standard for the target.  If there is no standard convention, GCC
18348 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
18349 the principal compiler.  In those cases, we can choose the standard, and
18350 we chose the more efficient register return alternative.
18351
18352 @strong{Warning:} code compiled with the @option{-freg-struct-return}
18353 switch is not binary compatible with code compiled with the
18354 @option{-fpcc-struct-return} switch.
18355 Use it to conform to a non-default application binary interface.
18356
18357 @item -fshort-enums
18358 @opindex fshort-enums
18359 Allocate to an @code{enum} type only as many bytes as it needs for the
18360 declared range of possible values.  Specifically, the @code{enum} type
18361 will be equivalent to the smallest integer type which has enough room.
18362
18363 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
18364 code that is not binary compatible with code generated without that switch.
18365 Use it to conform to a non-default application binary interface.
18366
18367 @item -fshort-double
18368 @opindex fshort-double
18369 Use the same size for @code{double} as for @code{float}.
18370
18371 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
18372 code that is not binary compatible with code generated without that switch.
18373 Use it to conform to a non-default application binary interface.
18374
18375 @item -fshort-wchar
18376 @opindex fshort-wchar
18377 Override the underlying type for @samp{wchar_t} to be @samp{short
18378 unsigned int} instead of the default for the target.  This option is
18379 useful for building programs to run under WINE@.
18380
18381 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
18382 code that is not binary compatible with code generated without that switch.
18383 Use it to conform to a non-default application binary interface.
18384
18385 @item -fno-common
18386 @opindex fno-common
18387 In C code, controls the placement of uninitialized global variables.
18388 Unix C compilers have traditionally permitted multiple definitions of
18389 such variables in different compilation units by placing the variables
18390 in a common block.
18391 This is the behavior specified by @option{-fcommon}, and is the default
18392 for GCC on most targets.
18393 On the other hand, this behavior is not required by ISO C, and on some
18394 targets may carry a speed or code size penalty on variable references.
18395 The @option{-fno-common} option specifies that the compiler should place
18396 uninitialized global variables in the data section of the object file,
18397 rather than generating them as common blocks.
18398 This has the effect that if the same variable is declared
18399 (without @code{extern}) in two different compilations,
18400 you will get a multiple-definition error when you link them.
18401 In this case, you must compile with @option{-fcommon} instead.
18402 Compiling with @option{-fno-common} is useful on targets for which
18403 it provides better performance, or if you wish to verify that the
18404 program will work on other systems which always treat uninitialized
18405 variable declarations this way.
18406
18407 @item -fno-ident
18408 @opindex fno-ident
18409 Ignore the @samp{#ident} directive.
18410
18411 @item -finhibit-size-directive
18412 @opindex finhibit-size-directive
18413 Don't output a @code{.size} assembler directive, or anything else that
18414 would cause trouble if the function is split in the middle, and the
18415 two halves are placed at locations far apart in memory.  This option is
18416 used when compiling @file{crtstuff.c}; you should not need to use it
18417 for anything else.
18418
18419 @item -fverbose-asm
18420 @opindex fverbose-asm
18421 Put extra commentary information in the generated assembly code to
18422 make it more readable.  This option is generally only of use to those
18423 who actually need to read the generated assembly code (perhaps while
18424 debugging the compiler itself).
18425
18426 @option{-fno-verbose-asm}, the default, causes the
18427 extra information to be omitted and is useful when comparing two assembler
18428 files.
18429
18430 @item -frecord-gcc-switches
18431 @opindex frecord-gcc-switches
18432 This switch causes the command line that was used to invoke the
18433 compiler to be recorded into the object file that is being created.
18434 This switch is only implemented on some targets and the exact format
18435 of the recording is target and binary file format dependent, but it
18436 usually takes the form of a section containing ASCII text.  This
18437 switch is related to the @option{-fverbose-asm} switch, but that
18438 switch only records information in the assembler output file as
18439 comments, so it never reaches the object file.
18440 See also @option{-grecord-gcc-switches} for another
18441 way of storing compiler options into the object file.
18442
18443 @item -fpic
18444 @opindex fpic
18445 @cindex global offset table
18446 @cindex PIC
18447 Generate position-independent code (PIC) suitable for use in a shared
18448 library, if supported for the target machine.  Such code accesses all
18449 constant addresses through a global offset table (GOT)@.  The dynamic
18450 loader resolves the GOT entries when the program starts (the dynamic
18451 loader is not part of GCC; it is part of the operating system).  If
18452 the GOT size for the linked executable exceeds a machine-specific
18453 maximum size, you get an error message from the linker indicating that
18454 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
18455 instead.  (These maximums are 8k on the SPARC and 32k
18456 on the m68k and RS/6000.  The 386 has no such limit.)
18457
18458 Position-independent code requires special support, and therefore works
18459 only on certain machines.  For the 386, GCC supports PIC for System V
18460 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
18461 position-independent.
18462
18463 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
18464 are defined to 1.
18465
18466 @item -fPIC
18467 @opindex fPIC
18468 If supported for the target machine, emit position-independent code,
18469 suitable for dynamic linking and avoiding any limit on the size of the
18470 global offset table.  This option makes a difference on the m68k,
18471 PowerPC and SPARC@.
18472
18473 Position-independent code requires special support, and therefore works
18474 only on certain machines.
18475
18476 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
18477 are defined to 2.
18478
18479 @item -fpie
18480 @itemx -fPIE
18481 @opindex fpie
18482 @opindex fPIE
18483 These options are similar to @option{-fpic} and @option{-fPIC}, but
18484 generated position independent code can be only linked into executables.
18485 Usually these options are used when @option{-pie} GCC option will be
18486 used during linking.
18487
18488 @option{-fpie} and @option{-fPIE} both define the macros
18489 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
18490 for @option{-fpie} and 2 for @option{-fPIE}.
18491
18492 @item -fno-jump-tables
18493 @opindex fno-jump-tables
18494 Do not use jump tables for switch statements even where it would be
18495 more efficient than other code generation strategies.  This option is
18496 of use in conjunction with @option{-fpic} or @option{-fPIC} for
18497 building code which forms part of a dynamic linker and cannot
18498 reference the address of a jump table.  On some targets, jump tables
18499 do not require a GOT and this option is not needed.
18500
18501 @item -ffixed-@var{reg}
18502 @opindex ffixed
18503 Treat the register named @var{reg} as a fixed register; generated code
18504 should never refer to it (except perhaps as a stack pointer, frame
18505 pointer or in some other fixed role).
18506
18507 @var{reg} must be the name of a register.  The register names accepted
18508 are machine-specific and are defined in the @code{REGISTER_NAMES}
18509 macro in the machine description macro file.
18510
18511 This flag does not have a negative form, because it specifies a
18512 three-way choice.
18513
18514 @item -fcall-used-@var{reg}
18515 @opindex fcall-used
18516 Treat the register named @var{reg} as an allocable register that is
18517 clobbered by function calls.  It may be allocated for temporaries or
18518 variables that do not live across a call.  Functions compiled this way
18519 will not save and restore the register @var{reg}.
18520
18521 It is an error to used this flag with the frame pointer or stack pointer.
18522 Use of this flag for other registers that have fixed pervasive roles in
18523 the machine's execution model will produce disastrous results.
18524
18525 This flag does not have a negative form, because it specifies a
18526 three-way choice.
18527
18528 @item -fcall-saved-@var{reg}
18529 @opindex fcall-saved
18530 Treat the register named @var{reg} as an allocable register saved by
18531 functions.  It may be allocated even for temporaries or variables that
18532 live across a call.  Functions compiled this way will save and restore
18533 the register @var{reg} if they use it.
18534
18535 It is an error to used this flag with the frame pointer or stack pointer.
18536 Use of this flag for other registers that have fixed pervasive roles in
18537 the machine's execution model will produce disastrous results.
18538
18539 A different sort of disaster will result from the use of this flag for
18540 a register in which function values may be returned.
18541
18542 This flag does not have a negative form, because it specifies a
18543 three-way choice.
18544
18545 @item -fpack-struct[=@var{n}]
18546 @opindex fpack-struct
18547 Without a value specified, pack all structure members together without
18548 holes.  When a value is specified (which must be a small power of two), pack
18549 structure members according to this value, representing the maximum
18550 alignment (that is, objects with default alignment requirements larger than
18551 this will be output potentially unaligned at the next fitting location.
18552
18553 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
18554 code that is not binary compatible with code generated without that switch.
18555 Additionally, it makes the code suboptimal.
18556 Use it to conform to a non-default application binary interface.
18557
18558 @item -finstrument-functions
18559 @opindex finstrument-functions
18560 Generate instrumentation calls for entry and exit to functions.  Just
18561 after function entry and just before function exit, the following
18562 profiling functions will be called with the address of the current
18563 function and its call site.  (On some platforms,
18564 @code{__builtin_return_address} does not work beyond the current
18565 function, so the call site information may not be available to the
18566 profiling functions otherwise.)
18567
18568 @smallexample
18569 void __cyg_profile_func_enter (void *this_fn,
18570                                void *call_site);
18571 void __cyg_profile_func_exit  (void *this_fn,
18572                                void *call_site);
18573 @end smallexample
18574
18575 The first argument is the address of the start of the current function,
18576 which may be looked up exactly in the symbol table.
18577
18578 This instrumentation is also done for functions expanded inline in other
18579 functions.  The profiling calls will indicate where, conceptually, the
18580 inline function is entered and exited.  This means that addressable
18581 versions of such functions must be available.  If all your uses of a
18582 function are expanded inline, this may mean an additional expansion of
18583 code size.  If you use @samp{extern inline} in your C code, an
18584 addressable version of such functions must be provided.  (This is
18585 normally the case anyways, but if you get lucky and the optimizer always
18586 expands the functions inline, you might have gotten away without
18587 providing static copies.)
18588
18589 A function may be given the attribute @code{no_instrument_function}, in
18590 which case this instrumentation will not be done.  This can be used, for
18591 example, for the profiling functions listed above, high-priority
18592 interrupt routines, and any functions from which the profiling functions
18593 cannot safely be called (perhaps signal handlers, if the profiling
18594 routines generate output or allocate memory).
18595
18596 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
18597 @opindex finstrument-functions-exclude-file-list
18598
18599 Set the list of functions that are excluded from instrumentation (see
18600 the description of @code{-finstrument-functions}).  If the file that
18601 contains a function definition matches with one of @var{file}, then
18602 that function is not instrumented.  The match is done on substrings:
18603 if the @var{file} parameter is a substring of the file name, it is
18604 considered to be a match.
18605
18606 For example:
18607
18608 @smallexample
18609 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
18610 @end smallexample
18611
18612 @noindent
18613 will exclude any inline function defined in files whose pathnames
18614 contain @code{/bits/stl} or @code{include/sys}.
18615
18616 If, for some reason, you want to include letter @code{','} in one of
18617 @var{sym}, write @code{'\,'}. For example,
18618 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
18619 (note the single quote surrounding the option).
18620
18621 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
18622 @opindex finstrument-functions-exclude-function-list
18623
18624 This is similar to @code{-finstrument-functions-exclude-file-list},
18625 but this option sets the list of function names to be excluded from
18626 instrumentation.  The function name to be matched is its user-visible
18627 name, such as @code{vector<int> blah(const vector<int> &)}, not the
18628 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
18629 match is done on substrings: if the @var{sym} parameter is a substring
18630 of the function name, it is considered to be a match.  For C99 and C++
18631 extended identifiers, the function name must be given in UTF-8, not
18632 using universal character names.
18633
18634 @item -fstack-check
18635 @opindex fstack-check
18636 Generate code to verify that you do not go beyond the boundary of the
18637 stack.  You should specify this flag if you are running in an
18638 environment with multiple threads, but only rarely need to specify it in
18639 a single-threaded environment since stack overflow is automatically
18640 detected on nearly all systems if there is only one stack.
18641
18642 Note that this switch does not actually cause checking to be done; the
18643 operating system or the language runtime must do that.  The switch causes
18644 generation of code to ensure that they see the stack being extended.
18645
18646 You can additionally specify a string parameter: @code{no} means no
18647 checking, @code{generic} means force the use of old-style checking,
18648 @code{specific} means use the best checking method and is equivalent
18649 to bare @option{-fstack-check}.
18650
18651 Old-style checking is a generic mechanism that requires no specific
18652 target support in the compiler but comes with the following drawbacks:
18653
18654 @enumerate
18655 @item
18656 Modified allocation strategy for large objects: they will always be
18657 allocated dynamically if their size exceeds a fixed threshold.
18658
18659 @item
18660 Fixed limit on the size of the static frame of functions: when it is
18661 topped by a particular function, stack checking is not reliable and
18662 a warning is issued by the compiler.
18663
18664 @item
18665 Inefficiency: because of both the modified allocation strategy and the
18666 generic implementation, the performances of the code are hampered.
18667 @end enumerate
18668
18669 Note that old-style stack checking is also the fallback method for
18670 @code{specific} if no target support has been added in the compiler.
18671
18672 @item -fstack-limit-register=@var{reg}
18673 @itemx -fstack-limit-symbol=@var{sym}
18674 @itemx -fno-stack-limit
18675 @opindex fstack-limit-register
18676 @opindex fstack-limit-symbol
18677 @opindex fno-stack-limit
18678 Generate code to ensure that the stack does not grow beyond a certain value,
18679 either the value of a register or the address of a symbol.  If the stack
18680 would grow beyond the value, a signal is raised.  For most targets,
18681 the signal is raised before the stack overruns the boundary, so
18682 it is possible to catch the signal without taking special precautions.
18683
18684 For instance, if the stack starts at absolute address @samp{0x80000000}
18685 and grows downwards, you can use the flags
18686 @option{-fstack-limit-symbol=__stack_limit} and
18687 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
18688 of 128KB@.  Note that this may only work with the GNU linker.
18689
18690 @item -fsplit-stack
18691 @opindex fsplit-stack
18692 Generate code to automatically split the stack before it overflows.
18693 The resulting program has a discontiguous stack which can only
18694 overflow if the program is unable to allocate any more memory.  This
18695 is most useful when running threaded programs, as it is no longer
18696 necessary to calculate a good stack size to use for each thread.  This
18697 is currently only implemented for the i386 and x86_64 backends running
18698 GNU/Linux.
18699
18700 When code compiled with @option{-fsplit-stack} calls code compiled
18701 without @option{-fsplit-stack}, there may not be much stack space
18702 available for the latter code to run.  If compiling all code,
18703 including library code, with @option{-fsplit-stack} is not an option,
18704 then the linker can fix up these calls so that the code compiled
18705 without @option{-fsplit-stack} always has a large stack.  Support for
18706 this is implemented in the gold linker in GNU binutils release 2.21
18707 and later.
18708
18709 @item -fleading-underscore
18710 @opindex fleading-underscore
18711 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
18712 change the way C symbols are represented in the object file.  One use
18713 is to help link with legacy assembly code.
18714
18715 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
18716 generate code that is not binary compatible with code generated without that
18717 switch.  Use it to conform to a non-default application binary interface.
18718 Not all targets provide complete support for this switch.
18719
18720 @item -ftls-model=@var{model}
18721 @opindex ftls-model
18722 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
18723 The @var{model} argument should be one of @code{global-dynamic},
18724 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
18725
18726 The default without @option{-fpic} is @code{initial-exec}; with
18727 @option{-fpic} the default is @code{global-dynamic}.
18728
18729 @item -fvisibility=@var{default|internal|hidden|protected}
18730 @opindex fvisibility
18731 Set the default ELF image symbol visibility to the specified option---all
18732 symbols will be marked with this unless overridden within the code.
18733 Using this feature can very substantially improve linking and
18734 load times of shared object libraries, produce more optimized
18735 code, provide near-perfect API export and prevent symbol clashes.
18736 It is @strong{strongly} recommended that you use this in any shared objects
18737 you distribute.
18738
18739 Despite the nomenclature, @code{default} always means public; i.e.,
18740 available to be linked against from outside the shared object.
18741 @code{protected} and @code{internal} are pretty useless in real-world
18742 usage so the only other commonly used option will be @code{hidden}.
18743 The default if @option{-fvisibility} isn't specified is
18744 @code{default}, i.e., make every
18745 symbol public---this causes the same behavior as previous versions of
18746 GCC@.
18747
18748 A good explanation of the benefits offered by ensuring ELF
18749 symbols have the correct visibility is given by ``How To Write
18750 Shared Libraries'' by Ulrich Drepper (which can be found at
18751 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
18752 solution made possible by this option to marking things hidden when
18753 the default is public is to make the default hidden and mark things
18754 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
18755 and @code{__attribute__ ((visibility("default")))} instead of
18756 @code{__declspec(dllexport)} you get almost identical semantics with
18757 identical syntax.  This is a great boon to those working with
18758 cross-platform projects.
18759
18760 For those adding visibility support to existing code, you may find
18761 @samp{#pragma GCC visibility} of use.  This works by you enclosing
18762 the declarations you wish to set visibility for with (for example)
18763 @samp{#pragma GCC visibility push(hidden)} and
18764 @samp{#pragma GCC visibility pop}.
18765 Bear in mind that symbol visibility should be viewed @strong{as
18766 part of the API interface contract} and thus all new code should
18767 always specify visibility when it is not the default; i.e., declarations
18768 only for use within the local DSO should @strong{always} be marked explicitly
18769 as hidden as so to avoid PLT indirection overheads---making this
18770 abundantly clear also aids readability and self-documentation of the code.
18771 Note that due to ISO C++ specification requirements, operator new and
18772 operator delete must always be of default visibility.
18773
18774 Be aware that headers from outside your project, in particular system
18775 headers and headers from any other library you use, may not be
18776 expecting to be compiled with visibility other than the default.  You
18777 may need to explicitly say @samp{#pragma GCC visibility push(default)}
18778 before including any such headers.
18779
18780 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
18781 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
18782 no modifications.  However, this means that calls to @samp{extern}
18783 functions with no explicit visibility will use the PLT, so it is more
18784 effective to use @samp{__attribute ((visibility))} and/or
18785 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
18786 declarations should be treated as hidden.
18787
18788 Note that @samp{-fvisibility} does affect C++ vague linkage
18789 entities. This means that, for instance, an exception class that will
18790 be thrown between DSOs must be explicitly marked with default
18791 visibility so that the @samp{type_info} nodes will be unified between
18792 the DSOs.
18793
18794 An overview of these techniques, their benefits and how to use them
18795 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
18796
18797 @item -fstrict-volatile-bitfields
18798 @opindex fstrict-volatile-bitfields
18799 This option should be used if accesses to volatile bitfields (or other
18800 structure fields, although the compiler usually honors those types
18801 anyway) should use a single access of the width of the
18802 field's type, aligned to a natural alignment if possible.  For
18803 example, targets with memory-mapped peripheral registers might require
18804 all such accesses to be 16 bits wide; with this flag the user could
18805 declare all peripheral bitfields as ``unsigned short'' (assuming short
18806 is 16 bits on these targets) to force GCC to use 16 bit accesses
18807 instead of, perhaps, a more efficient 32 bit access.
18808
18809 If this option is disabled, the compiler will use the most efficient
18810 instruction.  In the previous example, that might be a 32-bit load
18811 instruction, even though that will access bytes that do not contain
18812 any portion of the bitfield, or memory-mapped registers unrelated to
18813 the one being updated.
18814
18815 If the target requires strict alignment, and honoring the field
18816 type would require violating this alignment, a warning is issued.
18817 If the field has @code{packed} attribute, the access is done without
18818 honoring the field type.  If the field doesn't have @code{packed}
18819 attribute, the access is done honoring the field type.  In both cases,
18820 GCC assumes that the user knows something about the target hardware
18821 that it is unaware of.
18822
18823 The default value of this option is determined by the application binary
18824 interface for the target processor.
18825
18826 @end table
18827
18828 @c man end
18829
18830 @node Environment Variables
18831 @section Environment Variables Affecting GCC
18832 @cindex environment variables
18833
18834 @c man begin ENVIRONMENT
18835 This section describes several environment variables that affect how GCC
18836 operates.  Some of them work by specifying directories or prefixes to use
18837 when searching for various kinds of files.  Some are used to specify other
18838 aspects of the compilation environment.
18839
18840 Note that you can also specify places to search using options such as
18841 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
18842 take precedence over places specified using environment variables, which
18843 in turn take precedence over those specified by the configuration of GCC@.
18844 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
18845 GNU Compiler Collection (GCC) Internals}.
18846
18847 @table @env
18848 @item LANG
18849 @itemx LC_CTYPE
18850 @c @itemx LC_COLLATE
18851 @itemx LC_MESSAGES
18852 @c @itemx LC_MONETARY
18853 @c @itemx LC_NUMERIC
18854 @c @itemx LC_TIME
18855 @itemx LC_ALL
18856 @findex LANG
18857 @findex LC_CTYPE
18858 @c @findex LC_COLLATE
18859 @findex LC_MESSAGES
18860 @c @findex LC_MONETARY
18861 @c @findex LC_NUMERIC
18862 @c @findex LC_TIME
18863 @findex LC_ALL
18864 @cindex locale
18865 These environment variables control the way that GCC uses
18866 localization information that allow GCC to work with different
18867 national conventions.  GCC inspects the locale categories
18868 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
18869 so.  These locale categories can be set to any value supported by your
18870 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
18871 Kingdom encoded in UTF-8.
18872
18873 The @env{LC_CTYPE} environment variable specifies character
18874 classification.  GCC uses it to determine the character boundaries in
18875 a string; this is needed for some multibyte encodings that contain quote
18876 and escape characters that would otherwise be interpreted as a string
18877 end or escape.
18878
18879 The @env{LC_MESSAGES} environment variable specifies the language to
18880 use in diagnostic messages.
18881
18882 If the @env{LC_ALL} environment variable is set, it overrides the value
18883 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
18884 and @env{LC_MESSAGES} default to the value of the @env{LANG}
18885 environment variable.  If none of these variables are set, GCC
18886 defaults to traditional C English behavior.
18887
18888 @item TMPDIR
18889 @findex TMPDIR
18890 If @env{TMPDIR} is set, it specifies the directory to use for temporary
18891 files.  GCC uses temporary files to hold the output of one stage of
18892 compilation which is to be used as input to the next stage: for example,
18893 the output of the preprocessor, which is the input to the compiler
18894 proper.
18895
18896 @item GCC_COMPARE_DEBUG
18897 @findex GCC_COMPARE_DEBUG
18898 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
18899 @option{-fcompare-debug} to the compiler driver.  See the documentation
18900 of this option for more details.
18901
18902 @item GCC_EXEC_PREFIX
18903 @findex GCC_EXEC_PREFIX
18904 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
18905 names of the subprograms executed by the compiler.  No slash is added
18906 when this prefix is combined with the name of a subprogram, but you can
18907 specify a prefix that ends with a slash if you wish.
18908
18909 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
18910 an appropriate prefix to use based on the pathname it was invoked with.
18911
18912 If GCC cannot find the subprogram using the specified prefix, it
18913 tries looking in the usual places for the subprogram.
18914
18915 The default value of @env{GCC_EXEC_PREFIX} is
18916 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
18917 the installed compiler. In many cases @var{prefix} is the value
18918 of @code{prefix} when you ran the @file{configure} script.
18919
18920 Other prefixes specified with @option{-B} take precedence over this prefix.
18921
18922 This prefix is also used for finding files such as @file{crt0.o} that are
18923 used for linking.
18924
18925 In addition, the prefix is used in an unusual way in finding the
18926 directories to search for header files.  For each of the standard
18927 directories whose name normally begins with @samp{/usr/local/lib/gcc}
18928 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
18929 replacing that beginning with the specified prefix to produce an
18930 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
18931 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
18932 These alternate directories are searched first; the standard directories
18933 come next. If a standard directory begins with the configured
18934 @var{prefix} then the value of @var{prefix} is replaced by
18935 @env{GCC_EXEC_PREFIX} when looking for header files.
18936
18937 @item COMPILER_PATH
18938 @findex COMPILER_PATH
18939 The value of @env{COMPILER_PATH} is a colon-separated list of
18940 directories, much like @env{PATH}.  GCC tries the directories thus
18941 specified when searching for subprograms, if it can't find the
18942 subprograms using @env{GCC_EXEC_PREFIX}.
18943
18944 @item LIBRARY_PATH
18945 @findex LIBRARY_PATH
18946 The value of @env{LIBRARY_PATH} is a colon-separated list of
18947 directories, much like @env{PATH}.  When configured as a native compiler,
18948 GCC tries the directories thus specified when searching for special
18949 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
18950 using GCC also uses these directories when searching for ordinary
18951 libraries for the @option{-l} option (but directories specified with
18952 @option{-L} come first).
18953
18954 @item LANG
18955 @findex LANG
18956 @cindex locale definition
18957 This variable is used to pass locale information to the compiler.  One way in
18958 which this information is used is to determine the character set to be used
18959 when character literals, string literals and comments are parsed in C and C++.
18960 When the compiler is configured to allow multibyte characters,
18961 the following values for @env{LANG} are recognized:
18962
18963 @table @samp
18964 @item C-JIS
18965 Recognize JIS characters.
18966 @item C-SJIS
18967 Recognize SJIS characters.
18968 @item C-EUCJP
18969 Recognize EUCJP characters.
18970 @end table
18971
18972 If @env{LANG} is not defined, or if it has some other value, then the
18973 compiler will use mblen and mbtowc as defined by the default locale to
18974 recognize and translate multibyte characters.
18975 @end table
18976
18977 @noindent
18978 Some additional environments variables affect the behavior of the
18979 preprocessor.
18980
18981 @include cppenv.texi
18982
18983 @c man end
18984
18985 @node Precompiled Headers
18986 @section Using Precompiled Headers
18987 @cindex precompiled headers
18988 @cindex speed of compilation
18989
18990 Often large projects have many header files that are included in every
18991 source file.  The time the compiler takes to process these header files
18992 over and over again can account for nearly all of the time required to
18993 build the project.  To make builds faster, GCC allows users to
18994 `precompile' a header file; then, if builds can use the precompiled
18995 header file they will be much faster.
18996
18997 To create a precompiled header file, simply compile it as you would any
18998 other file, if necessary using the @option{-x} option to make the driver
18999 treat it as a C or C++ header file.  You will probably want to use a
19000 tool like @command{make} to keep the precompiled header up-to-date when
19001 the headers it contains change.
19002
19003 A precompiled header file will be searched for when @code{#include} is
19004 seen in the compilation.  As it searches for the included file
19005 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
19006 compiler looks for a precompiled header in each directory just before it
19007 looks for the include file in that directory.  The name searched for is
19008 the name specified in the @code{#include} with @samp{.gch} appended.  If
19009 the precompiled header file can't be used, it is ignored.
19010
19011 For instance, if you have @code{#include "all.h"}, and you have
19012 @file{all.h.gch} in the same directory as @file{all.h}, then the
19013 precompiled header file will be used if possible, and the original
19014 header will be used otherwise.
19015
19016 Alternatively, you might decide to put the precompiled header file in a
19017 directory and use @option{-I} to ensure that directory is searched
19018 before (or instead of) the directory containing the original header.
19019 Then, if you want to check that the precompiled header file is always
19020 used, you can put a file of the same name as the original header in this
19021 directory containing an @code{#error} command.
19022
19023 This also works with @option{-include}.  So yet another way to use
19024 precompiled headers, good for projects not designed with precompiled
19025 header files in mind, is to simply take most of the header files used by
19026 a project, include them from another header file, precompile that header
19027 file, and @option{-include} the precompiled header.  If the header files
19028 have guards against multiple inclusion, they will be skipped because
19029 they've already been included (in the precompiled header).
19030
19031 If you need to precompile the same header file for different
19032 languages, targets, or compiler options, you can instead make a
19033 @emph{directory} named like @file{all.h.gch}, and put each precompiled
19034 header in the directory, perhaps using @option{-o}.  It doesn't matter
19035 what you call the files in the directory, every precompiled header in
19036 the directory will be considered.  The first precompiled header
19037 encountered in the directory that is valid for this compilation will
19038 be used; they're searched in no particular order.
19039
19040 There are many other possibilities, limited only by your imagination,
19041 good sense, and the constraints of your build system.
19042
19043 A precompiled header file can be used only when these conditions apply:
19044
19045 @itemize
19046 @item
19047 Only one precompiled header can be used in a particular compilation.
19048
19049 @item
19050 A precompiled header can't be used once the first C token is seen.  You
19051 can have preprocessor directives before a precompiled header; you can
19052 even include a precompiled header from inside another header, so long as
19053 there are no C tokens before the @code{#include}.
19054
19055 @item
19056 The precompiled header file must be produced for the same language as
19057 the current compilation.  You can't use a C precompiled header for a C++
19058 compilation.
19059
19060 @item
19061 The precompiled header file must have been produced by the same compiler
19062 binary as the current compilation is using.
19063
19064 @item
19065 Any macros defined before the precompiled header is included must
19066 either be defined in the same way as when the precompiled header was
19067 generated, or must not affect the precompiled header, which usually
19068 means that they don't appear in the precompiled header at all.
19069
19070 The @option{-D} option is one way to define a macro before a
19071 precompiled header is included; using a @code{#define} can also do it.
19072 There are also some options that define macros implicitly, like
19073 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
19074 defined this way.
19075
19076 @item If debugging information is output when using the precompiled
19077 header, using @option{-g} or similar, the same kind of debugging information
19078 must have been output when building the precompiled header.  However,
19079 a precompiled header built using @option{-g} can be used in a compilation
19080 when no debugging information is being output.
19081
19082 @item The same @option{-m} options must generally be used when building
19083 and using the precompiled header.  @xref{Submodel Options},
19084 for any cases where this rule is relaxed.
19085
19086 @item Each of the following options must be the same when building and using
19087 the precompiled header:
19088
19089 @gccoptlist{-fexceptions}
19090
19091 @item
19092 Some other command-line options starting with @option{-f},
19093 @option{-p}, or @option{-O} must be defined in the same way as when
19094 the precompiled header was generated.  At present, it's not clear
19095 which options are safe to change and which are not; the safest choice
19096 is to use exactly the same options when generating and using the
19097 precompiled header.  The following are known to be safe:
19098
19099 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
19100 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
19101 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
19102 -pedantic-errors}
19103
19104 @end itemize
19105
19106 For all of these except the last, the compiler will automatically
19107 ignore the precompiled header if the conditions aren't met.  If you
19108 find an option combination that doesn't work and doesn't cause the
19109 precompiled header to be ignored, please consider filing a bug report,
19110 see @ref{Bugs}.
19111
19112 If you do use differing options when generating and using the
19113 precompiled header, the actual behavior will be a mixture of the
19114 behavior for the options.  For instance, if you use @option{-g} to
19115 generate the precompiled header but not when using it, you may or may
19116 not get debugging information for routines in the precompiled header.