OSDN Git Service

PR/44128
[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
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
15 Free Software Foundation, Inc.
16
17 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.3 or
19 any later version published by the Free Software Foundation; with the
20 Invariant Sections being ``GNU General Public License'' and ``Funding
21 Free Software'', the Front-Cover texts being (a) (see below), and with
22 the Back-Cover Texts being (b) (see below).  A copy of the license is
23 included in the gfdl(7) man page.
24
25 (a) The FSF's Front-Cover Text is:
26
27      A GNU Manual
28
29 (b) The FSF's Back-Cover Text is:
30
31      You have freedom to copy and modify this GNU Manual, like GNU
32      software.  Copies published by the Free Software Foundation raise
33      funds for GNU development.
34 @c man end
35 @c Set file name and title for the man page.
36 @setfilename gcc
37 @settitle GNU project C and C++ compiler
38 @c man begin SYNOPSIS
39 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
40     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
41     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
42     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
43     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
44     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
45     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
46
47 Only the most useful options are listed here; see below for the
48 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
49 @c man end
50 @c man begin SEEALSO
51 gpl(7), gfdl(7), fsf-funding(7),
52 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
53 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
54 @file{ld}, @file{binutils} and @file{gdb}.
55 @c man end
56 @c man begin BUGS
57 For instructions on reporting bugs, see
58 @w{@value{BUGURL}}.
59 @c man end
60 @c man begin AUTHOR
61 See the Info entry for @command{gcc}, or
62 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
63 for contributors to GCC@.
64 @c man end
65 @end ignore
66
67 @node Invoking GCC
68 @chapter GCC Command Options
69 @cindex GCC command options
70 @cindex command options
71 @cindex options, GCC command
72
73 @c man begin DESCRIPTION
74 When you invoke GCC, it normally does preprocessing, compilation,
75 assembly and linking.  The ``overall options'' allow you to stop this
76 process at an intermediate stage.  For example, the @option{-c} option
77 says not to run the linker.  Then the output consists of object files
78 output by the assembler.
79
80 Other options are passed on to one stage of processing.  Some options
81 control the preprocessor and others the compiler itself.  Yet other
82 options control the assembler and linker; most of these are not
83 documented here, since you rarely need to use any of them.
84
85 @cindex C compilation options
86 Most of the command line options that you can use with GCC are useful
87 for C programs; when an option is only useful with another language
88 (usually C++), the explanation says so explicitly.  If the description
89 for a particular option does not mention a source language, you can use
90 that option with all supported languages.
91
92 @cindex C++ compilation options
93 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
94 options for compiling C++ programs.
95
96 @cindex grouping options
97 @cindex options, grouping
98 The @command{gcc} program accepts options and file names as operands.  Many
99 options have multi-letter names; therefore multiple single-letter options
100 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
101 -v}}.
102
103 @cindex order of options
104 @cindex options, order
105 You can mix options and other arguments.  For the most part, the order
106 you use doesn't matter.  Order does matter when you use several
107 options of the same kind; for example, if you specify @option{-L} more
108 than once, the directories are searched in the order specified.  Also,
109 the placement of the @option{-l} option is significant.
110
111 Many options have long names starting with @samp{-f} or with
112 @samp{-W}---for example,
113 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
114 these have both positive and negative forms; the negative form of
115 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
116 only one of these two forms, whichever one is not the default.
117
118 @c man end
119
120 @xref{Option Index}, for an index to GCC's options.
121
122 @menu
123 * Option Summary::      Brief list of all options, without explanations.
124 * Overall Options::     Controlling the kind of output:
125                         an executable, object files, assembler files,
126                         or preprocessed source.
127 * Invoking G++::        Compiling C++ programs.
128 * C Dialect Options::   Controlling the variant of C language compiled.
129 * C++ Dialect Options:: Variations on C++.
130 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
131                         and Objective-C++.
132 * Language Independent Options:: Controlling how diagnostics should be
133                         formatted.
134 * Warning Options::     How picky should the compiler be?
135 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
136 * Optimize Options::    How much optimization?
137 * Preprocessor Options:: Controlling header files and macro definitions.
138                          Also, getting dependency information for Make.
139 * Assembler Options::   Passing options to the assembler.
140 * Link Options::        Specifying libraries and so on.
141 * Directory Options::   Where to find header files and libraries.
142                         Where to find the compiler executable files.
143 * Spec Files::          How to pass switches to sub-processes.
144 * Target Options::      Running a cross-compiler, or an old version of GCC.
145 * Submodel Options::    Specifying minor hardware or convention variations,
146                         such as 68010 vs 68020.
147 * Code Gen Options::    Specifying conventions for function calls, data layout
148                         and register usage.
149 * Environment Variables:: Env vars that affect GCC.
150 * Precompiled Headers:: Compiling a header once, and using it many times.
151 @end menu
152
153 @c man begin OPTIONS
154
155 @node Option Summary
156 @section Option Summary
157
158 Here is a summary of all the options, grouped by type.  Explanations are
159 in the following sections.
160
161 @table @emph
162 @item Overall Options
163 @xref{Overall Options,,Options Controlling the Kind of Output}.
164 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -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{]}}
169
170 @item C Language Options
171 @xref{C Dialect Options,,Options Controlling C Dialect}.
172 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
173 -aux-info @var{filename} @gol
174 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
175 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
176 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
177 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
178 -fsigned-bitfields  -fsigned-char @gol
179 -funsigned-bitfields  -funsigned-char}
180
181 @item C++ Language Options
182 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
183 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
184 -fconserve-space  -ffriend-injection @gol
185 -fno-elide-constructors @gol
186 -fno-enforce-eh-specs @gol
187 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
188 -fno-implicit-templates @gol
189 -fno-implicit-inline-templates @gol
190 -fno-implement-inlines  -fms-extensions @gol
191 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
192 -fno-optional-diags  -fpermissive @gol
193 -fno-pretty-templates @gol
194 -frepo  -fno-rtti  -fstats  -ftemplate-depth=@var{n} @gol
195 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
196 -fno-default-inline  -fvisibility-inlines-hidden @gol
197 -fvisibility-ms-compat @gol
198 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
199 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
200 -Weffc++  -Wstrict-null-sentinel @gol
201 -Wno-non-template-friend  -Wold-style-cast @gol
202 -Woverloaded-virtual  -Wno-pmf-conversions @gol
203 -Wsign-promo}
204
205 @item Objective-C and Objective-C++ Language Options
206 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
207 Objective-C and Objective-C++ Dialects}.
208 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
209 -fgnu-runtime  -fnext-runtime @gol
210 -fno-nil-receivers @gol
211 -fobjc-call-cxx-cdtors @gol
212 -fobjc-direct-dispatch @gol
213 -fobjc-exceptions @gol
214 -fobjc-gc @gol
215 -freplace-objc-classes @gol
216 -fzero-link @gol
217 -gen-decls @gol
218 -Wassign-intercept @gol
219 -Wno-protocol  -Wselector @gol
220 -Wstrict-selector-match @gol
221 -Wundeclared-selector}
222
223 @item Language Independent Options
224 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
225 @gccoptlist{-fmessage-length=@var{n}  @gol
226 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
227 -fdiagnostics-show-option}
228
229 @item Warning Options
230 @xref{Warning Options,,Options to Request or Suppress Warnings}.
231 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
232 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
233 -Wno-attributes -Wno-builtin-macro-redefined @gol
234 -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
235 -Wchar-subscripts -Wclobbered  -Wcomment @gol
236 -Wconversion  -Wcoverage-mismatch  -Wcpp  -Wno-deprecated  @gol
237 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
238 -Wno-div-by-zero -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
239 -Werror  -Werror=* @gol
240 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
241 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
242 -Wformat-security  -Wformat-y2k @gol
243 -Wframe-larger-than=@var{len} -Wjump-misses-init -Wignored-qualifiers @gol
244 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
245 -Winit-self  -Winline @gol
246 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
247 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
248 -Wlogical-op -Wlong-long @gol
249 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
250 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
251 -Wno-mudflap @gol
252 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
253 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
254 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
255 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
256 -Wredundant-decls @gol
257 -Wreturn-type  -Wsequence-point  -Wshadow @gol
258 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
259 -Wstrict-aliasing -Wstrict-aliasing=n @gol
260 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
261 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]} @gol
262 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
263 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
264 -Wunknown-pragmas  -Wno-pragmas @gol
265 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
266 -Wunused-label  -Wunused-parameter -Wno-unused-result -Wunused-value  -Wunused-variable @gol
267 -Wunused-but-set-parameter -Wunused-but-set-variable -Wvariadic-macros -Wvla @gol
268 -Wvolatile-register-var  -Wwrite-strings}
269
270 @item C and Objective-C-only Warning Options
271 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
272 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
273 -Wold-style-declaration  -Wold-style-definition @gol
274 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
275 -Wdeclaration-after-statement -Wpointer-sign}
276
277 @item Debugging Options
278 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
279 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
280 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
281 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
282 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
283 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
284 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
285 -fdump-statistics @gol
286 -fdump-tree-all @gol
287 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
288 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
290 -fdump-tree-ch @gol
291 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
296 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
297 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
298 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
299 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
300 -fdump-tree-nrv -fdump-tree-vect @gol
301 -fdump-tree-sink @gol
302 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
303 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
304 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
305 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
306 -ftree-vectorizer-verbose=@var{n} @gol
307 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
308 -fdump-final-insns=@var{file} @gol
309 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
310 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
311 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
312 -fenable-icf-debug @gol
313 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
314 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
315 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
316 -ftest-coverage  -ftime-report -fvar-tracking @gol
317 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
318 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
319 -ggdb  -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
320 -gvms  -gxcoff  -gxcoff+ @gol
321 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
322 -fdebug-prefix-map=@var{old}=@var{new} @gol
323 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
324 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
325 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
326 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
327 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
328 -print-sysroot -print-sysroot-headers-suffix @gol
329 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
330
331 @item Optimization Options
332 @xref{Optimize Options,,Options that Control Optimization}.
333 @gccoptlist{
334 -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
335 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
336 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
337 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
338 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol
339 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
340 -fdata-sections -fdce -fdce @gol
341 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
342 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol
343 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
344 -fforward-propagate -ffunction-sections @gol
345 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
346 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
347 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
348 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
349 -fipa-profile -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
350 -fira-algorithm=@var{algorithm} @gol
351 -fira-region=@var{region} -fira-coalesce @gol
352 -fira-loop-pressure -fno-ira-share-save-slots @gol
353 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
354 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
355 -floop-block -floop-interchange -floop-strip-mine -fgraphite-identity @gol
356 -floop-parallelize-all -flto -flto-compression-level -flto-report -fltrans @gol
357 -fltrans-output-list -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
358 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
359 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
360 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
361 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
362 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
363 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
364 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
365 -fpartial-inlining -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
366 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
367 -fprofile-generate=@var{path} @gol
368 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
369 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
370 -freorder-blocks-and-partition -freorder-functions @gol
371 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
372 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
373 -fsched-spec-load -fsched-spec-load-dangerous @gol
374 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
375 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
376 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
377 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
378 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
379 -fselective-scheduling -fselective-scheduling2 @gol
380 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
381 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
382 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
383 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
384 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
385 -ftree-copyrename -ftree-dce @gol
386 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im @gol
387 -ftree-phiprop -ftree-loop-distribution @gol
388 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
389 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
390 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
391 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
392 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
393 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
394 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
395 -fwhole-program -fwhopr[=@var{n}] -fwpa -fuse-linker-plugin @gol
396 --param @var{name}=@var{value}
397 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
398
399 @item Preprocessor Options
400 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
401 @gccoptlist{-A@var{question}=@var{answer} @gol
402 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
403 -C  -dD  -dI  -dM  -dN @gol
404 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
405 -idirafter @var{dir} @gol
406 -include @var{file}  -imacros @var{file} @gol
407 -iprefix @var{file}  -iwithprefix @var{dir} @gol
408 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
409 -imultilib @var{dir} -isysroot @var{dir} @gol
410 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
411 -P  -fworking-directory  -remap @gol
412 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
413 -Xpreprocessor @var{option}}
414
415 @item Assembler Option
416 @xref{Assembler Options,,Passing Options to the Assembler}.
417 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
418
419 @item Linker Options
420 @xref{Link Options,,Options for Linking}.
421 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
422 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
423 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
424 -shared-libgcc  -symbolic @gol
425 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
426 -u @var{symbol}}
427
428 @item Directory Options
429 @xref{Directory Options,,Options for Directory Search}.
430 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir}}
431 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I-
432 --sysroot=@var{dir}
433
434 @item Machine Dependent Options
435 @xref{Submodel Options,,Hardware Models and Configurations}.
436 @c This list is ordered alphanumerically by subsection name.
437 @c Try and put the significant identifier (CPU or system) first,
438 @c so users have a clue at guessing where the ones they want will be.
439
440 @emph{ARC Options}
441 @gccoptlist{-EB  -EL @gol
442 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
443 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
444
445 @emph{ARM Options}
446 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
447 -mabi=@var{name} @gol
448 -mapcs-stack-check  -mno-apcs-stack-check @gol
449 -mapcs-float  -mno-apcs-float @gol
450 -mapcs-reentrant  -mno-apcs-reentrant @gol
451 -msched-prolog  -mno-sched-prolog @gol
452 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
453 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
454 -mfp16-format=@var{name}
455 -mthumb-interwork  -mno-thumb-interwork @gol
456 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
457 -mstructure-size-boundary=@var{n} @gol
458 -mabort-on-noreturn @gol
459 -mlong-calls  -mno-long-calls @gol
460 -msingle-pic-base  -mno-single-pic-base @gol
461 -mpic-register=@var{reg} @gol
462 -mnop-fun-dllimport @gol
463 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
464 -mpoke-function-name @gol
465 -mthumb  -marm @gol
466 -mtpcs-frame  -mtpcs-leaf-frame @gol
467 -mcaller-super-interworking  -mcallee-super-interworking @gol
468 -mtp=@var{name} @gol
469 -mword-relocations @gol
470 -mfix-cortex-m3-ldrd}
471
472 @emph{AVR Options}
473 @gccoptlist{-mmcu=@var{mcu}  -mno-interrupts @gol
474 -mcall-prologues  -mtiny-stack  -mint8}
475
476 @emph{Blackfin Options}
477 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
478 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
479 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
480 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
481 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
482 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
483 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
484 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
485 -micplb}
486
487 @emph{CRIS Options}
488 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
489 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
490 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
491 -mstack-align  -mdata-align  -mconst-align @gol
492 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
493 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
494 -mmul-bug-workaround  -mno-mul-bug-workaround}
495
496 @emph{CRX Options}
497 @gccoptlist{-mmac -mpush-args}
498
499 @emph{Darwin Options}
500 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
501 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
502 -client_name  -compatibility_version  -current_version @gol
503 -dead_strip @gol
504 -dependency-file  -dylib_file  -dylinker_install_name @gol
505 -dynamic  -dynamiclib  -exported_symbols_list @gol
506 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
507 -force_flat_namespace  -headerpad_max_install_names @gol
508 -iframework @gol
509 -image_base  -init  -install_name  -keep_private_externs @gol
510 -multi_module  -multiply_defined  -multiply_defined_unused @gol
511 -noall_load   -no_dead_strip_inits_and_terms @gol
512 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
513 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
514 -private_bundle  -read_only_relocs  -sectalign @gol
515 -sectobjectsymbols  -whyload  -seg1addr @gol
516 -sectcreate  -sectobjectsymbols  -sectorder @gol
517 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
518 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
519 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
520 -single_module  -static  -sub_library  -sub_umbrella @gol
521 -twolevel_namespace  -umbrella  -undefined @gol
522 -unexported_symbols_list  -weak_reference_mismatches @gol
523 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
524 -mkernel -mone-byte-bool}
525
526 @emph{DEC Alpha Options}
527 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
528 -mieee  -mieee-with-inexact  -mieee-conformant @gol
529 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
530 -mtrap-precision=@var{mode}  -mbuild-constants @gol
531 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
532 -mbwx  -mmax  -mfix  -mcix @gol
533 -mfloat-vax  -mfloat-ieee @gol
534 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
535 -msmall-text  -mlarge-text @gol
536 -mmemory-latency=@var{time}}
537
538 @emph{DEC Alpha/VMS Options}
539 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
540
541 @emph{FR30 Options}
542 @gccoptlist{-msmall-model -mno-lsim}
543
544 @emph{FRV Options}
545 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
546 -mhard-float  -msoft-float @gol
547 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
548 -mdouble  -mno-double @gol
549 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
550 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
551 -mlinked-fp  -mlong-calls  -malign-labels @gol
552 -mlibrary-pic  -macc-4  -macc-8 @gol
553 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
554 -moptimize-membar -mno-optimize-membar @gol
555 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
556 -mvliw-branch  -mno-vliw-branch @gol
557 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
558 -mno-nested-cond-exec  -mtomcat-stats @gol
559 -mTLS -mtls @gol
560 -mcpu=@var{cpu}}
561
562 @emph{GNU/Linux Options}
563 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
564 -tno-android-cc -tno-android-ld}
565
566 @emph{H8/300 Options}
567 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
568
569 @emph{HPPA Options}
570 @gccoptlist{-march=@var{architecture-type} @gol
571 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
572 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
573 -mfixed-range=@var{register-range} @gol
574 -mjump-in-delay -mlinker-opt -mlong-calls @gol
575 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
576 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
577 -mno-jump-in-delay  -mno-long-load-store @gol
578 -mno-portable-runtime  -mno-soft-float @gol
579 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
580 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
581 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
582 -munix=@var{unix-std}  -nolibdld  -static  -threads}
583
584 @emph{i386 and x86-64 Options}
585 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
586 -mfpmath=@var{unit} @gol
587 -masm=@var{dialect}  -mno-fancy-math-387 @gol
588 -mno-fp-ret-in-387  -msoft-float @gol
589 -mno-wide-multiply  -mrtd  -malign-double @gol
590 -mpreferred-stack-boundary=@var{num}
591 -mincoming-stack-boundary=@var{num}
592 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip @gol
593 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
594 -maes -mpclmul -mfused-madd @gol
595 -msse4a -m3dnow -mpopcnt -mabm -mfma4 -mxop -mlwp @gol
596 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
597 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
598 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
599 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
600 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
601 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
602 -mcmodel=@var{code-model} -mabi=@var{name} @gol
603 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
604 -msse2avx}
605
606 @emph{IA-64 Options}
607 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
608 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
609 -mconstant-gp  -mauto-pic  -mfused-madd @gol
610 -minline-float-divide-min-latency @gol
611 -minline-float-divide-max-throughput @gol
612 -mno-inline-float-divide @gol
613 -minline-int-divide-min-latency @gol
614 -minline-int-divide-max-throughput  @gol
615 -mno-inline-int-divide @gol
616 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
617 -mno-inline-sqrt @gol
618 -mdwarf2-asm -mearly-stop-bits @gol
619 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
620 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
621 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
622 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
623 -msched-spec-ldc -msched-spec-control-ldc @gol
624 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
625 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
626 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
627 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
628
629 @emph{IA-64/VMS Options}
630 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
631
632 @emph{LM32 Options}
633 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
634 -msign-extend-enabled -muser-enabled}
635
636 @emph{M32R/D Options}
637 @gccoptlist{-m32r2 -m32rx -m32r @gol
638 -mdebug @gol
639 -malign-loops -mno-align-loops @gol
640 -missue-rate=@var{number} @gol
641 -mbranch-cost=@var{number} @gol
642 -mmodel=@var{code-size-model-type} @gol
643 -msdata=@var{sdata-type} @gol
644 -mno-flush-func -mflush-func=@var{name} @gol
645 -mno-flush-trap -mflush-trap=@var{number} @gol
646 -G @var{num}}
647
648 @emph{M32C Options}
649 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
650
651 @emph{M680x0 Options}
652 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
653 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
654 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
655 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
656 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
657 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
658 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
659 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
660 -mxgot -mno-xgot}
661
662 @emph{M68hc1x Options}
663 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
664 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
665 -msoft-reg-count=@var{count}}
666
667 @emph{MCore Options}
668 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
669 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
670 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
671 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
672 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
673
674 @emph{MeP Options}
675 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
676 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
677 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
678 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
679 -mtiny=@var{n}}
680
681 @emph{MIPS Options}
682 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
683 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
684 -mips64  -mips64r2 @gol
685 -mips16  -mno-mips16  -mflip-mips16 @gol
686 -minterlink-mips16  -mno-interlink-mips16 @gol
687 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
688 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
689 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
690 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
691 -mfpu=@var{fpu-type} @gol
692 -msmartmips  -mno-smartmips @gol
693 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
694 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
695 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
696 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
697 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
698 -membedded-data  -mno-embedded-data @gol
699 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
700 -mcode-readable=@var{setting} @gol
701 -msplit-addresses  -mno-split-addresses @gol
702 -mexplicit-relocs  -mno-explicit-relocs @gol
703 -mcheck-zero-division  -mno-check-zero-division @gol
704 -mdivide-traps  -mdivide-breaks @gol
705 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
706 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
707 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
708 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
709 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
710 -mflush-func=@var{func}  -mno-flush-func @gol
711 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
712 -mfp-exceptions -mno-fp-exceptions @gol
713 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
714 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
715
716 @emph{MMIX Options}
717 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
718 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
719 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
720 -mno-base-addresses  -msingle-exit  -mno-single-exit}
721
722 @emph{MN10300 Options}
723 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
724 -mam33  -mno-am33 @gol
725 -mam33-2  -mno-am33-2 @gol
726 -mreturn-pointer-on-d0 @gol
727 -mno-crt0  -mrelax}
728
729 @emph{PDP-11 Options}
730 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
731 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
732 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
733 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
734 -mbranch-expensive  -mbranch-cheap @gol
735 -msplit  -mno-split  -munix-asm  -mdec-asm}
736
737 @emph{picoChip Options}
738 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
739 -msymbol-as-address -mno-inefficient-warnings}
740
741 @emph{PowerPC Options}
742 See RS/6000 and PowerPC Options.
743
744 @emph{RS/6000 and PowerPC Options}
745 @gccoptlist{-mcpu=@var{cpu-type} @gol
746 -mtune=@var{cpu-type} @gol
747 -mcmodel=@var{code-model} @gol
748 -mpower  -mno-power  -mpower2  -mno-power2 @gol
749 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
750 -maltivec  -mno-altivec @gol
751 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
752 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
753 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
754 -mfprnd  -mno-fprnd @gol
755 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
756 -mnew-mnemonics  -mold-mnemonics @gol
757 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
758 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
759 -malign-power  -malign-natural @gol
760 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
761 -msingle-float -mdouble-float -msimple-fpu @gol
762 -mstring  -mno-string  -mupdate  -mno-update @gol
763 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
764 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
765 -mstrict-align  -mno-strict-align  -mrelocatable @gol
766 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
767 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
768 -mdynamic-no-pic  -maltivec -mswdiv @gol
769 -mprioritize-restricted-insns=@var{priority} @gol
770 -msched-costly-dep=@var{dependence_type} @gol
771 -minsert-sched-nops=@var{scheme} @gol
772 -mcall-sysv  -mcall-netbsd @gol
773 -maix-struct-return  -msvr4-struct-return @gol
774 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
775 -misel -mno-isel @gol
776 -misel=yes  -misel=no @gol
777 -mspe -mno-spe @gol
778 -mspe=yes  -mspe=no @gol
779 -mpaired @gol
780 -mgen-cell-microcode -mwarn-cell-microcode @gol
781 -mvrsave -mno-vrsave @gol
782 -mmulhw -mno-mulhw @gol
783 -mdlmzb -mno-dlmzb @gol
784 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
785 -mprototype  -mno-prototype @gol
786 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
787 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
788 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision -mno-recip-precision}
789
790 @emph{RX Options}
791 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
792 -mcpu= -patch=@gol
793 -mbig-endian-data -mlittle-endian-data @gol
794 -msmall-data @gol
795 -msim  -mno-sim@gol
796 -mas100-syntax -mno-as100-syntax@gol
797 -mrelax@gol
798 -mmax-constant-size=@gol
799 -mint-register=@gol
800 -msave-acc-in-interrupts}
801
802 @emph{S/390 and zSeries Options}
803 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
804 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
805 -mlong-double-64 -mlong-double-128 @gol
806 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
807 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
808 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
809 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
810 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
811
812 @emph{Score Options}
813 @gccoptlist{-meb -mel @gol
814 -mnhwloop @gol
815 -muls @gol
816 -mmac @gol
817 -mscore5 -mscore5u -mscore7 -mscore7d}
818
819 @emph{SH Options}
820 @gccoptlist{-m1  -m2  -m2e @gol
821 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
822 -m3  -m3e @gol
823 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
824 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
825 -m5-64media  -m5-64media-nofpu @gol
826 -m5-32media  -m5-32media-nofpu @gol
827 -m5-compact  -m5-compact-nofpu @gol
828 -mb  -ml  -mdalign  -mrelax @gol
829 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
830 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
831 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
832 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
833 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
834 -maccumulate-outgoing-args -minvalid-symbols}
835
836 @emph{SPARC Options}
837 @gccoptlist{-mcpu=@var{cpu-type} @gol
838 -mtune=@var{cpu-type} @gol
839 -mcmodel=@var{code-model} @gol
840 -m32  -m64  -mapp-regs  -mno-app-regs @gol
841 -mfaster-structs  -mno-faster-structs @gol
842 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
843 -mhard-quad-float  -msoft-quad-float @gol
844 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
845 -mstack-bias  -mno-stack-bias @gol
846 -munaligned-doubles  -mno-unaligned-doubles @gol
847 -mv8plus  -mno-v8plus  -mvis  -mno-vis
848 -threads -pthreads -pthread}
849
850 @emph{SPU Options}
851 @gccoptlist{-mwarn-reloc -merror-reloc @gol
852 -msafe-dma -munsafe-dma @gol
853 -mbranch-hints @gol
854 -msmall-mem -mlarge-mem -mstdmain @gol
855 -mfixed-range=@var{register-range} @gol
856 -mea32 -mea64 @gol
857 -maddress-space-conversion -mno-address-space-conversion @gol
858 -mcache-size=@var{cache-size} @gol
859 -matomic-updates -mno-atomic-updates}
860
861 @emph{System V Options}
862 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
863
864 @emph{V850 Options}
865 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
866 -mprolog-function  -mno-prolog-function  -mspace @gol
867 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
868 -mapp-regs  -mno-app-regs @gol
869 -mdisable-callt  -mno-disable-callt @gol
870 -mv850e1 @gol
871 -mv850e @gol
872 -mv850  -mbig-switch}
873
874 @emph{VAX Options}
875 @gccoptlist{-mg  -mgnu  -munix}
876
877 @emph{VxWorks Options}
878 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
879 -Xbind-lazy  -Xbind-now}
880
881 @emph{x86-64 Options}
882 See i386 and x86-64 Options.
883
884 @emph{i386 and x86-64 Windows Options}
885 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
886 -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows
887 -fno-set-stack-executable}
888
889 @emph{Xstormy16 Options}
890 @gccoptlist{-msim}
891
892 @emph{Xtensa Options}
893 @gccoptlist{-mconst16 -mno-const16 @gol
894 -mfused-madd  -mno-fused-madd @gol
895 -mforce-no-pic @gol
896 -mserialize-volatile  -mno-serialize-volatile @gol
897 -mtext-section-literals  -mno-text-section-literals @gol
898 -mtarget-align  -mno-target-align @gol
899 -mlongcalls  -mno-longcalls}
900
901 @emph{zSeries Options}
902 See S/390 and zSeries Options.
903
904 @item Code Generation Options
905 @xref{Code Gen Options,,Options for Code Generation Conventions}.
906 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
907 -ffixed-@var{reg}  -fexceptions @gol
908 -fnon-call-exceptions  -funwind-tables @gol
909 -fasynchronous-unwind-tables @gol
910 -finhibit-size-directive  -finstrument-functions @gol
911 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
912 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
913 -fno-common  -fno-ident @gol
914 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
915 -fno-jump-tables @gol
916 -frecord-gcc-switches @gol
917 -freg-struct-return  -fshort-enums @gol
918 -fshort-double  -fshort-wchar @gol
919 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
920 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
921 -fno-stack-limit @gol
922 -fleading-underscore  -ftls-model=@var{model} @gol
923 -ftrapv  -fwrapv  -fbounds-check @gol
924 -fvisibility}
925 @end table
926
927 @menu
928 * Overall Options::     Controlling the kind of output:
929                         an executable, object files, assembler files,
930                         or preprocessed source.
931 * C Dialect Options::   Controlling the variant of C language compiled.
932 * C++ Dialect Options:: Variations on C++.
933 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
934                         and Objective-C++.
935 * Language Independent Options:: Controlling how diagnostics should be
936                         formatted.
937 * Warning Options::     How picky should the compiler be?
938 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
939 * Optimize Options::    How much optimization?
940 * Preprocessor Options:: Controlling header files and macro definitions.
941                          Also, getting dependency information for Make.
942 * Assembler Options::   Passing options to the assembler.
943 * Link Options::        Specifying libraries and so on.
944 * Directory Options::   Where to find header files and libraries.
945                         Where to find the compiler executable files.
946 * Spec Files::          How to pass switches to sub-processes.
947 * Target Options::      Running a cross-compiler, or an old version of GCC.
948 @end menu
949
950 @node Overall Options
951 @section Options Controlling the Kind of Output
952
953 Compilation can involve up to four stages: preprocessing, compilation
954 proper, assembly and linking, always in that order.  GCC is capable of
955 preprocessing and compiling several files either into several
956 assembler input files, or into one assembler input file; then each
957 assembler input file produces an object file, and linking combines all
958 the object files (those newly compiled, and those specified as input)
959 into an executable file.
960
961 @cindex file name suffix
962 For any given input file, the file name suffix determines what kind of
963 compilation is done:
964
965 @table @gcctabopt
966 @item @var{file}.c
967 C source code which must be preprocessed.
968
969 @item @var{file}.i
970 C source code which should not be preprocessed.
971
972 @item @var{file}.ii
973 C++ source code which should not be preprocessed.
974
975 @item @var{file}.m
976 Objective-C source code.  Note that you must link with the @file{libobjc}
977 library to make an Objective-C program work.
978
979 @item @var{file}.mi
980 Objective-C source code which should not be preprocessed.
981
982 @item @var{file}.mm
983 @itemx @var{file}.M
984 Objective-C++ source code.  Note that you must link with the @file{libobjc}
985 library to make an Objective-C++ program work.  Note that @samp{.M} refers
986 to a literal capital M@.
987
988 @item @var{file}.mii
989 Objective-C++ source code which should not be preprocessed.
990
991 @item @var{file}.h
992 C, C++, Objective-C or Objective-C++ header file to be turned into a
993 precompiled header (default), or C, C++ header file to be turned into an
994 Ada spec (via the @option{-fdump-ada-spec} switch).
995
996 @item @var{file}.cc
997 @itemx @var{file}.cp
998 @itemx @var{file}.cxx
999 @itemx @var{file}.cpp
1000 @itemx @var{file}.CPP
1001 @itemx @var{file}.c++
1002 @itemx @var{file}.C
1003 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
1004 the last two letters must both be literally @samp{x}.  Likewise,
1005 @samp{.C} refers to a literal capital C@.
1006
1007 @item @var{file}.mm
1008 @itemx @var{file}.M
1009 Objective-C++ source code which must be preprocessed.
1010
1011 @item @var{file}.mii
1012 Objective-C++ source code which should not be preprocessed.
1013
1014 @item @var{file}.hh
1015 @itemx @var{file}.H
1016 @itemx @var{file}.hp
1017 @itemx @var{file}.hxx
1018 @itemx @var{file}.hpp
1019 @itemx @var{file}.HPP
1020 @itemx @var{file}.h++
1021 @itemx @var{file}.tcc
1022 C++ header file to be turned into a precompiled header or Ada spec.
1023
1024 @item @var{file}.f
1025 @itemx @var{file}.for
1026 @itemx @var{file}.ftn
1027 Fixed form Fortran source code which should not be preprocessed.
1028
1029 @item @var{file}.F
1030 @itemx @var{file}.FOR
1031 @itemx @var{file}.fpp
1032 @itemx @var{file}.FPP
1033 @itemx @var{file}.FTN
1034 Fixed form Fortran source code which must be preprocessed (with the traditional
1035 preprocessor).
1036
1037 @item @var{file}.f90
1038 @itemx @var{file}.f95
1039 @itemx @var{file}.f03
1040 @itemx @var{file}.f08
1041 Free form Fortran source code which should not be preprocessed.
1042
1043 @item @var{file}.F90
1044 @itemx @var{file}.F95
1045 @itemx @var{file}.F03
1046 @itemx @var{file}.F08
1047 Free form Fortran source code which must be preprocessed (with the
1048 traditional preprocessor).
1049
1050 @c FIXME: Descriptions of Java file types.
1051 @c @var{file}.java
1052 @c @var{file}.class
1053 @c @var{file}.zip
1054 @c @var{file}.jar
1055
1056 @item @var{file}.ads
1057 Ada source code file which contains a library unit declaration (a
1058 declaration of a package, subprogram, or generic, or a generic
1059 instantiation), or a library unit renaming declaration (a package,
1060 generic, or subprogram renaming declaration).  Such files are also
1061 called @dfn{specs}.
1062
1063 @item @var{file}.adb
1064 Ada source code file containing a library unit body (a subprogram or
1065 package body).  Such files are also called @dfn{bodies}.
1066
1067 @c GCC also knows about some suffixes for languages not yet included:
1068 @c Pascal:
1069 @c @var{file}.p
1070 @c @var{file}.pas
1071 @c Ratfor:
1072 @c @var{file}.r
1073
1074 @item @var{file}.s
1075 Assembler code.
1076
1077 @item @var{file}.S
1078 @itemx @var{file}.sx
1079 Assembler code which must be preprocessed.
1080
1081 @item @var{other}
1082 An object file to be fed straight into linking.
1083 Any file name with no recognized suffix is treated this way.
1084 @end table
1085
1086 @opindex x
1087 You can specify the input language explicitly with the @option{-x} option:
1088
1089 @table @gcctabopt
1090 @item -x @var{language}
1091 Specify explicitly the @var{language} for the following input files
1092 (rather than letting the compiler choose a default based on the file
1093 name suffix).  This option applies to all following input files until
1094 the next @option{-x} option.  Possible values for @var{language} are:
1095 @smallexample
1096 c  c-header  c-cpp-output
1097 c++  c++-header  c++-cpp-output
1098 objective-c  objective-c-header  objective-c-cpp-output
1099 objective-c++ objective-c++-header objective-c++-cpp-output
1100 assembler  assembler-with-cpp
1101 ada
1102 f77  f77-cpp-input f95  f95-cpp-input
1103 java
1104 @end smallexample
1105
1106 @item -x none
1107 Turn off any specification of a language, so that subsequent files are
1108 handled according to their file name suffixes (as they are if @option{-x}
1109 has not been used at all).
1110
1111 @item -pass-exit-codes
1112 @opindex pass-exit-codes
1113 Normally the @command{gcc} program will exit with the code of 1 if any
1114 phase of the compiler returns a non-success return code.  If you specify
1115 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1116 numerically highest error produced by any phase that returned an error
1117 indication.  The C, C++, and Fortran frontends return 4, if an internal
1118 compiler error is encountered.
1119 @end table
1120
1121 If you only want some of the stages of compilation, you can use
1122 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1123 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1124 @command{gcc} is to stop.  Note that some combinations (for example,
1125 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1126
1127 @table @gcctabopt
1128 @item -c
1129 @opindex c
1130 Compile or assemble the source files, but do not link.  The linking
1131 stage simply is not done.  The ultimate output is in the form of an
1132 object file for each source file.
1133
1134 By default, the object file name for a source file is made by replacing
1135 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1136
1137 Unrecognized input files, not requiring compilation or assembly, are
1138 ignored.
1139
1140 @item -S
1141 @opindex S
1142 Stop after the stage of compilation proper; do not assemble.  The output
1143 is in the form of an assembler code file for each non-assembler input
1144 file specified.
1145
1146 By default, the assembler file name for a source file is made by
1147 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1148
1149 Input files that don't require compilation are ignored.
1150
1151 @item -E
1152 @opindex E
1153 Stop after the preprocessing stage; do not run the compiler proper.  The
1154 output is in the form of preprocessed source code, which is sent to the
1155 standard output.
1156
1157 Input files which don't require preprocessing are ignored.
1158
1159 @cindex output file option
1160 @item -o @var{file}
1161 @opindex o
1162 Place output in file @var{file}.  This applies regardless to whatever
1163 sort of output is being produced, whether it be an executable file,
1164 an object file, an assembler file or preprocessed C code.
1165
1166 If @option{-o} is not specified, the default is to put an executable
1167 file in @file{a.out}, the object file for
1168 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1169 assembler file in @file{@var{source}.s}, a precompiled header file in
1170 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1171 standard output.
1172
1173 @item -v
1174 @opindex v
1175 Print (on standard error output) the commands executed to run the stages
1176 of compilation.  Also print the version number of the compiler driver
1177 program and of the preprocessor and the compiler proper.
1178
1179 @item -###
1180 @opindex ###
1181 Like @option{-v} except the commands are not executed and arguments
1182 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1183 This is useful for shell scripts to capture the driver-generated command lines.
1184
1185 @item -pipe
1186 @opindex pipe
1187 Use pipes rather than temporary files for communication between the
1188 various stages of compilation.  This fails to work on some systems where
1189 the assembler is unable to read from a pipe; but the GNU assembler has
1190 no trouble.
1191
1192 @item -combine
1193 @opindex combine
1194 If you are compiling multiple source files, this option tells the driver
1195 to pass all the source files to the compiler at once (for those
1196 languages for which the compiler can handle this).  This will allow
1197 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1198 language for which this is supported is C@.  If you pass source files for
1199 multiple languages to the driver, using this option, the driver will invoke
1200 the compiler(s) that support IMA once each, passing each compiler all the
1201 source files appropriate for it.  For those languages that do not support
1202 IMA this option will be ignored, and the compiler will be invoked once for
1203 each source file in that language.  If you use this option in conjunction
1204 with @option{-save-temps}, the compiler will generate multiple
1205 pre-processed files
1206 (one for each source file), but only one (combined) @file{.o} or
1207 @file{.s} file.
1208
1209 @item --help
1210 @opindex help
1211 Print (on the standard output) a description of the command line options
1212 understood by @command{gcc}.  If the @option{-v} option is also specified
1213 then @option{--help} will also be passed on to the various processes
1214 invoked by @command{gcc}, so that they can display the command line options
1215 they accept.  If the @option{-Wextra} option has also been specified
1216 (prior to the @option{--help} option), then command line options which
1217 have no documentation associated with them will also be displayed.
1218
1219 @item --target-help
1220 @opindex target-help
1221 Print (on the standard output) a description of target-specific command
1222 line options for each tool.  For some targets extra target-specific
1223 information may also be printed.
1224
1225 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1226 Print (on the standard output) a description of the command line
1227 options understood by the compiler that fit into all specified classes
1228 and qualifiers.  These are the supported classes:
1229
1230 @table @asis
1231 @item @samp{optimizers}
1232 This will display all of the optimization options supported by the
1233 compiler.
1234
1235 @item @samp{warnings}
1236 This will display all of the options controlling warning messages
1237 produced by the compiler.
1238
1239 @item @samp{target}
1240 This will display target-specific options.  Unlike the
1241 @option{--target-help} option however, target-specific options of the
1242 linker and assembler will not be displayed.  This is because those
1243 tools do not currently support the extended @option{--help=} syntax.
1244
1245 @item @samp{params}
1246 This will display the values recognized by the @option{--param}
1247 option.
1248
1249 @item @var{language}
1250 This will display the options supported for @var{language}, where
1251 @var{language} is the name of one of the languages supported in this
1252 version of GCC.
1253
1254 @item @samp{common}
1255 This will display the options that are common to all languages.
1256 @end table
1257
1258 These are the supported qualifiers:
1259
1260 @table @asis
1261 @item @samp{undocumented}
1262 Display only those options which are undocumented.
1263
1264 @item @samp{joined}
1265 Display options which take an argument that appears after an equal
1266 sign in the same continuous piece of text, such as:
1267 @samp{--help=target}.
1268
1269 @item @samp{separate}
1270 Display options which take an argument that appears as a separate word
1271 following the original option, such as: @samp{-o output-file}.
1272 @end table
1273
1274 Thus for example to display all the undocumented target-specific
1275 switches supported by the compiler the following can be used:
1276
1277 @smallexample
1278 --help=target,undocumented
1279 @end smallexample
1280
1281 The sense of a qualifier can be inverted by prefixing it with the
1282 @samp{^} character, so for example to display all binary warning
1283 options (i.e., ones that are either on or off and that do not take an
1284 argument), which have a description the following can be used:
1285
1286 @smallexample
1287 --help=warnings,^joined,^undocumented
1288 @end smallexample
1289
1290 The argument to @option{--help=} should not consist solely of inverted
1291 qualifiers.
1292
1293 Combining several classes is possible, although this usually
1294 restricts the output by so much that there is nothing to display.  One
1295 case where it does work however is when one of the classes is
1296 @var{target}.  So for example to display all the target-specific
1297 optimization options the following can be used:
1298
1299 @smallexample
1300 --help=target,optimizers
1301 @end smallexample
1302
1303 The @option{--help=} option can be repeated on the command line.  Each
1304 successive use will display its requested class of options, skipping
1305 those that have already been displayed.
1306
1307 If the @option{-Q} option appears on the command line before the
1308 @option{--help=} option, then the descriptive text displayed by
1309 @option{--help=} is changed.  Instead of describing the displayed
1310 options, an indication is given as to whether the option is enabled,
1311 disabled or set to a specific value (assuming that the compiler
1312 knows this at the point where the @option{--help=} option is used).
1313
1314 Here is a truncated example from the ARM port of @command{gcc}:
1315
1316 @smallexample
1317   % gcc -Q -mabi=2 --help=target -c
1318   The following options are target specific:
1319   -mabi=                                2
1320   -mabort-on-noreturn                   [disabled]
1321   -mapcs                                [disabled]
1322 @end smallexample
1323
1324 The output is sensitive to the effects of previous command line
1325 options, so for example it is possible to find out which optimizations
1326 are enabled at @option{-O2} by using:
1327
1328 @smallexample
1329 -Q -O2 --help=optimizers
1330 @end smallexample
1331
1332 Alternatively you can discover which binary optimizations are enabled
1333 by @option{-O3} by using:
1334
1335 @smallexample
1336 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1337 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1338 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1339 @end smallexample
1340
1341 @item -no-canonical-prefixes
1342 @opindex no-canonical-prefixes
1343 Do not expand any symbolic links, resolve references to @samp{/../}
1344 or @samp{/./}, or make the path absolute when generating a relative
1345 prefix.
1346
1347 @item --version
1348 @opindex version
1349 Display the version number and copyrights of the invoked GCC@.
1350
1351 @item -wrapper
1352 @opindex wrapper
1353 Invoke all subcommands under a wrapper program. It takes a single
1354 comma separated list as an argument, which will be used to invoke
1355 the wrapper:
1356
1357 @smallexample
1358 gcc -c t.c -wrapper gdb,--args
1359 @end smallexample
1360
1361 This will invoke all subprograms of gcc under "gdb --args",
1362 thus cc1 invocation will be "gdb --args cc1 ...".
1363
1364 @item -fplugin=@var{name}.so
1365 Load the plugin code in file @var{name}.so, assumed to be a
1366 shared object to be dlopen'd by the compiler.  The base name of
1367 the shared object file is used to identify the plugin for the
1368 purposes of argument parsing (See
1369 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1370 Each plugin should define the callback functions specified in the
1371 Plugins API.
1372
1373 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1374 Define an argument called @var{key} with a value of @var{value}
1375 for the plugin called @var{name}.
1376
1377 @item -fdump-ada-spec@r{[}-slim@r{]}
1378 For C and C++ source and include files, generate corresponding Ada
1379 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1380 GNAT User's Guide}, which provides detailed documentation on this feature.
1381
1382 @include @value{srcdir}/../libiberty/at-file.texi
1383 @end table
1384
1385 @node Invoking G++
1386 @section Compiling C++ Programs
1387
1388 @cindex suffixes for C++ source
1389 @cindex C++ source file suffixes
1390 C++ source files conventionally use one of the suffixes @samp{.C},
1391 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1392 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1393 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1394 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1395 files with these names and compiles them as C++ programs even if you
1396 call the compiler the same way as for compiling C programs (usually
1397 with the name @command{gcc}).
1398
1399 @findex g++
1400 @findex c++
1401 However, the use of @command{gcc} does not add the C++ library.
1402 @command{g++} is a program that calls GCC and treats @samp{.c},
1403 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1404 files unless @option{-x} is used, and automatically specifies linking
1405 against the C++ library.  This program is also useful when
1406 precompiling a C header file with a @samp{.h} extension for use in C++
1407 compilations.  On many systems, @command{g++} is also installed with
1408 the name @command{c++}.
1409
1410 @cindex invoking @command{g++}
1411 When you compile C++ programs, you may specify many of the same
1412 command-line options that you use for compiling programs in any
1413 language; or command-line options meaningful for C and related
1414 languages; or options that are meaningful only for C++ programs.
1415 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1416 explanations of options for languages related to C@.
1417 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1418 explanations of options that are meaningful only for C++ programs.
1419
1420 @node C Dialect Options
1421 @section Options Controlling C Dialect
1422 @cindex dialect options
1423 @cindex language dialect options
1424 @cindex options, dialect
1425
1426 The following options control the dialect of C (or languages derived
1427 from C, such as C++, Objective-C and Objective-C++) that the compiler
1428 accepts:
1429
1430 @table @gcctabopt
1431 @cindex ANSI support
1432 @cindex ISO support
1433 @item -ansi
1434 @opindex ansi
1435 In C mode, this is equivalent to @samp{-std=c90}. In C++ mode, it is
1436 equivalent to @samp{-std=c++98}.
1437
1438 This turns off certain features of GCC that are incompatible with ISO
1439 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1440 such as the @code{asm} and @code{typeof} keywords, and
1441 predefined macros such as @code{unix} and @code{vax} that identify the
1442 type of system you are using.  It also enables the undesirable and
1443 rarely used ISO trigraph feature.  For the C compiler,
1444 it disables recognition of C++ style @samp{//} comments as well as
1445 the @code{inline} keyword.
1446
1447 The alternate keywords @code{__asm__}, @code{__extension__},
1448 @code{__inline__} and @code{__typeof__} continue to work despite
1449 @option{-ansi}.  You would not want to use them in an ISO C program, of
1450 course, but it is useful to put them in header files that might be included
1451 in compilations done with @option{-ansi}.  Alternate predefined macros
1452 such as @code{__unix__} and @code{__vax__} are also available, with or
1453 without @option{-ansi}.
1454
1455 The @option{-ansi} option does not cause non-ISO programs to be
1456 rejected gratuitously.  For that, @option{-pedantic} is required in
1457 addition to @option{-ansi}.  @xref{Warning Options}.
1458
1459 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1460 option is used.  Some header files may notice this macro and refrain
1461 from declaring certain functions or defining certain macros that the
1462 ISO standard doesn't call for; this is to avoid interfering with any
1463 programs that might use these names for other things.
1464
1465 Functions that would normally be built in but do not have semantics
1466 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1467 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1468 built-in functions provided by GCC}, for details of the functions
1469 affected.
1470
1471 @item -std=
1472 @opindex std
1473 Determine the language standard. @xref{Standards,,Language Standards
1474 Supported by GCC}, for details of these standard versions.  This option
1475 is currently only supported when compiling C or C++.
1476
1477 The compiler can accept several base standards, such as @samp{c90} or
1478 @samp{c++98}, and GNU dialects of those standards, such as
1479 @samp{gnu90} or @samp{gnu++98}.  By specifying a base standard, the
1480 compiler will accept all programs following that standard and those
1481 using GNU extensions that do not contradict it.  For example,
1482 @samp{-std=c90} turns off certain features of GCC that are
1483 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1484 keywords, but not other GNU extensions that do not have a meaning in
1485 ISO C90, such as omitting the middle term of a @code{?:}
1486 expression. On the other hand, by specifying a GNU dialect of a
1487 standard, all features the compiler support are enabled, even when
1488 those features change the meaning of the base standard and some
1489 strict-conforming programs may be rejected.  The particular standard
1490 is used by @option{-pedantic} to identify which features are GNU
1491 extensions given that version of the standard. For example
1492 @samp{-std=gnu90 -pedantic} would warn about C++ style @samp{//}
1493 comments, while @samp{-std=gnu99 -pedantic} would not.
1494
1495 A value for this option must be provided; possible values are
1496
1497 @table @samp
1498 @item c90
1499 @itemx c89
1500 @itemx iso9899:1990
1501 Support all ISO C90 programs (certain GNU extensions that conflict
1502 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1503
1504 @item iso9899:199409
1505 ISO C90 as modified in amendment 1.
1506
1507 @item c99
1508 @itemx c9x
1509 @itemx iso9899:1999
1510 @itemx iso9899:199x
1511 ISO C99.  Note that this standard is not yet fully supported; see
1512 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1513 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1514
1515 @item c1x
1516 ISO C1X, the draft of the next revision of the ISO C standard.
1517 Support is limited and experimental and features enabled by this
1518 option may be changed or removed if changed in or removed from the
1519 standard draft.
1520
1521 @item gnu90
1522 @itemx gnu89
1523 GNU dialect of ISO C90 (including some C99 features). This
1524 is the default for C code.
1525
1526 @item gnu99
1527 @itemx gnu9x
1528 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1529 this will become the default.  The name @samp{gnu9x} is deprecated.
1530
1531 @item gnu1x
1532 GNU dialect of ISO C1X.  Support is limited and experimental and
1533 features enabled by this option may be changed or removed if changed
1534 in or removed from the standard draft.
1535
1536 @item c++98
1537 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1538 C++ code.
1539
1540 @item gnu++98
1541 GNU dialect of @option{-std=c++98}.  This is the default for
1542 C++ code.
1543
1544 @item c++0x
1545 The working draft of the upcoming ISO C++0x standard. This option
1546 enables experimental features that are likely to be included in
1547 C++0x. The working draft is constantly changing, and any feature that is
1548 enabled by this flag may be removed from future versions of GCC if it is
1549 not part of the C++0x standard.
1550
1551 @item gnu++0x
1552 GNU dialect of @option{-std=c++0x}. This option enables
1553 experimental features that may be removed in future versions of GCC.
1554 @end table
1555
1556 @item -fgnu89-inline
1557 @opindex fgnu89-inline
1558 The option @option{-fgnu89-inline} tells GCC to use the traditional
1559 GNU semantics for @code{inline} functions when in C99 mode.
1560 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1561 is accepted and ignored by GCC versions 4.1.3 up to but not including
1562 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1563 C99 mode.  Using this option is roughly equivalent to adding the
1564 @code{gnu_inline} function attribute to all inline functions
1565 (@pxref{Function Attributes}).
1566
1567 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1568 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1569 specifies the default behavior).  This option was first supported in
1570 GCC 4.3.  This option is not supported in @option{-std=c90} or
1571 @option{-std=gnu90} mode.
1572
1573 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1574 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1575 in effect for @code{inline} functions.  @xref{Common Predefined
1576 Macros,,,cpp,The C Preprocessor}.
1577
1578 @item -aux-info @var{filename}
1579 @opindex aux-info
1580 Output to the given filename prototyped declarations for all functions
1581 declared and/or defined in a translation unit, including those in header
1582 files.  This option is silently ignored in any language other than C@.
1583
1584 Besides declarations, the file indicates, in comments, the origin of
1585 each declaration (source file and line), whether the declaration was
1586 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1587 @samp{O} for old, respectively, in the first character after the line
1588 number and the colon), and whether it came from a declaration or a
1589 definition (@samp{C} or @samp{F}, respectively, in the following
1590 character).  In the case of function definitions, a K&R-style list of
1591 arguments followed by their declarations is also provided, inside
1592 comments, after the declaration.
1593
1594 @item -fno-asm
1595 @opindex fno-asm
1596 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1597 keyword, so that code can use these words as identifiers.  You can use
1598 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1599 instead.  @option{-ansi} implies @option{-fno-asm}.
1600
1601 In C++, this switch only affects the @code{typeof} keyword, since
1602 @code{asm} and @code{inline} are standard keywords.  You may want to
1603 use the @option{-fno-gnu-keywords} flag instead, which has the same
1604 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1605 switch only affects the @code{asm} and @code{typeof} keywords, since
1606 @code{inline} is a standard keyword in ISO C99.
1607
1608 @item -fno-builtin
1609 @itemx -fno-builtin-@var{function}
1610 @opindex fno-builtin
1611 @cindex built-in functions
1612 Don't recognize built-in functions that do not begin with
1613 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1614 functions provided by GCC}, for details of the functions affected,
1615 including those which are not built-in functions when @option{-ansi} or
1616 @option{-std} options for strict ISO C conformance are used because they
1617 do not have an ISO standard meaning.
1618
1619 GCC normally generates special code to handle certain built-in functions
1620 more efficiently; for instance, calls to @code{alloca} may become single
1621 instructions that adjust the stack directly, and calls to @code{memcpy}
1622 may become inline copy loops.  The resulting code is often both smaller
1623 and faster, but since the function calls no longer appear as such, you
1624 cannot set a breakpoint on those calls, nor can you change the behavior
1625 of the functions by linking with a different library.  In addition,
1626 when a function is recognized as a built-in function, GCC may use
1627 information about that function to warn about problems with calls to
1628 that function, or to generate more efficient code, even if the
1629 resulting code still contains calls to that function.  For example,
1630 warnings are given with @option{-Wformat} for bad calls to
1631 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1632 known not to modify global memory.
1633
1634 With the @option{-fno-builtin-@var{function}} option
1635 only the built-in function @var{function} is
1636 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1637 function is named that is not built-in in this version of GCC, this
1638 option is ignored.  There is no corresponding
1639 @option{-fbuiltin-@var{function}} option; if you wish to enable
1640 built-in functions selectively when using @option{-fno-builtin} or
1641 @option{-ffreestanding}, you may define macros such as:
1642
1643 @smallexample
1644 #define abs(n)          __builtin_abs ((n))
1645 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1646 @end smallexample
1647
1648 @item -fhosted
1649 @opindex fhosted
1650 @cindex hosted environment
1651
1652 Assert that compilation takes place in a hosted environment.  This implies
1653 @option{-fbuiltin}.  A hosted environment is one in which the
1654 entire standard library is available, and in which @code{main} has a return
1655 type of @code{int}.  Examples are nearly everything except a kernel.
1656 This is equivalent to @option{-fno-freestanding}.
1657
1658 @item -ffreestanding
1659 @opindex ffreestanding
1660 @cindex hosted environment
1661
1662 Assert that compilation takes place in a freestanding environment.  This
1663 implies @option{-fno-builtin}.  A freestanding environment
1664 is one in which the standard library may not exist, and program startup may
1665 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1666 This is equivalent to @option{-fno-hosted}.
1667
1668 @xref{Standards,,Language Standards Supported by GCC}, for details of
1669 freestanding and hosted environments.
1670
1671 @item -fopenmp
1672 @opindex fopenmp
1673 @cindex openmp parallel
1674 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1675 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1676 compiler generates parallel code according to the OpenMP Application
1677 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1678 implies @option{-pthread}, and thus is only supported on targets that
1679 have support for @option{-pthread}.
1680
1681 @item -fms-extensions
1682 @opindex fms-extensions
1683 Accept some non-standard constructs used in Microsoft header files.
1684
1685 Some cases of unnamed fields in structures and unions are only
1686 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1687 fields within structs/unions}, for details.
1688
1689 @item -trigraphs
1690 @opindex trigraphs
1691 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1692 options for strict ISO C conformance) implies @option{-trigraphs}.
1693
1694 @item -no-integrated-cpp
1695 @opindex no-integrated-cpp
1696 Performs a compilation in two passes: preprocessing and compiling.  This
1697 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1698 @option{-B} option.  The user supplied compilation step can then add in
1699 an additional preprocessing step after normal preprocessing but before
1700 compiling.  The default is to use the integrated cpp (internal cpp)
1701
1702 The semantics of this option will change if "cc1", "cc1plus", and
1703 "cc1obj" are merged.
1704
1705 @cindex traditional C language
1706 @cindex C language, traditional
1707 @item -traditional
1708 @itemx -traditional-cpp
1709 @opindex traditional-cpp
1710 @opindex traditional
1711 Formerly, these options caused GCC to attempt to emulate a pre-standard
1712 C compiler.  They are now only supported with the @option{-E} switch.
1713 The preprocessor continues to support a pre-standard mode.  See the GNU
1714 CPP manual for details.
1715
1716 @item -fcond-mismatch
1717 @opindex fcond-mismatch
1718 Allow conditional expressions with mismatched types in the second and
1719 third arguments.  The value of such an expression is void.  This option
1720 is not supported for C++.
1721
1722 @item -flax-vector-conversions
1723 @opindex flax-vector-conversions
1724 Allow implicit conversions between vectors with differing numbers of
1725 elements and/or incompatible element types.  This option should not be
1726 used for new code.
1727
1728 @item -funsigned-char
1729 @opindex funsigned-char
1730 Let the type @code{char} be unsigned, like @code{unsigned char}.
1731
1732 Each kind of machine has a default for what @code{char} should
1733 be.  It is either like @code{unsigned char} by default or like
1734 @code{signed char} by default.
1735
1736 Ideally, a portable program should always use @code{signed char} or
1737 @code{unsigned char} when it depends on the signedness of an object.
1738 But many programs have been written to use plain @code{char} and
1739 expect it to be signed, or expect it to be unsigned, depending on the
1740 machines they were written for.  This option, and its inverse, let you
1741 make such a program work with the opposite default.
1742
1743 The type @code{char} is always a distinct type from each of
1744 @code{signed char} or @code{unsigned char}, even though its behavior
1745 is always just like one of those two.
1746
1747 @item -fsigned-char
1748 @opindex fsigned-char
1749 Let the type @code{char} be signed, like @code{signed char}.
1750
1751 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1752 the negative form of @option{-funsigned-char}.  Likewise, the option
1753 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1754
1755 @item -fsigned-bitfields
1756 @itemx -funsigned-bitfields
1757 @itemx -fno-signed-bitfields
1758 @itemx -fno-unsigned-bitfields
1759 @opindex fsigned-bitfields
1760 @opindex funsigned-bitfields
1761 @opindex fno-signed-bitfields
1762 @opindex fno-unsigned-bitfields
1763 These options control whether a bit-field is signed or unsigned, when the
1764 declaration does not use either @code{signed} or @code{unsigned}.  By
1765 default, such a bit-field is signed, because this is consistent: the
1766 basic integer types such as @code{int} are signed types.
1767 @end table
1768
1769 @node C++ Dialect Options
1770 @section Options Controlling C++ Dialect
1771
1772 @cindex compiler options, C++
1773 @cindex C++ options, command line
1774 @cindex options, C++
1775 This section describes the command-line options that are only meaningful
1776 for C++ programs; but you can also use most of the GNU compiler options
1777 regardless of what language your program is in.  For example, you
1778 might compile a file @code{firstClass.C} like this:
1779
1780 @smallexample
1781 g++ -g -frepo -O -c firstClass.C
1782 @end smallexample
1783
1784 @noindent
1785 In this example, only @option{-frepo} is an option meant
1786 only for C++ programs; you can use the other options with any
1787 language supported by GCC@.
1788
1789 Here is a list of options that are @emph{only} for compiling C++ programs:
1790
1791 @table @gcctabopt
1792
1793 @item -fabi-version=@var{n}
1794 @opindex fabi-version
1795 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1796 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1797 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1798 the version that conforms most closely to the C++ ABI specification.
1799 Therefore, the ABI obtained using version 0 will change as ABI bugs
1800 are fixed.
1801
1802 The default is version 2.
1803
1804 Version 3 corrects an error in mangling a constant address as a
1805 template argument.
1806
1807 Version 4 implements a standard mangling for vector types.
1808
1809 See also @option{-Wabi}.
1810
1811 @item -fno-access-control
1812 @opindex fno-access-control
1813 Turn off all access checking.  This switch is mainly useful for working
1814 around bugs in the access control code.
1815
1816 @item -fcheck-new
1817 @opindex fcheck-new
1818 Check that the pointer returned by @code{operator new} is non-null
1819 before attempting to modify the storage allocated.  This check is
1820 normally unnecessary because the C++ standard specifies that
1821 @code{operator new} will only return @code{0} if it is declared
1822 @samp{throw()}, in which case the compiler will always check the
1823 return value even without this option.  In all other cases, when
1824 @code{operator new} has a non-empty exception specification, memory
1825 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1826 @samp{new (nothrow)}.
1827
1828 @item -fconserve-space
1829 @opindex fconserve-space
1830 Put uninitialized or runtime-initialized global variables into the
1831 common segment, as C does.  This saves space in the executable at the
1832 cost of not diagnosing duplicate definitions.  If you compile with this
1833 flag and your program mysteriously crashes after @code{main()} has
1834 completed, you may have an object that is being destroyed twice because
1835 two definitions were merged.
1836
1837 This option is no longer useful on most targets, now that support has
1838 been added for putting variables into BSS without making them common.
1839
1840 @item -fno-deduce-init-list
1841 @opindex fno-deduce-init-list
1842 Disable deduction of a template type parameter as
1843 std::initializer_list from a brace-enclosed initializer list, i.e.
1844
1845 @smallexample
1846 template <class T> auto forward(T t) -> decltype (realfn (t))
1847 @{
1848   return realfn (t);
1849 @}
1850
1851 void f()
1852 @{
1853   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1854 @}
1855 @end smallexample
1856
1857 This option is present because this deduction is an extension to the
1858 current specification in the C++0x working draft, and there was
1859 some concern about potential overload resolution problems.
1860
1861 @item -ffriend-injection
1862 @opindex ffriend-injection
1863 Inject friend functions into the enclosing namespace, so that they are
1864 visible outside the scope of the class in which they are declared.
1865 Friend functions were documented to work this way in the old Annotated
1866 C++ Reference Manual, and versions of G++ before 4.1 always worked
1867 that way.  However, in ISO C++ a friend function which is not declared
1868 in an enclosing scope can only be found using argument dependent
1869 lookup.  This option causes friends to be injected as they were in
1870 earlier releases.
1871
1872 This option is for compatibility, and may be removed in a future
1873 release of G++.
1874
1875 @item -fno-elide-constructors
1876 @opindex fno-elide-constructors
1877 The C++ standard allows an implementation to omit creating a temporary
1878 which is only used to initialize another object of the same type.
1879 Specifying this option disables that optimization, and forces G++ to
1880 call the copy constructor in all cases.
1881
1882 @item -fno-enforce-eh-specs
1883 @opindex fno-enforce-eh-specs
1884 Don't generate code to check for violation of exception specifications
1885 at runtime.  This option violates the C++ standard, but may be useful
1886 for reducing code size in production builds, much like defining
1887 @samp{NDEBUG}.  This does not give user code permission to throw
1888 exceptions in violation of the exception specifications; the compiler
1889 will still optimize based on the specifications, so throwing an
1890 unexpected exception will result in undefined behavior.
1891
1892 @item -ffor-scope
1893 @itemx -fno-for-scope
1894 @opindex ffor-scope
1895 @opindex fno-for-scope
1896 If @option{-ffor-scope} is specified, the scope of variables declared in
1897 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1898 as specified by the C++ standard.
1899 If @option{-fno-for-scope} is specified, the scope of variables declared in
1900 a @i{for-init-statement} extends to the end of the enclosing scope,
1901 as was the case in old versions of G++, and other (traditional)
1902 implementations of C++.
1903
1904 The default if neither flag is given to follow the standard,
1905 but to allow and give a warning for old-style code that would
1906 otherwise be invalid, or have different behavior.
1907
1908 @item -fno-gnu-keywords
1909 @opindex fno-gnu-keywords
1910 Do not recognize @code{typeof} as a keyword, so that code can use this
1911 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1912 @option{-ansi} implies @option{-fno-gnu-keywords}.
1913
1914 @item -fno-implicit-templates
1915 @opindex fno-implicit-templates
1916 Never emit code for non-inline templates which are instantiated
1917 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1918 @xref{Template Instantiation}, for more information.
1919
1920 @item -fno-implicit-inline-templates
1921 @opindex fno-implicit-inline-templates
1922 Don't emit code for implicit instantiations of inline templates, either.
1923 The default is to handle inlines differently so that compiles with and
1924 without optimization will need the same set of explicit instantiations.
1925
1926 @item -fno-implement-inlines
1927 @opindex fno-implement-inlines
1928 To save space, do not emit out-of-line copies of inline functions
1929 controlled by @samp{#pragma implementation}.  This will cause linker
1930 errors if these functions are not inlined everywhere they are called.
1931
1932 @item -fms-extensions
1933 @opindex fms-extensions
1934 Disable pedantic warnings about constructs used in MFC, such as implicit
1935 int and getting a pointer to member function via non-standard syntax.
1936
1937 @item -fno-nonansi-builtins
1938 @opindex fno-nonansi-builtins
1939 Disable built-in declarations of functions that are not mandated by
1940 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1941 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1942
1943 @item -fnothrow-opt
1944 @opindex fnothrow-opt
1945 Treat a @code{throw()} exception specification as though it were a
1946 @code{noexcept} specification to reduce or eliminate the text size
1947 overhead relative to a function with no exception specification.  If
1948 the function has local variables of types with non-trivial
1949 destructors, the exception specification will actually make the
1950 function smaller because the EH cleanups for those variables can be
1951 optimized away.  The semantic effect is that an exception thrown out of
1952 a function with such an exception specification will result in a call
1953 to @code{terminate} rather than @code{unexpected}.
1954
1955 @item -fno-operator-names
1956 @opindex fno-operator-names
1957 Do not treat the operator name keywords @code{and}, @code{bitand},
1958 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1959 synonyms as keywords.
1960
1961 @item -fno-optional-diags
1962 @opindex fno-optional-diags
1963 Disable diagnostics that the standard says a compiler does not need to
1964 issue.  Currently, the only such diagnostic issued by G++ is the one for
1965 a name having multiple meanings within a class.
1966
1967 @item -fpermissive
1968 @opindex fpermissive
1969 Downgrade some diagnostics about nonconformant code from errors to
1970 warnings.  Thus, using @option{-fpermissive} will allow some
1971 nonconforming code to compile.
1972
1973 @item -fno-pretty-templates
1974 @opindex fno-pretty-templates
1975 When an error message refers to a specialization of a function
1976 template, the compiler will normally print the signature of the
1977 template followed by the template arguments and any typedefs or
1978 typenames in the signature (e.g. @code{void f(T) [with T = int]}
1979 rather than @code{void f(int)}) so that it's clear which template is
1980 involved.  When an error message refers to a specialization of a class
1981 template, the compiler will omit any template arguments which match
1982 the default template arguments for that template.  If either of these
1983 behaviors make it harder to understand the error message rather than
1984 easier, using @option{-fno-pretty-templates} will disable them.
1985
1986 @item -frepo
1987 @opindex frepo
1988 Enable automatic template instantiation at link time.  This option also
1989 implies @option{-fno-implicit-templates}.  @xref{Template
1990 Instantiation}, for more information.
1991
1992 @item -fno-rtti
1993 @opindex fno-rtti
1994 Disable generation of information about every class with virtual
1995 functions for use by the C++ runtime type identification features
1996 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1997 of the language, you can save some space by using this flag.  Note that
1998 exception handling uses the same information, but it will generate it as
1999 needed. The @samp{dynamic_cast} operator can still be used for casts that
2000 do not require runtime type information, i.e.@: casts to @code{void *} or to
2001 unambiguous base classes.
2002
2003 @item -fstats
2004 @opindex fstats
2005 Emit statistics about front-end processing at the end of the compilation.
2006 This information is generally only useful to the G++ development team.
2007
2008 @item -fstrict-enums
2009 @opindex fstrict-enums
2010 Allow the compiler to optimize using the assumption that a value of
2011 enumeration type can only be one of the values of the enumeration (as
2012 defined in the C++ standard; basically, a value which can be
2013 represented in the minimum number of bits needed to represent all the
2014 enumerators).  This assumption may not be valid if the program uses a
2015 cast to convert an arbitrary integer value to the enumeration type.
2016
2017 @item -ftemplate-depth=@var{n}
2018 @opindex ftemplate-depth
2019 Set the maximum instantiation depth for template classes to @var{n}.
2020 A limit on the template instantiation depth is needed to detect
2021 endless recursions during template class instantiation.  ANSI/ISO C++
2022 conforming programs must not rely on a maximum depth greater than 17
2023 (changed to 1024 in C++0x).
2024
2025 @item -fno-threadsafe-statics
2026 @opindex fno-threadsafe-statics
2027 Do not emit the extra code to use the routines specified in the C++
2028 ABI for thread-safe initialization of local statics.  You can use this
2029 option to reduce code size slightly in code that doesn't need to be
2030 thread-safe.
2031
2032 @item -fuse-cxa-atexit
2033 @opindex fuse-cxa-atexit
2034 Register destructors for objects with static storage duration with the
2035 @code{__cxa_atexit} function rather than the @code{atexit} function.
2036 This option is required for fully standards-compliant handling of static
2037 destructors, but will only work if your C library supports
2038 @code{__cxa_atexit}.
2039
2040 @item -fno-use-cxa-get-exception-ptr
2041 @opindex fno-use-cxa-get-exception-ptr
2042 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2043 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
2044 if the runtime routine is not available.
2045
2046 @item -fvisibility-inlines-hidden
2047 @opindex fvisibility-inlines-hidden
2048 This switch declares that the user does not attempt to compare
2049 pointers to inline methods where the addresses of the two functions
2050 were taken in different shared objects.
2051
2052 The effect of this is that GCC may, effectively, mark inline methods with
2053 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2054 appear in the export table of a DSO and do not require a PLT indirection
2055 when used within the DSO@.  Enabling this option can have a dramatic effect
2056 on load and link times of a DSO as it massively reduces the size of the
2057 dynamic export table when the library makes heavy use of templates.
2058
2059 The behavior of this switch is not quite the same as marking the
2060 methods as hidden directly, because it does not affect static variables
2061 local to the function or cause the compiler to deduce that
2062 the function is defined in only one shared object.
2063
2064 You may mark a method as having a visibility explicitly to negate the
2065 effect of the switch for that method.  For example, if you do want to
2066 compare pointers to a particular inline method, you might mark it as
2067 having default visibility.  Marking the enclosing class with explicit
2068 visibility will have no effect.
2069
2070 Explicitly instantiated inline methods are unaffected by this option
2071 as their linkage might otherwise cross a shared library boundary.
2072 @xref{Template Instantiation}.
2073
2074 @item -fvisibility-ms-compat
2075 @opindex fvisibility-ms-compat
2076 This flag attempts to use visibility settings to make GCC's C++
2077 linkage model compatible with that of Microsoft Visual Studio.
2078
2079 The flag makes these changes to GCC's linkage model:
2080
2081 @enumerate
2082 @item
2083 It sets the default visibility to @code{hidden}, like
2084 @option{-fvisibility=hidden}.
2085
2086 @item
2087 Types, but not their members, are not hidden by default.
2088
2089 @item
2090 The One Definition Rule is relaxed for types without explicit
2091 visibility specifications which are defined in more than one different
2092 shared object: those declarations are permitted if they would have
2093 been permitted when this option was not used.
2094 @end enumerate
2095
2096 In new code it is better to use @option{-fvisibility=hidden} and
2097 export those classes which are intended to be externally visible.
2098 Unfortunately it is possible for code to rely, perhaps accidentally,
2099 on the Visual Studio behavior.
2100
2101 Among the consequences of these changes are that static data members
2102 of the same type with the same name but defined in different shared
2103 objects will be different, so changing one will not change the other;
2104 and that pointers to function members defined in different shared
2105 objects may not compare equal.  When this flag is given, it is a
2106 violation of the ODR to define types with the same name differently.
2107
2108 @item -fno-weak
2109 @opindex fno-weak
2110 Do not use weak symbol support, even if it is provided by the linker.
2111 By default, G++ will use weak symbols if they are available.  This
2112 option exists only for testing, and should not be used by end-users;
2113 it will result in inferior code and has no benefits.  This option may
2114 be removed in a future release of G++.
2115
2116 @item -nostdinc++
2117 @opindex nostdinc++
2118 Do not search for header files in the standard directories specific to
2119 C++, but do still search the other standard directories.  (This option
2120 is used when building the C++ library.)
2121 @end table
2122
2123 In addition, these optimization, warning, and code generation options
2124 have meanings only for C++ programs:
2125
2126 @table @gcctabopt
2127 @item -fno-default-inline
2128 @opindex fno-default-inline
2129 Do not assume @samp{inline} for functions defined inside a class scope.
2130 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2131 functions will have linkage like inline functions; they just won't be
2132 inlined by default.
2133
2134 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2135 @opindex Wabi
2136 @opindex Wno-abi
2137 Warn when G++ generates code that is probably not compatible with the
2138 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2139 all such cases, there are probably some cases that are not warned about,
2140 even though G++ is generating incompatible code.  There may also be
2141 cases where warnings are emitted even though the code that is generated
2142 will be compatible.
2143
2144 You should rewrite your code to avoid these warnings if you are
2145 concerned about the fact that code generated by G++ may not be binary
2146 compatible with code generated by other compilers.
2147
2148 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2149
2150 @itemize @bullet
2151
2152 @item
2153 A template with a non-type template parameter of reference type is
2154 mangled incorrectly:
2155 @smallexample
2156 extern int N;
2157 template <int &> struct S @{@};
2158 void n (S<N>) @{2@}
2159 @end smallexample
2160
2161 This is fixed in @option{-fabi-version=3}.
2162
2163 @item
2164 SIMD vector types declared using @code{__attribute ((vector_size))} are
2165 mangled in a non-standard way that does not allow for overloading of
2166 functions taking vectors of different sizes.
2167
2168 The mangling is changed in @option{-fabi-version=4}.
2169 @end itemize
2170
2171 The known incompatibilities in @option{-fabi-version=1} include:
2172
2173 @itemize @bullet
2174
2175 @item
2176 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2177 pack data into the same byte as a base class.  For example:
2178
2179 @smallexample
2180 struct A @{ virtual void f(); int f1 : 1; @};
2181 struct B : public A @{ int f2 : 1; @};
2182 @end smallexample
2183
2184 @noindent
2185 In this case, G++ will place @code{B::f2} into the same byte
2186 as@code{A::f1}; other compilers will not.  You can avoid this problem
2187 by explicitly padding @code{A} so that its size is a multiple of the
2188 byte size on your platform; that will cause G++ and other compilers to
2189 layout @code{B} identically.
2190
2191 @item
2192 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2193 tail padding when laying out virtual bases.  For example:
2194
2195 @smallexample
2196 struct A @{ virtual void f(); char c1; @};
2197 struct B @{ B(); char c2; @};
2198 struct C : public A, public virtual B @{@};
2199 @end smallexample
2200
2201 @noindent
2202 In this case, G++ will not place @code{B} into the tail-padding for
2203 @code{A}; other compilers will.  You can avoid this problem by
2204 explicitly padding @code{A} so that its size is a multiple of its
2205 alignment (ignoring virtual base classes); that will cause G++ and other
2206 compilers to layout @code{C} identically.
2207
2208 @item
2209 Incorrect handling of bit-fields with declared widths greater than that
2210 of their underlying types, when the bit-fields appear in a union.  For
2211 example:
2212
2213 @smallexample
2214 union U @{ int i : 4096; @};
2215 @end smallexample
2216
2217 @noindent
2218 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2219 union too small by the number of bits in an @code{int}.
2220
2221 @item
2222 Empty classes can be placed at incorrect offsets.  For example:
2223
2224 @smallexample
2225 struct A @{@};
2226
2227 struct B @{
2228   A a;
2229   virtual void f ();
2230 @};
2231
2232 struct C : public B, public A @{@};
2233 @end smallexample
2234
2235 @noindent
2236 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2237 it should be placed at offset zero.  G++ mistakenly believes that the
2238 @code{A} data member of @code{B} is already at offset zero.
2239
2240 @item
2241 Names of template functions whose types involve @code{typename} or
2242 template template parameters can be mangled incorrectly.
2243
2244 @smallexample
2245 template <typename Q>
2246 void f(typename Q::X) @{@}
2247
2248 template <template <typename> class Q>
2249 void f(typename Q<int>::X) @{@}
2250 @end smallexample
2251
2252 @noindent
2253 Instantiations of these templates may be mangled incorrectly.
2254
2255 @end itemize
2256
2257 It also warns psABI related changes.  The known psABI changes at this
2258 point include:
2259
2260 @itemize @bullet
2261
2262 @item
2263 For SYSV/x86-64, when passing union with long double, it is changed to
2264 pass in memory as specified in psABI.  For example:
2265
2266 @smallexample
2267 union U @{
2268   long double ld;
2269   int i;
2270 @};
2271 @end smallexample
2272
2273 @noindent
2274 @code{union U} will always be passed in memory.
2275
2276 @end itemize
2277
2278 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2279 @opindex Wctor-dtor-privacy
2280 @opindex Wno-ctor-dtor-privacy
2281 Warn when a class seems unusable because all the constructors or
2282 destructors in that class are private, and it has neither friends nor
2283 public static member functions.
2284
2285 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2286 @opindex Wnoexcept
2287 @opindex Wno-noexcept
2288 Warn when a noexcept-expression evaluates to false because of a call
2289 to a function that does not have a non-throwing exception
2290 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2291 the compiler to never throw an exception.
2292
2293 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2294 @opindex Wnon-virtual-dtor
2295 @opindex Wno-non-virtual-dtor
2296 Warn when a class has virtual functions and accessible non-virtual
2297 destructor, in which case it would be possible but unsafe to delete
2298 an instance of a derived class through a pointer to the base class.
2299 This warning is also enabled if -Weffc++ is specified.
2300
2301 @item -Wreorder @r{(C++ and Objective-C++ only)}
2302 @opindex Wreorder
2303 @opindex Wno-reorder
2304 @cindex reordering, warning
2305 @cindex warning for reordering of member initializers
2306 Warn when the order of member initializers given in the code does not
2307 match the order in which they must be executed.  For instance:
2308
2309 @smallexample
2310 struct A @{
2311   int i;
2312   int j;
2313   A(): j (0), i (1) @{ @}
2314 @};
2315 @end smallexample
2316
2317 The compiler will rearrange the member initializers for @samp{i}
2318 and @samp{j} to match the declaration order of the members, emitting
2319 a warning to that effect.  This warning is enabled by @option{-Wall}.
2320 @end table
2321
2322 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2323
2324 @table @gcctabopt
2325 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2326 @opindex Weffc++
2327 @opindex Wno-effc++
2328 Warn about violations of the following style guidelines from Scott Meyers'
2329 @cite{Effective C++} book:
2330
2331 @itemize @bullet
2332 @item
2333 Item 11:  Define a copy constructor and an assignment operator for classes
2334 with dynamically allocated memory.
2335
2336 @item
2337 Item 12:  Prefer initialization to assignment in constructors.
2338
2339 @item
2340 Item 14:  Make destructors virtual in base classes.
2341
2342 @item
2343 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2344
2345 @item
2346 Item 23:  Don't try to return a reference when you must return an object.
2347
2348 @end itemize
2349
2350 Also warn about violations of the following style guidelines from
2351 Scott Meyers' @cite{More Effective C++} book:
2352
2353 @itemize @bullet
2354 @item
2355 Item 6:  Distinguish between prefix and postfix forms of increment and
2356 decrement operators.
2357
2358 @item
2359 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2360
2361 @end itemize
2362
2363 When selecting this option, be aware that the standard library
2364 headers do not obey all of these guidelines; use @samp{grep -v}
2365 to filter out those warnings.
2366
2367 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2368 @opindex Wstrict-null-sentinel
2369 @opindex Wno-strict-null-sentinel
2370 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2371 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2372 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2373 it is guaranteed to be of the same size as a pointer.  But this use is
2374 not portable across different compilers.
2375
2376 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2377 @opindex Wno-non-template-friend
2378 @opindex Wnon-template-friend
2379 Disable warnings when non-templatized friend functions are declared
2380 within a template.  Since the advent of explicit template specification
2381 support in G++, if the name of the friend is an unqualified-id (i.e.,
2382 @samp{friend foo(int)}), the C++ language specification demands that the
2383 friend declare or define an ordinary, nontemplate function.  (Section
2384 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2385 could be interpreted as a particular specialization of a templatized
2386 function.  Because this non-conforming behavior is no longer the default
2387 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2388 check existing code for potential trouble spots and is on by default.
2389 This new compiler behavior can be turned off with
2390 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2391 but disables the helpful warning.
2392
2393 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2394 @opindex Wold-style-cast
2395 @opindex Wno-old-style-cast
2396 Warn if an old-style (C-style) cast to a non-void type is used within
2397 a C++ program.  The new-style casts (@samp{dynamic_cast},
2398 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2399 less vulnerable to unintended effects and much easier to search for.
2400
2401 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2402 @opindex Woverloaded-virtual
2403 @opindex Wno-overloaded-virtual
2404 @cindex overloaded virtual fn, warning
2405 @cindex warning for overloaded virtual fn
2406 Warn when a function declaration hides virtual functions from a
2407 base class.  For example, in:
2408
2409 @smallexample
2410 struct A @{
2411   virtual void f();
2412 @};
2413
2414 struct B: public A @{
2415   void f(int);
2416 @};
2417 @end smallexample
2418
2419 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2420 like:
2421
2422 @smallexample
2423 B* b;
2424 b->f();
2425 @end smallexample
2426
2427 will fail to compile.
2428
2429 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2430 @opindex Wno-pmf-conversions
2431 @opindex Wpmf-conversions
2432 Disable the diagnostic for converting a bound pointer to member function
2433 to a plain pointer.
2434
2435 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2436 @opindex Wsign-promo
2437 @opindex Wno-sign-promo
2438 Warn when overload resolution chooses a promotion from unsigned or
2439 enumerated type to a signed type, over a conversion to an unsigned type of
2440 the same size.  Previous versions of G++ would try to preserve
2441 unsignedness, but the standard mandates the current behavior.
2442
2443 @smallexample
2444 struct A @{
2445   operator int ();
2446   A& operator = (int);
2447 @};
2448
2449 main ()
2450 @{
2451   A a,b;
2452   a = b;
2453 @}
2454 @end smallexample
2455
2456 In this example, G++ will synthesize a default @samp{A& operator =
2457 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2458 @end table
2459
2460 @node Objective-C and Objective-C++ Dialect Options
2461 @section Options Controlling Objective-C and Objective-C++ Dialects
2462
2463 @cindex compiler options, Objective-C and Objective-C++
2464 @cindex Objective-C and Objective-C++ options, command line
2465 @cindex options, Objective-C and Objective-C++
2466 (NOTE: This manual does not describe the Objective-C and Objective-C++
2467 languages themselves.  See @xref{Standards,,Language Standards
2468 Supported by GCC}, for references.)
2469
2470 This section describes the command-line options that are only meaningful
2471 for Objective-C and Objective-C++ programs, but you can also use most of
2472 the language-independent GNU compiler options.
2473 For example, you might compile a file @code{some_class.m} like this:
2474
2475 @smallexample
2476 gcc -g -fgnu-runtime -O -c some_class.m
2477 @end smallexample
2478
2479 @noindent
2480 In this example, @option{-fgnu-runtime} is an option meant only for
2481 Objective-C and Objective-C++ programs; you can use the other options with
2482 any language supported by GCC@.
2483
2484 Note that since Objective-C is an extension of the C language, Objective-C
2485 compilations may also use options specific to the C front-end (e.g.,
2486 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2487 C++-specific options (e.g., @option{-Wabi}).
2488
2489 Here is a list of options that are @emph{only} for compiling Objective-C
2490 and Objective-C++ programs:
2491
2492 @table @gcctabopt
2493 @item -fconstant-string-class=@var{class-name}
2494 @opindex fconstant-string-class
2495 Use @var{class-name} as the name of the class to instantiate for each
2496 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2497 class name is @code{NXConstantString} if the GNU runtime is being used, and
2498 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2499 @option{-fconstant-cfstrings} option, if also present, will override the
2500 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2501 to be laid out as constant CoreFoundation strings.
2502
2503 @item -fgnu-runtime
2504 @opindex fgnu-runtime
2505 Generate object code compatible with the standard GNU Objective-C
2506 runtime.  This is the default for most types of systems.
2507
2508 @item -fnext-runtime
2509 @opindex fnext-runtime
2510 Generate output compatible with the NeXT runtime.  This is the default
2511 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2512 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2513 used.
2514
2515 @item -fno-nil-receivers
2516 @opindex fno-nil-receivers
2517 Assume that all Objective-C message dispatches (e.g.,
2518 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2519 is not @code{nil}.  This allows for more efficient entry points in the runtime
2520 to be used.  Currently, this option is only available in conjunction with
2521 the NeXT runtime on Mac OS X 10.3 and later.
2522
2523 @item -fobjc-call-cxx-cdtors
2524 @opindex fobjc-call-cxx-cdtors
2525 For each Objective-C class, check if any of its instance variables is a
2526 C++ object with a non-trivial default constructor.  If so, synthesize a
2527 special @code{- (id) .cxx_construct} instance method that will run
2528 non-trivial default constructors on any such instance variables, in order,
2529 and then return @code{self}.  Similarly, check if any instance variable
2530 is a C++ object with a non-trivial destructor, and if so, synthesize a
2531 special @code{- (void) .cxx_destruct} method that will run
2532 all such default destructors, in reverse order.
2533
2534 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2535 thusly generated will only operate on instance variables declared in the
2536 current Objective-C class, and not those inherited from superclasses.  It
2537 is the responsibility of the Objective-C runtime to invoke all such methods
2538 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2539 will be invoked by the runtime immediately after a new object
2540 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2541 be invoked immediately before the runtime deallocates an object instance.
2542
2543 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2544 support for invoking the @code{- (id) .cxx_construct} and
2545 @code{- (void) .cxx_destruct} methods.
2546
2547 @item -fobjc-direct-dispatch
2548 @opindex fobjc-direct-dispatch
2549 Allow fast jumps to the message dispatcher.  On Darwin this is
2550 accomplished via the comm page.
2551
2552 @item -fobjc-exceptions
2553 @opindex fobjc-exceptions
2554 Enable syntactic support for structured exception handling in Objective-C,
2555 similar to what is offered by C++ and Java.  This option is
2556 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2557 earlier.
2558
2559 @smallexample
2560   @@try @{
2561     @dots{}
2562        @@throw expr;
2563     @dots{}
2564   @}
2565   @@catch (AnObjCClass *exc) @{
2566     @dots{}
2567       @@throw expr;
2568     @dots{}
2569       @@throw;
2570     @dots{}
2571   @}
2572   @@catch (AnotherClass *exc) @{
2573     @dots{}
2574   @}
2575   @@catch (id allOthers) @{
2576     @dots{}
2577   @}
2578   @@finally @{
2579     @dots{}
2580       @@throw expr;
2581     @dots{}
2582   @}
2583 @end smallexample
2584
2585 The @code{@@throw} statement may appear anywhere in an Objective-C or
2586 Objective-C++ program; when used inside of a @code{@@catch} block, the
2587 @code{@@throw} may appear without an argument (as shown above), in which case
2588 the object caught by the @code{@@catch} will be rethrown.
2589
2590 Note that only (pointers to) Objective-C objects may be thrown and
2591 caught using this scheme.  When an object is thrown, it will be caught
2592 by the nearest @code{@@catch} clause capable of handling objects of that type,
2593 analogously to how @code{catch} blocks work in C++ and Java.  A
2594 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2595 any and all Objective-C exceptions not caught by previous @code{@@catch}
2596 clauses (if any).
2597
2598 The @code{@@finally} clause, if present, will be executed upon exit from the
2599 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2600 regardless of whether any exceptions are thrown, caught or rethrown
2601 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2602 of the @code{finally} clause in Java.
2603
2604 There are several caveats to using the new exception mechanism:
2605
2606 @itemize @bullet
2607 @item
2608 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2609 idioms provided by the @code{NSException} class, the new
2610 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2611 systems, due to additional functionality needed in the (NeXT) Objective-C
2612 runtime.
2613
2614 @item
2615 As mentioned above, the new exceptions do not support handling
2616 types other than Objective-C objects.   Furthermore, when used from
2617 Objective-C++, the Objective-C exception model does not interoperate with C++
2618 exceptions at this time.  This means you cannot @code{@@throw} an exception
2619 from Objective-C and @code{catch} it in C++, or vice versa
2620 (i.e., @code{throw @dots{} @@catch}).
2621 @end itemize
2622
2623 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2624 blocks for thread-safe execution:
2625
2626 @smallexample
2627   @@synchronized (ObjCClass *guard) @{
2628     @dots{}
2629   @}
2630 @end smallexample
2631
2632 Upon entering the @code{@@synchronized} block, a thread of execution shall
2633 first check whether a lock has been placed on the corresponding @code{guard}
2634 object by another thread.  If it has, the current thread shall wait until
2635 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2636 the current thread will place its own lock on it, execute the code contained in
2637 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2638 making @code{guard} available to other threads).
2639
2640 Unlike Java, Objective-C does not allow for entire methods to be marked
2641 @code{@@synchronized}.  Note that throwing exceptions out of
2642 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2643 to be unlocked properly.
2644
2645 @item -fobjc-gc
2646 @opindex fobjc-gc
2647 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2648
2649 @item -freplace-objc-classes
2650 @opindex freplace-objc-classes
2651 Emit a special marker instructing @command{ld(1)} not to statically link in
2652 the resulting object file, and allow @command{dyld(1)} to load it in at
2653 run time instead.  This is used in conjunction with the Fix-and-Continue
2654 debugging mode, where the object file in question may be recompiled and
2655 dynamically reloaded in the course of program execution, without the need
2656 to restart the program itself.  Currently, Fix-and-Continue functionality
2657 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2658 and later.
2659
2660 @item -fzero-link
2661 @opindex fzero-link
2662 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2663 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2664 compile time) with static class references that get initialized at load time,
2665 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2666 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2667 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2668 for individual class implementations to be modified during program execution.
2669
2670 @item -gen-decls
2671 @opindex gen-decls
2672 Dump interface declarations for all classes seen in the source file to a
2673 file named @file{@var{sourcename}.decl}.
2674
2675 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2676 @opindex Wassign-intercept
2677 @opindex Wno-assign-intercept
2678 Warn whenever an Objective-C assignment is being intercepted by the
2679 garbage collector.
2680
2681 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2682 @opindex Wno-protocol
2683 @opindex Wprotocol
2684 If a class is declared to implement a protocol, a warning is issued for
2685 every method in the protocol that is not implemented by the class.  The
2686 default behavior is to issue a warning for every method not explicitly
2687 implemented in the class, even if a method implementation is inherited
2688 from the superclass.  If you use the @option{-Wno-protocol} option, then
2689 methods inherited from the superclass are considered to be implemented,
2690 and no warning is issued for them.
2691
2692 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2693 @opindex Wselector
2694 @opindex Wno-selector
2695 Warn if multiple methods of different types for the same selector are
2696 found during compilation.  The check is performed on the list of methods
2697 in the final stage of compilation.  Additionally, a check is performed
2698 for each selector appearing in a @code{@@selector(@dots{})}
2699 expression, and a corresponding method for that selector has been found
2700 during compilation.  Because these checks scan the method table only at
2701 the end of compilation, these warnings are not produced if the final
2702 stage of compilation is not reached, for example because an error is
2703 found during compilation, or because the @option{-fsyntax-only} option is
2704 being used.
2705
2706 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2707 @opindex Wstrict-selector-match
2708 @opindex Wno-strict-selector-match
2709 Warn if multiple methods with differing argument and/or return types are
2710 found for a given selector when attempting to send a message using this
2711 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2712 is off (which is the default behavior), the compiler will omit such warnings
2713 if any differences found are confined to types which share the same size
2714 and alignment.
2715
2716 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2717 @opindex Wundeclared-selector
2718 @opindex Wno-undeclared-selector
2719 Warn if a @code{@@selector(@dots{})} expression referring to an
2720 undeclared selector is found.  A selector is considered undeclared if no
2721 method with that name has been declared before the
2722 @code{@@selector(@dots{})} expression, either explicitly in an
2723 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2724 an @code{@@implementation} section.  This option always performs its
2725 checks as soon as a @code{@@selector(@dots{})} expression is found,
2726 while @option{-Wselector} only performs its checks in the final stage of
2727 compilation.  This also enforces the coding style convention
2728 that methods and selectors must be declared before being used.
2729
2730 @item -print-objc-runtime-info
2731 @opindex print-objc-runtime-info
2732 Generate C header describing the largest structure that is passed by
2733 value, if any.
2734
2735 @end table
2736
2737 @node Language Independent Options
2738 @section Options to Control Diagnostic Messages Formatting
2739 @cindex options to control diagnostics formatting
2740 @cindex diagnostic messages
2741 @cindex message formatting
2742
2743 Traditionally, diagnostic messages have been formatted irrespective of
2744 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2745 below can be used to control the diagnostic messages formatting
2746 algorithm, e.g.@: how many characters per line, how often source location
2747 information should be reported.  Right now, only the C++ front end can
2748 honor these options.  However it is expected, in the near future, that
2749 the remaining front ends would be able to digest them correctly.
2750
2751 @table @gcctabopt
2752 @item -fmessage-length=@var{n}
2753 @opindex fmessage-length
2754 Try to format error messages so that they fit on lines of about @var{n}
2755 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2756 the front ends supported by GCC@.  If @var{n} is zero, then no
2757 line-wrapping will be done; each error message will appear on a single
2758 line.
2759
2760 @opindex fdiagnostics-show-location
2761 @item -fdiagnostics-show-location=once
2762 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2763 reporter to emit @emph{once} source location information; that is, in
2764 case the message is too long to fit on a single physical line and has to
2765 be wrapped, the source location won't be emitted (as prefix) again,
2766 over and over, in subsequent continuation lines.  This is the default
2767 behavior.
2768
2769 @item -fdiagnostics-show-location=every-line
2770 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2771 messages reporter to emit the same source location information (as
2772 prefix) for physical lines that result from the process of breaking
2773 a message which is too long to fit on a single line.
2774
2775 @item -fdiagnostics-show-option
2776 @opindex fdiagnostics-show-option
2777 This option instructs the diagnostic machinery to add text to each
2778 diagnostic emitted, which indicates which command line option directly
2779 controls that diagnostic, when such an option is known to the
2780 diagnostic machinery.
2781
2782 @item -Wcoverage-mismatch
2783 @opindex Wcoverage-mismatch
2784 Warn if feedback profiles do not match when using the
2785 @option{-fprofile-use} option.
2786 If a source file was changed between @option{-fprofile-gen} and
2787 @option{-fprofile-use}, the files with the profile feedback can fail
2788 to match the source file and GCC can not use the profile feedback
2789 information.  By default, this warning is enabled and is treated as an
2790 error.  @option{-Wno-coverage-mismatch} can be used to disable the
2791 warning or @option{-Wno-error=coverage-mismatch} can be used to
2792 disable the error.  Disable the error for this warning can result in
2793 poorly optimized code, so disabling the error is useful only in the
2794 case of very minor changes such as bug fixes to an existing code-base.
2795 Completely disabling the warning is not recommended.
2796
2797 @end table
2798
2799 @node Warning Options
2800 @section Options to Request or Suppress Warnings
2801 @cindex options to control warnings
2802 @cindex warning messages
2803 @cindex messages, warning
2804 @cindex suppressing warnings
2805
2806 Warnings are diagnostic messages that report constructions which
2807 are not inherently erroneous but which are risky or suggest there
2808 may have been an error.
2809
2810 The following language-independent options do not enable specific
2811 warnings but control the kinds of diagnostics produced by GCC.
2812
2813 @table @gcctabopt
2814 @cindex syntax checking
2815 @item -fsyntax-only
2816 @opindex fsyntax-only
2817 Check the code for syntax errors, but don't do anything beyond that.
2818
2819 @item -w
2820 @opindex w
2821 Inhibit all warning messages.
2822
2823 @item -Werror
2824 @opindex Werror
2825 @opindex Wno-error
2826 Make all warnings into errors.
2827
2828 @item -Werror=
2829 @opindex Werror=
2830 @opindex Wno-error=
2831 Make the specified warning into an error.  The specifier for a warning
2832 is appended, for example @option{-Werror=switch} turns the warnings
2833 controlled by @option{-Wswitch} into errors.  This switch takes a
2834 negative form, to be used to negate @option{-Werror} for specific
2835 warnings, for example @option{-Wno-error=switch} makes
2836 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2837 is in effect.  You can use the @option{-fdiagnostics-show-option}
2838 option to have each controllable warning amended with the option which
2839 controls it, to determine what to use with this option.
2840
2841 Note that specifying @option{-Werror=}@var{foo} automatically implies
2842 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2843 imply anything.
2844
2845 @item -Wfatal-errors
2846 @opindex Wfatal-errors
2847 @opindex Wno-fatal-errors
2848 This option causes the compiler to abort compilation on the first error
2849 occurred rather than trying to keep going and printing further error
2850 messages.
2851
2852 @end table
2853
2854 You can request many specific warnings with options beginning
2855 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2856 implicit declarations.  Each of these specific warning options also
2857 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2858 example, @option{-Wno-implicit}.  This manual lists only one of the
2859 two forms, whichever is not the default.  For further,
2860 language-specific options also refer to @ref{C++ Dialect Options} and
2861 @ref{Objective-C and Objective-C++ Dialect Options}.
2862
2863 When an unrecognized warning label is requested (e.g.,
2864 @option{-Wunknown-warning}), GCC will emit a diagnostic stating
2865 that the option is not recognized.  However, if the @samp{-Wno-} form
2866 is used, the behavior is slightly different: No diagnostic will be
2867 produced for @option{-Wno-unknown-warning} unless other diagnostics
2868 are being produced.  This allows the use of new @option{-Wno-} options
2869 with old compilers, but if something goes wrong, the compiler will
2870 warn that an unrecognized option was used.
2871
2872 @table @gcctabopt
2873 @item -pedantic
2874 @opindex pedantic
2875 Issue all the warnings demanded by strict ISO C and ISO C++;
2876 reject all programs that use forbidden extensions, and some other
2877 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2878 version of the ISO C standard specified by any @option{-std} option used.
2879
2880 Valid ISO C and ISO C++ programs should compile properly with or without
2881 this option (though a rare few will require @option{-ansi} or a
2882 @option{-std} option specifying the required version of ISO C)@.  However,
2883 without this option, certain GNU extensions and traditional C and C++
2884 features are supported as well.  With this option, they are rejected.
2885
2886 @option{-pedantic} does not cause warning messages for use of the
2887 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2888 warnings are also disabled in the expression that follows
2889 @code{__extension__}.  However, only system header files should use
2890 these escape routes; application programs should avoid them.
2891 @xref{Alternate Keywords}.
2892
2893 Some users try to use @option{-pedantic} to check programs for strict ISO
2894 C conformance.  They soon find that it does not do quite what they want:
2895 it finds some non-ISO practices, but not all---only those for which
2896 ISO C @emph{requires} a diagnostic, and some others for which
2897 diagnostics have been added.
2898
2899 A feature to report any failure to conform to ISO C might be useful in
2900 some instances, but would require considerable additional work and would
2901 be quite different from @option{-pedantic}.  We don't have plans to
2902 support such a feature in the near future.
2903
2904 Where the standard specified with @option{-std} represents a GNU
2905 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
2906 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2907 extended dialect is based.  Warnings from @option{-pedantic} are given
2908 where they are required by the base standard.  (It would not make sense
2909 for such warnings to be given only for features not in the specified GNU
2910 C dialect, since by definition the GNU dialects of C include all
2911 features the compiler supports with the given option, and there would be
2912 nothing to warn about.)
2913
2914 @item -pedantic-errors
2915 @opindex pedantic-errors
2916 Like @option{-pedantic}, except that errors are produced rather than
2917 warnings.
2918
2919 @item -Wall
2920 @opindex Wall
2921 @opindex Wno-all
2922 This enables all the warnings about constructions that some users
2923 consider questionable, and that are easy to avoid (or modify to
2924 prevent the warning), even in conjunction with macros.  This also
2925 enables some language-specific warnings described in @ref{C++ Dialect
2926 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2927
2928 @option{-Wall} turns on the following warning flags:
2929
2930 @gccoptlist{-Waddress   @gol
2931 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2932 -Wc++0x-compat  @gol
2933 -Wchar-subscripts  @gol
2934 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2935 -Wimplicit-int @r{(C and Objective-C only)} @gol
2936 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
2937 -Wcomment  @gol
2938 -Wformat   @gol
2939 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2940 -Wmissing-braces  @gol
2941 -Wnonnull  @gol
2942 -Wparentheses  @gol
2943 -Wpointer-sign  @gol
2944 -Wreorder   @gol
2945 -Wreturn-type  @gol
2946 -Wsequence-point  @gol
2947 -Wsign-compare @r{(only in C++)}  @gol
2948 -Wstrict-aliasing  @gol
2949 -Wstrict-overflow=1  @gol
2950 -Wswitch  @gol
2951 -Wtrigraphs  @gol
2952 -Wuninitialized  @gol
2953 -Wunknown-pragmas  @gol
2954 -Wunused-function  @gol
2955 -Wunused-label     @gol
2956 -Wunused-value     @gol
2957 -Wunused-variable  @gol
2958 -Wvolatile-register-var @gol
2959 }
2960
2961 Note that some warning flags are not implied by @option{-Wall}.  Some of
2962 them warn about constructions that users generally do not consider
2963 questionable, but which occasionally you might wish to check for;
2964 others warn about constructions that are necessary or hard to avoid in
2965 some cases, and there is no simple way to modify the code to suppress
2966 the warning. Some of them are enabled by @option{-Wextra} but many of
2967 them must be enabled individually.
2968
2969 @item -Wextra
2970 @opindex W
2971 @opindex Wextra
2972 @opindex Wno-extra
2973 This enables some extra warning flags that are not enabled by
2974 @option{-Wall}. (This option used to be called @option{-W}.  The older
2975 name is still supported, but the newer name is more descriptive.)
2976
2977 @gccoptlist{-Wclobbered  @gol
2978 -Wempty-body  @gol
2979 -Wignored-qualifiers @gol
2980 -Wmissing-field-initializers  @gol
2981 -Wmissing-parameter-type @r{(C only)}  @gol
2982 -Wold-style-declaration @r{(C only)}  @gol
2983 -Woverride-init  @gol
2984 -Wsign-compare  @gol
2985 -Wtype-limits  @gol
2986 -Wuninitialized  @gol
2987 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
2988 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2989 }
2990
2991 The option @option{-Wextra} also prints warning messages for the
2992 following cases:
2993
2994 @itemize @bullet
2995
2996 @item
2997 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2998 @samp{>}, or @samp{>=}.
2999
3000 @item
3001 (C++ only) An enumerator and a non-enumerator both appear in a
3002 conditional expression.
3003
3004 @item
3005 (C++ only) Ambiguous virtual bases.
3006
3007 @item
3008 (C++ only) Subscripting an array which has been declared @samp{register}.
3009
3010 @item
3011 (C++ only) Taking the address of a variable which has been declared
3012 @samp{register}.
3013
3014 @item
3015 (C++ only) A base class is not initialized in a derived class' copy
3016 constructor.
3017
3018 @end itemize
3019
3020 @item -Wchar-subscripts
3021 @opindex Wchar-subscripts
3022 @opindex Wno-char-subscripts
3023 Warn if an array subscript has type @code{char}.  This is a common cause
3024 of error, as programmers often forget that this type is signed on some
3025 machines.
3026 This warning is enabled by @option{-Wall}.
3027
3028 @item -Wcomment
3029 @opindex Wcomment
3030 @opindex Wno-comment
3031 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3032 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3033 This warning is enabled by @option{-Wall}.
3034
3035 @item -Wno-cpp \
3036 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3037
3038 Suppress warning messages emitted by @code{#warning} directives.
3039
3040 @item -Wformat
3041 @opindex Wformat
3042 @opindex Wno-format
3043 @opindex ffreestanding
3044 @opindex fno-builtin
3045 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3046 the arguments supplied have types appropriate to the format string
3047 specified, and that the conversions specified in the format string make
3048 sense.  This includes standard functions, and others specified by format
3049 attributes (@pxref{Function Attributes}), in the @code{printf},
3050 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3051 not in the C standard) families (or other target-specific families).
3052 Which functions are checked without format attributes having been
3053 specified depends on the standard version selected, and such checks of
3054 functions without the attribute specified are disabled by
3055 @option{-ffreestanding} or @option{-fno-builtin}.
3056
3057 The formats are checked against the format features supported by GNU
3058 libc version 2.2.  These include all ISO C90 and C99 features, as well
3059 as features from the Single Unix Specification and some BSD and GNU
3060 extensions.  Other library implementations may not support all these
3061 features; GCC does not support warning about features that go beyond a
3062 particular library's limitations.  However, if @option{-pedantic} is used
3063 with @option{-Wformat}, warnings will be given about format features not
3064 in the selected standard version (but not for @code{strfmon} formats,
3065 since those are not in any version of the C standard).  @xref{C Dialect
3066 Options,,Options Controlling C Dialect}.
3067
3068 Since @option{-Wformat} also checks for null format arguments for
3069 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3070
3071 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3072 aspects of format checking, the options @option{-Wformat-y2k},
3073 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3074 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3075 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3076
3077 @item -Wformat-y2k
3078 @opindex Wformat-y2k
3079 @opindex Wno-format-y2k
3080 If @option{-Wformat} is specified, also warn about @code{strftime}
3081 formats which may yield only a two-digit year.
3082
3083 @item -Wno-format-contains-nul
3084 @opindex Wno-format-contains-nul
3085 @opindex Wformat-contains-nul
3086 If @option{-Wformat} is specified, do not warn about format strings that
3087 contain NUL bytes.
3088
3089 @item -Wno-format-extra-args
3090 @opindex Wno-format-extra-args
3091 @opindex Wformat-extra-args
3092 If @option{-Wformat} is specified, do not warn about excess arguments to a
3093 @code{printf} or @code{scanf} format function.  The C standard specifies
3094 that such arguments are ignored.
3095
3096 Where the unused arguments lie between used arguments that are
3097 specified with @samp{$} operand number specifications, normally
3098 warnings are still given, since the implementation could not know what
3099 type to pass to @code{va_arg} to skip the unused arguments.  However,
3100 in the case of @code{scanf} formats, this option will suppress the
3101 warning if the unused arguments are all pointers, since the Single
3102 Unix Specification says that such unused arguments are allowed.
3103
3104 @item -Wno-format-zero-length @r{(C and Objective-C only)}
3105 @opindex Wno-format-zero-length
3106 @opindex Wformat-zero-length
3107 If @option{-Wformat} is specified, do not warn about zero-length formats.
3108 The C standard specifies that zero-length formats are allowed.
3109
3110 @item -Wformat-nonliteral
3111 @opindex Wformat-nonliteral
3112 @opindex Wno-format-nonliteral
3113 If @option{-Wformat} is specified, also warn if the format string is not a
3114 string literal and so cannot be checked, unless the format function
3115 takes its format arguments as a @code{va_list}.
3116
3117 @item -Wformat-security
3118 @opindex Wformat-security
3119 @opindex Wno-format-security
3120 If @option{-Wformat} is specified, also warn about uses of format
3121 functions that represent possible security problems.  At present, this
3122 warns about calls to @code{printf} and @code{scanf} functions where the
3123 format string is not a string literal and there are no format arguments,
3124 as in @code{printf (foo);}.  This may be a security hole if the format
3125 string came from untrusted input and contains @samp{%n}.  (This is
3126 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3127 in future warnings may be added to @option{-Wformat-security} that are not
3128 included in @option{-Wformat-nonliteral}.)
3129
3130 @item -Wformat=2
3131 @opindex Wformat=2
3132 @opindex Wno-format=2
3133 Enable @option{-Wformat} plus format checks not included in
3134 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
3135 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3136
3137 @item -Wnonnull @r{(C and Objective-C only)}
3138 @opindex Wnonnull
3139 @opindex Wno-nonnull
3140 Warn about passing a null pointer for arguments marked as
3141 requiring a non-null value by the @code{nonnull} function attribute.
3142
3143 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3144 can be disabled with the @option{-Wno-nonnull} option.
3145
3146 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3147 @opindex Winit-self
3148 @opindex Wno-init-self
3149 Warn about uninitialized variables which are initialized with themselves.
3150 Note this option can only be used with the @option{-Wuninitialized} option.
3151
3152 For example, GCC will warn about @code{i} being uninitialized in the
3153 following snippet only when @option{-Winit-self} has been specified:
3154 @smallexample
3155 @group
3156 int f()
3157 @{
3158   int i = i;
3159   return i;
3160 @}
3161 @end group
3162 @end smallexample
3163
3164 @item -Wimplicit-int @r{(C and Objective-C only)}
3165 @opindex Wimplicit-int
3166 @opindex Wno-implicit-int
3167 Warn when a declaration does not specify a type.
3168 This warning is enabled by @option{-Wall}.
3169
3170 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3171 @opindex Wimplicit-function-declaration
3172 @opindex Wno-implicit-function-declaration
3173 Give a warning whenever a function is used before being declared. In
3174 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3175 enabled by default and it is made into an error by
3176 @option{-pedantic-errors}. This warning is also enabled by
3177 @option{-Wall}.
3178
3179 @item -Wimplicit @r{(C and Objective-C only)}
3180 @opindex Wimplicit
3181 @opindex Wno-implicit
3182 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3183 This warning is enabled by @option{-Wall}.
3184
3185 @item -Wignored-qualifiers @r{(C and C++ only)}
3186 @opindex Wignored-qualifiers
3187 @opindex Wno-ignored-qualifiers
3188 Warn if the return type of a function has a type qualifier
3189 such as @code{const}.  For ISO C such a type qualifier has no effect,
3190 since the value returned by a function is not an lvalue.
3191 For C++, the warning is only emitted for scalar types or @code{void}.
3192 ISO C prohibits qualified @code{void} return types on function
3193 definitions, so such return types always receive a warning
3194 even without this option.
3195
3196 This warning is also enabled by @option{-Wextra}.
3197
3198 @item -Wmain
3199 @opindex Wmain
3200 @opindex Wno-main
3201 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3202 a function with external linkage, returning int, taking either zero
3203 arguments, two, or three arguments of appropriate types.  This warning
3204 is enabled by default in C++ and is enabled by either @option{-Wall}
3205 or @option{-pedantic}.
3206
3207 @item -Wmissing-braces
3208 @opindex Wmissing-braces
3209 @opindex Wno-missing-braces
3210 Warn if an aggregate or union initializer is not fully bracketed.  In
3211 the following example, the initializer for @samp{a} is not fully
3212 bracketed, but that for @samp{b} is fully bracketed.
3213
3214 @smallexample
3215 int a[2][2] = @{ 0, 1, 2, 3 @};
3216 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3217 @end smallexample
3218
3219 This warning is enabled by @option{-Wall}.
3220
3221 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3222 @opindex Wmissing-include-dirs
3223 @opindex Wno-missing-include-dirs
3224 Warn if a user-supplied include directory does not exist.
3225
3226 @item -Wparentheses
3227 @opindex Wparentheses
3228 @opindex Wno-parentheses
3229 Warn if parentheses are omitted in certain contexts, such
3230 as when there is an assignment in a context where a truth value
3231 is expected, or when operators are nested whose precedence people
3232 often get confused about.
3233
3234 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3235 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3236 interpretation from that of ordinary mathematical notation.
3237
3238 Also warn about constructions where there may be confusion to which
3239 @code{if} statement an @code{else} branch belongs.  Here is an example of
3240 such a case:
3241
3242 @smallexample
3243 @group
3244 @{
3245   if (a)
3246     if (b)
3247       foo ();
3248   else
3249     bar ();
3250 @}
3251 @end group
3252 @end smallexample
3253
3254 In C/C++, every @code{else} branch belongs to the innermost possible
3255 @code{if} statement, which in this example is @code{if (b)}.  This is
3256 often not what the programmer expected, as illustrated in the above
3257 example by indentation the programmer chose.  When there is the
3258 potential for this confusion, GCC will issue a warning when this flag
3259 is specified.  To eliminate the warning, add explicit braces around
3260 the innermost @code{if} statement so there is no way the @code{else}
3261 could belong to the enclosing @code{if}.  The resulting code would
3262 look like this:
3263
3264 @smallexample
3265 @group
3266 @{
3267   if (a)
3268     @{
3269       if (b)
3270         foo ();
3271       else
3272         bar ();
3273     @}
3274 @}
3275 @end group
3276 @end smallexample
3277
3278 Also warn for dangerous uses of the 
3279 ?: with omitted middle operand GNU extension. When the condition
3280 in the ?: operator is a boolean expression the omitted value will
3281 be always 1. Often the user expects it to be a value computed
3282 inside the conditional expression instead. 
3283
3284 This warning is enabled by @option{-Wall}.
3285
3286 @item -Wsequence-point
3287 @opindex Wsequence-point
3288 @opindex Wno-sequence-point
3289 Warn about code that may have undefined semantics because of violations
3290 of sequence point rules in the C and C++ standards.
3291
3292 The C and C++ standards defines the order in which expressions in a C/C++
3293 program are evaluated in terms of @dfn{sequence points}, which represent
3294 a partial ordering between the execution of parts of the program: those
3295 executed before the sequence point, and those executed after it.  These
3296 occur after the evaluation of a full expression (one which is not part
3297 of a larger expression), after the evaluation of the first operand of a
3298 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3299 function is called (but after the evaluation of its arguments and the
3300 expression denoting the called function), and in certain other places.
3301 Other than as expressed by the sequence point rules, the order of
3302 evaluation of subexpressions of an expression is not specified.  All
3303 these rules describe only a partial order rather than a total order,
3304 since, for example, if two functions are called within one expression
3305 with no sequence point between them, the order in which the functions
3306 are called is not specified.  However, the standards committee have
3307 ruled that function calls do not overlap.
3308
3309 It is not specified when between sequence points modifications to the
3310 values of objects take effect.  Programs whose behavior depends on this
3311 have undefined behavior; the C and C++ standards specify that ``Between
3312 the previous and next sequence point an object shall have its stored
3313 value modified at most once by the evaluation of an expression.
3314 Furthermore, the prior value shall be read only to determine the value
3315 to be stored.''.  If a program breaks these rules, the results on any
3316 particular implementation are entirely unpredictable.
3317
3318 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3319 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3320 diagnosed by this option, and it may give an occasional false positive
3321 result, but in general it has been found fairly effective at detecting
3322 this sort of problem in programs.
3323
3324 The standard is worded confusingly, therefore there is some debate
3325 over the precise meaning of the sequence point rules in subtle cases.
3326 Links to discussions of the problem, including proposed formal
3327 definitions, may be found on the GCC readings page, at
3328 @w{@uref{http://gcc.gnu.org/readings.html}}.
3329
3330 This warning is enabled by @option{-Wall} for C and C++.
3331
3332 @item -Wreturn-type
3333 @opindex Wreturn-type
3334 @opindex Wno-return-type
3335 Warn whenever a function is defined with a return-type that defaults
3336 to @code{int}.  Also warn about any @code{return} statement with no
3337 return-value in a function whose return-type is not @code{void}
3338 (falling off the end of the function body is considered returning
3339 without a value), and about a @code{return} statement with an
3340 expression in a function whose return-type is @code{void}.
3341
3342 For C++, a function without return type always produces a diagnostic
3343 message, even when @option{-Wno-return-type} is specified.  The only
3344 exceptions are @samp{main} and functions defined in system headers.
3345
3346 This warning is enabled by @option{-Wall}.
3347
3348 @item -Wswitch
3349 @opindex Wswitch
3350 @opindex Wno-switch
3351 Warn whenever a @code{switch} statement has an index of enumerated type
3352 and lacks a @code{case} for one or more of the named codes of that
3353 enumeration.  (The presence of a @code{default} label prevents this
3354 warning.)  @code{case} labels outside the enumeration range also
3355 provoke warnings when this option is used (even if there is a
3356 @code{default} label).
3357 This warning is enabled by @option{-Wall}.
3358
3359 @item -Wswitch-default
3360 @opindex Wswitch-default
3361 @opindex Wno-switch-default
3362 Warn whenever a @code{switch} statement does not have a @code{default}
3363 case.
3364
3365 @item -Wswitch-enum
3366 @opindex Wswitch-enum
3367 @opindex Wno-switch-enum
3368 Warn whenever a @code{switch} statement has an index of enumerated type
3369 and lacks a @code{case} for one or more of the named codes of that
3370 enumeration.  @code{case} labels outside the enumeration range also
3371 provoke warnings when this option is used.  The only difference
3372 between @option{-Wswitch} and this option is that this option gives a
3373 warning about an omitted enumeration code even if there is a
3374 @code{default} label.
3375
3376 @item -Wsync-nand @r{(C and C++ only)}
3377 @opindex Wsync-nand
3378 @opindex Wno-sync-nand
3379 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3380 built-in functions are used.  These functions changed semantics in GCC 4.4.
3381
3382 @item -Wtrigraphs
3383 @opindex Wtrigraphs
3384 @opindex Wno-trigraphs
3385 Warn if any trigraphs are encountered that might change the meaning of
3386 the program (trigraphs within comments are not warned about).
3387 This warning is enabled by @option{-Wall}.
3388
3389 @item -Wunused-but-set-parameter
3390 @opindex Wunused-but-set-parameter
3391 @opindex Wno-unused-but-set-parameter
3392 Warn whenever a function parameter is assigned to, but otherwise unused
3393 (aside from its declaration).
3394
3395 To suppress this warning use the @samp{unused} attribute
3396 (@pxref{Variable Attributes}).
3397
3398 This warning is also enabled by @option{-Wunused} together with
3399 @option{-Wextra}.
3400
3401 @item -Wunused-but-set-variable
3402 @opindex Wunused-but-set-variable
3403 @opindex Wno-unused-but-set-variable
3404 Warn whenever a local variable is assigned to, but otherwise unused
3405 (aside from its declaration).
3406 This warning is enabled by @option{-Wall}.
3407
3408 To suppress this warning use the @samp{unused} attribute
3409 (@pxref{Variable Attributes}).
3410
3411 This warning is also enabled by @option{-Wunused}, which is enabled
3412 by @option{-Wall}.
3413
3414 @item -Wunused-function
3415 @opindex Wunused-function
3416 @opindex Wno-unused-function
3417 Warn whenever a static function is declared but not defined or a
3418 non-inline static function is unused.
3419 This warning is enabled by @option{-Wall}.
3420
3421 @item -Wunused-label
3422 @opindex Wunused-label
3423 @opindex Wno-unused-label
3424 Warn whenever a label is declared but not used.
3425 This warning is enabled by @option{-Wall}.
3426
3427 To suppress this warning use the @samp{unused} attribute
3428 (@pxref{Variable Attributes}).
3429
3430 @item -Wunused-parameter
3431 @opindex Wunused-parameter
3432 @opindex Wno-unused-parameter
3433 Warn whenever a function parameter is unused aside from its declaration.
3434
3435 To suppress this warning use the @samp{unused} attribute
3436 (@pxref{Variable Attributes}).
3437
3438 @item -Wno-unused-result
3439 @opindex Wunused-result
3440 @opindex Wno-unused-result
3441 Do not warn if a caller of a function marked with attribute
3442 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3443 its return value. The default is @option{-Wunused-result}.
3444
3445 @item -Wunused-variable
3446 @opindex Wunused-variable
3447 @opindex Wno-unused-variable
3448 Warn whenever a local variable or non-constant static variable is unused
3449 aside from its declaration.
3450 This warning is enabled by @option{-Wall}.
3451
3452 To suppress this warning use the @samp{unused} attribute
3453 (@pxref{Variable Attributes}).
3454
3455 @item -Wunused-value
3456 @opindex Wunused-value
3457 @opindex Wno-unused-value
3458 Warn whenever a statement computes a result that is explicitly not
3459 used. To suppress this warning cast the unused expression to
3460 @samp{void}. This includes an expression-statement or the left-hand
3461 side of a comma expression that contains no side effects. For example,
3462 an expression such as @samp{x[i,j]} will cause a warning, while
3463 @samp{x[(void)i,j]} will not.
3464
3465 This warning is enabled by @option{-Wall}.
3466
3467 @item -Wunused
3468 @opindex Wunused
3469 @opindex Wno-unused
3470 All the above @option{-Wunused} options combined.
3471
3472 In order to get a warning about an unused function parameter, you must
3473 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3474 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3475
3476 @item -Wuninitialized
3477 @opindex Wuninitialized
3478 @opindex Wno-uninitialized
3479 Warn if an automatic variable is used without first being initialized
3480 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3481 warn if a non-static reference or non-static @samp{const} member
3482 appears in a class without constructors.
3483
3484 If you want to warn about code which uses the uninitialized value of the
3485 variable in its own initializer, use the @option{-Winit-self} option.
3486
3487 These warnings occur for individual uninitialized or clobbered
3488 elements of structure, union or array variables as well as for
3489 variables which are uninitialized or clobbered as a whole.  They do
3490 not occur for variables or elements declared @code{volatile}.  Because
3491 these warnings depend on optimization, the exact variables or elements
3492 for which there are warnings will depend on the precise optimization
3493 options and version of GCC used.
3494
3495 Note that there may be no warning about a variable that is used only
3496 to compute a value that itself is never used, because such
3497 computations may be deleted by data flow analysis before the warnings
3498 are printed.
3499
3500 These warnings are made optional because GCC is not smart
3501 enough to see all the reasons why the code might be correct
3502 despite appearing to have an error.  Here is one example of how
3503 this can happen:
3504
3505 @smallexample
3506 @group
3507 @{
3508   int x;
3509   switch (y)
3510     @{
3511     case 1: x = 1;
3512       break;
3513     case 2: x = 4;
3514       break;
3515     case 3: x = 5;
3516     @}
3517   foo (x);
3518 @}
3519 @end group
3520 @end smallexample
3521
3522 @noindent
3523 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3524 always initialized, but GCC doesn't know this.  Here is
3525 another common case:
3526
3527 @smallexample
3528 @{
3529   int save_y;
3530   if (change_y) save_y = y, y = new_y;
3531   @dots{}
3532   if (change_y) y = save_y;
3533 @}
3534 @end smallexample
3535
3536 @noindent
3537 This has no bug because @code{save_y} is used only if it is set.
3538
3539 @cindex @code{longjmp} warnings
3540 This option also warns when a non-volatile automatic variable might be
3541 changed by a call to @code{longjmp}.  These warnings as well are possible
3542 only in optimizing compilation.
3543
3544 The compiler sees only the calls to @code{setjmp}.  It cannot know
3545 where @code{longjmp} will be called; in fact, a signal handler could
3546 call it at any point in the code.  As a result, you may get a warning
3547 even when there is in fact no problem because @code{longjmp} cannot
3548 in fact be called at the place which would cause a problem.
3549
3550 Some spurious warnings can be avoided if you declare all the functions
3551 you use that never return as @code{noreturn}.  @xref{Function
3552 Attributes}.
3553
3554 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3555
3556 @item -Wunknown-pragmas
3557 @opindex Wunknown-pragmas
3558 @opindex Wno-unknown-pragmas
3559 @cindex warning for unknown pragmas
3560 @cindex unknown pragmas, warning
3561 @cindex pragmas, warning of unknown
3562 Warn when a #pragma directive is encountered which is not understood by
3563 GCC@.  If this command line option is used, warnings will even be issued
3564 for unknown pragmas in system header files.  This is not the case if
3565 the warnings were only enabled by the @option{-Wall} command line option.
3566
3567 @item -Wno-pragmas
3568 @opindex Wno-pragmas
3569 @opindex Wpragmas
3570 Do not warn about misuses of pragmas, such as incorrect parameters,
3571 invalid syntax, or conflicts between pragmas.  See also
3572 @samp{-Wunknown-pragmas}.
3573
3574 @item -Wstrict-aliasing
3575 @opindex Wstrict-aliasing
3576 @opindex Wno-strict-aliasing
3577 This option is only active when @option{-fstrict-aliasing} is active.
3578 It warns about code which might break the strict aliasing rules that the
3579 compiler is using for optimization.  The warning does not catch all
3580 cases, but does attempt to catch the more common pitfalls.  It is
3581 included in @option{-Wall}.
3582 It is equivalent to @option{-Wstrict-aliasing=3}
3583
3584 @item -Wstrict-aliasing=n
3585 @opindex Wstrict-aliasing=n
3586 @opindex Wno-strict-aliasing=n
3587 This option is only active when @option{-fstrict-aliasing} is active.
3588 It warns about code which might break the strict aliasing rules that the
3589 compiler is using for optimization.
3590 Higher levels correspond to higher accuracy (fewer false positives).
3591 Higher levels also correspond to more effort, similar to the way -O works.
3592 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3593 with n=3.
3594
3595 Level 1: Most aggressive, quick, least accurate.
3596 Possibly useful when higher levels
3597 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3598 false negatives.  However, it has many false positives.
3599 Warns for all pointer conversions between possibly incompatible types,
3600 even if never dereferenced.  Runs in the frontend only.
3601
3602 Level 2: Aggressive, quick, not too precise.
3603 May still have many false positives (not as many as level 1 though),
3604 and few false negatives (but possibly more than level 1).
3605 Unlike level 1, it only warns when an address is taken.  Warns about
3606 incomplete types.  Runs in the frontend only.
3607
3608 Level 3 (default for @option{-Wstrict-aliasing}):
3609 Should have very few false positives and few false
3610 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3611 Takes care of the common pun+dereference pattern in the frontend:
3612 @code{*(int*)&some_float}.
3613 If optimization is enabled, it also runs in the backend, where it deals
3614 with multiple statement cases using flow-sensitive points-to information.
3615 Only warns when the converted pointer is dereferenced.
3616 Does not warn about incomplete types.
3617
3618 @item -Wstrict-overflow
3619 @itemx -Wstrict-overflow=@var{n}
3620 @opindex Wstrict-overflow
3621 @opindex Wno-strict-overflow
3622 This option is only active when @option{-fstrict-overflow} is active.
3623 It warns about cases where the compiler optimizes based on the
3624 assumption that signed overflow does not occur.  Note that it does not
3625 warn about all cases where the code might overflow: it only warns
3626 about cases where the compiler implements some optimization.  Thus
3627 this warning depends on the optimization level.
3628
3629 An optimization which assumes that signed overflow does not occur is
3630 perfectly safe if the values of the variables involved are such that
3631 overflow never does, in fact, occur.  Therefore this warning can
3632 easily give a false positive: a warning about code which is not
3633 actually a problem.  To help focus on important issues, several
3634 warning levels are defined.  No warnings are issued for the use of
3635 undefined signed overflow when estimating how many iterations a loop
3636 will require, in particular when determining whether a loop will be
3637 executed at all.
3638
3639 @table @gcctabopt
3640 @item -Wstrict-overflow=1
3641 Warn about cases which are both questionable and easy to avoid.  For
3642 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3643 compiler will simplify this to @code{1}.  This level of
3644 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3645 are not, and must be explicitly requested.
3646
3647 @item -Wstrict-overflow=2
3648 Also warn about other cases where a comparison is simplified to a
3649 constant.  For example: @code{abs (x) >= 0}.  This can only be
3650 simplified when @option{-fstrict-overflow} is in effect, because
3651 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3652 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3653 @option{-Wstrict-overflow=2}.
3654
3655 @item -Wstrict-overflow=3
3656 Also warn about other cases where a comparison is simplified.  For
3657 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3658
3659 @item -Wstrict-overflow=4
3660 Also warn about other simplifications not covered by the above cases.
3661 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3662
3663 @item -Wstrict-overflow=5
3664 Also warn about cases where the compiler reduces the magnitude of a
3665 constant involved in a comparison.  For example: @code{x + 2 > y} will
3666 be simplified to @code{x + 1 >= y}.  This is reported only at the
3667 highest warning level because this simplification applies to many
3668 comparisons, so this warning level will give a very large number of
3669 false positives.
3670 @end table
3671
3672 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3673 @opindex Wsuggest-attribute=
3674 @opindex Wno-suggest-attribute=
3675 Warn for cases where adding an attribute may be beneficial. The
3676 attributes currently supported are listed below.
3677
3678 @table @gcctabopt
3679 @item -Wsuggest-attribute=pure
3680 @itemx -Wsuggest-attribute=const
3681 @itemx -Wsuggest-attribute=noreturn
3682 @opindex Wsuggest-attribute=pure
3683 @opindex Wno-suggest-attribute=pure
3684 @opindex Wsuggest-attribute=const
3685 @opindex Wno-suggest-attribute=const
3686 @opindex Wsuggest-attribute=noreturn
3687 @opindex Wno-suggest-attribute=noreturn
3688
3689 Warn about functions which might be candidates for attributes
3690 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3691 functions visible in other compilation units or (in the case of @code{pure} and
3692 @code{const}) if it cannot prove that the function returns normally. A function
3693 returns normally if it doesn't contain an infinite loop nor returns abnormally
3694 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3695 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3696 higher.  Higher optimization levels improve the accuracy of the analysis.
3697 @end table
3698
3699 @item -Warray-bounds
3700 @opindex Wno-array-bounds
3701 @opindex Warray-bounds
3702 This option is only active when @option{-ftree-vrp} is active
3703 (default for @option{-O2} and above). It warns about subscripts to arrays
3704 that are always out of bounds. This warning is enabled by @option{-Wall}.
3705
3706 @item -Wno-div-by-zero
3707 @opindex Wno-div-by-zero
3708 @opindex Wdiv-by-zero
3709 Do not warn about compile-time integer division by zero.  Floating point
3710 division by zero is not warned about, as it can be a legitimate way of
3711 obtaining infinities and NaNs.
3712
3713 @item -Wsystem-headers
3714 @opindex Wsystem-headers
3715 @opindex Wno-system-headers
3716 @cindex warnings from system headers
3717 @cindex system headers, warnings from
3718 Print warning messages for constructs found in system header files.
3719 Warnings from system headers are normally suppressed, on the assumption
3720 that they usually do not indicate real problems and would only make the
3721 compiler output harder to read.  Using this command line option tells
3722 GCC to emit warnings from system headers as if they occurred in user
3723 code.  However, note that using @option{-Wall} in conjunction with this
3724 option will @emph{not} warn about unknown pragmas in system
3725 headers---for that, @option{-Wunknown-pragmas} must also be used.
3726
3727 @item -Wfloat-equal
3728 @opindex Wfloat-equal
3729 @opindex Wno-float-equal
3730 Warn if floating point values are used in equality comparisons.
3731
3732 The idea behind this is that sometimes it is convenient (for the
3733 programmer) to consider floating-point values as approximations to
3734 infinitely precise real numbers.  If you are doing this, then you need
3735 to compute (by analyzing the code, or in some other way) the maximum or
3736 likely maximum error that the computation introduces, and allow for it
3737 when performing comparisons (and when producing output, but that's a
3738 different problem).  In particular, instead of testing for equality, you
3739 would check to see whether the two values have ranges that overlap; and
3740 this is done with the relational operators, so equality comparisons are
3741 probably mistaken.
3742
3743 @item -Wtraditional @r{(C and Objective-C only)}
3744 @opindex Wtraditional
3745 @opindex Wno-traditional
3746 Warn about certain constructs that behave differently in traditional and
3747 ISO C@.  Also warn about ISO C constructs that have no traditional C
3748 equivalent, and/or problematic constructs which should be avoided.
3749
3750 @itemize @bullet
3751 @item
3752 Macro parameters that appear within string literals in the macro body.
3753 In traditional C macro replacement takes place within string literals,
3754 but does not in ISO C@.
3755
3756 @item
3757 In traditional C, some preprocessor directives did not exist.
3758 Traditional preprocessors would only consider a line to be a directive
3759 if the @samp{#} appeared in column 1 on the line.  Therefore
3760 @option{-Wtraditional} warns about directives that traditional C
3761 understands but would ignore because the @samp{#} does not appear as the
3762 first character on the line.  It also suggests you hide directives like
3763 @samp{#pragma} not understood by traditional C by indenting them.  Some
3764 traditional implementations would not recognize @samp{#elif}, so it
3765 suggests avoiding it altogether.
3766
3767 @item
3768 A function-like macro that appears without arguments.
3769
3770 @item
3771 The unary plus operator.
3772
3773 @item
3774 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3775 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3776 constants.)  Note, these suffixes appear in macros defined in the system
3777 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3778 Use of these macros in user code might normally lead to spurious
3779 warnings, however GCC's integrated preprocessor has enough context to
3780 avoid warning in these cases.
3781
3782 @item
3783 A function declared external in one block and then used after the end of
3784 the block.
3785
3786 @item
3787 A @code{switch} statement has an operand of type @code{long}.
3788
3789 @item
3790 A non-@code{static} function declaration follows a @code{static} one.
3791 This construct is not accepted by some traditional C compilers.
3792
3793 @item
3794 The ISO type of an integer constant has a different width or
3795 signedness from its traditional type.  This warning is only issued if
3796 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3797 typically represent bit patterns, are not warned about.
3798
3799 @item
3800 Usage of ISO string concatenation is detected.
3801
3802 @item
3803 Initialization of automatic aggregates.
3804
3805 @item
3806 Identifier conflicts with labels.  Traditional C lacks a separate
3807 namespace for labels.
3808
3809 @item
3810 Initialization of unions.  If the initializer is zero, the warning is
3811 omitted.  This is done under the assumption that the zero initializer in
3812 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3813 initializer warnings and relies on default initialization to zero in the
3814 traditional C case.
3815
3816 @item
3817 Conversions by prototypes between fixed/floating point values and vice
3818 versa.  The absence of these prototypes when compiling with traditional
3819 C would cause serious problems.  This is a subset of the possible
3820 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3821
3822 @item
3823 Use of ISO C style function definitions.  This warning intentionally is
3824 @emph{not} issued for prototype declarations or variadic functions
3825 because these ISO C features will appear in your code when using
3826 libiberty's traditional C compatibility macros, @code{PARAMS} and
3827 @code{VPARAMS}.  This warning is also bypassed for nested functions
3828 because that feature is already a GCC extension and thus not relevant to
3829 traditional C compatibility.
3830 @end itemize
3831
3832 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3833 @opindex Wtraditional-conversion
3834 @opindex Wno-traditional-conversion
3835 Warn if a prototype causes a type conversion that is different from what
3836 would happen to the same argument in the absence of a prototype.  This
3837 includes conversions of fixed point to floating and vice versa, and
3838 conversions changing the width or signedness of a fixed point argument
3839 except when the same as the default promotion.
3840
3841 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3842 @opindex Wdeclaration-after-statement
3843 @opindex Wno-declaration-after-statement
3844 Warn when a declaration is found after a statement in a block.  This
3845 construct, known from C++, was introduced with ISO C99 and is by default
3846 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3847 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3848
3849 @item -Wundef
3850 @opindex Wundef
3851 @opindex Wno-undef
3852 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3853
3854 @item -Wno-endif-labels
3855 @opindex Wno-endif-labels
3856 @opindex Wendif-labels
3857 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3858
3859 @item -Wshadow
3860 @opindex Wshadow
3861 @opindex Wno-shadow
3862 Warn whenever a local variable or type declaration shadows another variable,
3863 parameter, type, or class member (in C++), or whenever a built-in function
3864 is shadowed. Note that in C++, the compiler will not warn if a local variable
3865 shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
3866
3867 @item -Wlarger-than=@var{len}
3868 @opindex Wlarger-than=@var{len}
3869 @opindex Wlarger-than-@var{len}
3870 Warn whenever an object of larger than @var{len} bytes is defined.
3871
3872 @item -Wframe-larger-than=@var{len}
3873 @opindex Wframe-larger-than
3874 Warn if the size of a function frame is larger than @var{len} bytes.
3875 The computation done to determine the stack frame size is approximate
3876 and not conservative.
3877 The actual requirements may be somewhat greater than @var{len}
3878 even if you do not get a warning.  In addition, any space allocated
3879 via @code{alloca}, variable-length arrays, or related constructs
3880 is not included by the compiler when determining
3881 whether or not to issue a warning.
3882
3883 @item -Wunsafe-loop-optimizations
3884 @opindex Wunsafe-loop-optimizations
3885 @opindex Wno-unsafe-loop-optimizations
3886 Warn if the loop cannot be optimized because the compiler could not
3887 assume anything on the bounds of the loop indices.  With
3888 @option{-funsafe-loop-optimizations} warn if the compiler made
3889 such assumptions.
3890
3891 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3892 @opindex Wno-pedantic-ms-format
3893 @opindex Wpedantic-ms-format
3894 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3895 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3896 depending on the MS runtime, when you are using the options @option{-Wformat}
3897 and @option{-pedantic} without gnu-extensions.
3898
3899 @item -Wpointer-arith
3900 @opindex Wpointer-arith
3901 @opindex Wno-pointer-arith
3902 Warn about anything that depends on the ``size of'' a function type or
3903 of @code{void}.  GNU C assigns these types a size of 1, for
3904 convenience in calculations with @code{void *} pointers and pointers
3905 to functions.  In C++, warn also when an arithmetic operation involves
3906 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3907
3908 @item -Wtype-limits
3909 @opindex Wtype-limits
3910 @opindex Wno-type-limits
3911 Warn if a comparison is always true or always false due to the limited
3912 range of the data type, but do not warn for constant expressions.  For
3913 example, warn if an unsigned variable is compared against zero with
3914 @samp{<} or @samp{>=}.  This warning is also enabled by
3915 @option{-Wextra}.
3916
3917 @item -Wbad-function-cast @r{(C and Objective-C only)}
3918 @opindex Wbad-function-cast
3919 @opindex Wno-bad-function-cast
3920 Warn whenever a function call is cast to a non-matching type.
3921 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3922
3923 @item -Wc++-compat @r{(C and Objective-C only)}
3924 Warn about ISO C constructs that are outside of the common subset of
3925 ISO C and ISO C++, e.g.@: request for implicit conversion from
3926 @code{void *} to a pointer to non-@code{void} type.
3927
3928 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3929 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3930 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3931 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3932
3933 @item -Wcast-qual
3934 @opindex Wcast-qual
3935 @opindex Wno-cast-qual
3936 Warn whenever a pointer is cast so as to remove a type qualifier from
3937 the target type.  For example, warn if a @code{const char *} is cast
3938 to an ordinary @code{char *}.
3939
3940 Also warn when making a cast which introduces a type qualifier in an
3941 unsafe way.  For example, casting @code{char **} to @code{const char **}
3942 is unsafe, as in this example:
3943
3944 @smallexample
3945   /* p is char ** value.  */
3946   const char **q = (const char **) p;
3947   /* Assignment of readonly string to const char * is OK.  */
3948   *q = "string";
3949   /* Now char** pointer points to read-only memory.  */
3950   **p = 'b';
3951 @end smallexample
3952
3953 @item -Wcast-align
3954 @opindex Wcast-align
3955 @opindex Wno-cast-align
3956 Warn whenever a pointer is cast such that the required alignment of the
3957 target is increased.  For example, warn if a @code{char *} is cast to
3958 an @code{int *} on machines where integers can only be accessed at
3959 two- or four-byte boundaries.
3960
3961 @item -Wwrite-strings
3962 @opindex Wwrite-strings
3963 @opindex Wno-write-strings
3964 When compiling C, give string constants the type @code{const
3965 char[@var{length}]} so that copying the address of one into a
3966 non-@code{const} @code{char *} pointer will get a warning.  These
3967 warnings will help you find at compile time code that can try to write
3968 into a string constant, but only if you have been very careful about
3969 using @code{const} in declarations and prototypes.  Otherwise, it will
3970 just be a nuisance. This is why we did not make @option{-Wall} request
3971 these warnings.
3972
3973 When compiling C++, warn about the deprecated conversion from string
3974 literals to @code{char *}.  This warning is enabled by default for C++
3975 programs.
3976
3977 @item -Wclobbered
3978 @opindex Wclobbered
3979 @opindex Wno-clobbered
3980 Warn for variables that might be changed by @samp{longjmp} or
3981 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3982
3983 @item -Wconversion
3984 @opindex Wconversion
3985 @opindex Wno-conversion
3986 Warn for implicit conversions that may alter a value. This includes
3987 conversions between real and integer, like @code{abs (x)} when
3988 @code{x} is @code{double}; conversions between signed and unsigned,
3989 like @code{unsigned ui = -1}; and conversions to smaller types, like
3990 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3991 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3992 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3993 conversions between signed and unsigned integers can be disabled by
3994 using @option{-Wno-sign-conversion}.
3995
3996 For C++, also warn for confusing overload resolution for user-defined
3997 conversions; and conversions that will never use a type conversion
3998 operator: conversions to @code{void}, the same type, a base class or a
3999 reference to them. Warnings about conversions between signed and
4000 unsigned integers are disabled by default in C++ unless
4001 @option{-Wsign-conversion} is explicitly enabled.
4002
4003 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4004 @opindex Wconversion-null
4005 @opindex Wno-conversion-null
4006 Do not warn for conversions between @code{NULL} and non-pointer
4007 types. @option{-Wconversion-null} is enabled by default.
4008
4009 @item -Wempty-body
4010 @opindex Wempty-body
4011 @opindex Wno-empty-body
4012 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4013 while} statement.  This warning is also enabled by @option{-Wextra}.
4014
4015 @item -Wenum-compare
4016 @opindex Wenum-compare
4017 @opindex Wno-enum-compare
4018 Warn about a comparison between values of different enum types. In C++
4019 this warning is enabled by default.  In C this warning is enabled by
4020 @option{-Wall}.
4021
4022 @item -Wjump-misses-init @r{(C, Objective-C only)}
4023 @opindex Wjump-misses-init
4024 @opindex Wno-jump-misses-init
4025 Warn if a @code{goto} statement or a @code{switch} statement jumps
4026 forward across the initialization of a variable, or jumps backward to a
4027 label after the variable has been initialized.  This only warns about
4028 variables which are initialized when they are declared.  This warning is
4029 only supported for C and Objective C; in C++ this sort of branch is an
4030 error in any case.
4031
4032 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4033 can be disabled with the @option{-Wno-jump-misses-init} option.
4034
4035 @item -Wsign-compare
4036 @opindex Wsign-compare
4037 @opindex Wno-sign-compare
4038 @cindex warning for comparison of signed and unsigned values
4039 @cindex comparison of signed and unsigned values, warning
4040 @cindex signed and unsigned values, comparison warning
4041 Warn when a comparison between signed and unsigned values could produce
4042 an incorrect result when the signed value is converted to unsigned.
4043 This warning is also enabled by @option{-Wextra}; to get the other warnings
4044 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
4045
4046 @item -Wsign-conversion
4047 @opindex Wsign-conversion
4048 @opindex Wno-sign-conversion
4049 Warn for implicit conversions that may change the sign of an integer
4050 value, like assigning a signed integer expression to an unsigned
4051 integer variable. An explicit cast silences the warning. In C, this
4052 option is enabled also by @option{-Wconversion}.
4053
4054 @item -Waddress
4055 @opindex Waddress
4056 @opindex Wno-address
4057 Warn about suspicious uses of memory addresses. These include using
4058 the address of a function in a conditional expression, such as
4059 @code{void func(void); if (func)}, and comparisons against the memory
4060 address of a string literal, such as @code{if (x == "abc")}.  Such
4061 uses typically indicate a programmer error: the address of a function
4062 always evaluates to true, so their use in a conditional usually
4063 indicate that the programmer forgot the parentheses in a function
4064 call; and comparisons against string literals result in unspecified
4065 behavior and are not portable in C, so they usually indicate that the
4066 programmer intended to use @code{strcmp}.  This warning is enabled by
4067 @option{-Wall}.
4068
4069 @item -Wlogical-op
4070 @opindex Wlogical-op
4071 @opindex Wno-logical-op
4072 Warn about suspicious uses of logical operators in expressions.
4073 This includes using logical operators in contexts where a
4074 bit-wise operator is likely to be expected.
4075
4076 @item -Waggregate-return
4077 @opindex Waggregate-return
4078 @opindex Wno-aggregate-return
4079 Warn if any functions that return structures or unions are defined or
4080 called.  (In languages where you can return an array, this also elicits
4081 a warning.)
4082
4083 @item -Wno-attributes
4084 @opindex Wno-attributes
4085 @opindex Wattributes
4086 Do not warn if an unexpected @code{__attribute__} is used, such as
4087 unrecognized attributes, function attributes applied to variables,
4088 etc.  This will not stop errors for incorrect use of supported
4089 attributes.
4090
4091 @item -Wno-builtin-macro-redefined
4092 @opindex Wno-builtin-macro-redefined
4093 @opindex Wbuiltin-macro-redefined
4094 Do not warn if certain built-in macros are redefined.  This suppresses
4095 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4096 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4097
4098 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4099 @opindex Wstrict-prototypes
4100 @opindex Wno-strict-prototypes
4101 Warn if a function is declared or defined without specifying the
4102 argument types.  (An old-style function definition is permitted without
4103 a warning if preceded by a declaration which specifies the argument
4104 types.)
4105
4106 @item -Wold-style-declaration @r{(C and Objective-C only)}
4107 @opindex Wold-style-declaration
4108 @opindex Wno-old-style-declaration
4109 Warn for obsolescent usages, according to the C Standard, in a
4110 declaration. For example, warn if storage-class specifiers like
4111 @code{static} are not the first things in a declaration.  This warning
4112 is also enabled by @option{-Wextra}.
4113
4114 @item -Wold-style-definition @r{(C and Objective-C only)}
4115 @opindex Wold-style-definition
4116 @opindex Wno-old-style-definition
4117 Warn if an old-style function definition is used.  A warning is given
4118 even if there is a previous prototype.
4119
4120 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4121 @opindex Wmissing-parameter-type
4122 @opindex Wno-missing-parameter-type
4123 A function parameter is declared without a type specifier in K&R-style
4124 functions:
4125
4126 @smallexample
4127 void foo(bar) @{ @}
4128 @end smallexample
4129
4130 This warning is also enabled by @option{-Wextra}.
4131
4132 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4133 @opindex Wmissing-prototypes
4134 @opindex Wno-missing-prototypes
4135 Warn if a global function is defined without a previous prototype
4136 declaration.  This warning is issued even if the definition itself
4137 provides a prototype.  The aim is to detect global functions that fail
4138 to be declared in header files.
4139
4140 @item -Wmissing-declarations
4141 @opindex Wmissing-declarations
4142 @opindex Wno-missing-declarations
4143 Warn if a global function is defined without a previous declaration.
4144 Do so even if the definition itself provides a prototype.
4145 Use this option to detect global functions that are not declared in
4146 header files.  In C++, no warnings are issued for function templates,
4147 or for inline functions, or for functions in anonymous namespaces.
4148
4149 @item -Wmissing-field-initializers
4150 @opindex Wmissing-field-initializers
4151 @opindex Wno-missing-field-initializers
4152 @opindex W
4153 @opindex Wextra
4154 @opindex Wno-extra
4155 Warn if a structure's initializer has some fields missing.  For
4156 example, the following code would cause such a warning, because
4157 @code{x.h} is implicitly zero:
4158
4159 @smallexample
4160 struct s @{ int f, g, h; @};
4161 struct s x = @{ 3, 4 @};
4162 @end smallexample
4163
4164 This option does not warn about designated initializers, so the following
4165 modification would not trigger a warning:
4166
4167 @smallexample
4168 struct s @{ int f, g, h; @};
4169 struct s x = @{ .f = 3, .g = 4 @};
4170 @end smallexample
4171
4172 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4173 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
4174
4175 @item -Wmissing-format-attribute
4176 @opindex Wmissing-format-attribute
4177 @opindex Wno-missing-format-attribute
4178 @opindex Wformat
4179 @opindex Wno-format
4180 Warn about function pointers which might be candidates for @code{format}
4181 attributes.  Note these are only possible candidates, not absolute ones.
4182 GCC will guess that function pointers with @code{format} attributes that
4183 are used in assignment, initialization, parameter passing or return
4184 statements should have a corresponding @code{format} attribute in the
4185 resulting type.  I.e.@: the left-hand side of the assignment or
4186 initialization, the type of the parameter variable, or the return type
4187 of the containing function respectively should also have a @code{format}
4188 attribute to avoid the warning.
4189
4190 GCC will also warn about function definitions which might be
4191 candidates for @code{format} attributes.  Again, these are only
4192 possible candidates.  GCC will guess that @code{format} attributes
4193 might be appropriate for any function that calls a function like
4194 @code{vprintf} or @code{vscanf}, but this might not always be the
4195 case, and some functions for which @code{format} attributes are
4196 appropriate may not be detected.
4197
4198 @item -Wno-multichar
4199 @opindex Wno-multichar
4200 @opindex Wmultichar
4201 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4202 Usually they indicate a typo in the user's code, as they have
4203 implementation-defined values, and should not be used in portable code.
4204
4205 @item -Wnormalized=<none|id|nfc|nfkc>
4206 @opindex Wnormalized=
4207 @cindex NFC
4208 @cindex NFKC
4209 @cindex character set, input normalization
4210 In ISO C and ISO C++, two identifiers are different if they are
4211 different sequences of characters.  However, sometimes when characters
4212 outside the basic ASCII character set are used, you can have two
4213 different character sequences that look the same.  To avoid confusion,
4214 the ISO 10646 standard sets out some @dfn{normalization rules} which
4215 when applied ensure that two sequences that look the same are turned into
4216 the same sequence.  GCC can warn you if you are using identifiers which
4217 have not been normalized; this option controls that warning.
4218
4219 There are four levels of warning that GCC supports.  The default is
4220 @option{-Wnormalized=nfc}, which warns about any identifier which is
4221 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4222 recommended form for most uses.
4223
4224 Unfortunately, there are some characters which ISO C and ISO C++ allow
4225 in identifiers that when turned into NFC aren't allowable as
4226 identifiers.  That is, there's no way to use these symbols in portable
4227 ISO C or C++ and have all your identifiers in NFC@.
4228 @option{-Wnormalized=id} suppresses the warning for these characters.
4229 It is hoped that future versions of the standards involved will correct
4230 this, which is why this option is not the default.
4231
4232 You can switch the warning off for all characters by writing
4233 @option{-Wnormalized=none}.  You would only want to do this if you
4234 were using some other normalization scheme (like ``D''), because
4235 otherwise you can easily create bugs that are literally impossible to see.
4236
4237 Some characters in ISO 10646 have distinct meanings but look identical
4238 in some fonts or display methodologies, especially once formatting has
4239 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4240 LETTER N'', will display just like a regular @code{n} which has been
4241 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4242 normalization scheme to convert all these into a standard form as
4243 well, and GCC will warn if your code is not in NFKC if you use
4244 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4245 about every identifier that contains the letter O because it might be
4246 confused with the digit 0, and so is not the default, but may be
4247 useful as a local coding convention if the programming environment is
4248 unable to be fixed to display these characters distinctly.
4249
4250 @item -Wno-deprecated
4251 @opindex Wno-deprecated
4252 @opindex Wdeprecated
4253 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4254
4255 @item -Wno-deprecated-declarations
4256 @opindex Wno-deprecated-declarations
4257 @opindex Wdeprecated-declarations
4258 Do not warn about uses of functions (@pxref{Function Attributes}),
4259 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4260 Attributes}) marked as deprecated by using the @code{deprecated}
4261 attribute.
4262
4263 @item -Wno-overflow
4264 @opindex Wno-overflow
4265 @opindex Woverflow
4266 Do not warn about compile-time overflow in constant expressions.
4267
4268 @item -Woverride-init @r{(C and Objective-C only)}
4269 @opindex Woverride-init
4270 @opindex Wno-override-init
4271 @opindex W
4272 @opindex Wextra
4273 @opindex Wno-extra
4274 Warn if an initialized field without side effects is overridden when
4275 using designated initializers (@pxref{Designated Inits, , Designated
4276 Initializers}).
4277
4278 This warning is included in @option{-Wextra}.  To get other
4279 @option{-Wextra} warnings without this one, use @samp{-Wextra
4280 -Wno-override-init}.
4281
4282 @item -Wpacked
4283 @opindex Wpacked
4284 @opindex Wno-packed
4285 Warn if a structure is given the packed attribute, but the packed
4286 attribute has no effect on the layout or size of the structure.
4287 Such structures may be mis-aligned for little benefit.  For
4288 instance, in this code, the variable @code{f.x} in @code{struct bar}
4289 will be misaligned even though @code{struct bar} does not itself
4290 have the packed attribute:
4291
4292 @smallexample
4293 @group
4294 struct foo @{
4295   int x;
4296   char a, b, c, d;
4297 @} __attribute__((packed));
4298 struct bar @{
4299   char z;
4300   struct foo f;
4301 @};
4302 @end group
4303 @end smallexample
4304
4305 @item -Wpacked-bitfield-compat
4306 @opindex Wpacked-bitfield-compat
4307 @opindex Wno-packed-bitfield-compat
4308 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4309 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4310 the change can lead to differences in the structure layout.  GCC
4311 informs you when the offset of such a field has changed in GCC 4.4.
4312 For example there is no longer a 4-bit padding between field @code{a}
4313 and @code{b} in this structure:
4314
4315 @smallexample
4316 struct foo
4317 @{
4318   char a:4;
4319   char b:8;
4320 @} __attribute__ ((packed));
4321 @end smallexample
4322
4323 This warning is enabled by default.  Use
4324 @option{-Wno-packed-bitfield-compat} to disable this warning.
4325
4326 @item -Wpadded
4327 @opindex Wpadded
4328 @opindex Wno-padded
4329 Warn if padding is included in a structure, either to align an element
4330 of the structure or to align the whole structure.  Sometimes when this
4331 happens it is possible to rearrange the fields of the structure to
4332 reduce the padding and so make the structure smaller.
4333
4334 @item -Wredundant-decls
4335 @opindex Wredundant-decls
4336 @opindex Wno-redundant-decls
4337 Warn if anything is declared more than once in the same scope, even in
4338 cases where multiple declaration is valid and changes nothing.
4339
4340 @item -Wnested-externs @r{(C and Objective-C only)}
4341 @opindex Wnested-externs
4342 @opindex Wno-nested-externs
4343 Warn if an @code{extern} declaration is encountered within a function.
4344
4345 @item -Winline
4346 @opindex Winline
4347 @opindex Wno-inline
4348 Warn if a function can not be inlined and it was declared as inline.
4349 Even with this option, the compiler will not warn about failures to
4350 inline functions declared in system headers.
4351
4352 The compiler uses a variety of heuristics to determine whether or not
4353 to inline a function.  For example, the compiler takes into account
4354 the size of the function being inlined and the amount of inlining
4355 that has already been done in the current function.  Therefore,
4356 seemingly insignificant changes in the source program can cause the
4357 warnings produced by @option{-Winline} to appear or disappear.
4358
4359 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4360 @opindex Wno-invalid-offsetof
4361 @opindex Winvalid-offsetof
4362 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4363 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4364 to a non-POD type is undefined.  In existing C++ implementations,
4365 however, @samp{offsetof} typically gives meaningful results even when
4366 applied to certain kinds of non-POD types. (Such as a simple
4367 @samp{struct} that fails to be a POD type only by virtue of having a
4368 constructor.)  This flag is for users who are aware that they are
4369 writing nonportable code and who have deliberately chosen to ignore the
4370 warning about it.
4371
4372 The restrictions on @samp{offsetof} may be relaxed in a future version
4373 of the C++ standard.
4374
4375 @item -Wno-int-to-pointer-cast
4376 @opindex Wno-int-to-pointer-cast
4377 @opindex Wint-to-pointer-cast
4378 Suppress warnings from casts to pointer type of an integer of a
4379 different size. In C++, casting to a pointer type of smaller size is
4380 an error. @option{Wint-to-pointer-cast} is enabled by default.
4381
4382
4383 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4384 @opindex Wno-pointer-to-int-cast
4385 @opindex Wpointer-to-int-cast
4386 Suppress warnings from casts from a pointer to an integer type of a
4387 different size.
4388
4389 @item -Winvalid-pch
4390 @opindex Winvalid-pch
4391 @opindex Wno-invalid-pch
4392 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4393 the search path but can't be used.
4394
4395 @item -Wlong-long
4396 @opindex Wlong-long
4397 @opindex Wno-long-long
4398 Warn if @samp{long long} type is used.  This is enabled by either
4399 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4400 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4401
4402 @item -Wvariadic-macros
4403 @opindex Wvariadic-macros
4404 @opindex Wno-variadic-macros
4405 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4406 alternate syntax when in pedantic ISO C99 mode.  This is default.
4407 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4408
4409 @item -Wvla
4410 @opindex Wvla
4411 @opindex Wno-vla
4412 Warn if variable length array is used in the code.
4413 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4414 the variable length array.
4415
4416 @item -Wvolatile-register-var
4417 @opindex Wvolatile-register-var
4418 @opindex Wno-volatile-register-var
4419 Warn if a register variable is declared volatile.  The volatile
4420 modifier does not inhibit all optimizations that may eliminate reads
4421 and/or writes to register variables.  This warning is enabled by
4422 @option{-Wall}.
4423
4424 @item -Wdisabled-optimization
4425 @opindex Wdisabled-optimization
4426 @opindex Wno-disabled-optimization
4427 Warn if a requested optimization pass is disabled.  This warning does
4428 not generally indicate that there is anything wrong with your code; it
4429 merely indicates that GCC's optimizers were unable to handle the code
4430 effectively.  Often, the problem is that your code is too big or too
4431 complex; GCC will refuse to optimize programs when the optimization
4432 itself is likely to take inordinate amounts of time.
4433
4434 @item -Wpointer-sign @r{(C and Objective-C only)}
4435 @opindex Wpointer-sign
4436 @opindex Wno-pointer-sign
4437 Warn for pointer argument passing or assignment with different signedness.
4438 This option is only supported for C and Objective-C@.  It is implied by
4439 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4440 @option{-Wno-pointer-sign}.
4441
4442 @item -Wstack-protector
4443 @opindex Wstack-protector
4444 @opindex Wno-stack-protector
4445 This option is only active when @option{-fstack-protector} is active.  It
4446 warns about functions that will not be protected against stack smashing.
4447
4448 @item -Wno-mudflap
4449 @opindex Wno-mudflap
4450 Suppress warnings about constructs that cannot be instrumented by
4451 @option{-fmudflap}.
4452
4453 @item -Woverlength-strings
4454 @opindex Woverlength-strings
4455 @opindex Wno-overlength-strings
4456 Warn about string constants which are longer than the ``minimum
4457 maximum'' length specified in the C standard.  Modern compilers
4458 generally allow string constants which are much longer than the
4459 standard's minimum limit, but very portable programs should avoid
4460 using longer strings.
4461
4462 The limit applies @emph{after} string constant concatenation, and does
4463 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4464 C99, it was raised to 4095.  C++98 does not specify a normative
4465 minimum maximum, so we do not diagnose overlength strings in C++@.
4466
4467 This option is implied by @option{-pedantic}, and can be disabled with
4468 @option{-Wno-overlength-strings}.
4469
4470 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4471 @opindex Wunsuffixed-float-constants
4472
4473 GCC will issue a warning for any floating constant that does not have
4474 a suffix.  When used together with @option{-Wsystem-headers} it will
4475 warn about such constants in system header files.  This can be useful
4476 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4477 from the decimal floating-point extension to C99.
4478 @end table
4479
4480 @node Debugging Options
4481 @section Options for Debugging Your Program or GCC
4482 @cindex options, debugging
4483 @cindex debugging information options
4484
4485 GCC has various special options that are used for debugging
4486 either your program or GCC:
4487
4488 @table @gcctabopt
4489 @item -g
4490 @opindex g
4491 Produce debugging information in the operating system's native format
4492 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4493 information.
4494
4495 On most systems that use stabs format, @option{-g} enables use of extra
4496 debugging information that only GDB can use; this extra information
4497 makes debugging work better in GDB but will probably make other debuggers
4498 crash or
4499 refuse to read the program.  If you want to control for certain whether
4500 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4501 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4502
4503 GCC allows you to use @option{-g} with
4504 @option{-O}.  The shortcuts taken by optimized code may occasionally
4505 produce surprising results: some variables you declared may not exist
4506 at all; flow of control may briefly move where you did not expect it;
4507 some statements may not be executed because they compute constant
4508 results or their values were already at hand; some statements may
4509 execute in different places because they were moved out of loops.
4510
4511 Nevertheless it proves possible to debug optimized output.  This makes
4512 it reasonable to use the optimizer for programs that might have bugs.
4513
4514 The following options are useful when GCC is generated with the
4515 capability for more than one debugging format.
4516
4517 @item -ggdb
4518 @opindex ggdb
4519 Produce debugging information for use by GDB@.  This means to use the
4520 most expressive format available (DWARF 2, stabs, or the native format
4521 if neither of those are supported), including GDB extensions if at all
4522 possible.
4523
4524 @item -gstabs
4525 @opindex gstabs
4526 Produce debugging information in stabs format (if that is supported),
4527 without GDB extensions.  This is the format used by DBX on most BSD
4528 systems.  On MIPS, Alpha and System V Release 4 systems this option
4529 produces stabs debugging output which is not understood by DBX or SDB@.
4530 On System V Release 4 systems this option requires the GNU assembler.
4531
4532 @item -feliminate-unused-debug-symbols
4533 @opindex feliminate-unused-debug-symbols
4534 Produce debugging information in stabs format (if that is supported),
4535 for only symbols that are actually used.
4536
4537 @item -femit-class-debug-always
4538 Instead of emitting debugging information for a C++ class in only one
4539 object file, emit it in all object files using the class.  This option
4540 should be used only with debuggers that are unable to handle the way GCC
4541 normally emits debugging information for classes because using this
4542 option will increase the size of debugging information by as much as a
4543 factor of two.
4544
4545 @item -gstabs+
4546 @opindex gstabs+
4547 Produce debugging information in stabs format (if that is supported),
4548 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4549 use of these extensions is likely to make other debuggers crash or
4550 refuse to read the program.
4551
4552 @item -gcoff
4553 @opindex gcoff
4554 Produce debugging information in COFF format (if that is supported).
4555 This is the format used by SDB on most System V systems prior to
4556 System V Release 4.
4557
4558 @item -gxcoff
4559 @opindex gxcoff
4560 Produce debugging information in XCOFF format (if that is supported).
4561 This is the format used by the DBX debugger on IBM RS/6000 systems.
4562
4563 @item -gxcoff+
4564 @opindex gxcoff+
4565 Produce debugging information in XCOFF format (if that is supported),
4566 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4567 use of these extensions is likely to make other debuggers crash or
4568 refuse to read the program, and may cause assemblers other than the GNU
4569 assembler (GAS) to fail with an error.
4570
4571 @item -gdwarf-@var{version}
4572 @opindex gdwarf-@var{version}
4573 Produce debugging information in DWARF format (if that is
4574 supported).  This is the format used by DBX on IRIX 6.  The value
4575 of @var{version} may be either 2, 3 or 4; the default version is 2.
4576
4577 Note that with DWARF version 2 some ports require, and will always
4578 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4579
4580 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4581 for maximum benefit.
4582
4583 @item -gstrict-dwarf
4584 @opindex gstrict-dwarf
4585 Disallow using extensions of later DWARF standard version than selected
4586 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4587 DWARF extensions from later standard versions is allowed.
4588
4589 @item -gno-strict-dwarf
4590 @opindex gno-strict-dwarf
4591 Allow using extensions of later DWARF standard version than selected with
4592 @option{-gdwarf-@var{version}}.
4593
4594 @item -gvms
4595 @opindex gvms
4596 Produce debugging information in VMS debug format (if that is
4597 supported).  This is the format used by DEBUG on VMS systems.
4598
4599 @item -g@var{level}
4600 @itemx -ggdb@var{level}
4601 @itemx -gstabs@var{level}
4602 @itemx -gcoff@var{level}
4603 @itemx -gxcoff@var{level}
4604 @itemx -gvms@var{level}
4605 Request debugging information and also use @var{level} to specify how
4606 much information.  The default level is 2.
4607
4608 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4609 @option{-g}.
4610
4611 Level 1 produces minimal information, enough for making backtraces in
4612 parts of the program that you don't plan to debug.  This includes
4613 descriptions of functions and external variables, but no information
4614 about local variables and no line numbers.
4615
4616 Level 3 includes extra information, such as all the macro definitions
4617 present in the program.  Some debuggers support macro expansion when
4618 you use @option{-g3}.
4619
4620 @option{-gdwarf-2} does not accept a concatenated debug level, because
4621 GCC used to support an option @option{-gdwarf} that meant to generate
4622 debug information in version 1 of the DWARF format (which is very
4623 different from version 2), and it would have been too confusing.  That
4624 debug format is long obsolete, but the option cannot be changed now.
4625 Instead use an additional @option{-g@var{level}} option to change the
4626 debug level for DWARF.
4627
4628 @item -gtoggle
4629 @opindex gtoggle
4630 Turn off generation of debug info, if leaving out this option would have
4631 generated it, or turn it on at level 2 otherwise.  The position of this
4632 argument in the command line does not matter, it takes effect after all
4633 other options are processed, and it does so only once, no matter how
4634 many times it is given.  This is mainly intended to be used with
4635 @option{-fcompare-debug}.
4636
4637 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4638 @opindex fdump-final-insns
4639 Dump the final internal representation (RTL) to @var{file}.  If the
4640 optional argument is omitted (or if @var{file} is @code{.}), the name
4641 of the dump file will be determined by appending @code{.gkd} to the
4642 compilation output file name.
4643
4644 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4645 @opindex fcompare-debug
4646 @opindex fno-compare-debug
4647 If no error occurs during compilation, run the compiler a second time,
4648 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4649 passed to the second compilation.  Dump the final internal
4650 representation in both compilations, and print an error if they differ.
4651
4652 If the equal sign is omitted, the default @option{-gtoggle} is used.
4653
4654 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4655 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4656 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4657 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4658 is used.
4659
4660 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4661 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4662 of the final representation and the second compilation, preventing even
4663 @env{GCC_COMPARE_DEBUG} from taking effect.
4664
4665 To verify full coverage during @option{-fcompare-debug} testing, set
4666 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4667 which GCC will reject as an invalid option in any actual compilation
4668 (rather than preprocessing, assembly or linking).  To get just a
4669 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4670 not overridden} will do.
4671
4672 @item -fcompare-debug-second
4673 @opindex fcompare-debug-second
4674 This option is implicitly passed to the compiler for the second
4675 compilation requested by @option{-fcompare-debug}, along with options to
4676 silence warnings, and omitting other options that would cause
4677 side-effect compiler outputs to files or to the standard output.  Dump
4678 files and preserved temporary files are renamed so as to contain the
4679 @code{.gk} additional extension during the second compilation, to avoid
4680 overwriting those generated by the first.
4681
4682 When this option is passed to the compiler driver, it causes the
4683 @emph{first} compilation to be skipped, which makes it useful for little
4684 other than debugging the compiler proper.
4685
4686 @item -feliminate-dwarf2-dups
4687 @opindex feliminate-dwarf2-dups
4688 Compress DWARF2 debugging information by eliminating duplicated
4689 information about each symbol.  This option only makes sense when
4690 generating DWARF2 debugging information with @option{-gdwarf-2}.
4691
4692 @item -femit-struct-debug-baseonly
4693 Emit debug information for struct-like types
4694 only when the base name of the compilation source file
4695 matches the base name of file in which the struct was defined.
4696
4697 This option substantially reduces the size of debugging information,
4698 but at significant potential loss in type information to the debugger.
4699 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4700 See @option{-femit-struct-debug-detailed} for more detailed control.
4701
4702 This option works only with DWARF 2.
4703
4704 @item -femit-struct-debug-reduced
4705 Emit debug information for struct-like types
4706 only when the base name of the compilation source file
4707 matches the base name of file in which the type was defined,
4708 unless the struct is a template or defined in a system header.
4709
4710 This option significantly reduces the size of debugging information,
4711 with some potential loss in type information to the debugger.
4712 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4713 See @option{-femit-struct-debug-detailed} for more detailed control.
4714
4715 This option works only with DWARF 2.
4716
4717 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4718 Specify the struct-like types
4719 for which the compiler will generate debug information.
4720 The intent is to reduce duplicate struct debug information
4721 between different object files within the same program.
4722
4723 This option is a detailed version of
4724 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4725 which will serve for most needs.
4726
4727 A specification has the syntax
4728 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4729
4730 The optional first word limits the specification to
4731 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4732 A struct type is used directly when it is the type of a variable, member.
4733 Indirect uses arise through pointers to structs.
4734 That is, when use of an incomplete struct would be legal, the use is indirect.
4735 An example is
4736 @samp{struct one direct; struct two * indirect;}.
4737
4738 The optional second word limits the specification to
4739 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4740 Generic structs are a bit complicated to explain.
4741 For C++, these are non-explicit specializations of template classes,
4742 or non-template classes within the above.
4743 Other programming languages have generics,
4744 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4745
4746 The third word specifies the source files for those
4747 structs for which the compiler will emit debug information.
4748 The values @samp{none} and @samp{any} have the normal meaning.
4749 The value @samp{base} means that
4750 the base of name of the file in which the type declaration appears
4751 must match the base of the name of the main compilation file.
4752 In practice, this means that
4753 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4754 but types declared in other header will not.
4755 The value @samp{sys} means those types satisfying @samp{base}
4756 or declared in system or compiler headers.
4757
4758 You may need to experiment to determine the best settings for your application.
4759
4760 The default is @samp{-femit-struct-debug-detailed=all}.
4761
4762 This option works only with DWARF 2.
4763
4764 @item -fenable-icf-debug
4765 @opindex fenable-icf-debug
4766 Generate additional debug information to support identical code folding (ICF).
4767 This option only works with DWARF version 2 or higher.
4768
4769 @item -fno-merge-debug-strings
4770 @opindex fmerge-debug-strings
4771 @opindex fno-merge-debug-strings
4772 Direct the linker to not merge together strings in the debugging
4773 information which are identical in different object files.  Merging is
4774 not supported by all assemblers or linkers.  Merging decreases the size
4775 of the debug information in the output file at the cost of increasing
4776 link processing time.  Merging is enabled by default.
4777
4778 @item -fdebug-prefix-map=@var{old}=@var{new}
4779 @opindex fdebug-prefix-map
4780 When compiling files in directory @file{@var{old}}, record debugging
4781 information describing them as in @file{@var{new}} instead.
4782
4783 @item -fno-dwarf2-cfi-asm
4784 @opindex fdwarf2-cfi-asm
4785 @opindex fno-dwarf2-cfi-asm
4786 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4787 instead of using GAS @code{.cfi_*} directives.
4788
4789 @cindex @command{prof}
4790 @item -p
4791 @opindex p
4792 Generate extra code to write profile information suitable for the
4793 analysis program @command{prof}.  You must use this option when compiling
4794 the source files you want data about, and you must also use it when
4795 linking.
4796
4797 @cindex @command{gprof}
4798 @item -pg
4799 @opindex pg
4800 Generate extra code to write profile information suitable for the
4801 analysis program @command{gprof}.  You must use this option when compiling
4802 the source files you want data about, and you must also use it when
4803 linking.
4804
4805 @item -Q
4806 @opindex Q
4807 Makes the compiler print out each function name as it is compiled, and
4808 print some statistics about each pass when it finishes.
4809
4810 @item -ftime-report
4811 @opindex ftime-report
4812 Makes the compiler print some statistics about the time consumed by each
4813 pass when it finishes.
4814
4815 @item -fmem-report
4816 @opindex fmem-report
4817 Makes the compiler print some statistics about permanent memory
4818 allocation when it finishes.
4819
4820 @item -fpre-ipa-mem-report
4821 @opindex fpre-ipa-mem-report
4822 @item -fpost-ipa-mem-report
4823 @opindex fpost-ipa-mem-report
4824 Makes the compiler print some statistics about permanent memory
4825 allocation before or after interprocedural optimization.
4826
4827 @item -fprofile-arcs
4828 @opindex fprofile-arcs
4829 Add code so that program flow @dfn{arcs} are instrumented.  During
4830 execution the program records how many times each branch and call is
4831 executed and how many times it is taken or returns.  When the compiled
4832 program exits it saves this data to a file called
4833 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4834 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4835 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4836 @var{auxname} is generated from the name of the output file, if
4837 explicitly specified and it is not the final executable, otherwise it is
4838 the basename of the source file.  In both cases any suffix is removed
4839 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4840 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4841 @xref{Cross-profiling}.
4842
4843 @cindex @command{gcov}
4844 @item --coverage
4845 @opindex coverage
4846
4847 This option is used to compile and link code instrumented for coverage
4848 analysis.  The option is a synonym for @option{-fprofile-arcs}
4849 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4850 linking).  See the documentation for those options for more details.
4851
4852 @itemize
4853
4854 @item
4855 Compile the source files with @option{-fprofile-arcs} plus optimization
4856 and code generation options.  For test coverage analysis, use the
4857 additional @option{-ftest-coverage} option.  You do not need to profile
4858 every source file in a program.
4859
4860 @item
4861 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4862 (the latter implies the former).
4863
4864 @item
4865 Run the program on a representative workload to generate the arc profile
4866 information.  This may be repeated any number of times.  You can run
4867 concurrent instances of your program, and provided that the file system
4868 supports locking, the data files will be correctly updated.  Also
4869 @code{fork} calls are detected and correctly handled (double counting
4870 will not happen).
4871
4872 @item
4873 For profile-directed optimizations, compile the source files again with
4874 the same optimization and code generation options plus
4875 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4876 Control Optimization}).
4877
4878 @item
4879 For test coverage analysis, use @command{gcov} to produce human readable
4880 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4881 @command{gcov} documentation for further information.
4882
4883 @end itemize
4884
4885 With @option{-fprofile-arcs}, for each function of your program GCC
4886 creates a program flow graph, then finds a spanning tree for the graph.
4887 Only arcs that are not on the spanning tree have to be instrumented: the
4888 compiler adds code to count the number of times that these arcs are
4889 executed.  When an arc is the only exit or only entrance to a block, the
4890 instrumentation code can be added to the block; otherwise, a new basic
4891 block must be created to hold the instrumentation code.
4892
4893 @need 2000
4894 @item -ftest-coverage
4895 @opindex ftest-coverage
4896 Produce a notes file that the @command{gcov} code-coverage utility
4897 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4898 show program coverage.  Each source file's note file is called
4899 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4900 above for a description of @var{auxname} and instructions on how to
4901 generate test coverage data.  Coverage data will match the source files
4902 more closely, if you do not optimize.
4903
4904 @item -fdbg-cnt-list
4905 @opindex fdbg-cnt-list
4906 Print the name and the counter upperbound for all debug counters.
4907
4908 @item -fdbg-cnt=@var{counter-value-list}
4909 @opindex fdbg-cnt
4910 Set the internal debug counter upperbound. @var{counter-value-list}
4911 is a comma-separated list of @var{name}:@var{value} pairs
4912 which sets the upperbound of each debug counter @var{name} to @var{value}.
4913 All debug counters have the initial upperbound of @var{UINT_MAX},
4914 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4915 e.g. With -fdbg-cnt=dce:10,tail_call:0
4916 dbg_cnt(dce) will return true only for first 10 invocations
4917 and dbg_cnt(tail_call) will return false always.
4918
4919 @item -d@var{letters}
4920 @itemx -fdump-rtl-@var{pass}
4921 @opindex d
4922 Says to make debugging dumps during compilation at times specified by
4923 @var{letters}.  This is used for debugging the RTL-based passes of the
4924 compiler.  The file names for most of the dumps are made by appending
4925 a pass number and a word to the @var{dumpname}, and the files are
4926 created in the directory of the output file.  @var{dumpname} is
4927 generated from the name of the output file, if explicitly specified
4928 and it is not an executable, otherwise it is the basename of the
4929 source file. These switches may have different effects when
4930 @option{-E} is used for preprocessing.
4931
4932 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
4933 @option{-d} option @var{letters}.  Here are the possible
4934 letters for use in @var{pass} and @var{letters}, and their meanings:
4935
4936 @table @gcctabopt
4937
4938 @item -fdump-rtl-alignments
4939 @opindex fdump-rtl-alignments
4940 Dump after branch alignments have been computed.
4941
4942 @item -fdump-rtl-asmcons
4943 @opindex fdump-rtl-asmcons
4944 Dump after fixing rtl statements that have unsatisfied in/out constraints.
4945
4946 @item -fdump-rtl-auto_inc_dec
4947 @opindex fdump-rtl-auto_inc_dec
4948 Dump after auto-inc-dec discovery.  This pass is only run on
4949 architectures that have auto inc or auto dec instructions.
4950
4951 @item -fdump-rtl-barriers
4952 @opindex fdump-rtl-barriers
4953 Dump after cleaning up the barrier instructions.
4954
4955 @item -fdump-rtl-bbpart
4956 @opindex fdump-rtl-bbpart
4957 Dump after partitioning hot and cold basic blocks.
4958
4959 @item -fdump-rtl-bbro
4960 @opindex fdump-rtl-bbro
4961 Dump after block reordering.
4962
4963 @item -fdump-rtl-btl1
4964 @itemx -fdump-rtl-btl2
4965 @opindex fdump-rtl-btl2
4966 @opindex fdump-rtl-btl2
4967 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
4968 after the two branch
4969 target load optimization passes.
4970
4971 @item -fdump-rtl-bypass
4972 @opindex fdump-rtl-bypass
4973 Dump after jump bypassing and control flow optimizations.
4974
4975 @item -fdump-rtl-combine
4976 @opindex fdump-rtl-combine
4977 Dump after the RTL instruction combination pass.
4978
4979 @item -fdump-rtl-compgotos
4980 @opindex fdump-rtl-compgotos
4981 Dump after duplicating the computed gotos.
4982
4983 @item -fdump-rtl-ce1
4984 @itemx -fdump-rtl-ce2
4985 @itemx -fdump-rtl-ce3
4986 @opindex fdump-rtl-ce1
4987 @opindex fdump-rtl-ce2
4988 @opindex fdump-rtl-ce3
4989 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
4990 @option{-fdump-rtl-ce3} enable dumping after the three
4991 if conversion passes.
4992
4993 @itemx -fdump-rtl-cprop_hardreg
4994 @opindex fdump-rtl-cprop_hardreg
4995 Dump after hard register copy propagation.
4996
4997 @itemx -fdump-rtl-csa
4998 @opindex fdump-rtl-csa
4999 Dump after combining stack adjustments.
5000
5001 @item -fdump-rtl-cse1
5002 @itemx -fdump-rtl-cse2
5003 @opindex fdump-rtl-cse1
5004 @opindex fdump-rtl-cse2
5005 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5006 the two common sub-expression elimination passes.
5007
5008 @itemx -fdump-rtl-dce
5009 @opindex fdump-rtl-dce
5010 Dump after the standalone dead code elimination passes.
5011
5012 @itemx -fdump-rtl-dbr
5013 @opindex fdump-rtl-dbr
5014 Dump after delayed branch scheduling.
5015
5016 @item -fdump-rtl-dce1
5017 @itemx -fdump-rtl-dce2
5018 @opindex fdump-rtl-dce1
5019 @opindex fdump-rtl-dce2
5020 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5021 the two dead store elimination passes.
5022
5023 @item -fdump-rtl-eh
5024 @opindex fdump-rtl-eh
5025 Dump after finalization of EH handling code.
5026
5027 @item -fdump-rtl-eh_ranges
5028 @opindex fdump-rtl-eh_ranges
5029 Dump after conversion of EH handling range regions.
5030
5031 @item -fdump-rtl-expand
5032 @opindex fdump-rtl-expand
5033 Dump after RTL generation.
5034
5035 @item -fdump-rtl-fwprop1
5036 @itemx -fdump-rtl-fwprop2
5037 @opindex fdump-rtl-fwprop1
5038 @opindex fdump-rtl-fwprop2
5039 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5040 dumping after the two forward propagation passes.
5041
5042 @item -fdump-rtl-gcse1
5043 @itemx -fdump-rtl-gcse2
5044 @opindex fdump-rtl-gcse1
5045 @opindex fdump-rtl-gcse2
5046 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5047 after global common subexpression elimination.
5048
5049 @item -fdump-rtl-init-regs
5050 @opindex fdump-rtl-init-regs
5051 Dump after the initialization of the registers.
5052
5053 @item -fdump-rtl-initvals
5054 @opindex fdump-rtl-initvals
5055 Dump after the computation of the initial value sets.
5056
5057 @itemx -fdump-rtl-into_cfglayout
5058 @opindex fdump-rtl-into_cfglayout
5059 Dump after converting to cfglayout mode.
5060
5061 @item -fdump-rtl-ira
5062 @opindex fdump-rtl-ira
5063 Dump after iterated register allocation.
5064
5065 @item -fdump-rtl-jump
5066 @opindex fdump-rtl-jump
5067 Dump after the second jump optimization.
5068
5069 @item -fdump-rtl-loop2
5070 @opindex fdump-rtl-loop2
5071 @option{-fdump-rtl-loop2} enables dumping after the rtl
5072 loop optimization passes.
5073
5074 @item -fdump-rtl-mach
5075 @opindex fdump-rtl-mach
5076 Dump after performing the machine dependent reorganization pass, if that
5077 pass exists.
5078
5079 @item -fdump-rtl-mode_sw
5080 @opindex fdump-rtl-mode_sw
5081 Dump after removing redundant mode switches.
5082
5083 @item -fdump-rtl-rnreg
5084 @opindex fdump-rtl-rnreg
5085 Dump after register renumbering.
5086
5087 @itemx -fdump-rtl-outof_cfglayout
5088 @opindex fdump-rtl-outof_cfglayout
5089 Dump after converting from cfglayout mode.
5090
5091 @item -fdump-rtl-peephole2
5092 @opindex fdump-rtl-peephole2
5093 Dump after the peephole pass.
5094
5095 @item -fdump-rtl-postreload
5096 @opindex fdump-rtl-postreload
5097 Dump after post-reload optimizations.
5098
5099 @itemx -fdump-rtl-pro_and_epilogue
5100 @opindex fdump-rtl-pro_and_epilogue
5101 Dump after generating the function pro and epilogues.
5102
5103 @item -fdump-rtl-regmove
5104 @opindex fdump-rtl-regmove
5105 Dump after the register move pass.
5106
5107 @item -fdump-rtl-sched1
5108 @itemx -fdump-rtl-sched2
5109 @opindex fdump-rtl-sched1
5110 @opindex fdump-rtl-sched2
5111 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5112 after the basic block scheduling passes.
5113
5114 @item -fdump-rtl-see
5115 @opindex fdump-rtl-see
5116 Dump after sign extension elimination.
5117
5118 @item -fdump-rtl-seqabstr
5119 @opindex fdump-rtl-seqabstr
5120 Dump after common sequence discovery.
5121
5122 @item -fdump-rtl-shorten
5123 @opindex fdump-rtl-shorten
5124 Dump after shortening branches.
5125
5126 @item -fdump-rtl-sibling
5127 @opindex fdump-rtl-sibling
5128 Dump after sibling call optimizations.
5129
5130 @item -fdump-rtl-split1
5131 @itemx -fdump-rtl-split2
5132 @itemx -fdump-rtl-split3
5133 @itemx -fdump-rtl-split4
5134 @itemx -fdump-rtl-split5
5135 @opindex fdump-rtl-split1
5136 @opindex fdump-rtl-split2
5137 @opindex fdump-rtl-split3
5138 @opindex fdump-rtl-split4
5139 @opindex fdump-rtl-split5
5140 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5141 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5142 @option{-fdump-rtl-split5} enable dumping after five rounds of
5143 instruction splitting.
5144
5145 @item -fdump-rtl-sms
5146 @opindex fdump-rtl-sms
5147 Dump after modulo scheduling.  This pass is only run on some
5148 architectures.
5149
5150 @item -fdump-rtl-stack
5151 @opindex fdump-rtl-stack
5152 Dump after conversion from GCC's "flat register file" registers to the
5153 x87's stack-like registers.  This pass is only run on x86 variants.
5154
5155 @item -fdump-rtl-subreg1
5156 @itemx -fdump-rtl-subreg2
5157 @opindex fdump-rtl-subreg1
5158 @opindex fdump-rtl-subreg2
5159 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5160 the two subreg expansion passes.
5161
5162 @item -fdump-rtl-unshare
5163 @opindex fdump-rtl-unshare
5164 Dump after all rtl has been unshared.
5165
5166 @item -fdump-rtl-vartrack
5167 @opindex fdump-rtl-vartrack
5168 Dump after variable tracking.
5169
5170 @item -fdump-rtl-vregs
5171 @opindex fdump-rtl-vregs
5172 Dump after converting virtual registers to hard registers.
5173
5174 @item -fdump-rtl-web
5175 @opindex fdump-rtl-web
5176 Dump after live range splitting.
5177
5178 @item -fdump-rtl-regclass
5179 @itemx -fdump-rtl-subregs_of_mode_init
5180 @itemx -fdump-rtl-subregs_of_mode_finish
5181 @itemx -fdump-rtl-dfinit
5182 @itemx -fdump-rtl-dfinish
5183 @opindex fdump-rtl-regclass
5184 @opindex fdump-rtl-subregs_of_mode_init
5185 @opindex fdump-rtl-subregs_of_mode_finish
5186 @opindex fdump-rtl-dfinit
5187 @opindex fdump-rtl-dfinish
5188 These dumps are defined but always produce empty files.
5189
5190 @item -fdump-rtl-all
5191 @opindex fdump-rtl-all
5192 Produce all the dumps listed above.
5193
5194 @item -dA
5195 @opindex dA
5196 Annotate the assembler output with miscellaneous debugging information.
5197
5198 @item -dD
5199 @opindex dD
5200 Dump all macro definitions, at the end of preprocessing, in addition to
5201 normal output.
5202
5203 @item -dH
5204 @opindex dH
5205 Produce a core dump whenever an error occurs.
5206
5207 @item -dm
5208 @opindex dm
5209 Print statistics on memory usage, at the end of the run, to
5210 standard error.
5211
5212 @item -dp
5213 @opindex dp
5214 Annotate the assembler output with a comment indicating which
5215 pattern and alternative was used.  The length of each instruction is
5216 also printed.
5217
5218 @item -dP
5219 @opindex dP
5220 Dump the RTL in the assembler output as a comment before each instruction.
5221 Also turns on @option{-dp} annotation.
5222
5223 @item -dv
5224 @opindex dv
5225 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5226 dump a representation of the control flow graph suitable for viewing with VCG
5227 to @file{@var{file}.@var{pass}.vcg}.
5228
5229 @item -dx
5230 @opindex dx
5231 Just generate RTL for a function instead of compiling it.  Usually used
5232 with @option{-fdump-rtl-expand}.
5233
5234 @item -dy
5235 @opindex dy
5236 Dump debugging information during parsing, to standard error.
5237 @end table
5238
5239 @item -fdump-noaddr
5240 @opindex fdump-noaddr
5241 When doing debugging dumps, suppress address output.  This makes it more
5242 feasible to use diff on debugging dumps for compiler invocations with
5243 different compiler binaries and/or different
5244 text / bss / data / heap / stack / dso start locations.
5245
5246 @item -fdump-unnumbered
5247 @opindex fdump-unnumbered
5248 When doing debugging dumps, suppress instruction numbers and address output.
5249 This makes it more feasible to use diff on debugging dumps for compiler
5250 invocations with different options, in particular with and without
5251 @option{-g}.
5252
5253 @item -fdump-unnumbered-links
5254 @opindex fdump-unnumbered-links
5255 When doing debugging dumps (see @option{-d} option above), suppress
5256 instruction numbers for the links to the previous and next instructions
5257 in a sequence.
5258
5259 @item -fdump-translation-unit @r{(C++ only)}
5260 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5261 @opindex fdump-translation-unit
5262 Dump a representation of the tree structure for the entire translation
5263 unit to a file.  The file name is made by appending @file{.tu} to the
5264 source file name, and the file is created in the same directory as the
5265 output file.  If the @samp{-@var{options}} form is used, @var{options}
5266 controls the details of the dump as described for the
5267 @option{-fdump-tree} options.
5268
5269 @item -fdump-class-hierarchy @r{(C++ only)}
5270 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5271 @opindex fdump-class-hierarchy
5272 Dump a representation of each class's hierarchy and virtual function
5273 table layout to a file.  The file name is made by appending
5274 @file{.class} to the source file name, and the file is created in the
5275 same directory as the output file.  If the @samp{-@var{options}} form
5276 is used, @var{options} controls the details of the dump as described
5277 for the @option{-fdump-tree} options.
5278
5279 @item -fdump-ipa-@var{switch}
5280 @opindex fdump-ipa
5281 Control the dumping at various stages of inter-procedural analysis
5282 language tree to a file.  The file name is generated by appending a
5283 switch specific suffix to the source file name, and the file is created
5284 in the same directory as the output file.  The following dumps are
5285 possible:
5286
5287 @table @samp
5288 @item all
5289 Enables all inter-procedural analysis dumps.
5290
5291 @item cgraph
5292 Dumps information about call-graph optimization, unused function removal,
5293 and inlining decisions.
5294
5295 @item inline
5296 Dump after function inlining.
5297
5298 @end table
5299
5300 @item -fdump-statistics-@var{option}
5301 @opindex fdump-statistics
5302 Enable and control dumping of pass statistics in a separate file.  The
5303 file name is generated by appending a suffix ending in
5304 @samp{.statistics} to the source file name, and the file is created in
5305 the same directory as the output file.  If the @samp{-@var{option}}
5306 form is used, @samp{-stats} will cause counters to be summed over the
5307 whole compilation unit while @samp{-details} will dump every event as
5308 the passes generate them.  The default with no option is to sum
5309 counters for each function compiled.
5310
5311 @item -fdump-tree-@var{switch}
5312 @itemx -fdump-tree-@var{switch}-@var{options}
5313 @opindex fdump-tree
5314 Control the dumping at various stages of processing the intermediate
5315 language tree to a file.  The file name is generated by appending a
5316 switch specific suffix to the source file name, and the file is
5317 created in the same directory as the output file.  If the
5318 @samp{-@var{options}} form is used, @var{options} is a list of
5319 @samp{-} separated options that control the details of the dump.  Not
5320 all options are applicable to all dumps, those which are not
5321 meaningful will be ignored.  The following options are available
5322
5323 @table @samp
5324 @item address
5325 Print the address of each node.  Usually this is not meaningful as it
5326 changes according to the environment and source file.  Its primary use
5327 is for tying up a dump file with a debug environment.
5328 @item asmname
5329 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5330 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5331 use working backward from mangled names in the assembly file.
5332 @item slim
5333 Inhibit dumping of members of a scope or body of a function merely
5334 because that scope has been reached.  Only dump such items when they
5335 are directly reachable by some other path.  When dumping pretty-printed
5336 trees, this option inhibits dumping the bodies of control structures.
5337 @item raw
5338 Print a raw representation of the tree.  By default, trees are
5339 pretty-printed into a C-like representation.
5340 @item details
5341 Enable more detailed dumps (not honored by every dump option).
5342 @item stats
5343 Enable dumping various statistics about the pass (not honored by every dump
5344 option).
5345 @item blocks
5346 Enable showing basic block boundaries (disabled in raw dumps).
5347 @item vops
5348 Enable showing virtual operands for every statement.
5349 @item lineno
5350 Enable showing line numbers for statements.
5351 @item uid
5352 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5353 @item verbose
5354 Enable showing the tree dump for each statement.
5355 @item eh
5356 Enable showing the EH region number holding each statement.
5357 @item all
5358 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5359 and @option{lineno}.
5360 @end table
5361
5362 The following tree dumps are possible:
5363 @table @samp
5364
5365 @item original
5366 @opindex fdump-tree-original
5367 Dump before any tree based optimization, to @file{@var{file}.original}.
5368
5369 @item optimized
5370 @opindex fdump-tree-optimized
5371 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5372
5373 @item gimple
5374 @opindex fdump-tree-gimple
5375 Dump each function before and after the gimplification pass to a file.  The
5376 file name is made by appending @file{.gimple} to the source file name.
5377
5378 @item cfg
5379 @opindex fdump-tree-cfg
5380 Dump the control flow graph of each function to a file.  The file name is
5381 made by appending @file{.cfg} to the source file name.
5382
5383 @item vcg
5384 @opindex fdump-tree-vcg
5385 Dump the control flow graph of each function to a file in VCG format.  The
5386 file name is made by appending @file{.vcg} to the source file name.  Note
5387 that if the file contains more than one function, the generated file cannot
5388 be used directly by VCG@.  You will need to cut and paste each function's
5389 graph into its own separate file first.
5390
5391 @item ch
5392 @opindex fdump-tree-ch
5393 Dump each function after copying loop headers.  The file name is made by
5394 appending @file{.ch} to the source file name.
5395
5396 @item ssa
5397 @opindex fdump-tree-ssa
5398 Dump SSA related information to a file.  The file name is made by appending
5399 @file{.ssa} to the source file name.
5400
5401 @item alias
5402 @opindex fdump-tree-alias
5403 Dump aliasing information for each function.  The file name is made by
5404 appending @file{.alias} to the source file name.
5405
5406 @item ccp
5407 @opindex fdump-tree-ccp
5408 Dump each function after CCP@.  The file name is made by appending
5409 @file{.ccp} to the source file name.
5410
5411 @item storeccp
5412 @opindex fdump-tree-storeccp
5413 Dump each function after STORE-CCP@.  The file name is made by appending
5414 @file{.storeccp} to the source file name.
5415
5416 @item pre
5417 @opindex fdump-tree-pre
5418 Dump trees after partial redundancy elimination.  The file name is made
5419 by appending @file{.pre} to the source file name.
5420
5421 @item fre
5422 @opindex fdump-tree-fre
5423 Dump trees after full redundancy elimination.  The file name is made
5424 by appending @file{.fre} to the source file name.
5425
5426 @item copyprop
5427 @opindex fdump-tree-copyprop
5428 Dump trees after copy propagation.  The file name is made
5429 by appending @file{.copyprop} to the source file name.
5430
5431 @item store_copyprop
5432 @opindex fdump-tree-store_copyprop
5433 Dump trees after store copy-propagation.  The file name is made
5434 by appending @file{.store_copyprop} to the source file name.
5435
5436 @item dce
5437 @opindex fdump-tree-dce
5438 Dump each function after dead code elimination.  The file name is made by
5439 appending @file{.dce} to the source file name.
5440
5441 @item mudflap
5442 @opindex fdump-tree-mudflap
5443 Dump each function after adding mudflap instrumentation.  The file name is
5444 made by appending @file{.mudflap} to the source file name.
5445
5446 @item sra
5447 @opindex fdump-tree-sra
5448 Dump each function after performing scalar replacement of aggregates.  The
5449 file name is made by appending @file{.sra} to the source file name.
5450
5451 @item sink
5452 @opindex fdump-tree-sink
5453 Dump each function after performing code sinking.  The file name is made
5454 by appending @file{.sink} to the source file name.
5455
5456 @item dom
5457 @opindex fdump-tree-dom
5458 Dump each function after applying dominator tree optimizations.  The file
5459 name is made by appending @file{.dom} to the source file name.
5460
5461 @item dse
5462 @opindex fdump-tree-dse
5463 Dump each function after applying dead store elimination.  The file
5464 name is made by appending @file{.dse} to the source file name.
5465
5466 @item phiopt
5467 @opindex fdump-tree-phiopt
5468 Dump each function after optimizing PHI nodes into straightline code.  The file
5469 name is made by appending @file{.phiopt} to the source file name.
5470
5471 @item forwprop
5472 @opindex fdump-tree-forwprop
5473 Dump each function after forward propagating single use variables.  The file
5474 name is made by appending @file{.forwprop} to the source file name.
5475
5476 @item copyrename
5477 @opindex fdump-tree-copyrename
5478 Dump each function after applying the copy rename optimization.  The file
5479 name is made by appending @file{.copyrename} to the source file name.
5480
5481 @item nrv
5482 @opindex fdump-tree-nrv
5483 Dump each function after applying the named return value optimization on
5484 generic trees.  The file name is made by appending @file{.nrv} to the source
5485 file name.
5486
5487 @item vect
5488 @opindex fdump-tree-vect
5489 Dump each function after applying vectorization of loops.  The file name is
5490 made by appending @file{.vect} to the source file name.
5491
5492 @item slp
5493 @opindex fdump-tree-slp
5494 Dump each function after applying vectorization of basic blocks.  The file name
5495 is made by appending @file{.slp} to the source file name.
5496
5497 @item vrp
5498 @opindex fdump-tree-vrp
5499 Dump each function after Value Range Propagation (VRP).  The file name
5500 is made by appending @file{.vrp} to the source file name.
5501
5502 @item all
5503 @opindex fdump-tree-all
5504 Enable all the available tree dumps with the flags provided in this option.
5505 @end table
5506
5507 @item -ftree-vectorizer-verbose=@var{n}
5508 @opindex ftree-vectorizer-verbose
5509 This option controls the amount of debugging output the vectorizer prints.
5510 This information is written to standard error, unless
5511 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5512 in which case it is output to the usual dump listing file, @file{.vect}.
5513 For @var{n}=0 no diagnostic information is reported.
5514 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5515 and the total number of loops that got vectorized.
5516 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5517 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5518 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5519 level that @option{-fdump-tree-vect-stats} uses.
5520 Higher verbosity levels mean either more information dumped for each
5521 reported loop, or same amount of information reported for more loops:
5522 if @var{n}=3, vectorizer cost model information is reported.
5523 If @var{n}=4, alignment related information is added to the reports.
5524 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5525 memory access-patterns) is added to the reports.
5526 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5527 that did not pass the first analysis phase (i.e., may not be countable, or
5528 may have complicated control-flow).
5529 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5530 If @var{n}=8, SLP related information is added to the reports.
5531 For @var{n}=9, all the information the vectorizer generates during its
5532 analysis and transformation is reported.  This is the same verbosity level
5533 that @option{-fdump-tree-vect-details} uses.
5534
5535 @item -frandom-seed=@var{string}
5536 @opindex frandom-seed
5537 This option provides a seed that GCC uses when it would otherwise use
5538 random numbers.  It is used to generate certain symbol names
5539 that have to be different in every compiled file.  It is also used to
5540 place unique stamps in coverage data files and the object files that
5541 produce them.  You can use the @option{-frandom-seed} option to produce
5542 reproducibly identical object files.
5543
5544 The @var{string} should be different for every file you compile.
5545
5546 @item -fsched-verbose=@var{n}
5547 @opindex fsched-verbose
5548 On targets that use instruction scheduling, this option controls the
5549 amount of debugging output the scheduler prints.  This information is
5550 written to standard error, unless @option{-fdump-rtl-sched1} or
5551 @option{-fdump-rtl-sched2} is specified, in which case it is output
5552 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5553 respectively.  However for @var{n} greater than nine, the output is
5554 always printed to standard error.
5555
5556 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5557 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5558 For @var{n} greater than one, it also output basic block probabilities,
5559 detailed ready list information and unit/insn info.  For @var{n} greater
5560 than two, it includes RTL at abort point, control-flow and regions info.
5561 And for @var{n} over four, @option{-fsched-verbose} also includes
5562 dependence info.
5563
5564 @item -save-temps
5565 @itemx -save-temps=cwd
5566 @opindex save-temps
5567 Store the usual ``temporary'' intermediate files permanently; place them
5568 in the current directory and name them based on the source file.  Thus,
5569 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5570 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5571 preprocessed @file{foo.i} output file even though the compiler now
5572 normally uses an integrated preprocessor.
5573
5574 When used in combination with the @option{-x} command line option,
5575 @option{-save-temps} is sensible enough to avoid over writing an
5576 input source file with the same extension as an intermediate file.
5577 The corresponding intermediate file may be obtained by renaming the
5578 source file before using @option{-save-temps}.
5579
5580 If you invoke GCC in parallel, compiling several different source
5581 files that share a common base name in different subdirectories or the
5582 same source file compiled for multiple output destinations, it is
5583 likely that the different parallel compilers will interfere with each
5584 other, and overwrite the temporary files.  For instance:
5585
5586 @smallexample
5587 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5588 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5589 @end smallexample
5590
5591 may result in @file{foo.i} and @file{foo.o} being written to
5592 simultaneously by both compilers.
5593
5594 @item -save-temps=obj
5595 @opindex save-temps=obj
5596 Store the usual ``temporary'' intermediate files permanently.  If the
5597 @option{-o} option is used, the temporary files are based on the
5598 object file.  If the @option{-o} option is not used, the
5599 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5600
5601 For example:
5602
5603 @smallexample
5604 gcc -save-temps=obj -c foo.c
5605 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5606 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5607 @end smallexample
5608
5609 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5610 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5611 @file{dir2/yfoobar.o}.
5612
5613 @item -time@r{[}=@var{file}@r{]}
5614 @opindex time
5615 Report the CPU time taken by each subprocess in the compilation
5616 sequence.  For C source files, this is the compiler proper and assembler
5617 (plus the linker if linking is done).
5618
5619 Without the specification of an output file, the output looks like this:
5620
5621 @smallexample
5622 # cc1 0.12 0.01
5623 # as 0.00 0.01
5624 @end smallexample
5625
5626 The first number on each line is the ``user time'', that is time spent
5627 executing the program itself.  The second number is ``system time'',
5628 time spent executing operating system routines on behalf of the program.
5629 Both numbers are in seconds.
5630
5631 With the specification of an output file, the output is appended to the
5632 named file, and it looks like this:
5633
5634 @smallexample
5635 0.12 0.01 cc1 @var{options}
5636 0.00 0.01 as @var{options}
5637 @end smallexample
5638
5639 The ``user time'' and the ``system time'' are moved before the program
5640 name, and the options passed to the program are displayed, so that one
5641 can later tell what file was being compiled, and with which options.
5642
5643 @item -fvar-tracking
5644 @opindex fvar-tracking
5645 Run variable tracking pass.  It computes where variables are stored at each
5646 position in code.  Better debugging information is then generated
5647 (if the debugging information format supports this information).
5648
5649 It is enabled by default when compiling with optimization (@option{-Os},
5650 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5651 the debug info format supports it.
5652
5653 @item -fvar-tracking-assignments
5654 @opindex fvar-tracking-assignments
5655 @opindex fno-var-tracking-assignments
5656 Annotate assignments to user variables early in the compilation and
5657 attempt to carry the annotations over throughout the compilation all the
5658 way to the end, in an attempt to improve debug information while
5659 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
5660
5661 It can be enabled even if var-tracking is disabled, in which case
5662 annotations will be created and maintained, but discarded at the end.
5663
5664 @item -fvar-tracking-assignments-toggle
5665 @opindex fvar-tracking-assignments-toggle
5666 @opindex fno-var-tracking-assignments-toggle
5667 Toggle @option{-fvar-tracking-assignments}, in the same way that
5668 @option{-gtoggle} toggles @option{-g}.
5669
5670 @item -print-file-name=@var{library}
5671 @opindex print-file-name
5672 Print the full absolute name of the library file @var{library} that
5673 would be used when linking---and don't do anything else.  With this
5674 option, GCC does not compile or link anything; it just prints the
5675 file name.
5676
5677 @item -print-multi-directory
5678 @opindex print-multi-directory
5679 Print the directory name corresponding to the multilib selected by any
5680 other switches present in the command line.  This directory is supposed
5681 to exist in @env{GCC_EXEC_PREFIX}.
5682
5683 @item -print-multi-lib
5684 @opindex print-multi-lib
5685 Print the mapping from multilib directory names to compiler switches
5686 that enable them.  The directory name is separated from the switches by
5687 @samp{;}, and each switch starts with an @samp{@@} instead of the
5688 @samp{-}, without spaces between multiple switches.  This is supposed to
5689 ease shell-processing.
5690
5691 @item -print-multi-os-directory
5692 @opindex print-multi-os-directory
5693 Print the path to OS libraries for the selected
5694 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
5695 present in the @file{lib} subdirectory and no multilibs are used, this is
5696 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
5697 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
5698 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
5699 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
5700
5701 @item -print-prog-name=@var{program}
5702 @opindex print-prog-name
5703 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5704
5705 @item -print-libgcc-file-name
5706 @opindex print-libgcc-file-name
5707 Same as @option{-print-file-name=libgcc.a}.
5708
5709 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5710 but you do want to link with @file{libgcc.a}.  You can do
5711
5712 @smallexample
5713 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5714 @end smallexample
5715
5716 @item -print-search-dirs
5717 @opindex print-search-dirs
5718 Print the name of the configured installation directory and a list of
5719 program and library directories @command{gcc} will search---and don't do anything else.
5720
5721 This is useful when @command{gcc} prints the error message
5722 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5723 To resolve this you either need to put @file{cpp0} and the other compiler
5724 components where @command{gcc} expects to find them, or you can set the environment
5725 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5726 Don't forget the trailing @samp{/}.
5727 @xref{Environment Variables}.
5728
5729 @item -print-sysroot
5730 @opindex print-sysroot
5731 Print the target sysroot directory that will be used during
5732 compilation.  This is the target sysroot specified either at configure
5733 time or using the @option{--sysroot} option, possibly with an extra
5734 suffix that depends on compilation options.  If no target sysroot is
5735 specified, the option prints nothing.
5736
5737 @item -print-sysroot-headers-suffix
5738 @opindex print-sysroot-headers-suffix
5739 Print the suffix added to the target sysroot when searching for
5740 headers, or give an error if the compiler is not configured with such
5741 a suffix---and don't do anything else.
5742
5743 @item -dumpmachine
5744 @opindex dumpmachine
5745 Print the compiler's target machine (for example,
5746 @samp{i686-pc-linux-gnu})---and don't do anything else.
5747
5748 @item -dumpversion
5749 @opindex dumpversion
5750 Print the compiler version (for example, @samp{3.0})---and don't do
5751 anything else.
5752
5753 @item -dumpspecs
5754 @opindex dumpspecs
5755 Print the compiler's built-in specs---and don't do anything else.  (This
5756 is used when GCC itself is being built.)  @xref{Spec Files}.
5757
5758 @item -feliminate-unused-debug-types
5759 @opindex feliminate-unused-debug-types
5760 Normally, when producing DWARF2 output, GCC will emit debugging
5761 information for all types declared in a compilation
5762 unit, regardless of whether or not they are actually used
5763 in that compilation unit.  Sometimes this is useful, such as
5764 if, in the debugger, you want to cast a value to a type that is
5765 not actually used in your program (but is declared).  More often,
5766 however, this results in a significant amount of wasted space.
5767 With this option, GCC will avoid producing debug symbol output
5768 for types that are nowhere used in the source file being compiled.
5769 @end table
5770
5771 @node Optimize Options
5772 @section Options That Control Optimization
5773 @cindex optimize options
5774 @cindex options, optimization
5775
5776 These options control various sorts of optimizations.
5777
5778 Without any optimization option, the compiler's goal is to reduce the
5779 cost of compilation and to make debugging produce the expected
5780 results.  Statements are independent: if you stop the program with a
5781 breakpoint between statements, you can then assign a new value to any
5782 variable or change the program counter to any other statement in the
5783 function and get exactly the results you would expect from the source
5784 code.
5785
5786 Turning on optimization flags makes the compiler attempt to improve
5787 the performance and/or code size at the expense of compilation time
5788 and possibly the ability to debug the program.
5789
5790 The compiler performs optimization based on the knowledge it has of the
5791 program.  Compiling multiple files at once to a single output file mode allows
5792 the compiler to use information gained from all of the files when compiling
5793 each of them.
5794
5795 Not all optimizations are controlled directly by a flag.  Only
5796 optimizations that have a flag are listed in this section.
5797
5798 Most optimizations are only enabled if an @option{-O} level is set on
5799 the command line.  Otherwise they are disabled, even if individual             
5800 optimization flags are specified.
5801
5802 Depending on the target and how GCC was configured, a slightly different
5803 set of optimizations may be enabled at each @option{-O} level than
5804 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
5805 to find out the exact set of optimizations that are enabled at each level.
5806 @xref{Overall Options}, for examples.
5807
5808 @table @gcctabopt
5809 @item -O
5810 @itemx -O1
5811 @opindex O
5812 @opindex O1
5813 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5814 more memory for a large function.
5815
5816 With @option{-O}, the compiler tries to reduce code size and execution
5817 time, without performing any optimizations that take a great deal of
5818 compilation time.
5819
5820 @option{-O} turns on the following optimization flags:
5821 @gccoptlist{
5822 -fauto-inc-dec @gol
5823 -fcprop-registers @gol
5824 -fdce @gol
5825 -fdefer-pop @gol
5826 -fdelayed-branch @gol
5827 -fdse @gol
5828 -fguess-branch-probability @gol
5829 -fif-conversion2 @gol
5830 -fif-conversion @gol
5831 -fipa-pure-const @gol
5832 -fipa-profile @gol
5833 -fipa-reference @gol
5834 -fmerge-constants
5835 -fsplit-wide-types @gol
5836 -ftree-builtin-call-dce @gol
5837 -ftree-ccp @gol
5838 -ftree-ch @gol
5839 -ftree-copyrename @gol
5840 -ftree-dce @gol
5841 -ftree-dominator-opts @gol
5842 -ftree-dse @gol
5843 -ftree-forwprop @gol
5844 -ftree-fre @gol
5845 -ftree-phiprop @gol
5846 -ftree-sra @gol
5847 -ftree-pta @gol
5848 -ftree-ter @gol
5849 -funit-at-a-time}
5850
5851 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5852 where doing so does not interfere with debugging.
5853
5854 @item -O2
5855 @opindex O2
5856 Optimize even more.  GCC performs nearly all supported optimizations
5857 that do not involve a space-speed tradeoff.
5858 As compared to @option{-O}, this option increases both compilation time
5859 and the performance of the generated code.
5860
5861 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5862 also turns on the following optimization flags:
5863 @gccoptlist{-fthread-jumps @gol
5864 -falign-functions  -falign-jumps @gol
5865 -falign-loops  -falign-labels @gol
5866 -fcaller-saves @gol
5867 -fcrossjumping @gol
5868 -fcse-follow-jumps  -fcse-skip-blocks @gol
5869 -fdelete-null-pointer-checks @gol
5870 -fexpensive-optimizations @gol
5871 -fgcse  -fgcse-lm  @gol
5872 -finline-small-functions @gol
5873 -findirect-inlining @gol
5874 -fipa-sra @gol
5875 -foptimize-sibling-calls @gol
5876 -fpartial-inlining @gol
5877 -fpeephole2 @gol
5878 -fregmove @gol
5879 -freorder-blocks  -freorder-functions @gol
5880 -frerun-cse-after-loop  @gol
5881 -fsched-interblock  -fsched-spec @gol
5882 -fschedule-insns  -fschedule-insns2 @gol
5883 -fstrict-aliasing -fstrict-overflow @gol
5884 -ftree-switch-conversion @gol
5885 -ftree-pre @gol
5886 -ftree-vrp}
5887
5888 Please note the warning under @option{-fgcse} about
5889 invoking @option{-O2} on programs that use computed gotos.
5890
5891 @item -O3
5892 @opindex O3
5893 Optimize yet more.  @option{-O3} turns on all optimizations specified
5894 by @option{-O2} and also turns on the @option{-finline-functions},
5895 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5896 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5897
5898 @item -O0
5899 @opindex O0
5900 Reduce compilation time and make debugging produce the expected
5901 results.  This is the default.
5902
5903 @item -Os
5904 @opindex Os
5905 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5906 do not typically increase code size.  It also performs further
5907 optimizations designed to reduce code size.
5908
5909 @option{-Os} disables the following optimization flags:
5910 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5911 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5912 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5913
5914 @item -Ofast
5915 @opindex Ofast
5916 Disregard strict standards compliance.  @option{-Ofast} enables all
5917 @option{-O3} optimizations.  It also enables optimizations that are not
5918 valid for all standard compliant programs.
5919 It turns on @option{-ffast-math}.
5920
5921 If you use multiple @option{-O} options, with or without level numbers,
5922 the last such option is the one that is effective.
5923 @end table
5924
5925 Options of the form @option{-f@var{flag}} specify machine-independent
5926 flags.  Most flags have both positive and negative forms; the negative
5927 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5928 below, only one of the forms is listed---the one you typically will
5929 use.  You can figure out the other form by either removing @samp{no-}
5930 or adding it.
5931
5932 The following options control specific optimizations.  They are either
5933 activated by @option{-O} options or are related to ones that are.  You
5934 can use the following flags in the rare cases when ``fine-tuning'' of
5935 optimizations to be performed is desired.
5936
5937 @table @gcctabopt
5938 @item -fno-default-inline
5939 @opindex fno-default-inline
5940 Do not make member functions inline by default merely because they are
5941 defined inside the class scope (C++ only).  Otherwise, when you specify
5942 @w{@option{-O}}, member functions defined inside class scope are compiled
5943 inline by default; i.e., you don't need to add @samp{inline} in front of
5944 the member function name.
5945
5946 @item -fno-defer-pop
5947 @opindex fno-defer-pop
5948 Always pop the arguments to each function call as soon as that function
5949 returns.  For machines which must pop arguments after a function call,
5950 the compiler normally lets arguments accumulate on the stack for several
5951 function calls and pops them all at once.
5952
5953 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5954
5955 @item -fforward-propagate
5956 @opindex fforward-propagate
5957 Perform a forward propagation pass on RTL@.  The pass tries to combine two
5958 instructions and checks if the result can be simplified.  If loop unrolling
5959 is active, two passes are performed and the second is scheduled after
5960 loop unrolling.
5961
5962 This option is enabled by default at optimization levels @option{-O},
5963 @option{-O2}, @option{-O3}, @option{-Os}.
5964
5965 @item -fomit-frame-pointer
5966 @opindex fomit-frame-pointer
5967 Don't keep the frame pointer in a register for functions that
5968 don't need one.  This avoids the instructions to save, set up and
5969 restore frame pointers; it also makes an extra register available
5970 in many functions.  @strong{It also makes debugging impossible on
5971 some machines.}
5972
5973 On some machines, such as the VAX, this flag has no effect, because
5974 the standard calling sequence automatically handles the frame pointer
5975 and nothing is saved by pretending it doesn't exist.  The
5976 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5977 whether a target machine supports this flag.  @xref{Registers,,Register
5978 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5979
5980 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5981
5982 @item -foptimize-sibling-calls
5983 @opindex foptimize-sibling-calls
5984 Optimize sibling and tail recursive calls.
5985
5986 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5987
5988 @item -fno-inline
5989 @opindex fno-inline
5990 Don't pay attention to the @code{inline} keyword.  Normally this option
5991 is used to keep the compiler from expanding any functions inline.
5992 Note that if you are not optimizing, no functions can be expanded inline.
5993
5994 @item -finline-small-functions
5995 @opindex finline-small-functions
5996 Integrate functions into their callers when their body is smaller than expected
5997 function call code (so overall size of program gets smaller).  The compiler
5998 heuristically decides which functions are simple enough to be worth integrating
5999 in this way.
6000
6001 Enabled at level @option{-O2}.
6002
6003 @item -findirect-inlining
6004 @opindex findirect-inlining
6005 Inline also indirect calls that are discovered to be known at compile
6006 time thanks to previous inlining.  This option has any effect only
6007 when inlining itself is turned on by the @option{-finline-functions}
6008 or @option{-finline-small-functions} options.
6009
6010 Enabled at level @option{-O2}.
6011
6012 @item -finline-functions
6013 @opindex finline-functions
6014 Integrate all simple functions into their callers.  The compiler
6015 heuristically decides which functions are simple enough to be worth
6016 integrating in this way.
6017
6018 If all calls to a given function are integrated, and the function is
6019 declared @code{static}, then the function is normally not output as
6020 assembler code in its own right.
6021
6022 Enabled at level @option{-O3}.
6023
6024 @item -finline-functions-called-once
6025 @opindex finline-functions-called-once
6026 Consider all @code{static} functions called once for inlining into their
6027 caller even if they are not marked @code{inline}.  If a call to a given
6028 function is integrated, then the function is not output as assembler code
6029 in its own right.
6030
6031 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6032
6033 @item -fearly-inlining
6034 @opindex fearly-inlining
6035 Inline functions marked by @code{always_inline} and functions whose body seems
6036 smaller than the function call overhead early before doing
6037 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6038 makes profiling significantly cheaper and usually inlining faster on programs
6039 having large chains of nested wrapper functions.
6040
6041 Enabled by default.
6042
6043 @item -fipa-sra
6044 @opindex fipa-sra
6045 Perform interprocedural scalar replacement of aggregates, removal of
6046 unused parameters and replacement of parameters passed by reference
6047 by parameters passed by value.
6048
6049 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6050
6051 @item -finline-limit=@var{n}
6052 @opindex finline-limit
6053 By default, GCC limits the size of functions that can be inlined.  This flag
6054 allows coarse control of this limit.  @var{n} is the size of functions that
6055 can be inlined in number of pseudo instructions.
6056
6057 Inlining is actually controlled by a number of parameters, which may be
6058 specified individually by using @option{--param @var{name}=@var{value}}.
6059 The @option{-finline-limit=@var{n}} option sets some of these parameters
6060 as follows:
6061
6062 @table @gcctabopt
6063 @item max-inline-insns-single
6064 is set to @var{n}/2.
6065 @item max-inline-insns-auto
6066 is set to @var{n}/2.
6067 @end table
6068
6069 See below for a documentation of the individual
6070 parameters controlling inlining and for the defaults of these parameters.
6071
6072 @emph{Note:} there may be no value to @option{-finline-limit} that results
6073 in default behavior.
6074
6075 @emph{Note:} pseudo instruction represents, in this particular context, an
6076 abstract measurement of function's size.  In no way does it represent a count
6077 of assembly instructions and as such its exact meaning might change from one
6078 release to an another.
6079
6080 @item -fkeep-inline-functions
6081 @opindex fkeep-inline-functions
6082 In C, emit @code{static} functions that are declared @code{inline}
6083 into the object file, even if the function has been inlined into all
6084 of its callers.  This switch does not affect functions using the
6085 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6086 inline functions into the object file.
6087
6088 @item -fkeep-static-consts
6089 @opindex fkeep-static-consts
6090 Emit variables declared @code{static const} when optimization isn't turned
6091 on, even if the variables aren't referenced.
6092
6093 GCC enables this option by default.  If you want to force the compiler to
6094 check if the variable was referenced, regardless of whether or not
6095 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6096
6097 @item -fmerge-constants
6098 @opindex fmerge-constants
6099 Attempt to merge identical constants (string constants and floating point
6100 constants) across compilation units.
6101
6102 This option is the default for optimized compilation if the assembler and
6103 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6104 behavior.
6105
6106 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6107
6108 @item -fmerge-all-constants
6109 @opindex fmerge-all-constants
6110 Attempt to merge identical constants and identical variables.
6111
6112 This option implies @option{-fmerge-constants}.  In addition to
6113 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6114 arrays or initialized constant variables with integral or floating point
6115 types.  Languages like C or C++ require each variable, including multiple
6116 instances of the same variable in recursive calls, to have distinct locations,
6117 so using this option will result in non-conforming
6118 behavior.
6119
6120 @item -fmodulo-sched
6121 @opindex fmodulo-sched
6122 Perform swing modulo scheduling immediately before the first scheduling
6123 pass.  This pass looks at innermost loops and reorders their
6124 instructions by overlapping different iterations.
6125
6126 @item -fmodulo-sched-allow-regmoves
6127 @opindex fmodulo-sched-allow-regmoves
6128 Perform more aggressive SMS based modulo scheduling with register moves
6129 allowed.  By setting this flag certain anti-dependences edges will be
6130 deleted which will trigger the generation of reg-moves based on the
6131 life-range analysis.  This option is effective only with
6132 @option{-fmodulo-sched} enabled.
6133
6134 @item -fno-branch-count-reg
6135 @opindex fno-branch-count-reg
6136 Do not use ``decrement and branch'' instructions on a count register,
6137 but instead generate a sequence of instructions that decrement a
6138 register, compare it against zero, then branch based upon the result.
6139 This option is only meaningful on architectures that support such
6140 instructions, which include x86, PowerPC, IA-64 and S/390.
6141
6142 The default is @option{-fbranch-count-reg}.
6143
6144 @item -fno-function-cse
6145 @opindex fno-function-cse
6146 Do not put function addresses in registers; make each instruction that
6147 calls a constant function contain the function's address explicitly.
6148
6149 This option results in less efficient code, but some strange hacks
6150 that alter the assembler output may be confused by the optimizations
6151 performed when this option is not used.
6152
6153 The default is @option{-ffunction-cse}
6154
6155 @item -fno-zero-initialized-in-bss
6156 @opindex fno-zero-initialized-in-bss
6157 If the target supports a BSS section, GCC by default puts variables that
6158 are initialized to zero into BSS@.  This can save space in the resulting
6159 code.
6160
6161 This option turns off this behavior because some programs explicitly
6162 rely on variables going to the data section.  E.g., so that the
6163 resulting executable can find the beginning of that section and/or make
6164 assumptions based on that.
6165
6166 The default is @option{-fzero-initialized-in-bss}.
6167
6168 @item -fmudflap -fmudflapth -fmudflapir
6169 @opindex fmudflap
6170 @opindex fmudflapth
6171 @opindex fmudflapir
6172 @cindex bounds checking
6173 @cindex mudflap
6174 For front-ends that support it (C and C++), instrument all risky
6175 pointer/array dereferencing operations, some standard library
6176 string/heap functions, and some other associated constructs with
6177 range/validity tests.  Modules so instrumented should be immune to
6178 buffer overflows, invalid heap use, and some other classes of C/C++
6179 programming errors.  The instrumentation relies on a separate runtime
6180 library (@file{libmudflap}), which will be linked into a program if
6181 @option{-fmudflap} is given at link time.  Run-time behavior of the
6182 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6183 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6184 for its options.
6185
6186 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6187 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6188 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6189 instrumentation should ignore pointer reads.  This produces less
6190 instrumentation (and therefore faster execution) and still provides
6191 some protection against outright memory corrupting writes, but allows
6192 erroneously read data to propagate within a program.
6193
6194 @item -fthread-jumps
6195 @opindex fthread-jumps
6196 Perform optimizations where we check to see if a jump branches to a
6197 location where another comparison subsumed by the first is found.  If
6198 so, the first branch is redirected to either the destination of the
6199 second branch or a point immediately following it, depending on whether
6200 the condition is known to be true or false.
6201
6202 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6203
6204 @item -fsplit-wide-types
6205 @opindex fsplit-wide-types
6206 When using a type that occupies multiple registers, such as @code{long
6207 long} on a 32-bit system, split the registers apart and allocate them
6208 independently.  This normally generates better code for those types,
6209 but may make debugging more difficult.
6210
6211 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6212 @option{-Os}.
6213
6214 @item -fcse-follow-jumps
6215 @opindex fcse-follow-jumps
6216 In common subexpression elimination (CSE), scan through jump instructions
6217 when the target of the jump is not reached by any other path.  For
6218 example, when CSE encounters an @code{if} statement with an
6219 @code{else} clause, CSE will follow the jump when the condition
6220 tested is false.
6221
6222 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6223
6224 @item -fcse-skip-blocks
6225 @opindex fcse-skip-blocks
6226 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6227 follow jumps which conditionally skip over blocks.  When CSE
6228 encounters a simple @code{if} statement with no else clause,
6229 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6230 body of the @code{if}.
6231
6232 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6233
6234 @item -frerun-cse-after-loop
6235 @opindex frerun-cse-after-loop
6236 Re-run common subexpression elimination after loop optimizations has been
6237 performed.
6238
6239 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6240
6241 @item -fgcse
6242 @opindex fgcse
6243 Perform a global common subexpression elimination pass.
6244 This pass also performs global constant and copy propagation.
6245
6246 @emph{Note:} When compiling a program using computed gotos, a GCC
6247 extension, you may get better runtime performance if you disable
6248 the global common subexpression elimination pass by adding
6249 @option{-fno-gcse} to the command line.
6250
6251 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6252
6253 @item -fgcse-lm
6254 @opindex fgcse-lm
6255 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
6256 attempt to move loads which are only killed by stores into themselves.  This
6257 allows a loop containing a load/store sequence to be changed to a load outside
6258 the loop, and a copy/store within the loop.
6259
6260 Enabled by default when gcse is enabled.
6261
6262 @item -fgcse-sm
6263 @opindex fgcse-sm
6264 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6265 global common subexpression elimination.  This pass will attempt to move
6266 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6267 loops containing a load/store sequence can be changed to a load before
6268 the loop and a store after the loop.
6269
6270 Not enabled at any optimization level.
6271
6272 @item -fgcse-las
6273 @opindex fgcse-las
6274 When @option{-fgcse-las} is enabled, the global common subexpression
6275 elimination pass eliminates redundant loads that come after stores to the
6276 same memory location (both partial and full redundancies).
6277
6278 Not enabled at any optimization level.
6279
6280 @item -fgcse-after-reload
6281 @opindex fgcse-after-reload
6282 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6283 pass is performed after reload.  The purpose of this pass is to cleanup
6284 redundant spilling.
6285
6286 @item -funsafe-loop-optimizations
6287 @opindex funsafe-loop-optimizations
6288 If given, the loop optimizer will assume that loop indices do not
6289 overflow, and that the loops with nontrivial exit condition are not
6290 infinite.  This enables a wider range of loop optimizations even if
6291 the loop optimizer itself cannot prove that these assumptions are valid.
6292 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6293 if it finds this kind of loop.
6294
6295 @item -fcrossjumping
6296 @opindex fcrossjumping
6297 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6298 resulting code may or may not perform better than without cross-jumping.
6299
6300 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6301
6302 @item -fauto-inc-dec
6303 @opindex fauto-inc-dec
6304 Combine increments or decrements of addresses with memory accesses.
6305 This pass is always skipped on architectures that do not have
6306 instructions to support this.  Enabled by default at @option{-O} and
6307 higher on architectures that support this.
6308
6309 @item -fdce
6310 @opindex fdce
6311 Perform dead code elimination (DCE) on RTL@.
6312 Enabled by default at @option{-O} and higher.
6313
6314 @item -fdse
6315 @opindex fdse
6316 Perform dead store elimination (DSE) on RTL@.
6317 Enabled by default at @option{-O} and higher.
6318
6319 @item -fif-conversion
6320 @opindex fif-conversion
6321 Attempt to transform conditional jumps into branch-less equivalents.  This
6322 include use of conditional moves, min, max, set flags and abs instructions, and
6323 some tricks doable by standard arithmetics.  The use of conditional execution
6324 on chips where it is available is controlled by @code{if-conversion2}.
6325
6326 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6327
6328 @item -fif-conversion2
6329 @opindex fif-conversion2
6330 Use conditional execution (where available) to transform conditional jumps into
6331 branch-less equivalents.
6332
6333 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6334
6335 @item -fdelete-null-pointer-checks
6336 @opindex fdelete-null-pointer-checks
6337 Assume that programs cannot safely dereference null pointers, and that
6338 no code or data element resides there.  This enables simple constant
6339 folding optimizations at all optimization levels.  In addition, other
6340 optimization passes in GCC use this flag to control global dataflow
6341 analyses that eliminate useless checks for null pointers; these assume
6342 that if a pointer is checked after it has already been dereferenced,
6343 it cannot be null.
6344
6345 Note however that in some environments this assumption is not true.
6346 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6347 for programs which depend on that behavior.
6348
6349 Some targets, especially embedded ones, disable this option at all levels.
6350 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6351 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6352 are enabled independently at different optimization levels.
6353
6354 @item -fexpensive-optimizations
6355 @opindex fexpensive-optimizations
6356 Perform a number of minor optimizations that are relatively expensive.
6357
6358 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6359
6360 @item -foptimize-register-move
6361 @itemx -fregmove
6362 @opindex foptimize-register-move
6363 @opindex fregmove
6364 Attempt to reassign register numbers in move instructions and as
6365 operands of other simple instructions in order to maximize the amount of
6366 register tying.  This is especially helpful on machines with two-operand
6367 instructions.
6368
6369 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6370 optimization.
6371
6372 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6373
6374 @item -fira-algorithm=@var{algorithm}
6375 Use specified coloring algorithm for the integrated register
6376 allocator.  The @var{algorithm} argument should be @code{priority} or
6377 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6378 the second one specifies Chaitin-Briggs coloring.  The second
6379 algorithm can be unimplemented for some architectures.  If it is
6380 implemented, it is the default because Chaitin-Briggs coloring as a
6381 rule generates a better code.
6382
6383 @item -fira-region=@var{region}
6384 Use specified regions for the integrated register allocator.  The
6385 @var{region} argument should be one of @code{all}, @code{mixed}, or
6386 @code{one}.  The first value means using all loops as register
6387 allocation regions, the second value which is the default means using
6388 all loops except for loops with small register pressure as the
6389 regions, and third one means using all function as a single region.
6390 The first value can give best result for machines with small size and
6391 irregular register set, the third one results in faster and generates
6392 decent code and the smallest size code, and the default value usually
6393 give the best results in most cases and for most architectures.
6394
6395 @item -fira-coalesce
6396 @opindex fira-coalesce
6397 Do optimistic register coalescing.  This option might be profitable for
6398 architectures with big regular register files.
6399
6400 @item -fira-loop-pressure
6401 @opindex fira-loop-pressure
6402 Use IRA to evaluate register pressure in loops for decision to move
6403 loop invariants.  Usage of this option usually results in generation
6404 of faster and smaller code on machines with big register files (>= 32
6405 registers) but it can slow compiler down.
6406
6407 This option is enabled at level @option{-O3} for some targets.
6408
6409 @item -fno-ira-share-save-slots
6410 @opindex fno-ira-share-save-slots
6411 Switch off sharing stack slots used for saving call used hard
6412 registers living through a call.  Each hard register will get a
6413 separate stack slot and as a result function stack frame will be
6414 bigger.
6415
6416 @item -fno-ira-share-spill-slots
6417 @opindex fno-ira-share-spill-slots
6418 Switch off sharing stack slots allocated for pseudo-registers.  Each
6419 pseudo-register which did not get a hard register will get a separate
6420 stack slot and as a result function stack frame will be bigger.
6421
6422 @item -fira-verbose=@var{n}
6423 @opindex fira-verbose
6424 Set up how verbose dump file for the integrated register allocator
6425 will be.  Default value is 5.  If the value is greater or equal to 10,
6426 the dump file will be stderr as if the value were @var{n} minus 10.
6427
6428 @item -fdelayed-branch
6429 @opindex fdelayed-branch
6430 If supported for the target machine, attempt to reorder instructions
6431 to exploit instruction slots available after delayed branch
6432 instructions.
6433
6434 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6435
6436 @item -fschedule-insns
6437 @opindex fschedule-insns
6438 If supported for the target machine, attempt to reorder instructions to
6439 eliminate execution stalls due to required data being unavailable.  This
6440 helps machines that have slow floating point or memory load instructions
6441 by allowing other instructions to be issued until the result of the load
6442 or floating point instruction is required.
6443
6444 Enabled at levels @option{-O2}, @option{-O3}.
6445
6446 @item -fschedule-insns2
6447 @opindex fschedule-insns2
6448 Similar to @option{-fschedule-insns}, but requests an additional pass of
6449 instruction scheduling after register allocation has been done.  This is
6450 especially useful on machines with a relatively small number of
6451 registers and where memory load instructions take more than one cycle.
6452
6453 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6454
6455 @item -fno-sched-interblock
6456 @opindex fno-sched-interblock
6457 Don't schedule instructions across basic blocks.  This is normally
6458 enabled by default when scheduling before register allocation, i.e.@:
6459 with @option{-fschedule-insns} or at @option{-O2} or higher.
6460
6461 @item -fno-sched-spec
6462 @opindex fno-sched-spec
6463 Don't allow speculative motion of non-load instructions.  This is normally
6464 enabled by default when scheduling before register allocation, i.e.@:
6465 with @option{-fschedule-insns} or at @option{-O2} or higher.
6466
6467 @item -fsched-pressure
6468 @opindex fsched-pressure
6469 Enable register pressure sensitive insn scheduling before the register
6470 allocation.  This only makes sense when scheduling before register
6471 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6472 @option{-O2} or higher.  Usage of this option can improve the
6473 generated code and decrease its size by preventing register pressure
6474 increase above the number of available hard registers and as a
6475 consequence register spills in the register allocation.
6476
6477 @item -fsched-spec-load
6478 @opindex fsched-spec-load
6479 Allow speculative motion of some load instructions.  This only makes
6480 sense when scheduling before register allocation, i.e.@: with
6481 @option{-fschedule-insns} or at @option{-O2} or higher.
6482
6483 @item -fsched-spec-load-dangerous
6484 @opindex fsched-spec-load-dangerous
6485 Allow speculative motion of more load instructions.  This only makes
6486 sense when scheduling before register allocation, i.e.@: with
6487 @option{-fschedule-insns} or at @option{-O2} or higher.
6488
6489 @item -fsched-stalled-insns
6490 @itemx -fsched-stalled-insns=@var{n}
6491 @opindex fsched-stalled-insns
6492 Define how many insns (if any) can be moved prematurely from the queue
6493 of stalled insns into the ready list, during the second scheduling pass.
6494 @option{-fno-sched-stalled-insns} means that no insns will be moved
6495 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6496 on how many queued insns can be moved prematurely.
6497 @option{-fsched-stalled-insns} without a value is equivalent to
6498 @option{-fsched-stalled-insns=1}.
6499
6500 @item -fsched-stalled-insns-dep
6501 @itemx -fsched-stalled-insns-dep=@var{n}
6502 @opindex fsched-stalled-insns-dep
6503 Define how many insn groups (cycles) will be examined for a dependency
6504 on a stalled insn that is candidate for premature removal from the queue
6505 of stalled insns.  This has an effect only during the second scheduling pass,
6506 and only if @option{-fsched-stalled-insns} is used.
6507 @option{-fno-sched-stalled-insns-dep} is equivalent to
6508 @option{-fsched-stalled-insns-dep=0}.
6509 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6510 @option{-fsched-stalled-insns-dep=1}.
6511
6512 @item -fsched2-use-superblocks
6513 @opindex fsched2-use-superblocks
6514 When scheduling after register allocation, do use superblock scheduling
6515 algorithm.  Superblock scheduling allows motion across basic block boundaries
6516 resulting on faster schedules.  This option is experimental, as not all machine
6517 descriptions used by GCC model the CPU closely enough to avoid unreliable
6518 results from the algorithm.
6519
6520 This only makes sense when scheduling after register allocation, i.e.@: with
6521 @option{-fschedule-insns2} or at @option{-O2} or higher.
6522
6523 @item -fsched-group-heuristic
6524 @opindex fsched-group-heuristic
6525 Enable the group heuristic in the scheduler.  This heuristic favors 
6526 the instruction that belongs to a schedule group.  This is enabled 
6527 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6528 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6529
6530 @item -fsched-critical-path-heuristic
6531 @opindex fsched-critical-path-heuristic
6532 Enable the critical-path heuristic in the scheduler.  This heuristic favors 
6533 instructions on the critical path.  This is enabled by default when 
6534 scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6535 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6536
6537 @item -fsched-spec-insn-heuristic
6538 @opindex fsched-spec-insn-heuristic
6539 Enable the speculative instruction heuristic in the scheduler.  This 
6540 heuristic favors speculative instructions with greater dependency weakness.  
6541 This is enabled by default when scheduling is enabled, i.e.@: 
6542 with @option{-fschedule-insns} or @option{-fschedule-insns2} 
6543 or at @option{-O2} or higher.
6544
6545 @item -fsched-rank-heuristic
6546 @opindex fsched-rank-heuristic
6547 Enable the rank heuristic in the scheduler.  This heuristic favors 
6548 the instruction belonging to a basic block with greater size or frequency.  
6549 This is enabled by default when scheduling is enabled, i.e.@: 
6550 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6551 at @option{-O2} or higher.
6552
6553 @item -fsched-last-insn-heuristic
6554 @opindex fsched-last-insn-heuristic
6555 Enable the last-instruction heuristic in the scheduler.  This heuristic 
6556 favors the instruction that is less dependent on the last instruction
6557 scheduled.  This is enabled by default when scheduling is enabled, 
6558 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6559 at @option{-O2} or higher.
6560
6561 @item -fsched-dep-count-heuristic
6562 @opindex fsched-dep-count-heuristic
6563 Enable the dependent-count heuristic in the scheduler.  This heuristic 
6564 favors the instruction that has more instructions depending on it.  
6565 This is enabled by default when scheduling is enabled, i.e.@: 
6566 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6567 at @option{-O2} or higher.
6568
6569 @item -freschedule-modulo-scheduled-loops
6570 @opindex freschedule-modulo-scheduled-loops
6571 The modulo scheduling comes before the traditional scheduling, if a loop
6572 was modulo scheduled we may want to prevent the later scheduling passes
6573 from changing its schedule, we use this option to control that.
6574
6575 @item -fselective-scheduling
6576 @opindex fselective-scheduling
6577 Schedule instructions using selective scheduling algorithm.  Selective
6578 scheduling runs instead of the first scheduler pass.
6579
6580 @item -fselective-scheduling2
6581 @opindex fselective-scheduling2
6582 Schedule instructions using selective scheduling algorithm.  Selective
6583 scheduling runs instead of the second scheduler pass.
6584
6585 @item -fsel-sched-pipelining
6586 @opindex fsel-sched-pipelining
6587 Enable software pipelining of innermost loops during selective scheduling.
6588 This option has no effect until one of @option{-fselective-scheduling} or
6589 @option{-fselective-scheduling2} is turned on.
6590
6591 @item -fsel-sched-pipelining-outer-loops
6592 @opindex fsel-sched-pipelining-outer-loops
6593 When pipelining loops during selective scheduling, also pipeline outer loops.
6594 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6595
6596 @item -fcaller-saves
6597 @opindex fcaller-saves
6598 Enable values to be allocated in registers that will be clobbered by
6599 function calls, by emitting extra instructions to save and restore the
6600 registers around such calls.  Such allocation is done only when it
6601 seems to result in better code than would otherwise be produced.
6602
6603 This option is always enabled by default on certain machines, usually
6604 those which have no call-preserved registers to use instead.
6605
6606 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6607
6608 @item -fconserve-stack
6609 @opindex fconserve-stack
6610 Attempt to minimize stack usage.  The compiler will attempt to use less
6611 stack space, even if that makes the program slower.  This option
6612 implies setting the @option{large-stack-frame} parameter to 100
6613 and the @option{large-stack-frame-growth} parameter to 400.
6614
6615 @item -ftree-reassoc
6616 @opindex ftree-reassoc
6617 Perform reassociation on trees.  This flag is enabled by default
6618 at @option{-O} and higher.
6619
6620 @item -ftree-pre
6621 @opindex ftree-pre
6622 Perform partial redundancy elimination (PRE) on trees.  This flag is
6623 enabled by default at @option{-O2} and @option{-O3}.
6624
6625 @item -ftree-forwprop
6626 @opindex ftree-forwprop
6627 Perform forward propagation on trees.  This flag is enabled by default
6628 at @option{-O} and higher.
6629
6630 @item -ftree-fre
6631 @opindex ftree-fre
6632 Perform full redundancy elimination (FRE) on trees.  The difference
6633 between FRE and PRE is that FRE only considers expressions
6634 that are computed on all paths leading to the redundant computation.
6635 This analysis is faster than PRE, though it exposes fewer redundancies.
6636 This flag is enabled by default at @option{-O} and higher.
6637
6638 @item -ftree-phiprop
6639 @opindex ftree-phiprop
6640 Perform hoisting of loads from conditional pointers on trees.  This
6641 pass is enabled by default at @option{-O} and higher.
6642
6643 @item -ftree-copy-prop
6644 @opindex ftree-copy-prop
6645 Perform copy propagation on trees.  This pass eliminates unnecessary
6646 copy operations.  This flag is enabled by default at @option{-O} and
6647 higher.
6648
6649 @item -fipa-pure-const
6650 @opindex fipa-pure-const
6651 Discover which functions are pure or constant.
6652 Enabled by default at @option{-O} and higher.
6653
6654 @item -fipa-reference
6655 @opindex fipa-reference
6656 Discover which static variables do not escape cannot escape the
6657 compilation unit.
6658 Enabled by default at @option{-O} and higher.
6659
6660 @item -fipa-struct-reorg
6661 @opindex fipa-struct-reorg
6662 Perform structure reorganization optimization, that change C-like structures
6663 layout in order to better utilize spatial locality.  This transformation is
6664 affective for programs containing arrays of structures.  Available in two
6665 compilation modes: profile-based (enabled with @option{-fprofile-generate})
6666 or static (which uses built-in heuristics).  It works only in whole program
6667 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
6668 enabled.  Structures considered @samp{cold} by this transformation are not
6669 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
6670
6671 With this flag, the program debug info reflects a new structure layout.
6672
6673 @item -fipa-pta
6674 @opindex fipa-pta
6675 Perform interprocedural pointer analysis and interprocedural modification
6676 and reference analysis.  This option can cause excessive memory and
6677 compile-time usage on large compilation units.  It is not enabled by
6678 default at any optimization level.
6679
6680 @item -fipa-profile
6681 @opindex fipa-profile
6682 Perform interprocedural profile propagation.  The functions called only from
6683 cold functions are marked as cold. Also functions executed once (such as
6684 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
6685 functions and loop less parts of functions executed once are then optimized for
6686 size.
6687 Enabled by default at @option{-O} and higher.
6688
6689 @item -fipa-cp
6690 @opindex fipa-cp
6691 Perform interprocedural constant propagation.
6692 This optimization analyzes the program to determine when values passed
6693 to functions are constants and then optimizes accordingly.
6694 This optimization can substantially increase performance
6695 if the application has constants passed to functions.
6696 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6697
6698 @item -fipa-cp-clone
6699 @opindex fipa-cp-clone
6700 Perform function cloning to make interprocedural constant propagation stronger.
6701 When enabled, interprocedural constant propagation will perform function cloning
6702 when externally visible function can be called with constant arguments.
6703 Because this optimization can create multiple copies of functions,
6704 it may significantly increase code size
6705 (see @option{--param ipcp-unit-growth=@var{value}}).
6706 This flag is enabled by default at @option{-O3}.
6707
6708 @item -fipa-matrix-reorg
6709 @opindex fipa-matrix-reorg
6710 Perform matrix flattening and transposing.
6711 Matrix flattening tries to replace an @math{m}-dimensional matrix
6712 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
6713 This reduces the level of indirection needed for accessing the elements
6714 of the matrix. The second optimization is matrix transposing that
6715 attempts to change the order of the matrix's dimensions in order to
6716 improve cache locality.
6717 Both optimizations need the @option{-fwhole-program} flag.
6718 Transposing is enabled only if profiling information is available.
6719
6720 @item -ftree-sink
6721 @opindex ftree-sink
6722 Perform forward store motion  on trees.  This flag is
6723 enabled by default at @option{-O} and higher.
6724
6725 @item -ftree-ccp
6726 @opindex ftree-ccp
6727 Perform sparse conditional constant propagation (CCP) on trees.  This
6728 pass only operates on local scalar variables and is enabled by default
6729 at @option{-O} and higher.
6730
6731 @item -ftree-switch-conversion
6732 Perform conversion of simple initializations in a switch to
6733 initializations from a scalar array.  This flag is enabled by default
6734 at @option{-O2} and higher.
6735
6736 @item -ftree-dce
6737 @opindex ftree-dce
6738 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6739 default at @option{-O} and higher.
6740
6741 @item -ftree-builtin-call-dce
6742 @opindex ftree-builtin-call-dce
6743 Perform conditional dead code elimination (DCE) for calls to builtin functions
6744 that may set @code{errno} but are otherwise side-effect free.  This flag is
6745 enabled by default at @option{-O2} and higher if @option{-Os} is not also
6746 specified.
6747
6748 @item -ftree-dominator-opts
6749 @opindex ftree-dominator-opts
6750 Perform a variety of simple scalar cleanups (constant/copy
6751 propagation, redundancy elimination, range propagation and expression
6752 simplification) based on a dominator tree traversal.  This also
6753 performs jump threading (to reduce jumps to jumps). This flag is
6754 enabled by default at @option{-O} and higher.
6755
6756 @item -ftree-dse
6757 @opindex ftree-dse
6758 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6759 a memory location which will later be overwritten by another store without
6760 any intervening loads.  In this case the earlier store can be deleted.  This
6761 flag is enabled by default at @option{-O} and higher.
6762
6763 @item -ftree-ch
6764 @opindex ftree-ch
6765 Perform loop header copying on trees.  This is beneficial since it increases
6766 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6767 is enabled by default at @option{-O} and higher.  It is not enabled
6768 for @option{-Os}, since it usually increases code size.
6769
6770 @item -ftree-loop-optimize
6771 @opindex ftree-loop-optimize
6772 Perform loop optimizations on trees.  This flag is enabled by default
6773 at @option{-O} and higher.
6774
6775 @item -ftree-loop-linear
6776 @opindex ftree-loop-linear
6777 Perform linear loop transformations on tree.  This flag can improve cache
6778 performance and allow further loop optimizations to take place.
6779
6780 @item -floop-interchange
6781 Perform loop interchange transformations on loops.  Interchanging two
6782 nested loops switches the inner and outer loops.  For example, given a
6783 loop like:
6784 @smallexample
6785 DO J = 1, M
6786   DO I = 1, N
6787     A(J, I) = A(J, I) * C
6788   ENDDO
6789 ENDDO
6790 @end smallexample
6791 loop interchange will transform the loop as if the user had written:
6792 @smallexample
6793 DO I = 1, N
6794   DO J = 1, M
6795     A(J, I) = A(J, I) * C
6796   ENDDO
6797 ENDDO
6798 @end smallexample
6799 which can be beneficial when @code{N} is larger than the caches,
6800 because in Fortran, the elements of an array are stored in memory
6801 contiguously by column, and the original loop iterates over rows,
6802 potentially creating at each access a cache miss.  This optimization
6803 applies to all the languages supported by GCC and is not limited to
6804 Fortran.  To use this code transformation, GCC has to be configured
6805 with @option{--with-ppl} and @option{--with-cloog} to enable the
6806 Graphite loop transformation infrastructure.
6807
6808 @item -floop-strip-mine
6809 Perform loop strip mining transformations on loops.  Strip mining
6810 splits a loop into two nested loops.  The outer loop has strides
6811 equal to the strip size and the inner loop has strides of the
6812 original loop within a strip.  The strip length can be changed
6813 using the @option{loop-block-tile-size} parameter.  For example,
6814 given a loop like:
6815 @smallexample
6816 DO I = 1, N
6817   A(I) = A(I) + C
6818 ENDDO
6819 @end smallexample
6820 loop strip mining will transform the loop as if the user had written:
6821 @smallexample
6822 DO II = 1, N, 51
6823   DO I = II, min (II + 50, N)
6824     A(I) = A(I) + C
6825   ENDDO
6826 ENDDO
6827 @end smallexample
6828 This optimization applies to all the languages supported by GCC and is
6829 not limited to Fortran.  To use this code transformation, GCC has to
6830 be configured with @option{--with-ppl} and @option{--with-cloog} to
6831 enable the Graphite loop transformation infrastructure.
6832
6833 @item -floop-block
6834 Perform loop blocking transformations on loops.  Blocking strip mines
6835 each loop in the loop nest such that the memory accesses of the
6836 element loops fit inside caches.  The strip length can be changed
6837 using the @option{loop-block-tile-size} parameter.  For example, given
6838 a loop like:
6839 @smallexample
6840 DO I = 1, N
6841   DO J = 1, M
6842     A(J, I) = B(I) + C(J)
6843   ENDDO
6844 ENDDO
6845 @end smallexample
6846 loop blocking will transform the loop as if the user had written:
6847 @smallexample
6848 DO II = 1, N, 51
6849   DO JJ = 1, M, 51
6850     DO I = II, min (II + 50, N)
6851       DO J = JJ, min (JJ + 50, M)
6852         A(J, I) = B(I) + C(J)
6853       ENDDO
6854     ENDDO
6855   ENDDO
6856 ENDDO
6857 @end smallexample
6858 which can be beneficial when @code{M} is larger than the caches,
6859 because the innermost loop will iterate over a smaller amount of data
6860 that can be kept in the caches.  This optimization applies to all the
6861 languages supported by GCC and is not limited to Fortran.  To use this
6862 code transformation, GCC has to be configured with @option{--with-ppl}
6863 and @option{--with-cloog} to enable the Graphite loop transformation
6864 infrastructure.
6865
6866 @item -fgraphite-identity
6867 @opindex fgraphite-identity
6868 Enable the identity transformation for graphite.  For every SCoP we generate
6869 the polyhedral representation and transform it back to gimple.  Using
6870 @option{-fgraphite-identity} we can check the costs or benefits of the
6871 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
6872 are also performed by the code generator CLooG, like index splitting and
6873 dead code elimination in loops.
6874
6875 @item -floop-parallelize-all
6876 Use the Graphite data dependence analysis to identify loops that can
6877 be parallelized.  Parallelize all the loops that can be analyzed to
6878 not contain loop carried dependences without checking that it is
6879 profitable to parallelize the loops.
6880
6881 @item -fcheck-data-deps
6882 @opindex fcheck-data-deps
6883 Compare the results of several data dependence analyzers.  This option
6884 is used for debugging the data dependence analyzers.
6885
6886 @item -ftree-loop-distribution
6887 Perform loop distribution.  This flag can improve cache performance on
6888 big loop bodies and allow further loop optimizations, like
6889 parallelization or vectorization, to take place.  For example, the loop
6890 @smallexample
6891 DO I = 1, N
6892   A(I) = B(I) + C
6893   D(I) = E(I) * F
6894 ENDDO
6895 @end smallexample
6896 is transformed to
6897 @smallexample
6898 DO I = 1, N
6899    A(I) = B(I) + C
6900 ENDDO
6901 DO I = 1, N
6902    D(I) = E(I) * F
6903 ENDDO
6904 @end smallexample
6905
6906 @item -ftree-loop-im
6907 @opindex ftree-loop-im
6908 Perform loop invariant motion on trees.  This pass moves only invariants that
6909 would be hard to handle at RTL level (function calls, operations that expand to
6910 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
6911 operands of conditions that are invariant out of the loop, so that we can use
6912 just trivial invariantness analysis in loop unswitching.  The pass also includes
6913 store motion.
6914
6915 @item -ftree-loop-ivcanon
6916 @opindex ftree-loop-ivcanon
6917 Create a canonical counter for number of iterations in the loop for that
6918 determining number of iterations requires complicated analysis.  Later
6919 optimizations then may determine the number easily.  Useful especially
6920 in connection with unrolling.
6921
6922 @item -fivopts
6923 @opindex fivopts
6924 Perform induction variable optimizations (strength reduction, induction
6925 variable merging and induction variable elimination) on trees.
6926
6927 @item -ftree-parallelize-loops=n
6928 @opindex ftree-parallelize-loops
6929 Parallelize loops, i.e., split their iteration space to run in n threads.
6930 This is only possible for loops whose iterations are independent
6931 and can be arbitrarily reordered.  The optimization is only
6932 profitable on multiprocessor machines, for loops that are CPU-intensive,
6933 rather than constrained e.g.@: by memory bandwidth.  This option
6934 implies @option{-pthread}, and thus is only supported on targets
6935 that have support for @option{-pthread}.
6936
6937 @item -ftree-pta
6938 @opindex ftree-pta
6939 Perform function-local points-to analysis on trees.  This flag is
6940 enabled by default at @option{-O} and higher.
6941
6942 @item -ftree-sra
6943 @opindex ftree-sra
6944 Perform scalar replacement of aggregates.  This pass replaces structure
6945 references with scalars to prevent committing structures to memory too
6946 early.  This flag is enabled by default at @option{-O} and higher.
6947
6948 @item -ftree-copyrename
6949 @opindex ftree-copyrename
6950 Perform copy renaming on trees.  This pass attempts to rename compiler
6951 temporaries to other variables at copy locations, usually resulting in
6952 variable names which more closely resemble the original variables.  This flag
6953 is enabled by default at @option{-O} and higher.
6954
6955 @item -ftree-ter
6956 @opindex ftree-ter
6957 Perform temporary expression replacement during the SSA->normal phase.  Single
6958 use/single def temporaries are replaced at their use location with their
6959 defining expression.  This results in non-GIMPLE code, but gives the expanders
6960 much more complex trees to work on resulting in better RTL generation.  This is
6961 enabled by default at @option{-O} and higher.
6962
6963 @item -ftree-vectorize
6964 @opindex ftree-vectorize
6965 Perform loop vectorization on trees. This flag is enabled by default at
6966 @option{-O3}.
6967
6968 @item -ftree-slp-vectorize
6969 @opindex ftree-slp-vectorize
6970 Perform basic block vectorization on trees. This flag is enabled by default at
6971 @option{-O3} and when @option{-ftree-vectorize} is enabled.
6972
6973 @item -ftree-vect-loop-version
6974 @opindex ftree-vect-loop-version
6975 Perform loop versioning when doing loop vectorization on trees.  When a loop
6976 appears to be vectorizable except that data alignment or data dependence cannot
6977 be determined at compile time then vectorized and non-vectorized versions of
6978 the loop are generated along with runtime checks for alignment or dependence
6979 to control which version is executed.  This option is enabled by default
6980 except at level @option{-Os} where it is disabled.
6981
6982 @item -fvect-cost-model
6983 @opindex fvect-cost-model
6984 Enable cost model for vectorization.
6985
6986 @item -ftree-vrp
6987 @opindex ftree-vrp
6988 Perform Value Range Propagation on trees.  This is similar to the
6989 constant propagation pass, but instead of values, ranges of values are
6990 propagated.  This allows the optimizers to remove unnecessary range
6991 checks like array bound checks and null pointer checks.  This is
6992 enabled by default at @option{-O2} and higher.  Null pointer check
6993 elimination is only done if @option{-fdelete-null-pointer-checks} is
6994 enabled.
6995
6996 @item -ftracer
6997 @opindex ftracer
6998 Perform tail duplication to enlarge superblock size.  This transformation
6999 simplifies the control flow of the function allowing other optimizations to do
7000 better job.
7001
7002 @item -funroll-loops
7003 @opindex funroll-loops
7004 Unroll loops whose number of iterations can be determined at compile
7005 time or upon entry to the loop.  @option{-funroll-loops} implies
7006 @option{-frerun-cse-after-loop}.  This option makes code larger,
7007 and may or may not make it run faster.
7008
7009 @item -funroll-all-loops
7010 @opindex funroll-all-loops
7011 Unroll all loops, even if their number of iterations is uncertain when
7012 the loop is entered.  This usually makes programs run more slowly.
7013 @option{-funroll-all-loops} implies the same options as
7014 @option{-funroll-loops},
7015
7016 @item -fsplit-ivs-in-unroller
7017 @opindex fsplit-ivs-in-unroller
7018 Enables expressing of values of induction variables in later iterations
7019 of the unrolled loop using the value in the first iteration.  This breaks
7020 long dependency chains, thus improving efficiency of the scheduling passes.
7021
7022 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7023 same effect.  However in cases the loop body is more complicated than
7024 a single basic block, this is not reliable.  It also does not work at all
7025 on some of the architectures due to restrictions in the CSE pass.
7026
7027 This optimization is enabled by default.
7028
7029 @item -fvariable-expansion-in-unroller
7030 @opindex fvariable-expansion-in-unroller
7031 With this option, the compiler will create multiple copies of some
7032 local variables when unrolling a loop which can result in superior code.
7033
7034 @item -fpartial-inlining
7035 @opindex fpartial-inlining
7036 Inline parts of functions.  This option has any effect only
7037 when inlining itself is turned on by the @option{-finline-functions}
7038 or @option{-finline-small-functions} options.
7039
7040 Enabled at level @option{-O2}.
7041
7042 @item -fpredictive-commoning
7043 @opindex fpredictive-commoning
7044 Perform predictive commoning optimization, i.e., reusing computations
7045 (especially memory loads and stores) performed in previous
7046 iterations of loops.
7047
7048 This option is enabled at level @option{-O3}.
7049
7050 @item -fprefetch-loop-arrays
7051 @opindex fprefetch-loop-arrays
7052 If supported by the target machine, generate instructions to prefetch
7053 memory to improve the performance of loops that access large arrays.
7054
7055 This option may generate better or worse code; results are highly
7056 dependent on the structure of loops within the source code.
7057
7058 Disabled at level @option{-Os}.
7059
7060 @item -fno-peephole
7061 @itemx -fno-peephole2
7062 @opindex fno-peephole
7063 @opindex fno-peephole2
7064 Disable any machine-specific peephole optimizations.  The difference
7065 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7066 are implemented in the compiler; some targets use one, some use the
7067 other, a few use both.
7068
7069 @option{-fpeephole} is enabled by default.
7070 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7071
7072 @item -fno-guess-branch-probability
7073 @opindex fno-guess-branch-probability
7074 Do not guess branch probabilities using heuristics.
7075
7076 GCC will use heuristics to guess branch probabilities if they are
7077 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7078 heuristics are based on the control flow graph.  If some branch probabilities
7079 are specified by @samp{__builtin_expect}, then the heuristics will be
7080 used to guess branch probabilities for the rest of the control flow graph,
7081 taking the @samp{__builtin_expect} info into account.  The interactions
7082 between the heuristics and @samp{__builtin_expect} can be complex, and in
7083 some cases, it may be useful to disable the heuristics so that the effects
7084 of @samp{__builtin_expect} are easier to understand.
7085
7086 The default is @option{-fguess-branch-probability} at levels
7087 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7088
7089 @item -freorder-blocks
7090 @opindex freorder-blocks
7091 Reorder basic blocks in the compiled function in order to reduce number of
7092 taken branches and improve code locality.
7093
7094 Enabled at levels @option{-O2}, @option{-O3}.
7095
7096 @item -freorder-blocks-and-partition
7097 @opindex freorder-blocks-and-partition
7098 In addition to reordering basic blocks in the compiled function, in order
7099 to reduce number of taken branches, partitions hot and cold basic blocks
7100 into separate sections of the assembly and .o files, to improve
7101 paging and cache locality performance.
7102
7103 This optimization is automatically turned off in the presence of
7104 exception handling, for linkonce sections, for functions with a user-defined
7105 section attribute and on any architecture that does not support named
7106 sections.
7107
7108 @item -freorder-functions
7109 @opindex freorder-functions
7110 Reorder functions in the object file in order to
7111 improve code locality.  This is implemented by using special
7112 subsections @code{.text.hot} for most frequently executed functions and
7113 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7114 the linker so object file format must support named sections and linker must
7115 place them in a reasonable way.
7116
7117 Also profile feedback must be available in to make this option effective.  See
7118 @option{-fprofile-arcs} for details.
7119
7120 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7121
7122 @item -fstrict-aliasing
7123 @opindex fstrict-aliasing
7124 Allow the compiler to assume the strictest aliasing rules applicable to
7125 the language being compiled.  For C (and C++), this activates
7126 optimizations based on the type of expressions.  In particular, an
7127 object of one type is assumed never to reside at the same address as an
7128 object of a different type, unless the types are almost the same.  For
7129 example, an @code{unsigned int} can alias an @code{int}, but not a
7130 @code{void*} or a @code{double}.  A character type may alias any other
7131 type.
7132
7133 @anchor{Type-punning}Pay special attention to code like this:
7134 @smallexample
7135 union a_union @{
7136   int i;
7137   double d;
7138 @};
7139
7140 int f() @{
7141   union a_union t;
7142   t.d = 3.0;
7143   return t.i;
7144 @}
7145 @end smallexample
7146 The practice of reading from a different union member than the one most
7147 recently written to (called ``type-punning'') is common.  Even with
7148 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7149 is accessed through the union type.  So, the code above will work as
7150 expected.  @xref{Structures unions enumerations and bit-fields
7151 implementation}.  However, this code might not:
7152 @smallexample
7153 int f() @{
7154   union a_union t;
7155   int* ip;
7156   t.d = 3.0;
7157   ip = &t.i;
7158   return *ip;
7159 @}
7160 @end smallexample
7161
7162 Similarly, access by taking the address, casting the resulting pointer
7163 and dereferencing the result has undefined behavior, even if the cast
7164 uses a union type, e.g.:
7165 @smallexample
7166 int f() @{
7167   double d = 3.0;
7168   return ((union a_union *) &d)->i;
7169 @}
7170 @end smallexample
7171
7172 The @option{-fstrict-aliasing} option is enabled at levels
7173 @option{-O2}, @option{-O3}, @option{-Os}.
7174
7175 @item -fstrict-overflow
7176 @opindex fstrict-overflow
7177 Allow the compiler to assume strict signed overflow rules, depending
7178 on the language being compiled.  For C (and C++) this means that
7179 overflow when doing arithmetic with signed numbers is undefined, which
7180 means that the compiler may assume that it will not happen.  This
7181 permits various optimizations.  For example, the compiler will assume
7182 that an expression like @code{i + 10 > i} will always be true for
7183 signed @code{i}.  This assumption is only valid if signed overflow is
7184 undefined, as the expression is false if @code{i + 10} overflows when
7185 using twos complement arithmetic.  When this option is in effect any
7186 attempt to determine whether an operation on signed numbers will
7187 overflow must be written carefully to not actually involve overflow.
7188
7189 This option also allows the compiler to assume strict pointer
7190 semantics: given a pointer to an object, if adding an offset to that
7191 pointer does not produce a pointer to the same object, the addition is
7192 undefined.  This permits the compiler to conclude that @code{p + u >
7193 p} is always true for a pointer @code{p} and unsigned integer
7194 @code{u}.  This assumption is only valid because pointer wraparound is
7195 undefined, as the expression is false if @code{p + u} overflows using
7196 twos complement arithmetic.
7197
7198 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7199 that integer signed overflow is fully defined: it wraps.  When
7200 @option{-fwrapv} is used, there is no difference between
7201 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7202 integers.  With @option{-fwrapv} certain types of overflow are
7203 permitted.  For example, if the compiler gets an overflow when doing
7204 arithmetic on constants, the overflowed value can still be used with
7205 @option{-fwrapv}, but not otherwise.
7206
7207 The @option{-fstrict-overflow} option is enabled at levels
7208 @option{-O2}, @option{-O3}, @option{-Os}.
7209
7210 @item -falign-functions
7211 @itemx -falign-functions=@var{n}
7212 @opindex falign-functions
7213 Align the start of functions to the next power-of-two greater than
7214 @var{n}, skipping up to @var{n} bytes.  For instance,
7215 @option{-falign-functions=32} aligns functions to the next 32-byte
7216 boundary, but @option{-falign-functions=24} would align to the next
7217 32-byte boundary only if this can be done by skipping 23 bytes or less.
7218
7219 @option{-fno-align-functions} and @option{-falign-functions=1} are
7220 equivalent and mean that functions will not be aligned.
7221
7222 Some assemblers only support this flag when @var{n} is a power of two;
7223 in that case, it is rounded up.
7224
7225 If @var{n} is not specified or is zero, use a machine-dependent default.
7226
7227 Enabled at levels @option{-O2}, @option{-O3}.
7228
7229 @item -falign-labels
7230 @itemx -falign-labels=@var{n}
7231 @opindex falign-labels
7232 Align all branch targets to a power-of-two boundary, skipping up to
7233 @var{n} bytes like @option{-falign-functions}.  This option can easily
7234 make code slower, because it must insert dummy operations for when the
7235 branch target is reached in the usual flow of the code.
7236
7237 @option{-fno-align-labels} and @option{-falign-labels=1} are
7238 equivalent and mean that labels will not be aligned.
7239
7240 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7241 are greater than this value, then their values are used instead.
7242
7243 If @var{n} is not specified or is zero, use a machine-dependent default
7244 which is very likely to be @samp{1}, meaning no alignment.
7245
7246 Enabled at levels @option{-O2}, @option{-O3}.
7247
7248 @item -falign-loops
7249 @itemx -falign-loops=@var{n}
7250 @opindex falign-loops
7251 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7252 like @option{-falign-functions}.  The hope is that the loop will be
7253 executed many times, which will make up for any execution of the dummy
7254 operations.
7255
7256 @option{-fno-align-loops} and @option{-falign-loops=1} are
7257 equivalent and mean that loops will not be aligned.
7258
7259 If @var{n} is not specified or is zero, use a machine-dependent default.
7260
7261 Enabled at levels @option{-O2}, @option{-O3}.
7262
7263 @item -falign-jumps
7264 @itemx -falign-jumps=@var{n}
7265 @opindex falign-jumps
7266 Align branch targets to a power-of-two boundary, for branch targets
7267 where the targets can only be reached by jumping, skipping up to @var{n}
7268 bytes like @option{-falign-functions}.  In this case, no dummy operations
7269 need be executed.
7270
7271 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7272 equivalent and mean that loops will not be aligned.
7273
7274 If @var{n} is not specified or is zero, use a machine-dependent default.
7275
7276 Enabled at levels @option{-O2}, @option{-O3}.
7277
7278 @item -funit-at-a-time
7279 @opindex funit-at-a-time
7280 This option is left for compatibility reasons. @option{-funit-at-a-time}
7281 has no effect, while @option{-fno-unit-at-a-time} implies
7282 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7283
7284 Enabled by default.
7285
7286 @item -fno-toplevel-reorder
7287 @opindex fno-toplevel-reorder
7288 Do not reorder top-level functions, variables, and @code{asm}
7289 statements.  Output them in the same order that they appear in the
7290 input file.  When this option is used, unreferenced static variables
7291 will not be removed.  This option is intended to support existing code
7292 which relies on a particular ordering.  For new code, it is better to
7293 use attributes.
7294
7295 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
7296 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
7297 targets.
7298
7299 @item -fweb
7300 @opindex fweb
7301 Constructs webs as commonly used for register allocation purposes and assign
7302 each web individual pseudo register.  This allows the register allocation pass
7303 to operate on pseudos directly, but also strengthens several other optimization
7304 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7305 however, make debugging impossible, since variables will no longer stay in a
7306 ``home register''.
7307
7308 Enabled by default with @option{-funroll-loops}.
7309
7310 @item -fwhole-program
7311 @opindex fwhole-program
7312 Assume that the current compilation unit represents the whole program being
7313 compiled.  All public functions and variables with the exception of @code{main}
7314 and those merged by attribute @code{externally_visible} become static functions
7315 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.
7316 While this option is equivalent to proper use of the @code{static} keyword for
7317 programs consisting of a single file, in combination with option
7318 @option{-combine}, @option{-flto} or @option{-fwhopr} this flag can be used to
7319 compile many smaller scale programs since the functions and variables become
7320 local for the whole combined compilation unit, not for the single source file
7321 itself.
7322
7323 This option implies @option{-fwhole-file} for Fortran programs.
7324
7325 @item -flto
7326 @opindex flto
7327 This option runs the standard link-time optimizer.  When invoked
7328 with source code, it generates GIMPLE (one of GCC's internal
7329 representations) and writes it to special ELF sections in the object
7330 file.  When the object files are linked together, all the function
7331 bodies are read from these ELF sections and instantiated as if they
7332 had been part of the same translation unit.
7333
7334 To use the link-timer optimizer, @option{-flto} needs to be specified at
7335 compile time and during the final link.  For example,
7336
7337 @smallexample
7338 gcc -c -O2 -flto foo.c
7339 gcc -c -O2 -flto bar.c
7340 gcc -o myprog -flto -O2 foo.o bar.o
7341 @end smallexample
7342
7343 The first two invocations to GCC will save a bytecode representation
7344 of GIMPLE into special ELF sections inside @file{foo.o} and
7345 @file{bar.o}.  The final invocation will read the GIMPLE bytecode from
7346 @file{foo.o} and @file{bar.o}, merge the two files into a single
7347 internal image, and compile the result as usual.  Since both
7348 @file{foo.o} and @file{bar.o} are merged into a single image, this
7349 causes all the inter-procedural analyses and optimizations in GCC to
7350 work across the two files as if they were a single one.  This means,
7351 for example, that the inliner will be able to inline functions in
7352 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7353
7354 Another (simpler) way to enable link-time optimization is,
7355
7356 @smallexample
7357 gcc -o myprog -flto -O2 foo.c bar.c
7358 @end smallexample
7359
7360 The above will generate bytecode for @file{foo.c} and @file{bar.c},
7361 merge them together into a single GIMPLE representation and optimize
7362 them as usual to produce @file{myprog}.
7363
7364 The only important thing to keep in mind is that to enable link-time
7365 optimizations the @option{-flto} flag needs to be passed to both the
7366 compile and the link commands.
7367
7368 Note that when a file is compiled with @option{-flto}, the generated
7369 object file will be larger than a regular object file because it will
7370 contain GIMPLE bytecodes and the usual final code.  This means that
7371 object files with LTO information can be linked as a normal object
7372 file.  So, in the previous example, if the final link is done with
7373
7374 @smallexample
7375 gcc -o myprog foo.o bar.o
7376 @end smallexample
7377
7378 The only difference will be that no inter-procedural optimizations
7379 will be applied to produce @file{myprog}.  The two object files
7380 @file{foo.o} and @file{bar.o} will be simply sent to the regular
7381 linker.
7382
7383 Additionally, the optimization flags used to compile individual files
7384 are not necessarily related to those used at link-time.  For instance,
7385
7386 @smallexample
7387 gcc -c -O0 -flto foo.c
7388 gcc -c -O0 -flto bar.c
7389 gcc -o myprog -flto -O3 foo.o bar.o
7390 @end smallexample
7391
7392 This will produce individual object files with unoptimized assembler
7393 code, but the resulting binary @file{myprog} will be optimized at
7394 @option{-O3}.  Now, if the final binary is generated without
7395 @option{-flto}, then @file{myprog} will not be optimized.
7396
7397 When producing the final binary with @option{-flto}, GCC will only
7398 apply link-time optimizations to those files that contain bytecode.
7399 Therefore, you can mix and match object files and libraries with
7400 GIMPLE bytecodes and final object code.  GCC will automatically select
7401 which files to optimize in LTO mode and which files to link without
7402 further processing.
7403
7404 There are some code generation flags that GCC will preserve when
7405 generating bytecodes, as they need to be used during the final link
7406 stage.  Currently, the following options are saved into the GIMPLE
7407 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7408 @option{-m} target flags.
7409
7410 At link time, these options are read-in and reapplied.  Note that the
7411 current implementation makes no attempt at recognizing conflicting
7412 values for these options.  If two or more files have a conflicting
7413 value (e.g., one file is compiled with @option{-fPIC} and another
7414 isn't), the compiler will simply use the last value read from the
7415 bytecode files.  It is recommended, then, that all the files
7416 participating in the same link be compiled with the same options.
7417
7418 Another feature of LTO is that it is possible to apply interprocedural
7419 optimizations on files written in different languages.  This requires
7420 some support in the language front end.  Currently, the C, C++ and
7421 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7422 something like this should work
7423
7424 @smallexample
7425 gcc -c -flto foo.c
7426 g++ -c -flto bar.cc
7427 gfortran -c -flto baz.f90
7428 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7429 @end smallexample
7430
7431 Notice that the final link is done with @command{g++} to get the C++
7432 runtime libraries and @option{-lgfortran} is added to get the Fortran
7433 runtime libraries.  In general, when mixing languages in LTO mode, you
7434 should use the same link command used when mixing languages in a
7435 regular (non-LTO) compilation.  This means that if your build process
7436 was mixing languages before, all you need to add is @option{-flto} to
7437 all the compile and link commands.
7438
7439 If LTO encounters objects with C linkage declared with incompatible
7440 types in separate translation units to be linked together (undefined
7441 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7442 issued.  The behavior is still undefined at runtime.
7443
7444 If object files containing GIMPLE bytecode are stored in a library
7445 archive, say @file{libfoo.a}, it is possible to extract and use them
7446 in an LTO link if you are using @command{gold} as the linker (which,
7447 in turn requires GCC to be configured with @option{--enable-gold}).
7448 To enable this feature, use the flag @option{-fuse-linker-plugin} at
7449 link-time:
7450
7451 @smallexample
7452 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7453 @end smallexample
7454
7455 With the linker plugin enabled, @command{gold} will extract the needed
7456 GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
7457 to make them part of the aggregated GIMPLE image to be optimized.
7458
7459 If you are not using @command{gold} and/or do not specify
7460 @option{-fuse-linker-plugin} then the objects inside @file{libfoo.a}
7461 will be extracted and linked as usual, but they will not participate
7462 in the LTO optimization process.
7463
7464 Link time optimizations do not require the presence of the whole
7465 program to operate.  If the program does not require any symbols to
7466 be exported, it is possible to combine @option{-flto} and
7467 @option{-fwhopr} with @option{-fwhole-program} to allow the
7468 interprocedural optimizers to use more aggressive assumptions which
7469 may lead to improved optimization opportunities.
7470
7471 Regarding portability: the current implementation of LTO makes no
7472 attempt at generating bytecode that can be ported between different
7473 types of hosts.  The bytecode files are versioned and there is a
7474 strict version check, so bytecode files generated in one version of
7475 GCC will not work with an older/newer version of GCC.
7476
7477 Link time optimization does not play well with generating debugging
7478 information.  Combining @option{-flto} or @option{-fwhopr} with
7479 @option{-g} is experimental.
7480
7481 This option is disabled by default.
7482
7483 @item -fwhopr[=@var{n}]
7484 @opindex fwhopr
7485 This option is identical in functionality to @option{-flto} but it
7486 differs in how the final link stage is executed.  Instead of loading
7487 all the function bodies in memory, the callgraph is analyzed and
7488 optimization decisions are made (whole program analysis or WPA). Once
7489 optimization decisions are made, the callgraph is partitioned and the
7490 different sections are compiled separately (local transformations or
7491 LTRANS)@.  This process allows optimizations on very large programs
7492 that otherwise would not fit in memory.  This option enables
7493 @option{-fwpa} and @option{-fltrans} automatically.
7494
7495 If you specify the optional @var{n} the link stage is executed in
7496 parallel using @var{n} parallel jobs by utilizing an installed
7497 @command{make} program.  The environment variable @env{MAKE} may be
7498 used to override the program used.
7499
7500 Disabled by default.
7501
7502 @item -fwpa
7503 @opindex fwpa
7504 This is an internal option used by GCC when compiling with
7505 @option{-fwhopr}.  You should never need to use it.
7506
7507 This option runs the link-time optimizer in the whole-program-analysis
7508 (WPA) mode, which reads in summary information from all inputs and
7509 performs a whole-program analysis based on summary information only.
7510 It generates object files for subsequent runs of the link-time
7511 optimizer where individual object files are optimized using both
7512 summary information from the WPA mode and the actual function bodies.
7513 It then drives the LTRANS phase.
7514
7515 Disabled by default.
7516
7517 @item -fltrans
7518 @opindex fltrans
7519 This is an internal option used by GCC when compiling with
7520 @option{-fwhopr}.  You should never need to use it.
7521
7522 This option runs the link-time optimizer in the local-transformation (LTRANS)
7523 mode, which reads in output from a previous run of the LTO in WPA mode.
7524 In the LTRANS mode, LTO optimizes an object and produces the final assembly.
7525
7526 Disabled by default.
7527
7528 @item -fltrans-output-list=@var{file}
7529 @opindex fltrans-output-list
7530 This is an internal option used by GCC when compiling with
7531 @option{-fwhopr}.  You should never need to use it.
7532
7533 This option specifies a file to which the names of LTRANS output files are
7534 written.  This option is only meaningful in conjunction with @option{-fwpa}.
7535
7536 Disabled by default.
7537
7538 @item -flto-compression-level=@var{n}
7539 This option specifies the level of compression used for intermediate
7540 language written to LTO object files, and is only meaningful in
7541 conjunction with LTO mode (@option{-fwhopr}, @option{-flto}).  Valid
7542 values are 0 (no compression) to 9 (maximum compression).  Values
7543 outside this range are clamped to either 0 or 9.  If the option is not
7544 given, a default balanced compression setting is used.
7545
7546 @item -flto-report
7547 Prints a report with internal details on the workings of the link-time
7548 optimizer.  The contents of this report vary from version to version,
7549 it is meant to be useful to GCC developers when processing object
7550 files in LTO mode (via @option{-fwhopr} or @option{-flto}).
7551
7552 Disabled by default.
7553
7554 @item -fuse-linker-plugin
7555 Enables the extraction of objects with GIMPLE bytecode information
7556 from library archives.  This option relies on features available only
7557 in @command{gold}, so to use this you must configure GCC with
7558 @option{--enable-gold}.  See @option{-flto} for a description on the
7559 effect of this flag and how to use it.
7560
7561 Disabled by default.
7562
7563 @item -fcprop-registers
7564 @opindex fcprop-registers
7565 After register allocation and post-register allocation instruction splitting,
7566 we perform a copy-propagation pass to try to reduce scheduling dependencies
7567 and occasionally eliminate the copy.
7568
7569 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7570
7571 @item -fprofile-correction
7572 @opindex fprofile-correction
7573 Profiles collected using an instrumented binary for multi-threaded programs may
7574 be inconsistent due to missed counter updates. When this option is specified,
7575 GCC will use heuristics to correct or smooth out such inconsistencies. By
7576 default, GCC will emit an error message when an inconsistent profile is detected.
7577
7578 @item -fprofile-dir=@var{path}
7579 @opindex fprofile-dir
7580
7581 Set the directory to search the profile data files in to @var{path}.
7582 This option affects only the profile data generated by
7583 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
7584 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
7585 and its related options.
7586 By default, GCC will use the current directory as @var{path}
7587 thus the profile data file will appear in the same directory as the object file.
7588
7589 @item -fprofile-generate
7590 @itemx -fprofile-generate=@var{path}
7591 @opindex fprofile-generate
7592
7593 Enable options usually used for instrumenting application to produce
7594 profile useful for later recompilation with profile feedback based
7595 optimization.  You must use @option{-fprofile-generate} both when
7596 compiling and when linking your program.
7597
7598 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
7599
7600 If @var{path} is specified, GCC will look at the @var{path} to find
7601 the profile feedback data files. See @option{-fprofile-dir}.
7602
7603 @item -fprofile-use
7604 @itemx -fprofile-use=@var{path}
7605 @opindex fprofile-use
7606 Enable profile feedback directed optimizations, and optimizations
7607 generally profitable only with profile feedback available.
7608
7609 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
7610 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
7611
7612 By default, GCC emits an error message if the feedback profiles do not
7613 match the source code.  This error can be turned into a warning by using
7614 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
7615 code.
7616
7617 If @var{path} is specified, GCC will look at the @var{path} to find
7618 the profile feedback data files. See @option{-fprofile-dir}.
7619 @end table
7620
7621 The following options control compiler behavior regarding floating
7622 point arithmetic.  These options trade off between speed and
7623 correctness.  All must be specifically enabled.
7624
7625 @table @gcctabopt
7626 @item -ffloat-store
7627 @opindex ffloat-store
7628 Do not store floating point variables in registers, and inhibit other
7629 options that might change whether a floating point value is taken from a
7630 register or memory.
7631
7632 @cindex floating point precision
7633 This option prevents undesirable excess precision on machines such as
7634 the 68000 where the floating registers (of the 68881) keep more
7635 precision than a @code{double} is supposed to have.  Similarly for the
7636 x86 architecture.  For most programs, the excess precision does only
7637 good, but a few programs rely on the precise definition of IEEE floating
7638 point.  Use @option{-ffloat-store} for such programs, after modifying
7639 them to store all pertinent intermediate computations into variables.
7640
7641 @item -fexcess-precision=@var{style}
7642 @opindex fexcess-precision
7643 This option allows further control over excess precision on machines
7644 where floating-point registers have more precision than the IEEE
7645 @code{float} and @code{double} types and the processor does not
7646 support operations rounding to those types.  By default,
7647 @option{-fexcess-precision=fast} is in effect; this means that
7648 operations are carried out in the precision of the registers and that
7649 it is unpredictable when rounding to the types specified in the source
7650 code takes place.  When compiling C, if
7651 @option{-fexcess-precision=standard} is specified then excess
7652 precision will follow the rules specified in ISO C99; in particular,
7653 both casts and assignments cause values to be rounded to their
7654 semantic types (whereas @option{-ffloat-store} only affects
7655 assignments).  This option is enabled by default for C if a strict
7656 conformance option such as @option{-std=c99} is used.
7657
7658 @opindex mfpmath
7659 @option{-fexcess-precision=standard} is not implemented for languages
7660 other than C, and has no effect if
7661 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
7662 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
7663 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
7664 semantics apply without excess precision, and in the latter, rounding
7665 is unpredictable.
7666
7667 @item -ffast-math
7668 @opindex ffast-math
7669 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
7670 @option{-ffinite-math-only}, @option{-fno-rounding-math},
7671 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
7672
7673 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
7674
7675 This option is not turned on by any @option{-O} option since
7676 it can result in incorrect output for programs which depend on
7677 an exact implementation of IEEE or ISO rules/specifications for
7678 math functions. It may, however, yield faster code for programs
7679 that do not require the guarantees of these specifications.
7680
7681 @item -fno-math-errno
7682 @opindex fno-math-errno
7683 Do not set ERRNO after calling math functions that are executed
7684 with a single instruction, e.g., sqrt.  A program that relies on
7685 IEEE exceptions for math error handling may want to use this flag
7686 for speed while maintaining IEEE arithmetic compatibility.
7687
7688 This option is not turned on by any @option{-O} option since
7689 it can result in incorrect output for programs which depend on
7690 an exact implementation of IEEE or ISO rules/specifications for
7691 math functions. It may, however, yield faster code for programs
7692 that do not require the guarantees of these specifications.
7693
7694 The default is @option{-fmath-errno}.
7695
7696 On Darwin systems, the math library never sets @code{errno}.  There is
7697 therefore no reason for the compiler to consider the possibility that
7698 it might, and @option{-fno-math-errno} is the default.
7699
7700 @item -funsafe-math-optimizations
7701 @opindex funsafe-math-optimizations
7702
7703 Allow optimizations for floating-point arithmetic that (a) assume
7704 that arguments and results are valid and (b) may violate IEEE or
7705 ANSI standards.  When used at link-time, it may include libraries
7706 or startup files that change the default FPU control word or other
7707 similar optimizations.
7708
7709 This option is not turned on by any @option{-O} option since
7710 it can result in incorrect output for programs which depend on
7711 an exact implementation of IEEE or ISO rules/specifications for
7712 math functions. It may, however, yield faster code for programs
7713 that do not require the guarantees of these specifications.
7714 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
7715 @option{-fassociative-math} and @option{-freciprocal-math}.
7716
7717 The default is @option{-fno-unsafe-math-optimizations}.
7718
7719 @item -fassociative-math
7720 @opindex fassociative-math
7721
7722 Allow re-association of operands in series of floating-point operations.
7723 This violates the ISO C and C++ language standard by possibly changing
7724 computation result.  NOTE: re-ordering may change the sign of zero as
7725 well as ignore NaNs and inhibit or create underflow or overflow (and
7726 thus cannot be used on a code which relies on rounding behavior like
7727 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
7728 and thus may not be used when ordered comparisons are required.
7729 This option requires that both @option{-fno-signed-zeros} and
7730 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
7731 much sense with @option{-frounding-math}. For Fortran the option
7732 is automatically enabled when both @option{-fno-signed-zeros} and
7733 @option{-fno-trapping-math} are in effect.
7734
7735 The default is @option{-fno-associative-math}.
7736
7737 @item -freciprocal-math
7738 @opindex freciprocal-math
7739
7740 Allow the reciprocal of a value to be used instead of dividing by
7741 the value if this enables optimizations.  For example @code{x / y}
7742 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
7743 is subject to common subexpression elimination.  Note that this loses
7744 precision and increases the number of flops operating on the value.
7745
7746 The default is @option{-fno-reciprocal-math}.
7747
7748 @item -ffinite-math-only
7749 @opindex ffinite-math-only
7750 Allow optimizations for floating-point arithmetic that assume
7751 that arguments and results are not NaNs or +-Infs.
7752
7753 This option is not turned on by any @option{-O} option since
7754 it can result in incorrect output for programs which depend on
7755 an exact implementation of IEEE or ISO rules/specifications for
7756 math functions. It may, however, yield faster code for programs
7757 that do not require the guarantees of these specifications.
7758
7759 The default is @option{-fno-finite-math-only}.
7760
7761 @item -fno-signed-zeros
7762 @opindex fno-signed-zeros
7763 Allow optimizations for floating point arithmetic that ignore the
7764 signedness of zero.  IEEE arithmetic specifies the behavior of
7765 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
7766 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
7767 This option implies that the sign of a zero result isn't significant.
7768
7769 The default is @option{-fsigned-zeros}.
7770
7771 @item -fno-trapping-math
7772 @opindex fno-trapping-math
7773 Compile code assuming that floating-point operations cannot generate
7774 user-visible traps.  These traps include division by zero, overflow,
7775 underflow, inexact result and invalid operation.  This option requires
7776 that @option{-fno-signaling-nans} be in effect.  Setting this option may
7777 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
7778
7779 This option should never be turned on by any @option{-O} option since
7780 it can result in incorrect output for programs which depend on
7781 an exact implementation of IEEE or ISO rules/specifications for
7782 math functions.
7783
7784 The default is @option{-ftrapping-math}.
7785
7786 @item -frounding-math
7787 @opindex frounding-math
7788 Disable transformations and optimizations that assume default floating
7789 point rounding behavior.  This is round-to-zero for all floating point
7790 to integer conversions, and round-to-nearest for all other arithmetic
7791 truncations.  This option should be specified for programs that change
7792 the FP rounding mode dynamically, or that may be executed with a
7793 non-default rounding mode.  This option disables constant folding of
7794 floating point expressions at compile-time (which may be affected by
7795 rounding mode) and arithmetic transformations that are unsafe in the
7796 presence of sign-dependent rounding modes.
7797
7798 The default is @option{-fno-rounding-math}.
7799
7800 This option is experimental and does not currently guarantee to
7801 disable all GCC optimizations that are affected by rounding mode.
7802 Future versions of GCC may provide finer control of this setting
7803 using C99's @code{FENV_ACCESS} pragma.  This command line option
7804 will be used to specify the default state for @code{FENV_ACCESS}.
7805
7806 @item -fsignaling-nans
7807 @opindex fsignaling-nans
7808 Compile code assuming that IEEE signaling NaNs may generate user-visible
7809 traps during floating-point operations.  Setting this option disables
7810 optimizations that may change the number of exceptions visible with
7811 signaling NaNs.  This option implies @option{-ftrapping-math}.
7812
7813 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
7814 be defined.
7815
7816 The default is @option{-fno-signaling-nans}.
7817
7818 This option is experimental and does not currently guarantee to
7819 disable all GCC optimizations that affect signaling NaN behavior.
7820
7821 @item -fsingle-precision-constant
7822 @opindex fsingle-precision-constant
7823 Treat floating point constant as single precision constant instead of
7824 implicitly converting it to double precision constant.
7825
7826 @item -fcx-limited-range
7827 @opindex fcx-limited-range
7828 When enabled, this option states that a range reduction step is not
7829 needed when performing complex division.  Also, there is no checking
7830 whether the result of a complex multiplication or division is @code{NaN
7831 + I*NaN}, with an attempt to rescue the situation in that case.  The
7832 default is @option{-fno-cx-limited-range}, but is enabled by
7833 @option{-ffast-math}.
7834
7835 This option controls the default setting of the ISO C99
7836 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
7837 all languages.
7838
7839 @item -fcx-fortran-rules
7840 @opindex fcx-fortran-rules
7841 Complex multiplication and division follow Fortran rules.  Range
7842 reduction is done as part of complex division, but there is no checking
7843 whether the result of a complex multiplication or division is @code{NaN
7844 + I*NaN}, with an attempt to rescue the situation in that case.
7845
7846 The default is @option{-fno-cx-fortran-rules}.
7847
7848 @end table
7849
7850 The following options control optimizations that may improve
7851 performance, but are not enabled by any @option{-O} options.  This
7852 section includes experimental options that may produce broken code.
7853
7854 @table @gcctabopt
7855 @item -fbranch-probabilities
7856 @opindex fbranch-probabilities
7857 After running a program compiled with @option{-fprofile-arcs}
7858 (@pxref{Debugging Options,, Options for Debugging Your Program or
7859 @command{gcc}}), you can compile it a second time using
7860 @option{-fbranch-probabilities}, to improve optimizations based on
7861 the number of times each branch was taken.  When the program
7862 compiled with @option{-fprofile-arcs} exits it saves arc execution
7863 counts to a file called @file{@var{sourcename}.gcda} for each source
7864 file.  The information in this data file is very dependent on the
7865 structure of the generated code, so you must use the same source code
7866 and the same optimization options for both compilations.
7867
7868 With @option{-fbranch-probabilities}, GCC puts a
7869 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
7870 These can be used to improve optimization.  Currently, they are only
7871 used in one place: in @file{reorg.c}, instead of guessing which path a
7872 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
7873 exactly determine which path is taken more often.
7874
7875 @item -fprofile-values
7876 @opindex fprofile-values
7877 If combined with @option{-fprofile-arcs}, it adds code so that some
7878 data about values of expressions in the program is gathered.
7879
7880 With @option{-fbranch-probabilities}, it reads back the data gathered
7881 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
7882 notes to instructions for their later usage in optimizations.
7883
7884 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
7885
7886 @item -fvpt
7887 @opindex fvpt
7888 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
7889 a code to gather information about values of expressions.
7890
7891 With @option{-fbranch-probabilities}, it reads back the data gathered
7892 and actually performs the optimizations based on them.
7893 Currently the optimizations include specialization of division operation
7894 using the knowledge about the value of the denominator.
7895
7896 @item -frename-registers
7897 @opindex frename-registers
7898 Attempt to avoid false dependencies in scheduled code by making use
7899 of registers left over after register allocation.  This optimization
7900 will most benefit processors with lots of registers.  Depending on the
7901 debug information format adopted by the target, however, it can
7902 make debugging impossible, since variables will no longer stay in
7903 a ``home register''.
7904
7905 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
7906
7907 @item -ftracer
7908 @opindex ftracer
7909 Perform tail duplication to enlarge superblock size.  This transformation
7910 simplifies the control flow of the function allowing other optimizations to do
7911 better job.
7912
7913 Enabled with @option{-fprofile-use}.
7914
7915 @item -funroll-loops
7916 @opindex funroll-loops
7917 Unroll loops whose number of iterations can be determined at compile time or
7918 upon entry to the loop.  @option{-funroll-loops} implies
7919 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
7920 It also turns on complete loop peeling (i.e.@: complete removal of loops with
7921 small constant number of iterations).  This option makes code larger, and may
7922 or may not make it run faster.
7923
7924 Enabled with @option{-fprofile-use}.
7925
7926 @item -funroll-all-loops
7927 @opindex funroll-all-loops
7928 Unroll all loops, even if their number of iterations is uncertain when
7929 the loop is entered.  This usually makes programs run more slowly.
7930 @option{-funroll-all-loops} implies the same options as
7931 @option{-funroll-loops}.
7932
7933 @item -fpeel-loops
7934 @opindex fpeel-loops
7935 Peels the loops for that there is enough information that they do not
7936 roll much (from profile feedback).  It also turns on complete loop peeling
7937 (i.e.@: complete removal of loops with small constant number of iterations).
7938
7939 Enabled with @option{-fprofile-use}.
7940
7941 @item -fmove-loop-invariants
7942 @opindex fmove-loop-invariants
7943 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
7944 at level @option{-O1}
7945
7946 @item -funswitch-loops
7947 @opindex funswitch-loops
7948 Move branches with loop invariant conditions out of the loop, with duplicates
7949 of the loop on both branches (modified according to result of the condition).
7950
7951 @item -ffunction-sections
7952 @itemx -fdata-sections
7953 @opindex ffunction-sections
7954 @opindex fdata-sections
7955 Place each function or data item into its own section in the output
7956 file if the target supports arbitrary sections.  The name of the
7957 function or the name of the data item determines the section's name
7958 in the output file.
7959
7960 Use these options on systems where the linker can perform optimizations
7961 to improve locality of reference in the instruction space.  Most systems
7962 using the ELF object format and SPARC processors running Solaris 2 have
7963 linkers with such optimizations.  AIX may have these optimizations in
7964 the future.
7965
7966 Only use these options when there are significant benefits from doing
7967 so.  When you specify these options, the assembler and linker will
7968 create larger object and executable files and will also be slower.
7969 You will not be able to use @code{gprof} on all systems if you
7970 specify this option and you may have problems with debugging if
7971 you specify both this option and @option{-g}.
7972
7973 @item -fbranch-target-load-optimize
7974 @opindex fbranch-target-load-optimize
7975 Perform branch target register load optimization before prologue / epilogue
7976 threading.
7977 The use of target registers can typically be exposed only during reload,
7978 thus hoisting loads out of loops and doing inter-block scheduling needs
7979 a separate optimization pass.
7980
7981 @item -fbranch-target-load-optimize2
7982 @opindex fbranch-target-load-optimize2
7983 Perform branch target register load optimization after prologue / epilogue
7984 threading.
7985
7986 @item -fbtr-bb-exclusive
7987 @opindex fbtr-bb-exclusive
7988 When performing branch target register load optimization, don't reuse
7989 branch target registers in within any basic block.
7990
7991 @item -fstack-protector
7992 @opindex fstack-protector
7993 Emit extra code to check for buffer overflows, such as stack smashing
7994 attacks.  This is done by adding a guard variable to functions with
7995 vulnerable objects.  This includes functions that call alloca, and
7996 functions with buffers larger than 8 bytes.  The guards are initialized
7997 when a function is entered and then checked when the function exits.
7998 If a guard check fails, an error message is printed and the program exits.
7999
8000 @item -fstack-protector-all
8001 @opindex fstack-protector-all
8002 Like @option{-fstack-protector} except that all functions are protected.
8003
8004 @item -fsection-anchors
8005 @opindex fsection-anchors
8006 Try to reduce the number of symbolic address calculations by using
8007 shared ``anchor'' symbols to address nearby objects.  This transformation
8008 can help to reduce the number of GOT entries and GOT accesses on some
8009 targets.
8010
8011 For example, the implementation of the following function @code{foo}:
8012
8013 @smallexample
8014 static int a, b, c;
8015 int foo (void) @{ return a + b + c; @}
8016 @end smallexample
8017
8018 would usually calculate the addresses of all three variables, but if you
8019 compile it with @option{-fsection-anchors}, it will access the variables
8020 from a common anchor point instead.  The effect is similar to the
8021 following pseudocode (which isn't valid C):
8022
8023 @smallexample
8024 int foo (void)
8025 @{
8026   register int *xr = &x;
8027   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8028 @}
8029 @end smallexample
8030
8031 Not all targets support this option.
8032
8033 @item --param @var{name}=@var{value}
8034 @opindex param
8035 In some places, GCC uses various constants to control the amount of
8036 optimization that is done.  For example, GCC will not inline functions
8037 that contain more that a certain number of instructions.  You can
8038 control some of these constants on the command-line using the
8039 @option{--param} option.
8040
8041 The names of specific parameters, and the meaning of the values, are
8042 tied to the internals of the compiler, and are subject to change
8043 without notice in future releases.
8044
8045 In each case, the @var{value} is an integer.  The allowable choices for
8046 @var{name} are given in the following table:
8047
8048 @table @gcctabopt
8049 @item struct-reorg-cold-struct-ratio
8050 The threshold ratio (as a percentage) between a structure frequency
8051 and the frequency of the hottest structure in the program.  This parameter
8052 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
8053 We say that if the ratio of a structure frequency, calculated by profiling,
8054 to the hottest structure frequency in the program is less than this
8055 parameter, then structure reorganization is not applied to this structure.
8056 The default is 10.
8057
8058 @item predictable-branch-outcome
8059 When branch is predicted to be taken with probability lower than this threshold
8060 (in percent), then it is considered well predictable. The default is 10.
8061
8062 @item max-crossjump-edges
8063 The maximum number of incoming edges to consider for crossjumping.
8064 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8065 the number of edges incoming to each block.  Increasing values mean
8066 more aggressive optimization, making the compile time increase with
8067 probably small improvement in executable size.
8068
8069 @item min-crossjump-insns
8070 The minimum number of instructions which must be matched at the end
8071 of two blocks before crossjumping will be performed on them.  This
8072 value is ignored in the case where all instructions in the block being
8073 crossjumped from are matched.  The default value is 5.
8074
8075 @item max-grow-copy-bb-insns
8076 The maximum code size expansion factor when copying basic blocks
8077 instead of jumping.  The expansion is relative to a jump instruction.
8078 The default value is 8.
8079
8080 @item max-goto-duplication-insns
8081 The maximum number of instructions to duplicate to a block that jumps
8082 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8083 passes, GCC factors computed gotos early in the compilation process,
8084 and unfactors them as late as possible.  Only computed jumps at the
8085 end of a basic blocks with no more than max-goto-duplication-insns are
8086 unfactored.  The default value is 8.
8087
8088 @item max-delay-slot-insn-search
8089 The maximum number of instructions to consider when looking for an
8090 instruction to fill a delay slot.  If more than this arbitrary number of
8091 instructions is searched, the time savings from filling the delay slot
8092 will be minimal so stop searching.  Increasing values mean more
8093 aggressive optimization, making the compile time increase with probably
8094 small improvement in executable run time.
8095
8096 @item max-delay-slot-live-search
8097 When trying to fill delay slots, the maximum number of instructions to
8098 consider when searching for a block with valid live register
8099 information.  Increasing this arbitrarily chosen value means more
8100 aggressive optimization, increasing the compile time.  This parameter
8101 should be removed when the delay slot code is rewritten to maintain the
8102 control-flow graph.
8103
8104 @item max-gcse-memory
8105 The approximate maximum amount of memory that will be allocated in
8106 order to perform the global common subexpression elimination
8107 optimization.  If more memory than specified is required, the
8108 optimization will not be done.
8109
8110 @item max-pending-list-length
8111 The maximum number of pending dependencies scheduling will allow
8112 before flushing the current state and starting over.  Large functions
8113 with few branches or calls can create excessively large lists which
8114 needlessly consume memory and resources.
8115
8116 @item max-inline-insns-single
8117 Several parameters control the tree inliner used in gcc.
8118 This number sets the maximum number of instructions (counted in GCC's
8119 internal representation) in a single function that the tree inliner
8120 will consider for inlining.  This only affects functions declared
8121 inline and methods implemented in a class declaration (C++).
8122 The default value is 300.
8123
8124 @item max-inline-insns-auto
8125 When you use @option{-finline-functions} (included in @option{-O3}),
8126 a lot of functions that would otherwise not be considered for inlining
8127 by the compiler will be investigated.  To those functions, a different
8128 (more restrictive) limit compared to functions declared inline can
8129 be applied.
8130 The default value is 40.
8131
8132 @item large-function-insns
8133 The limit specifying really large functions.  For functions larger than this
8134 limit after inlining, inlining is constrained by
8135 @option{--param large-function-growth}.  This parameter is useful primarily
8136 to avoid extreme compilation time caused by non-linear algorithms used by the
8137 backend.
8138 The default value is 2700.
8139
8140 @item large-function-growth
8141 Specifies maximal growth of large function caused by inlining in percents.
8142 The default value is 100 which limits large function growth to 2.0 times
8143 the original size.
8144
8145 @item large-unit-insns
8146 The limit specifying large translation unit.  Growth caused by inlining of
8147 units larger than this limit is limited by @option{--param inline-unit-growth}.
8148 For small units this might be too tight (consider unit consisting of function A
8149 that is inline and B that just calls A three time.  If B is small relative to
8150 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8151 large units consisting of small inlineable functions however the overall unit
8152 growth limit is needed to avoid exponential explosion of code size.  Thus for
8153 smaller units, the size is increased to @option{--param large-unit-insns}
8154 before applying @option{--param inline-unit-growth}.  The default is 10000
8155
8156 @item inline-unit-growth
8157 Specifies maximal overall growth of the compilation unit caused by inlining.
8158 The default value is 30 which limits unit growth to 1.3 times the original
8159 size.
8160
8161 @item ipcp-unit-growth
8162 Specifies maximal overall growth of the compilation unit caused by
8163 interprocedural constant propagation.  The default value is 10 which limits
8164 unit growth to 1.1 times the original size.
8165
8166 @item large-stack-frame
8167 The limit specifying large stack frames.  While inlining the algorithm is trying
8168 to not grow past this limit too much.  Default value is 256 bytes.
8169
8170 @item large-stack-frame-growth
8171 Specifies maximal growth of large stack frames caused by inlining in percents.
8172 The default value is 1000 which limits large stack frame growth to 11 times
8173 the original size.
8174
8175 @item max-inline-insns-recursive
8176 @itemx max-inline-insns-recursive-auto
8177 Specifies maximum number of instructions out-of-line copy of self recursive inline
8178 function can grow into by performing recursive inlining.
8179
8180 For functions declared inline @option{--param max-inline-insns-recursive} is
8181 taken into account.  For function not declared inline, recursive inlining
8182 happens only when @option{-finline-functions} (included in @option{-O3}) is
8183 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8184 default value is 450.
8185
8186 @item max-inline-recursive-depth
8187 @itemx max-inline-recursive-depth-auto
8188 Specifies maximum recursion depth used by the recursive inlining.
8189
8190 For functions declared inline @option{--param max-inline-recursive-depth} is
8191 taken into account.  For function not declared inline, recursive inlining
8192 happens only when @option{-finline-functions} (included in @option{-O3}) is
8193 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8194 default value is 8.
8195
8196 @item min-inline-recursive-probability
8197 Recursive inlining is profitable only for function having deep recursion
8198 in average and can hurt for function having little recursion depth by
8199 increasing the prologue size or complexity of function body to other
8200 optimizers.
8201
8202 When profile feedback is available (see @option{-fprofile-generate}) the actual
8203 recursion depth can be guessed from probability that function will recurse via
8204 given call expression.  This parameter limits inlining only to call expression
8205 whose probability exceeds given threshold (in percents).  The default value is
8206 10.
8207
8208 @item early-inlining-insns
8209 Specify growth that early inliner can make.  In effect it increases amount of
8210 inlining for code having large abstraction penalty.  The default value is 8.
8211
8212 @item max-early-inliner-iterations
8213 @itemx max-early-inliner-iterations
8214 Limit of iterations of early inliner.  This basically bounds number of nested
8215 indirect calls early inliner can resolve.  Deeper chains are still handled by
8216 late inlining.
8217
8218 @item min-vect-loop-bound
8219 The minimum number of iterations under which a loop will not get vectorized
8220 when @option{-ftree-vectorize} is used.  The number of iterations after
8221 vectorization needs to be greater than the value specified by this option
8222 to allow vectorization.  The default value is 0.
8223
8224 @item max-unrolled-insns
8225 The maximum number of instructions that a loop should have if that loop
8226 is unrolled, and if the loop is unrolled, it determines how many times
8227 the loop code is unrolled.
8228
8229 @item max-average-unrolled-insns
8230 The maximum number of instructions biased by probabilities of their execution
8231 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8232 it determines how many times the loop code is unrolled.
8233
8234 @item max-unroll-times
8235 The maximum number of unrollings of a single loop.
8236
8237 @item max-peeled-insns
8238 The maximum number of instructions that a loop should have if that loop
8239 is peeled, and if the loop is peeled, it determines how many times
8240 the loop code is peeled.
8241
8242 @item max-peel-times
8243 The maximum number of peelings of a single loop.
8244
8245 @item max-completely-peeled-insns
8246 The maximum number of insns of a completely peeled loop.
8247
8248 @item max-completely-peel-times
8249 The maximum number of iterations of a loop to be suitable for complete peeling.
8250
8251 @item max-completely-peel-loop-nest-depth
8252 The maximum depth of a loop nest suitable for complete peeling.
8253
8254 @item max-unswitch-insns
8255 The maximum number of insns of an unswitched loop.
8256
8257 @item max-unswitch-level
8258 The maximum number of branches unswitched in a single loop.
8259
8260 @item lim-expensive
8261 The minimum cost of an expensive expression in the loop invariant motion.
8262
8263 @item iv-consider-all-candidates-bound
8264 Bound on number of candidates for induction variables below that
8265 all candidates are considered for each use in induction variable
8266 optimizations.  Only the most relevant candidates are considered
8267 if there are more candidates, to avoid quadratic time complexity.
8268
8269 @item iv-max-considered-uses
8270 The induction variable optimizations give up on loops that contain more
8271 induction variable uses.
8272
8273 @item iv-always-prune-cand-set-bound
8274 If number of candidates in the set is smaller than this value,
8275 we always try to remove unnecessary ivs from the set during its
8276 optimization when a new iv is added to the set.
8277
8278 @item scev-max-expr-size
8279 Bound on size of expressions used in the scalar evolutions analyzer.
8280 Large expressions slow the analyzer.
8281
8282 @item omega-max-vars
8283 The maximum number of variables in an Omega constraint system.
8284 The default value is 128.
8285
8286 @item omega-max-geqs
8287 The maximum number of inequalities in an Omega constraint system.
8288 The default value is 256.
8289
8290 @item omega-max-eqs
8291 The maximum number of equalities in an Omega constraint system.
8292 The default value is 128.
8293
8294 @item omega-max-wild-cards
8295 The maximum number of wildcard variables that the Omega solver will
8296 be able to insert.  The default value is 18.
8297
8298 @item omega-hash-table-size
8299 The size of the hash table in the Omega solver.  The default value is
8300 550.
8301
8302 @item omega-max-keys
8303 The maximal number of keys used by the Omega solver.  The default
8304 value is 500.
8305
8306 @item omega-eliminate-redundant-constraints
8307 When set to 1, use expensive methods to eliminate all redundant
8308 constraints.  The default value is 0.
8309
8310 @item vect-max-version-for-alignment-checks
8311 The maximum number of runtime checks that can be performed when
8312 doing loop versioning for alignment in the vectorizer.  See option
8313 ftree-vect-loop-version for more information.
8314
8315 @item vect-max-version-for-alias-checks
8316 The maximum number of runtime checks that can be performed when
8317 doing loop versioning for alias in the vectorizer.  See option
8318 ftree-vect-loop-version for more information.
8319
8320 @item max-iterations-to-track
8321
8322 The maximum number of iterations of a loop the brute force algorithm
8323 for analysis of # of iterations of the loop tries to evaluate.
8324
8325 @item hot-bb-count-fraction
8326 Select fraction of the maximal count of repetitions of basic block in program
8327 given basic block needs to have to be considered hot.
8328
8329 @item hot-bb-frequency-fraction
8330 Select fraction of the maximal frequency of executions of basic block in
8331 function given basic block needs to have to be considered hot
8332
8333 @item max-predicted-iterations
8334 The maximum number of loop iterations we predict statically.  This is useful
8335 in cases where function contain single loop with known bound and other loop
8336 with unknown.  We predict the known number of iterations correctly, while
8337 the unknown number of iterations average to roughly 10.  This means that the
8338 loop without bounds would appear artificially cold relative to the other one.
8339
8340 @item align-threshold
8341
8342 Select fraction of the maximal frequency of executions of basic block in
8343 function given basic block will get aligned.
8344
8345 @item align-loop-iterations
8346
8347 A loop expected to iterate at lest the selected number of iterations will get
8348 aligned.
8349
8350 @item tracer-dynamic-coverage
8351 @itemx tracer-dynamic-coverage-feedback
8352
8353 This value is used to limit superblock formation once the given percentage of
8354 executed instructions is covered.  This limits unnecessary code size
8355 expansion.
8356
8357 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8358 feedback is available.  The real profiles (as opposed to statically estimated
8359 ones) are much less balanced allowing the threshold to be larger value.
8360
8361 @item tracer-max-code-growth
8362 Stop tail duplication once code growth has reached given percentage.  This is
8363 rather hokey argument, as most of the duplicates will be eliminated later in
8364 cross jumping, so it may be set to much higher values than is the desired code
8365 growth.
8366
8367 @item tracer-min-branch-ratio
8368
8369 Stop reverse growth when the reverse probability of best edge is less than this
8370 threshold (in percent).
8371
8372 @item tracer-min-branch-ratio
8373 @itemx tracer-min-branch-ratio-feedback
8374
8375 Stop forward growth if the best edge do have probability lower than this
8376 threshold.
8377
8378 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8379 compilation for profile feedback and one for compilation without.  The value
8380 for compilation with profile feedback needs to be more conservative (higher) in
8381 order to make tracer effective.
8382
8383 @item max-cse-path-length
8384
8385 Maximum number of basic blocks on path that cse considers.  The default is 10.
8386
8387 @item max-cse-insns
8388 The maximum instructions CSE process before flushing. The default is 1000.
8389
8390 @item ggc-min-expand
8391
8392 GCC uses a garbage collector to manage its own memory allocation.  This
8393 parameter specifies the minimum percentage by which the garbage
8394 collector's heap should be allowed to expand between collections.
8395 Tuning this may improve compilation speed; it has no effect on code
8396 generation.
8397
8398 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8399 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
8400 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8401 GCC is not able to calculate RAM on a particular platform, the lower
8402 bound of 30% is used.  Setting this parameter and
8403 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8404 every opportunity.  This is extremely slow, but can be useful for
8405 debugging.
8406
8407 @item ggc-min-heapsize
8408
8409 Minimum size of the garbage collector's heap before it begins bothering
8410 to collect garbage.  The first collection occurs after the heap expands
8411 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8412 tuning this may improve compilation speed, and has no effect on code
8413 generation.
8414
8415 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
8416 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8417 with a lower bound of 4096 (four megabytes) and an upper bound of
8418 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8419 particular platform, the lower bound is used.  Setting this parameter
8420 very large effectively disables garbage collection.  Setting this
8421 parameter and @option{ggc-min-expand} to zero causes a full collection
8422 to occur at every opportunity.
8423
8424 @item max-reload-search-insns
8425 The maximum number of instruction reload should look backward for equivalent
8426 register.  Increasing values mean more aggressive optimization, making the
8427 compile time increase with probably slightly better performance.  The default
8428 value is 100.
8429
8430 @item max-cselib-memory-locations
8431 The maximum number of memory locations cselib should take into account.
8432 Increasing values mean more aggressive optimization, making the compile time
8433 increase with probably slightly better performance.  The default value is 500.
8434
8435 @item reorder-blocks-duplicate
8436 @itemx reorder-blocks-duplicate-feedback
8437
8438 Used by basic block reordering pass to decide whether to use unconditional
8439 branch or duplicate the code on its destination.  Code is duplicated when its
8440 estimated size is smaller than this value multiplied by the estimated size of
8441 unconditional jump in the hot spots of the program.
8442
8443 The @option{reorder-block-duplicate-feedback} is used only when profile
8444 feedback is available and may be set to higher values than
8445 @option{reorder-block-duplicate} since information about the hot spots is more
8446 accurate.
8447
8448 @item max-sched-ready-insns
8449 The maximum number of instructions ready to be issued the scheduler should
8450 consider at any given time during the first scheduling pass.  Increasing
8451 values mean more thorough searches, making the compilation time increase
8452 with probably little benefit.  The default value is 100.
8453
8454 @item max-sched-region-blocks
8455 The maximum number of blocks in a region to be considered for
8456 interblock scheduling.  The default value is 10.
8457
8458 @item max-pipeline-region-blocks
8459 The maximum number of blocks in a region to be considered for
8460 pipelining in the selective scheduler.  The default value is 15.
8461
8462 @item max-sched-region-insns
8463 The maximum number of insns in a region to be considered for
8464 interblock scheduling.  The default value is 100.
8465
8466 @item max-pipeline-region-insns
8467 The maximum number of insns in a region to be considered for
8468 pipelining in the selective scheduler.  The default value is 200.
8469
8470 @item min-spec-prob
8471 The minimum probability (in percents) of reaching a source block
8472 for interblock speculative scheduling.  The default value is 40.
8473
8474 @item max-sched-extend-regions-iters
8475 The maximum number of iterations through CFG to extend regions.
8476 0 - disable region extension,
8477 N - do at most N iterations.
8478 The default value is 0.
8479
8480 @item max-sched-insn-conflict-delay
8481 The maximum conflict delay for an insn to be considered for speculative motion.
8482 The default value is 3.
8483
8484 @item sched-spec-prob-cutoff
8485 The minimal probability of speculation success (in percents), so that
8486 speculative insn will be scheduled.
8487 The default value is 40.
8488
8489 @item sched-mem-true-dep-cost
8490 Minimal distance (in CPU cycles) between store and load targeting same
8491 memory locations.  The default value is 1.
8492
8493 @item selsched-max-lookahead
8494 The maximum size of the lookahead window of selective scheduling.  It is a
8495 depth of search for available instructions.
8496 The default value is 50.
8497
8498 @item selsched-max-sched-times
8499 The maximum number of times that an instruction will be scheduled during
8500 selective scheduling.  This is the limit on the number of iterations
8501 through which the instruction may be pipelined.  The default value is 2.
8502
8503 @item selsched-max-insns-to-rename
8504 The maximum number of best instructions in the ready list that are considered
8505 for renaming in the selective scheduler.  The default value is 2.
8506
8507 @item max-last-value-rtl
8508 The maximum size measured as number of RTLs that can be recorded in an expression
8509 in combiner for a pseudo register as last known value of that register.  The default
8510 is 10000.
8511
8512 @item integer-share-limit
8513 Small integer constants can use a shared data structure, reducing the
8514 compiler's memory usage and increasing its speed.  This sets the maximum
8515 value of a shared integer constant.  The default value is 256.
8516
8517 @item min-virtual-mappings
8518 Specifies the minimum number of virtual mappings in the incremental
8519 SSA updater that should be registered to trigger the virtual mappings
8520 heuristic defined by virtual-mappings-ratio.  The default value is
8521 100.
8522
8523 @item virtual-mappings-ratio
8524 If the number of virtual mappings is virtual-mappings-ratio bigger
8525 than the number of virtual symbols to be updated, then the incremental
8526 SSA updater switches to a full update for those symbols.  The default
8527 ratio is 3.
8528
8529 @item ssp-buffer-size
8530 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
8531 protection when @option{-fstack-protection} is used.
8532
8533 @item max-jump-thread-duplication-stmts
8534 Maximum number of statements allowed in a block that needs to be
8535 duplicated when threading jumps.
8536
8537 @item max-fields-for-field-sensitive
8538 Maximum number of fields in a structure we will treat in
8539 a field sensitive manner during pointer analysis.  The default is zero
8540 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
8541
8542 @item prefetch-latency
8543 Estimate on average number of instructions that are executed before
8544 prefetch finishes.  The distance we prefetch ahead is proportional
8545 to this constant.  Increasing this number may also lead to less
8546 streams being prefetched (see @option{simultaneous-prefetches}).
8547
8548 @item simultaneous-prefetches
8549 Maximum number of prefetches that can run at the same time.
8550
8551 @item l1-cache-line-size
8552 The size of cache line in L1 cache, in bytes.
8553
8554 @item l1-cache-size
8555 The size of L1 cache, in kilobytes.
8556
8557 @item l2-cache-size
8558 The size of L2 cache, in kilobytes.
8559
8560 @item min-insn-to-prefetch-ratio
8561 The minimum ratio between the number of instructions and the
8562 number of prefetches to enable prefetching in a loop.
8563
8564 @item prefetch-min-insn-to-mem-ratio
8565 The minimum ratio between the number of instructions and the
8566 number of memory references to enable prefetching in a loop.
8567
8568 @item use-canonical-types
8569 Whether the compiler should use the ``canonical'' type system.  By
8570 default, this should always be 1, which uses a more efficient internal
8571 mechanism for comparing types in C++ and Objective-C++.  However, if
8572 bugs in the canonical type system are causing compilation failures,
8573 set this value to 0 to disable canonical types.
8574
8575 @item switch-conversion-max-branch-ratio
8576 Switch initialization conversion will refuse to create arrays that are
8577 bigger than @option{switch-conversion-max-branch-ratio} times the number of
8578 branches in the switch.
8579
8580 @item max-partial-antic-length
8581 Maximum length of the partial antic set computed during the tree
8582 partial redundancy elimination optimization (@option{-ftree-pre}) when
8583 optimizing at @option{-O3} and above.  For some sorts of source code
8584 the enhanced partial redundancy elimination optimization can run away,
8585 consuming all of the memory available on the host machine.  This
8586 parameter sets a limit on the length of the sets that are computed,
8587 which prevents the runaway behavior.  Setting a value of 0 for
8588 this parameter will allow an unlimited set length.
8589
8590 @item sccvn-max-scc-size
8591 Maximum size of a strongly connected component (SCC) during SCCVN
8592 processing.  If this limit is hit, SCCVN processing for the whole
8593 function will not be done and optimizations depending on it will
8594 be disabled.  The default maximum SCC size is 10000.
8595
8596 @item ira-max-loops-num
8597 IRA uses a regional register allocation by default.  If a function
8598 contains loops more than number given by the parameter, only at most
8599 given number of the most frequently executed loops will form regions
8600 for the regional register allocation.  The default value of the
8601 parameter is 100.
8602
8603 @item ira-max-conflict-table-size
8604 Although IRA uses a sophisticated algorithm of compression conflict
8605 table, the table can be still big for huge functions.  If the conflict
8606 table for a function could be more than size in MB given by the
8607 parameter, the conflict table is not built and faster, simpler, and
8608 lower quality register allocation algorithm will be used.  The
8609 algorithm do not use pseudo-register conflicts.  The default value of
8610 the parameter is 2000.
8611
8612 @item ira-loop-reserved-regs
8613 IRA can be used to evaluate more accurate register pressure in loops
8614 for decision to move loop invariants (see @option{-O3}).  The number
8615 of available registers reserved for some other purposes is described
8616 by this parameter.  The default value of the parameter is 2 which is
8617 minimal number of registers needed for execution of typical
8618 instruction.  This value is the best found from numerous experiments.
8619
8620 @item loop-invariant-max-bbs-in-loop
8621 Loop invariant motion can be very expensive, both in compile time and
8622 in amount of needed compile time memory, with very large loops.  Loops
8623 with more basic blocks than this parameter won't have loop invariant
8624 motion optimization performed on them.  The default value of the
8625 parameter is 1000 for -O1 and 10000 for -O2 and above.
8626
8627 @item max-vartrack-size
8628 Sets a maximum number of hash table slots to use during variable
8629 tracking dataflow analysis of any function.  If this limit is exceeded
8630 with variable tracking at assignments enabled, analysis for that
8631 function is retried without it, after removing all debug insns from
8632 the function.  If the limit is exceeded even without debug insns, var
8633 tracking analysis is completely disabled for the function.  Setting
8634 the parameter to zero makes it unlimited.
8635
8636 @item min-nondebug-insn-uid
8637 Use uids starting at this parameter for nondebug insns.  The range below
8638 the parameter is reserved exclusively for debug insns created by
8639 @option{-fvar-tracking-assignments}, but debug insns may get
8640 (non-overlapping) uids above it if the reserved range is exhausted.
8641
8642 @item ipa-sra-ptr-growth-factor
8643 IPA-SRA will replace a pointer to an aggregate with one or more new
8644 parameters only when their cumulative size is less or equal to
8645 @option{ipa-sra-ptr-growth-factor} times the size of the original
8646 pointer parameter.
8647
8648 @item graphite-max-nb-scop-params
8649 To avoid exponential effects in the Graphite loop transforms, the
8650 number of parameters in a Static Control Part (SCoP) is bounded.  The
8651 default value is 10 parameters.  A variable whose value is unknown at
8652 compile time and defined outside a SCoP is a parameter of the SCoP.
8653
8654 @item graphite-max-bbs-per-function
8655 To avoid exponential effects in the detection of SCoPs, the size of
8656 the functions analyzed by Graphite is bounded.  The default value is
8657 100 basic blocks.
8658
8659 @item loop-block-tile-size
8660 Loop blocking or strip mining transforms, enabled with
8661 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
8662 loop in the loop nest by a given number of iterations.  The strip
8663 length can be changed using the @option{loop-block-tile-size}
8664 parameter.  The default value is 51 iterations.
8665
8666 @end table
8667 @end table
8668
8669 @node Preprocessor Options
8670 @section Options Controlling the Preprocessor
8671 @cindex preprocessor options
8672 @cindex options, preprocessor
8673
8674 These options control the C preprocessor, which is run on each C source
8675 file before actual compilation.
8676
8677 If you use the @option{-E} option, nothing is done except preprocessing.
8678 Some of these options make sense only together with @option{-E} because
8679 they cause the preprocessor output to be unsuitable for actual
8680 compilation.
8681
8682 @table @gcctabopt
8683 @item -Wp,@var{option}
8684 @opindex Wp
8685 You can use @option{-Wp,@var{option}} to bypass the compiler driver
8686 and pass @var{option} directly through to the preprocessor.  If
8687 @var{option} contains commas, it is split into multiple options at the
8688 commas.  However, many options are modified, translated or interpreted
8689 by the compiler driver before being passed to the preprocessor, and
8690 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
8691 interface is undocumented and subject to change, so whenever possible
8692 you should avoid using @option{-Wp} and let the driver handle the
8693 options instead.
8694
8695 @item -Xpreprocessor @var{option}
8696 @opindex Xpreprocessor
8697 Pass @var{option} as an option to the preprocessor.  You can use this to
8698 supply system-specific preprocessor options which GCC does not know how to
8699 recognize.
8700
8701 If you want to pass an option that takes an argument, you must use
8702 @option{-Xpreprocessor} twice, once for the option and once for the argument.
8703 @end table
8704
8705 @include cppopts.texi
8706
8707 @node Assembler Options
8708 @section Passing Options to the Assembler
8709
8710 @c prevent bad page break with this line
8711 You can pass options to the assembler.
8712
8713 @table @gcctabopt
8714 @item -Wa,@var{option}
8715 @opindex Wa
8716 Pass @var{option} as an option to the assembler.  If @var{option}
8717 contains commas, it is split into multiple options at the commas.
8718
8719 @item -Xassembler @var{option}
8720 @opindex Xassembler
8721 Pass @var{option} as an option to the assembler.  You can use this to
8722 supply system-specific assembler options which GCC does not know how to
8723 recognize.
8724
8725 If you want to pass an option that takes an argument, you must use
8726 @option{-Xassembler} twice, once for the option and once for the argument.
8727
8728 @end table
8729
8730 @node Link Options
8731 @section Options for Linking
8732 @cindex link options
8733 @cindex options, linking
8734
8735 These options come into play when the compiler links object files into
8736 an executable output file.  They are meaningless if the compiler is
8737 not doing a link step.
8738
8739 @table @gcctabopt
8740 @cindex file names
8741 @item @var{object-file-name}
8742 A file name that does not end in a special recognized suffix is
8743 considered to name an object file or library.  (Object files are
8744 distinguished from libraries by the linker according to the file
8745 contents.)  If linking is done, these object files are used as input
8746 to the linker.
8747
8748 @item -c
8749 @itemx -S
8750 @itemx -E
8751 @opindex c
8752 @opindex S
8753 @opindex E
8754 If any of these options is used, then the linker is not run, and
8755 object file names should not be used as arguments.  @xref{Overall
8756 Options}.
8757
8758 @cindex Libraries
8759 @item -l@var{library}
8760 @itemx -l @var{library}
8761 @opindex l
8762 Search the library named @var{library} when linking.  (The second
8763 alternative with the library as a separate argument is only for
8764 POSIX compliance and is not recommended.)
8765
8766 It makes a difference where in the command you write this option; the
8767 linker searches and processes libraries and object files in the order they
8768 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
8769 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
8770 to functions in @samp{z}, those functions may not be loaded.
8771
8772 The linker searches a standard list of directories for the library,
8773 which is actually a file named @file{lib@var{library}.a}.  The linker
8774 then uses this file as if it had been specified precisely by name.
8775
8776 The directories searched include several standard system directories
8777 plus any that you specify with @option{-L}.
8778
8779 Normally the files found this way are library files---archive files
8780 whose members are object files.  The linker handles an archive file by
8781 scanning through it for members which define symbols that have so far
8782 been referenced but not defined.  But if the file that is found is an
8783 ordinary object file, it is linked in the usual fashion.  The only
8784 difference between using an @option{-l} option and specifying a file name
8785 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
8786 and searches several directories.
8787
8788 @item -lobjc
8789 @opindex lobjc
8790 You need this special case of the @option{-l} option in order to
8791 link an Objective-C or Objective-C++ program.
8792
8793 @item -nostartfiles
8794 @opindex nostartfiles
8795 Do not use the standard system startup files when linking.
8796 The standard system libraries are used normally, unless @option{-nostdlib}
8797 or @option{-nodefaultlibs} is used.
8798
8799 @item -nodefaultlibs
8800 @opindex nodefaultlibs
8801 Do not use the standard system libraries when linking.
8802 Only the libraries you specify will be passed to the linker, options
8803 specifying linkage of the system libraries, such as @code{-static-libgcc}
8804 or @code{-shared-libgcc}, will be ignored.
8805 The standard startup files are used normally, unless @option{-nostartfiles}
8806 is used.  The compiler may generate calls to @code{memcmp},
8807 @code{memset}, @code{memcpy} and @code{memmove}.
8808 These entries are usually resolved by entries in
8809 libc.  These entry points should be supplied through some other
8810 mechanism when this option is specified.
8811
8812 @item -nostdlib
8813 @opindex nostdlib
8814 Do not use the standard system startup files or libraries when linking.
8815 No startup files and only the libraries you specify will be passed to
8816 the linker, options specifying linkage of the system libraries, such as
8817 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
8818 The compiler may generate calls to @code{memcmp}, @code{memset},
8819 @code{memcpy} and @code{memmove}.
8820 These entries are usually resolved by entries in
8821 libc.  These entry points should be supplied through some other
8822 mechanism when this option is specified.
8823
8824 @cindex @option{-lgcc}, use with @option{-nostdlib}
8825 @cindex @option{-nostdlib} and unresolved references
8826 @cindex unresolved references and @option{-nostdlib}
8827 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
8828 @cindex @option{-nodefaultlibs} and unresolved references
8829 @cindex unresolved references and @option{-nodefaultlibs}
8830 One of the standard libraries bypassed by @option{-nostdlib} and
8831 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
8832 that GCC uses to overcome shortcomings of particular machines, or special
8833 needs for some languages.
8834 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
8835 Collection (GCC) Internals},
8836 for more discussion of @file{libgcc.a}.)
8837 In most cases, you need @file{libgcc.a} even when you want to avoid
8838 other standard libraries.  In other words, when you specify @option{-nostdlib}
8839 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
8840 This ensures that you have no unresolved references to internal GCC
8841 library subroutines.  (For example, @samp{__main}, used to ensure C++
8842 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
8843 GNU Compiler Collection (GCC) Internals}.)
8844
8845 @item -pie
8846 @opindex pie
8847 Produce a position independent executable on targets which support it.
8848 For predictable results, you must also specify the same set of options
8849 that were used to generate code (@option{-fpie}, @option{-fPIE},
8850 or model suboptions) when you specify this option.
8851
8852 @item -rdynamic
8853 @opindex rdynamic
8854 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
8855 that support it. This instructs the linker to add all symbols, not
8856 only used ones, to the dynamic symbol table. This option is needed
8857 for some uses of @code{dlopen} or to allow obtaining backtraces
8858 from within a program.
8859
8860 @item -s
8861 @opindex s
8862 Remove all symbol table and relocation information from the executable.
8863
8864 @item -static
8865 @opindex static
8866 On systems that support dynamic linking, this prevents linking with the shared
8867 libraries.  On other systems, this option has no effect.
8868
8869 @item -shared
8870 @opindex shared
8871 Produce a shared object which can then be linked with other objects to
8872 form an executable.  Not all systems support this option.  For predictable
8873 results, you must also specify the same set of options that were used to
8874 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
8875 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
8876 needs to build supplementary stub code for constructors to work.  On
8877 multi-libbed systems, @samp{gcc -shared} must select the correct support
8878 libraries to link against.  Failing to supply the correct flags may lead
8879 to subtle defects.  Supplying them in cases where they are not necessary
8880 is innocuous.}
8881
8882 @item -shared-libgcc
8883 @itemx -static-libgcc
8884 @opindex shared-libgcc
8885 @opindex static-libgcc
8886 On systems that provide @file{libgcc} as a shared library, these options
8887 force the use of either the shared or static version respectively.
8888 If no shared version of @file{libgcc} was built when the compiler was
8889 configured, these options have no effect.
8890
8891 There are several situations in which an application should use the
8892 shared @file{libgcc} instead of the static version.  The most common
8893 of these is when the application wishes to throw and catch exceptions
8894 across different shared libraries.  In that case, each of the libraries
8895 as well as the application itself should use the shared @file{libgcc}.
8896
8897 Therefore, the G++ and GCJ drivers automatically add
8898 @option{-shared-libgcc} whenever you build a shared library or a main
8899 executable, because C++ and Java programs typically use exceptions, so
8900 this is the right thing to do.
8901
8902 If, instead, you use the GCC driver to create shared libraries, you may
8903 find that they will not always be linked with the shared @file{libgcc}.
8904 If GCC finds, at its configuration time, that you have a non-GNU linker
8905 or a GNU linker that does not support option @option{--eh-frame-hdr},
8906 it will link the shared version of @file{libgcc} into shared libraries
8907 by default.  Otherwise, it will take advantage of the linker and optimize
8908 away the linking with the shared version of @file{libgcc}, linking with
8909 the static version of libgcc by default.  This allows exceptions to
8910 propagate through such shared libraries, without incurring relocation
8911 costs at library load time.
8912
8913 However, if a library or main executable is supposed to throw or catch
8914 exceptions, you must link it using the G++ or GCJ driver, as appropriate
8915 for the languages used in the program, or using the option
8916 @option{-shared-libgcc}, such that it is linked with the shared
8917 @file{libgcc}.
8918
8919 @item -static-libstdc++
8920 When the @command{g++} program is used to link a C++ program, it will
8921 normally automatically link against @option{libstdc++}.  If
8922 @file{libstdc++} is available as a shared library, and the
8923 @option{-static} option is not used, then this will link against the
8924 shared version of @file{libstdc++}.  That is normally fine.  However, it
8925 is sometimes useful to freeze the version of @file{libstdc++} used by
8926 the program without going all the way to a fully static link.  The
8927 @option{-static-libstdc++} option directs the @command{g++} driver to
8928 link @file{libstdc++} statically, without necessarily linking other
8929 libraries statically.
8930
8931 @item -symbolic
8932 @opindex symbolic
8933 Bind references to global symbols when building a shared object.  Warn
8934 about any unresolved references (unless overridden by the link editor
8935 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
8936 this option.
8937
8938 @item -T @var{script}
8939 @opindex T
8940 @cindex linker script
8941 Use @var{script} as the linker script.  This option is supported by most
8942 systems using the GNU linker.  On some targets, such as bare-board
8943 targets without an operating system, the @option{-T} option may be required
8944 when linking to avoid references to undefined symbols.
8945
8946 @item -Xlinker @var{option}
8947 @opindex Xlinker
8948 Pass @var{option} as an option to the linker.  You can use this to
8949 supply system-specific linker options which GCC does not know how to
8950 recognize.
8951
8952 If you want to pass an option that takes a separate argument, you must use
8953 @option{-Xlinker} twice, once for the option and once for the argument.
8954 For example, to pass @option{-assert definitions}, you must write
8955 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
8956 @option{-Xlinker "-assert definitions"}, because this passes the entire
8957 string as a single argument, which is not what the linker expects.
8958
8959 When using the GNU linker, it is usually more convenient to pass
8960 arguments to linker options using the @option{@var{option}=@var{value}}
8961 syntax than as separate arguments.  For example, you can specify
8962 @samp{-Xlinker -Map=output.map} rather than
8963 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
8964 this syntax for command-line options.
8965
8966 @item -Wl,@var{option}
8967 @opindex Wl
8968 Pass @var{option} as an option to the linker.  If @var{option} contains
8969 commas, it is split into multiple options at the commas.  You can use this
8970 syntax to pass an argument to the option.
8971 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
8972 linker.  When using the GNU linker, you can also get the same effect with
8973 @samp{-Wl,-Map=output.map}.
8974
8975 @item -u @var{symbol}
8976 @opindex u
8977 Pretend the symbol @var{symbol} is undefined, to force linking of
8978 library modules to define it.  You can use @option{-u} multiple times with
8979 different symbols to force loading of additional library modules.
8980 @end table
8981
8982 @node Directory Options
8983 @section Options for Directory Search
8984 @cindex directory options
8985 @cindex options, directory search
8986 @cindex search path
8987
8988 These options specify directories to search for header files, for
8989 libraries and for parts of the compiler:
8990
8991 @table @gcctabopt
8992 @item -I@var{dir}
8993 @opindex I
8994 Add the directory @var{dir} to the head of the list of directories to be
8995 searched for header files.  This can be used to override a system header
8996 file, substituting your own version, since these directories are
8997 searched before the system header file directories.  However, you should
8998 not use this option to add directories that contain vendor-supplied
8999 system header files (use @option{-isystem} for that).  If you use more than
9000 one @option{-I} option, the directories are scanned in left-to-right
9001 order; the standard system directories come after.
9002
9003 If a standard system include directory, or a directory specified with
9004 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9005 option will be ignored.  The directory will still be searched but as a
9006 system directory at its normal position in the system include chain.
9007 This is to ensure that GCC's procedure to fix buggy system headers and
9008 the ordering for the include_next directive are not inadvertently changed.
9009 If you really need to change the search order for system directories,
9010 use the @option{-nostdinc} and/or @option{-isystem} options.
9011
9012 @item -iplugindir=@var{dir}
9013 Set the directory to search for plugins which are passed
9014 by @option{-fplugin=@var{name}} instead of
9015 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9016 to be used by the user, but only passed by the driver.
9017
9018 @item -iquote@var{dir}
9019 @opindex iquote
9020 Add the directory @var{dir} to the head of the list of directories to
9021 be searched for header files only for the case of @samp{#include
9022 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9023 otherwise just like @option{-I}.
9024
9025 @item -L@var{dir}
9026 @opindex L
9027 Add directory @var{dir} to the list of directories to be searched
9028 for @option{-l}.
9029
9030 @item -B@var{prefix}
9031 @opindex B
9032 This option specifies where to find the executables, libraries,
9033 include files, and data files of the compiler itself.
9034
9035 The compiler driver program runs one or more of the subprograms
9036 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
9037 @var{prefix} as a prefix for each program it tries to run, both with and
9038 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9039
9040 For each subprogram to be run, the compiler driver first tries the
9041 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9042 was not specified, the driver tries two standard prefixes, which are
9043 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9044 those results in a file name that is found, the unmodified program
9045 name is searched for using the directories specified in your
9046 @env{PATH} environment variable.
9047
9048 The compiler will check to see if the path provided by the @option{-B}
9049 refers to a directory, and if necessary it will add a directory
9050 separator character at the end of the path.
9051
9052 @option{-B} prefixes that effectively specify directory names also apply
9053 to libraries in the linker, because the compiler translates these
9054 options into @option{-L} options for the linker.  They also apply to
9055 includes files in the preprocessor, because the compiler translates these
9056 options into @option{-isystem} options for the preprocessor.  In this case,
9057 the compiler appends @samp{include} to the prefix.
9058
9059 The run-time support file @file{libgcc.a} can also be searched for using
9060 the @option{-B} prefix, if needed.  If it is not found there, the two
9061 standard prefixes above are tried, and that is all.  The file is left
9062 out of the link if it is not found by those means.
9063
9064 Another way to specify a prefix much like the @option{-B} prefix is to use
9065 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9066 Variables}.
9067
9068 As a special kludge, if the path provided by @option{-B} is
9069 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9070 9, then it will be replaced by @file{[dir/]include}.  This is to help
9071 with boot-strapping the compiler.
9072
9073 @item -specs=@var{file}
9074 @opindex specs
9075 Process @var{file} after the compiler reads in the standard @file{specs}
9076 file, in order to override the defaults that the @file{gcc} driver
9077 program uses when determining what switches to pass to @file{cc1},
9078 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
9079 @option{-specs=@var{file}} can be specified on the command line, and they
9080 are processed in order, from left to right.
9081
9082 @item --sysroot=@var{dir}
9083 @opindex sysroot
9084 Use @var{dir} as the logical root directory for headers and libraries.
9085 For example, if the compiler would normally search for headers in
9086 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
9087 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9088
9089 If you use both this option and the @option{-isysroot} option, then
9090 the @option{--sysroot} option will apply to libraries, but the
9091 @option{-isysroot} option will apply to header files.
9092
9093 The GNU linker (beginning with version 2.16) has the necessary support
9094 for this option.  If your linker does not support this option, the
9095 header file aspect of @option{--sysroot} will still work, but the
9096 library aspect will not.
9097
9098 @item -I-
9099 @opindex I-
9100 This option has been deprecated.  Please use @option{-iquote} instead for
9101 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9102 Any directories you specify with @option{-I} options before the @option{-I-}
9103 option are searched only for the case of @samp{#include "@var{file}"};
9104 they are not searched for @samp{#include <@var{file}>}.
9105
9106 If additional directories are specified with @option{-I} options after
9107 the @option{-I-}, these directories are searched for all @samp{#include}
9108 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9109 this way.)
9110
9111 In addition, the @option{-I-} option inhibits the use of the current
9112 directory (where the current input file came from) as the first search
9113 directory for @samp{#include "@var{file}"}.  There is no way to
9114 override this effect of @option{-I-}.  With @option{-I.} you can specify
9115 searching the directory which was current when the compiler was
9116 invoked.  That is not exactly the same as what the preprocessor does
9117 by default, but it is often satisfactory.
9118
9119 @option{-I-} does not inhibit the use of the standard system directories
9120 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9121 independent.
9122 @end table
9123
9124 @c man end
9125
9126 @node Spec Files
9127 @section Specifying subprocesses and the switches to pass to them
9128 @cindex Spec Files
9129
9130 @command{gcc} is a driver program.  It performs its job by invoking a
9131 sequence of other programs to do the work of compiling, assembling and
9132 linking.  GCC interprets its command-line parameters and uses these to
9133 deduce which programs it should invoke, and which command-line options
9134 it ought to place on their command lines.  This behavior is controlled
9135 by @dfn{spec strings}.  In most cases there is one spec string for each
9136 program that GCC can invoke, but a few programs have multiple spec
9137 strings to control their behavior.  The spec strings built into GCC can
9138 be overridden by using the @option{-specs=} command-line switch to specify
9139 a spec file.
9140
9141 @dfn{Spec files} are plaintext files that are used to construct spec
9142 strings.  They consist of a sequence of directives separated by blank
9143 lines.  The type of directive is determined by the first non-whitespace
9144 character on the line and it can be one of the following:
9145
9146 @table @code
9147 @item %@var{command}
9148 Issues a @var{command} to the spec file processor.  The commands that can
9149 appear here are:
9150
9151 @table @code
9152 @item %include <@var{file}>
9153 @cindex %include
9154 Search for @var{file} and insert its text at the current point in the
9155 specs file.
9156
9157 @item %include_noerr <@var{file}>
9158 @cindex %include_noerr
9159 Just like @samp{%include}, but do not generate an error message if the include
9160 file cannot be found.
9161
9162 @item %rename @var{old_name} @var{new_name}
9163 @cindex %rename
9164 Rename the spec string @var{old_name} to @var{new_name}.
9165
9166 @end table
9167
9168 @item *[@var{spec_name}]:
9169 This tells the compiler to create, override or delete the named spec
9170 string.  All lines after this directive up to the next directive or
9171 blank line are considered to be the text for the spec string.  If this
9172 results in an empty string then the spec will be deleted.  (Or, if the
9173 spec did not exist, then nothing will happened.)  Otherwise, if the spec
9174 does not currently exist a new spec will be created.  If the spec does
9175 exist then its contents will be overridden by the text of this
9176 directive, unless the first character of that text is the @samp{+}
9177 character, in which case the text will be appended to the spec.
9178
9179 @item [@var{suffix}]:
9180 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9181 and up to the next directive or blank line are considered to make up the
9182 spec string for the indicated suffix.  When the compiler encounters an
9183 input file with the named suffix, it will processes the spec string in
9184 order to work out how to compile that file.  For example:
9185
9186 @smallexample
9187 .ZZ:
9188 z-compile -input %i
9189 @end smallexample
9190
9191 This says that any input file whose name ends in @samp{.ZZ} should be
9192 passed to the program @samp{z-compile}, which should be invoked with the
9193 command-line switch @option{-input} and with the result of performing the
9194 @samp{%i} substitution.  (See below.)
9195
9196 As an alternative to providing a spec string, the text that follows a
9197 suffix directive can be one of the following:
9198
9199 @table @code
9200 @item @@@var{language}
9201 This says that the suffix is an alias for a known @var{language}.  This is
9202 similar to using the @option{-x} command-line switch to GCC to specify a
9203 language explicitly.  For example:
9204
9205 @smallexample
9206 .ZZ:
9207 @@c++
9208 @end smallexample
9209
9210 Says that .ZZ files are, in fact, C++ source files.
9211
9212 @item #@var{name}
9213 This causes an error messages saying:
9214
9215 @smallexample
9216 @var{name} compiler not installed on this system.
9217 @end smallexample
9218 @end table
9219
9220 GCC already has an extensive list of suffixes built into it.
9221 This directive will add an entry to the end of the list of suffixes, but
9222 since the list is searched from the end backwards, it is effectively
9223 possible to override earlier entries using this technique.
9224
9225 @end table
9226
9227 GCC has the following spec strings built into it.  Spec files can
9228 override these strings or create their own.  Note that individual
9229 targets can also add their own spec strings to this list.
9230
9231 @smallexample
9232 asm          Options to pass to the assembler
9233 asm_final    Options to pass to the assembler post-processor
9234 cpp          Options to pass to the C preprocessor
9235 cc1          Options to pass to the C compiler
9236 cc1plus      Options to pass to the C++ compiler
9237 endfile      Object files to include at the end of the link
9238 link         Options to pass to the linker
9239 lib          Libraries to include on the command line to the linker
9240 libgcc       Decides which GCC support library to pass to the linker
9241 linker       Sets the name of the linker
9242 predefines   Defines to be passed to the C preprocessor
9243 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9244              by default
9245 startfile    Object files to include at the start of the link
9246 @end smallexample
9247
9248 Here is a small example of a spec file:
9249
9250 @smallexample
9251 %rename lib                 old_lib
9252
9253 *lib:
9254 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9255 @end smallexample
9256
9257 This example renames the spec called @samp{lib} to @samp{old_lib} and
9258 then overrides the previous definition of @samp{lib} with a new one.
9259 The new definition adds in some extra command-line options before
9260 including the text of the old definition.
9261
9262 @dfn{Spec strings} are a list of command-line options to be passed to their
9263 corresponding program.  In addition, the spec strings can contain
9264 @samp{%}-prefixed sequences to substitute variable text or to
9265 conditionally insert text into the command line.  Using these constructs
9266 it is possible to generate quite complex command lines.
9267
9268 Here is a table of all defined @samp{%}-sequences for spec
9269 strings.  Note that spaces are not generated automatically around the
9270 results of expanding these sequences.  Therefore you can concatenate them
9271 together or combine them with constant text in a single argument.
9272
9273 @table @code
9274 @item %%
9275 Substitute one @samp{%} into the program name or argument.
9276
9277 @item %i
9278 Substitute the name of the input file being processed.
9279
9280 @item %b
9281 Substitute the basename of the input file being processed.
9282 This is the substring up to (and not including) the last period
9283 and not including the directory.
9284
9285 @item %B
9286 This is the same as @samp{%b}, but include the file suffix (text after
9287 the last period).
9288
9289 @item %d
9290 Marks the argument containing or following the @samp{%d} as a
9291 temporary file name, so that that file will be deleted if GCC exits
9292 successfully.  Unlike @samp{%g}, this contributes no text to the
9293 argument.
9294
9295 @item %g@var{suffix}
9296 Substitute a file name that has suffix @var{suffix} and is chosen
9297 once per compilation, and mark the argument in the same way as
9298 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9299 name is now chosen in a way that is hard to predict even when previously
9300 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9301 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9302 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9303 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9304 was simply substituted with a file name chosen once per compilation,
9305 without regard to any appended suffix (which was therefore treated
9306 just like ordinary text), making such attacks more likely to succeed.
9307
9308 @item %u@var{suffix}
9309 Like @samp{%g}, but generates a new temporary file name even if
9310 @samp{%u@var{suffix}} was already seen.
9311
9312 @item %U@var{suffix}
9313 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9314 new one if there is no such last file name.  In the absence of any
9315 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9316 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9317 would involve the generation of two distinct file names, one
9318 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9319 simply substituted with a file name chosen for the previous @samp{%u},
9320 without regard to any appended suffix.
9321
9322 @item %j@var{suffix}
9323 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9324 writable, and if save-temps is off; otherwise, substitute the name
9325 of a temporary file, just like @samp{%u}.  This temporary file is not
9326 meant for communication between processes, but rather as a junk
9327 disposal mechanism.
9328
9329 @item %|@var{suffix}
9330 @itemx %m@var{suffix}
9331 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9332 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9333 all.  These are the two most common ways to instruct a program that it
9334 should read from standard input or write to standard output.  If you
9335 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9336 construct: see for example @file{f/lang-specs.h}.
9337
9338 @item %.@var{SUFFIX}
9339 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9340 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9341 terminated by the next space or %.
9342
9343 @item %w
9344 Marks the argument containing or following the @samp{%w} as the
9345 designated output file of this compilation.  This puts the argument
9346 into the sequence of arguments that @samp{%o} will substitute later.
9347
9348 @item %o
9349 Substitutes the names of all the output files, with spaces
9350 automatically placed around them.  You should write spaces
9351 around the @samp{%o} as well or the results are undefined.
9352 @samp{%o} is for use in the specs for running the linker.
9353 Input files whose names have no recognized suffix are not compiled
9354 at all, but they are included among the output files, so they will
9355 be linked.
9356
9357 @item %O
9358 Substitutes the suffix for object files.  Note that this is
9359 handled specially when it immediately follows @samp{%g, %u, or %U},
9360 because of the need for those to form complete file names.  The
9361 handling is such that @samp{%O} is treated exactly as if it had already
9362 been substituted, except that @samp{%g, %u, and %U} do not currently
9363 support additional @var{suffix} characters following @samp{%O} as they would
9364 following, for example, @samp{.o}.
9365
9366 @item %p
9367 Substitutes the standard macro predefinitions for the
9368 current target machine.  Use this when running @code{cpp}.
9369
9370 @item %P
9371 Like @samp{%p}, but puts @samp{__} before and after the name of each
9372 predefined macro, except for macros that start with @samp{__} or with
9373 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
9374 C@.
9375
9376 @item %I
9377 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
9378 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
9379 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
9380 and @option{-imultilib} as necessary.
9381
9382 @item %s
9383 Current argument is the name of a library or startup file of some sort.
9384 Search for that file in a standard list of directories and substitute
9385 the full name found.  The current working directory is included in the
9386 list of directories scanned.
9387
9388 @item %T
9389 Current argument is the name of a linker script.  Search for that file
9390 in the current list of directories to scan for libraries. If the file
9391 is located insert a @option{--script} option into the command line
9392 followed by the full path name found.  If the file is not found then
9393 generate an error message.  Note: the current working directory is not
9394 searched.
9395
9396 @item %e@var{str}
9397 Print @var{str} as an error message.  @var{str} is terminated by a newline.
9398 Use this when inconsistent options are detected.
9399
9400 @item %(@var{name})
9401 Substitute the contents of spec string @var{name} at this point.
9402
9403 @item %[@var{name}]
9404 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
9405
9406 @item %x@{@var{option}@}
9407 Accumulate an option for @samp{%X}.
9408
9409 @item %X
9410 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
9411 spec string.
9412
9413 @item %Y
9414 Output the accumulated assembler options specified by @option{-Wa}.
9415
9416 @item %Z
9417 Output the accumulated preprocessor options specified by @option{-Wp}.
9418
9419 @item %a
9420 Process the @code{asm} spec.  This is used to compute the
9421 switches to be passed to the assembler.
9422
9423 @item %A
9424 Process the @code{asm_final} spec.  This is a spec string for
9425 passing switches to an assembler post-processor, if such a program is
9426 needed.
9427
9428 @item %l
9429 Process the @code{link} spec.  This is the spec for computing the
9430 command line passed to the linker.  Typically it will make use of the
9431 @samp{%L %G %S %D and %E} sequences.
9432
9433 @item %D
9434 Dump out a @option{-L} option for each directory that GCC believes might
9435 contain startup files.  If the target supports multilibs then the
9436 current multilib directory will be prepended to each of these paths.
9437
9438 @item %L
9439 Process the @code{lib} spec.  This is a spec string for deciding which
9440 libraries should be included on the command line to the linker.
9441
9442 @item %G
9443 Process the @code{libgcc} spec.  This is a spec string for deciding
9444 which GCC support library should be included on the command line to the linker.
9445
9446 @item %S
9447 Process the @code{startfile} spec.  This is a spec for deciding which
9448 object files should be the first ones passed to the linker.  Typically
9449 this might be a file named @file{crt0.o}.
9450
9451 @item %E
9452 Process the @code{endfile} spec.  This is a spec string that specifies
9453 the last object files that will be passed to the linker.
9454
9455 @item %C
9456 Process the @code{cpp} spec.  This is used to construct the arguments
9457 to be passed to the C preprocessor.
9458
9459 @item %1
9460 Process the @code{cc1} spec.  This is used to construct the options to be
9461 passed to the actual C compiler (@samp{cc1}).
9462
9463 @item %2
9464 Process the @code{cc1plus} spec.  This is used to construct the options to be
9465 passed to the actual C++ compiler (@samp{cc1plus}).
9466
9467 @item %*
9468 Substitute the variable part of a matched option.  See below.
9469 Note that each comma in the substituted string is replaced by
9470 a single space.
9471
9472 @item %<@code{S}
9473 Remove all occurrences of @code{-S} from the command line.  Note---this
9474 command is position dependent.  @samp{%} commands in the spec string
9475 before this one will see @code{-S}, @samp{%} commands in the spec string
9476 after this one will not.
9477
9478 @item %:@var{function}(@var{args})
9479 Call the named function @var{function}, passing it @var{args}.
9480 @var{args} is first processed as a nested spec string, then split
9481 into an argument vector in the usual fashion.  The function returns
9482 a string which is processed as if it had appeared literally as part
9483 of the current spec.
9484
9485 The following built-in spec functions are provided:
9486
9487 @table @code
9488 @item @code{getenv}
9489 The @code{getenv} spec function takes two arguments: an environment
9490 variable name and a string.  If the environment variable is not
9491 defined, a fatal error is issued.  Otherwise, the return value is the
9492 value of the environment variable concatenated with the string.  For
9493 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
9494
9495 @smallexample
9496 %:getenv(TOPDIR /include)
9497 @end smallexample
9498
9499 expands to @file{/path/to/top/include}.
9500
9501 @item @code{if-exists}
9502 The @code{if-exists} spec function takes one argument, an absolute
9503 pathname to a file.  If the file exists, @code{if-exists} returns the
9504 pathname.  Here is a small example of its usage:
9505
9506 @smallexample
9507 *startfile:
9508 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
9509 @end smallexample
9510
9511 @item @code{if-exists-else}
9512 The @code{if-exists-else} spec function is similar to the @code{if-exists}
9513 spec function, except that it takes two arguments.  The first argument is
9514 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
9515 returns the pathname.  If it does not exist, it returns the second argument.
9516 This way, @code{if-exists-else} can be used to select one file or another,
9517 based on the existence of the first.  Here is a small example of its usage:
9518
9519 @smallexample
9520 *startfile:
9521 crt0%O%s %:if-exists(crti%O%s) \
9522 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
9523 @end smallexample
9524
9525 @item @code{replace-outfile}
9526 The @code{replace-outfile} spec function takes two arguments.  It looks for the
9527 first argument in the outfiles array and replaces it with the second argument.  Here
9528 is a small example of its usage:
9529
9530 @smallexample
9531 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
9532 @end smallexample
9533
9534 @item @code{print-asm-header}
9535 The @code{print-asm-header} function takes no arguments and simply
9536 prints a banner like:
9537
9538 @smallexample
9539 Assembler options
9540 =================
9541
9542 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
9543 @end smallexample
9544
9545 It is used to separate compiler options from assembler options
9546 in the @option{--target-help} output.
9547 @end table
9548
9549 @item %@{@code{S}@}
9550 Substitutes the @code{-S} switch, if that switch was given to GCC@.
9551 If that switch was not specified, this substitutes nothing.  Note that
9552 the leading dash is omitted when specifying this option, and it is
9553 automatically inserted if the substitution is performed.  Thus the spec
9554 string @samp{%@{foo@}} would match the command-line option @option{-foo}
9555 and would output the command line option @option{-foo}.
9556
9557 @item %W@{@code{S}@}
9558 Like %@{@code{S}@} but mark last argument supplied within as a file to be
9559 deleted on failure.
9560
9561 @item %@{@code{S}*@}
9562 Substitutes all the switches specified to GCC whose names start
9563 with @code{-S}, but which also take an argument.  This is used for
9564 switches like @option{-o}, @option{-D}, @option{-I}, etc.
9565 GCC considers @option{-o foo} as being
9566 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
9567 text, including the space.  Thus two arguments would be generated.
9568
9569 @item %@{@code{S}*&@code{T}*@}
9570 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
9571 (the order of @code{S} and @code{T} in the spec is not significant).
9572 There can be any number of ampersand-separated variables; for each the
9573 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
9574
9575 @item %@{@code{S}:@code{X}@}
9576 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
9577
9578 @item %@{!@code{S}:@code{X}@}
9579 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
9580
9581 @item %@{@code{S}*:@code{X}@}
9582 Substitutes @code{X} if one or more switches whose names start with
9583 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
9584 once, no matter how many such switches appeared.  However, if @code{%*}
9585 appears somewhere in @code{X}, then @code{X} will be substituted once
9586 for each matching switch, with the @code{%*} replaced by the part of
9587 that switch that matched the @code{*}.
9588
9589 @item %@{.@code{S}:@code{X}@}
9590 Substitutes @code{X}, if processing a file with suffix @code{S}.
9591
9592 @item %@{!.@code{S}:@code{X}@}
9593 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
9594
9595 @item %@{,@code{S}:@code{X}@}
9596 Substitutes @code{X}, if processing a file for language @code{S}.
9597
9598 @item %@{!,@code{S}:@code{X}@}
9599 Substitutes @code{X}, if not processing a file for language @code{S}.
9600
9601 @item %@{@code{S}|@code{P}:@code{X}@}
9602 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
9603 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
9604 @code{*} sequences as well, although they have a stronger binding than
9605 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
9606 alternatives must be starred, and only the first matching alternative
9607 is substituted.
9608
9609 For example, a spec string like this:
9610
9611 @smallexample
9612 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
9613 @end smallexample
9614
9615 will output the following command-line options from the following input
9616 command-line options:
9617
9618 @smallexample
9619 fred.c        -foo -baz
9620 jim.d         -bar -boggle
9621 -d fred.c     -foo -baz -boggle
9622 -d jim.d      -bar -baz -boggle
9623 @end smallexample
9624
9625 @item %@{S:X; T:Y; :D@}
9626
9627 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
9628 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
9629 be as many clauses as you need.  This may be combined with @code{.},
9630 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
9631
9632
9633 @end table
9634
9635 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
9636 construct may contain other nested @samp{%} constructs or spaces, or
9637 even newlines.  They are processed as usual, as described above.
9638 Trailing white space in @code{X} is ignored.  White space may also
9639 appear anywhere on the left side of the colon in these constructs,
9640 except between @code{.} or @code{*} and the corresponding word.
9641
9642 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
9643 handled specifically in these constructs.  If another value of
9644 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
9645 @option{-W} switch is found later in the command line, the earlier
9646 switch value is ignored, except with @{@code{S}*@} where @code{S} is
9647 just one letter, which passes all matching options.
9648
9649 The character @samp{|} at the beginning of the predicate text is used to
9650 indicate that a command should be piped to the following command, but
9651 only if @option{-pipe} is specified.
9652
9653 It is built into GCC which switches take arguments and which do not.
9654 (You might think it would be useful to generalize this to allow each
9655 compiler's spec to say which switches take arguments.  But this cannot
9656 be done in a consistent fashion.  GCC cannot even decide which input
9657 files have been specified without knowing which switches take arguments,
9658 and it must know which input files to compile in order to tell which
9659 compilers to run).
9660
9661 GCC also knows implicitly that arguments starting in @option{-l} are to be
9662 treated as compiler output files, and passed to the linker in their
9663 proper position among the other output files.
9664
9665 @c man begin OPTIONS
9666
9667 @node Target Options
9668 @section Specifying Target Machine and Compiler Version
9669 @cindex target options
9670 @cindex cross compiling
9671 @cindex specifying machine version
9672 @cindex specifying compiler version and target machine
9673 @cindex compiler version, specifying
9674 @cindex target machine, specifying
9675
9676 The usual way to run GCC is to run the executable called @file{gcc}, or
9677 @file{<machine>-gcc} when cross-compiling, or
9678 @file{<machine>-gcc-<version>} to run a version other than the one that
9679 was installed last.
9680
9681 @node Submodel Options
9682 @section Hardware Models and Configurations
9683 @cindex submodel options
9684 @cindex specifying hardware config
9685 @cindex hardware models and configurations, specifying
9686 @cindex machine dependent options
9687
9688 Each target machine types can have its own
9689 special options, starting with @samp{-m}, to choose among various
9690 hardware models or configurations---for example, 68010 vs 68020,
9691 floating coprocessor or none.  A single installed version of the
9692 compiler can compile for any model or configuration, according to the
9693 options specified.
9694
9695 Some configurations of the compiler also support additional special
9696 options, usually for compatibility with other compilers on the same
9697 platform.
9698
9699 @c This list is ordered alphanumerically by subsection name.
9700 @c It should be the same order and spelling as these options are listed
9701 @c in Machine Dependent Options
9702
9703 @menu
9704 * ARC Options::
9705 * ARM Options::
9706 * AVR Options::
9707 * Blackfin Options::
9708 * CRIS Options::
9709 * CRX Options::
9710 * Darwin Options::
9711 * DEC Alpha Options::
9712 * DEC Alpha/VMS Options::
9713 * FR30 Options::
9714 * FRV Options::
9715 * GNU/Linux Options::
9716 * H8/300 Options::
9717 * HPPA Options::
9718 * i386 and x86-64 Options::
9719 * i386 and x86-64 Windows Options::
9720 * IA-64 Options::
9721 * IA-64/VMS Options::
9722 * LM32 Options::
9723 * M32C Options::
9724 * M32R/D Options::
9725 * M680x0 Options::
9726 * M68hc1x Options::
9727 * MCore Options::
9728 * MeP Options::
9729 * MIPS Options::
9730 * MMIX Options::
9731 * MN10300 Options::
9732 * PDP-11 Options::
9733 * picoChip Options::
9734 * PowerPC Options::
9735 * RS/6000 and PowerPC Options::
9736 * RX Options::
9737 * S/390 and zSeries Options::
9738 * Score Options::
9739 * SH Options::
9740 * SPARC Options::
9741 * SPU Options::
9742 * System V Options::
9743 * V850 Options::
9744 * VAX Options::
9745 * VxWorks Options::
9746 * x86-64 Options::
9747 * Xstormy16 Options::
9748 * Xtensa Options::
9749 * zSeries Options::
9750 @end menu
9751
9752 @node ARC Options
9753 @subsection ARC Options
9754 @cindex ARC Options
9755
9756 These options are defined for ARC implementations:
9757
9758 @table @gcctabopt
9759 @item -EL
9760 @opindex EL
9761 Compile code for little endian mode.  This is the default.
9762
9763 @item -EB
9764 @opindex EB
9765 Compile code for big endian mode.
9766
9767 @item -mmangle-cpu
9768 @opindex mmangle-cpu
9769 Prepend the name of the cpu to all public symbol names.
9770 In multiple-processor systems, there are many ARC variants with different
9771 instruction and register set characteristics.  This flag prevents code
9772 compiled for one cpu to be linked with code compiled for another.
9773 No facility exists for handling variants that are ``almost identical''.
9774 This is an all or nothing option.
9775
9776 @item -mcpu=@var{cpu}
9777 @opindex mcpu
9778 Compile code for ARC variant @var{cpu}.
9779 Which variants are supported depend on the configuration.
9780 All variants support @option{-mcpu=base}, this is the default.
9781
9782 @item -mtext=@var{text-section}
9783 @itemx -mdata=@var{data-section}
9784 @itemx -mrodata=@var{readonly-data-section}
9785 @opindex mtext
9786 @opindex mdata
9787 @opindex mrodata
9788 Put functions, data, and readonly data in @var{text-section},
9789 @var{data-section}, and @var{readonly-data-section} respectively
9790 by default.  This can be overridden with the @code{section} attribute.
9791 @xref{Variable Attributes}.
9792
9793 @end table
9794
9795 @node ARM Options
9796 @subsection ARM Options
9797 @cindex ARM options
9798
9799 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
9800 architectures:
9801
9802 @table @gcctabopt
9803 @item -mabi=@var{name}
9804 @opindex mabi
9805 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
9806 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
9807
9808 @item -mapcs-frame
9809 @opindex mapcs-frame
9810 Generate a stack frame that is compliant with the ARM Procedure Call
9811 Standard for all functions, even if this is not strictly necessary for
9812 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
9813 with this option will cause the stack frames not to be generated for
9814 leaf functions.  The default is @option{-mno-apcs-frame}.
9815
9816 @item -mapcs
9817 @opindex mapcs
9818 This is a synonym for @option{-mapcs-frame}.
9819
9820 @ignore
9821 @c not currently implemented
9822 @item -mapcs-stack-check
9823 @opindex mapcs-stack-check
9824 Generate code to check the amount of stack space available upon entry to
9825 every function (that actually uses some stack space).  If there is
9826 insufficient space available then either the function
9827 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
9828 called, depending upon the amount of stack space required.  The run time
9829 system is required to provide these functions.  The default is
9830 @option{-mno-apcs-stack-check}, since this produces smaller code.
9831
9832 @c not currently implemented
9833 @item -mapcs-float
9834 @opindex mapcs-float
9835 Pass floating point arguments using the float point registers.  This is
9836 one of the variants of the APCS@.  This option is recommended if the
9837 target hardware has a floating point unit or if a lot of floating point
9838 arithmetic is going to be performed by the code.  The default is
9839 @option{-mno-apcs-float}, since integer only code is slightly increased in
9840 size if @option{-mapcs-float} is used.
9841
9842 @c not currently implemented
9843 @item -mapcs-reentrant
9844 @opindex mapcs-reentrant
9845 Generate reentrant, position independent code.  The default is
9846 @option{-mno-apcs-reentrant}.
9847 @end ignore
9848
9849 @item -mthumb-interwork
9850 @opindex mthumb-interwork
9851 Generate code which supports calling between the ARM and Thumb
9852 instruction sets.  Without this option the two instruction sets cannot
9853 be reliably used inside one program.  The default is
9854 @option{-mno-thumb-interwork}, since slightly larger code is generated
9855 when @option{-mthumb-interwork} is specified.
9856
9857 @item -mno-sched-prolog
9858 @opindex mno-sched-prolog
9859 Prevent the reordering of instructions in the function prolog, or the
9860 merging of those instruction with the instructions in the function's
9861 body.  This means that all functions will start with a recognizable set
9862 of instructions (or in fact one of a choice from a small set of
9863 different function prologues), and this information can be used to
9864 locate the start if functions inside an executable piece of code.  The
9865 default is @option{-msched-prolog}.
9866
9867 @item -mfloat-abi=@var{name}
9868 @opindex mfloat-abi
9869 Specifies which floating-point ABI to use.  Permissible values
9870 are: @samp{soft}, @samp{softfp} and @samp{hard}.
9871
9872 Specifying @samp{soft} causes GCC to generate output containing
9873 library calls for floating-point operations.
9874 @samp{softfp} allows the generation of code using hardware floating-point
9875 instructions, but still uses the soft-float calling conventions.
9876 @samp{hard} allows generation of floating-point instructions
9877 and uses FPU-specific calling conventions.
9878
9879 The default depends on the specific target configuration.  Note that
9880 the hard-float and soft-float ABIs are not link-compatible; you must
9881 compile your entire program with the same ABI, and link with a
9882 compatible set of libraries.
9883
9884 @item -mhard-float
9885 @opindex mhard-float
9886 Equivalent to @option{-mfloat-abi=hard}.
9887
9888 @item -msoft-float
9889 @opindex msoft-float
9890 Equivalent to @option{-mfloat-abi=soft}.
9891
9892 @item -mlittle-endian
9893 @opindex mlittle-endian
9894 Generate code for a processor running in little-endian mode.  This is
9895 the default for all standard configurations.
9896
9897 @item -mbig-endian
9898 @opindex mbig-endian
9899 Generate code for a processor running in big-endian mode; the default is
9900 to compile code for a little-endian processor.
9901
9902 @item -mwords-little-endian
9903 @opindex mwords-little-endian
9904 This option only applies when generating code for big-endian processors.
9905 Generate code for a little-endian word order but a big-endian byte
9906 order.  That is, a byte order of the form @samp{32107654}.  Note: this
9907 option should only be used if you require compatibility with code for
9908 big-endian ARM processors generated by versions of the compiler prior to
9909 2.8.
9910
9911 @item -mcpu=@var{name}
9912 @opindex mcpu
9913 This specifies the name of the target ARM processor.  GCC uses this name
9914 to determine what kind of instructions it can emit when generating
9915 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
9916 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
9917 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
9918 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
9919 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
9920 @samp{arm720},
9921 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
9922 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
9923 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
9924 @samp{strongarm1110},
9925 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
9926 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
9927 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
9928 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
9929 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
9930 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
9931 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
9932 @samp{cortex-a5}, @samp{cortex-a8}, @samp{cortex-a9},
9933 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m4}, @samp{cortex-m3},
9934 @samp{cortex-m1},
9935 @samp{cortex-m0},
9936 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9937
9938 @item -mtune=@var{name}
9939 @opindex mtune
9940 This option is very similar to the @option{-mcpu=} option, except that
9941 instead of specifying the actual target processor type, and hence
9942 restricting which instructions can be used, it specifies that GCC should
9943 tune the performance of the code as if the target were of the type
9944 specified in this option, but still choosing the instructions that it
9945 will generate based on the cpu specified by a @option{-mcpu=} option.
9946 For some ARM implementations better performance can be obtained by using
9947 this option.
9948
9949 @item -march=@var{name}
9950 @opindex march
9951 This specifies the name of the target ARM architecture.  GCC uses this
9952 name to determine what kind of instructions it can emit when generating
9953 assembly code.  This option can be used in conjunction with or instead
9954 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
9955 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
9956 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
9957 @samp{armv6}, @samp{armv6j},
9958 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
9959 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
9960 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9961
9962 @item -mfpu=@var{name}
9963 @itemx -mfpe=@var{number}
9964 @itemx -mfp=@var{number}
9965 @opindex mfpu
9966 @opindex mfpe
9967 @opindex mfp
9968 This specifies what floating point hardware (or hardware emulation) is
9969 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
9970 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
9971 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
9972 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
9973 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
9974 @option{-mfp} and @option{-mfpe} are synonyms for
9975 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
9976 of GCC@.
9977
9978 If @option{-msoft-float} is specified this specifies the format of
9979 floating point values.
9980
9981 If the selected floating-point hardware includes the NEON extension
9982 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
9983 operations will not be used by GCC's auto-vectorization pass unless
9984 @option{-funsafe-math-optimizations} is also specified.  This is
9985 because NEON hardware does not fully implement the IEEE 754 standard for
9986 floating-point arithmetic (in particular denormal values are treated as
9987 zero), so the use of NEON instructions may lead to a loss of precision.
9988
9989 @item -mfp16-format=@var{name}
9990 @opindex mfp16-format
9991 Specify the format of the @code{__fp16} half-precision floating-point type.
9992 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
9993 the default is @samp{none}, in which case the @code{__fp16} type is not
9994 defined.  @xref{Half-Precision}, for more information.
9995
9996 @item -mstructure-size-boundary=@var{n}
9997 @opindex mstructure-size-boundary
9998 The size of all structures and unions will be rounded up to a multiple
9999 of the number of bits set by this option.  Permissible values are 8, 32
10000 and 64.  The default value varies for different toolchains.  For the COFF
10001 targeted toolchain the default value is 8.  A value of 64 is only allowed
10002 if the underlying ABI supports it.
10003
10004 Specifying the larger number can produce faster, more efficient code, but
10005 can also increase the size of the program.  Different values are potentially
10006 incompatible.  Code compiled with one value cannot necessarily expect to
10007 work with code or libraries compiled with another value, if they exchange
10008 information using structures or unions.
10009
10010 @item -mabort-on-noreturn
10011 @opindex mabort-on-noreturn
10012 Generate a call to the function @code{abort} at the end of a
10013 @code{noreturn} function.  It will be executed if the function tries to
10014 return.
10015
10016 @item -mlong-calls
10017 @itemx -mno-long-calls
10018 @opindex mlong-calls
10019 @opindex mno-long-calls
10020 Tells the compiler to perform function calls by first loading the
10021 address of the function into a register and then performing a subroutine
10022 call on this register.  This switch is needed if the target function
10023 will lie outside of the 64 megabyte addressing range of the offset based
10024 version of subroutine call instruction.
10025
10026 Even if this switch is enabled, not all function calls will be turned
10027 into long calls.  The heuristic is that static functions, functions
10028 which have the @samp{short-call} attribute, functions that are inside
10029 the scope of a @samp{#pragma no_long_calls} directive and functions whose
10030 definitions have already been compiled within the current compilation
10031 unit, will not be turned into long calls.  The exception to this rule is
10032 that weak function definitions, functions with the @samp{long-call}
10033 attribute or the @samp{section} attribute, and functions that are within
10034 the scope of a @samp{#pragma long_calls} directive, will always be
10035 turned into long calls.
10036
10037 This feature is not enabled by default.  Specifying
10038 @option{-mno-long-calls} will restore the default behavior, as will
10039 placing the function calls within the scope of a @samp{#pragma
10040 long_calls_off} directive.  Note these switches have no effect on how
10041 the compiler generates code to handle function calls via function
10042 pointers.
10043
10044 @item -msingle-pic-base
10045 @opindex msingle-pic-base
10046 Treat the register used for PIC addressing as read-only, rather than
10047 loading it in the prologue for each function.  The run-time system is
10048 responsible for initializing this register with an appropriate value
10049 before execution begins.
10050
10051 @item -mpic-register=@var{reg}
10052 @opindex mpic-register
10053 Specify the register to be used for PIC addressing.  The default is R10
10054 unless stack-checking is enabled, when R9 is used.
10055
10056 @item -mcirrus-fix-invalid-insns
10057 @opindex mcirrus-fix-invalid-insns
10058 @opindex mno-cirrus-fix-invalid-insns
10059 Insert NOPs into the instruction stream to in order to work around
10060 problems with invalid Maverick instruction combinations.  This option
10061 is only valid if the @option{-mcpu=ep9312} option has been used to
10062 enable generation of instructions for the Cirrus Maverick floating
10063 point co-processor.  This option is not enabled by default, since the
10064 problem is only present in older Maverick implementations.  The default
10065 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10066 switch.
10067
10068 @item -mpoke-function-name
10069 @opindex mpoke-function-name
10070 Write the name of each function into the text section, directly
10071 preceding the function prologue.  The generated code is similar to this:
10072
10073 @smallexample
10074      t0
10075          .ascii "arm_poke_function_name", 0
10076          .align
10077      t1
10078          .word 0xff000000 + (t1 - t0)
10079      arm_poke_function_name
10080          mov     ip, sp
10081          stmfd   sp!, @{fp, ip, lr, pc@}
10082          sub     fp, ip, #4
10083 @end smallexample
10084
10085 When performing a stack backtrace, code can inspect the value of
10086 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10087 location @code{pc - 12} and the top 8 bits are set, then we know that
10088 there is a function name embedded immediately preceding this location
10089 and has length @code{((pc[-3]) & 0xff000000)}.
10090
10091 @item -mthumb
10092 @opindex mthumb
10093 Generate code for the Thumb instruction set.  The default is to
10094 use the 32-bit ARM instruction set.
10095 This option automatically enables either 16-bit Thumb-1 or
10096 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
10097 and @option{-march=@var{name}} options.  This option is not passed to the
10098 assembler. If you want to force assembler files to be interpreted as Thumb code,
10099 either add a @samp{.thumb} directive to the source or pass the @option{-mthumb}
10100 option directly to the assembler by prefixing it with @option{-Wa}.
10101
10102 @item -mtpcs-frame
10103 @opindex mtpcs-frame
10104 Generate a stack frame that is compliant with the Thumb Procedure Call
10105 Standard for all non-leaf functions.  (A leaf function is one that does
10106 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10107
10108 @item -mtpcs-leaf-frame
10109 @opindex mtpcs-leaf-frame
10110 Generate a stack frame that is compliant with the Thumb Procedure Call
10111 Standard for all leaf functions.  (A leaf function is one that does
10112 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10113
10114 @item -mcallee-super-interworking
10115 @opindex mcallee-super-interworking
10116 Gives all externally visible functions in the file being compiled an ARM
10117 instruction set header which switches to Thumb mode before executing the
10118 rest of the function.  This allows these functions to be called from
10119 non-interworking code.  This option is not valid in AAPCS configurations
10120 because interworking is enabled by default.
10121
10122 @item -mcaller-super-interworking
10123 @opindex mcaller-super-interworking
10124 Allows calls via function pointers (including virtual functions) to
10125 execute correctly regardless of whether the target code has been
10126 compiled for interworking or not.  There is a small overhead in the cost
10127 of executing a function pointer if this option is enabled.  This option
10128 is not valid in AAPCS configurations because interworking is enabled
10129 by default.
10130
10131 @item -mtp=@var{name}
10132 @opindex mtp
10133 Specify the access model for the thread local storage pointer.  The valid
10134 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10135 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10136 (supported in the arm6k architecture), and @option{auto}, which uses the
10137 best available method for the selected processor.  The default setting is
10138 @option{auto}.
10139
10140 @item -mword-relocations
10141 @opindex mword-relocations
10142 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
10143 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10144 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10145 is specified.
10146
10147 @item -mfix-cortex-m3-ldrd
10148 @opindex mfix-cortex-m3-ldrd
10149 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10150 with overlapping destination and base registers are used.  This option avoids
10151 generating these instructions.  This option is enabled by default when
10152 @option{-mcpu=cortex-m3} is specified.
10153
10154 @end table
10155
10156 @node AVR Options
10157 @subsection AVR Options
10158 @cindex AVR Options
10159
10160 These options are defined for AVR implementations:
10161
10162 @table @gcctabopt
10163 @item -mmcu=@var{mcu}
10164 @opindex mmcu
10165 Specify ATMEL AVR instruction set or MCU type.
10166
10167 Instruction set avr1 is for the minimal AVR core, not supported by the C
10168 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
10169 attiny11, attiny12, attiny15, attiny28).
10170
10171 Instruction set avr2 (default) is for the classic AVR core with up to
10172 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
10173 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
10174 at90c8534, at90s8535).
10175
10176 Instruction set avr3 is for the classic AVR core with up to 128K program
10177 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
10178
10179 Instruction set avr4 is for the enhanced AVR core with up to 8K program
10180 memory space (MCU types: atmega8, atmega83, atmega85).
10181
10182 Instruction set avr5 is for the enhanced AVR core with up to 128K program
10183 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
10184 atmega64, atmega128, at43usb355, at94k).
10185
10186 @item -mno-interrupts
10187 @opindex mno-interrupts
10188 Generated code is not compatible with hardware interrupts.
10189 Code size will be smaller.
10190
10191 @item -mcall-prologues
10192 @opindex mcall-prologues
10193 Functions prologues/epilogues expanded as call to appropriate
10194 subroutines.  Code size will be smaller.
10195
10196 @item -mtiny-stack
10197 @opindex mtiny-stack
10198 Change only the low 8 bits of the stack pointer.
10199
10200 @item -mint8
10201 @opindex mint8
10202 Assume int to be 8 bit integer.  This affects the sizes of all types: A
10203 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
10204 and long long will be 4 bytes.  Please note that this option does not
10205 comply to the C standards, but it will provide you with smaller code
10206 size.
10207 @end table
10208
10209 @node Blackfin Options
10210 @subsection Blackfin Options
10211 @cindex Blackfin Options
10212
10213 @table @gcctabopt
10214 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
10215 @opindex mcpu=
10216 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
10217 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
10218 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
10219 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
10220 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
10221 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
10222 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
10223 @samp{bf561}.
10224 The optional @var{sirevision} specifies the silicon revision of the target
10225 Blackfin processor.  Any workarounds available for the targeted silicon revision
10226 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
10227 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
10228 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
10229 hexadecimal digits representing the major and minor numbers in the silicon
10230 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
10231 is not defined.  If @var{sirevision} is @samp{any}, the
10232 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
10233 If this optional @var{sirevision} is not used, GCC assumes the latest known
10234 silicon revision of the targeted Blackfin processor.
10235
10236 Support for @samp{bf561} is incomplete.  For @samp{bf561},
10237 Only the processor macro is defined.
10238 Without this option, @samp{bf532} is used as the processor by default.
10239 The corresponding predefined processor macros for @var{cpu} is to
10240 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
10241 provided by libgloss to be linked in if @option{-msim} is not given.
10242
10243 @item -msim
10244 @opindex msim
10245 Specifies that the program will be run on the simulator.  This causes
10246 the simulator BSP provided by libgloss to be linked in.  This option
10247 has effect only for @samp{bfin-elf} toolchain.
10248 Certain other options, such as @option{-mid-shared-library} and
10249 @option{-mfdpic}, imply @option{-msim}.
10250
10251 @item -momit-leaf-frame-pointer
10252 @opindex momit-leaf-frame-pointer
10253 Don't keep the frame pointer in a register for leaf functions.  This
10254 avoids the instructions to save, set up and restore frame pointers and
10255 makes an extra register available in leaf functions.  The option
10256 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10257 which might make debugging harder.
10258
10259 @item -mspecld-anomaly
10260 @opindex mspecld-anomaly
10261 When enabled, the compiler will ensure that the generated code does not
10262 contain speculative loads after jump instructions. If this option is used,
10263 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
10264
10265 @item -mno-specld-anomaly
10266 @opindex mno-specld-anomaly
10267 Don't generate extra code to prevent speculative loads from occurring.
10268
10269 @item -mcsync-anomaly
10270 @opindex mcsync-anomaly
10271 When enabled, the compiler will ensure that the generated code does not
10272 contain CSYNC or SSYNC instructions too soon after conditional branches.
10273 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
10274
10275 @item -mno-csync-anomaly
10276 @opindex mno-csync-anomaly
10277 Don't generate extra code to prevent CSYNC or SSYNC instructions from
10278 occurring too soon after a conditional branch.
10279
10280 @item -mlow-64k
10281 @opindex mlow-64k
10282 When enabled, the compiler is free to take advantage of the knowledge that
10283 the entire program fits into the low 64k of memory.
10284
10285 @item -mno-low-64k
10286 @opindex mno-low-64k
10287 Assume that the program is arbitrarily large.  This is the default.
10288
10289 @item -mstack-check-l1
10290 @opindex mstack-check-l1
10291 Do stack checking using information placed into L1 scratchpad memory by the
10292 uClinux kernel.
10293
10294 @item -mid-shared-library
10295 @opindex mid-shared-library
10296 Generate code that supports shared libraries via the library ID method.
10297 This allows for execute in place and shared libraries in an environment
10298 without virtual memory management.  This option implies @option{-fPIC}.
10299 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10300
10301 @item -mno-id-shared-library
10302 @opindex mno-id-shared-library
10303 Generate code that doesn't assume ID based shared libraries are being used.
10304 This is the default.
10305
10306 @item -mleaf-id-shared-library
10307 @opindex mleaf-id-shared-library
10308 Generate code that supports shared libraries via the library ID method,
10309 but assumes that this library or executable won't link against any other
10310 ID shared libraries.  That allows the compiler to use faster code for jumps
10311 and calls.
10312
10313 @item -mno-leaf-id-shared-library
10314 @opindex mno-leaf-id-shared-library
10315 Do not assume that the code being compiled won't link against any ID shared
10316 libraries.  Slower code will be generated for jump and call insns.
10317
10318 @item -mshared-library-id=n
10319 @opindex mshared-library-id
10320 Specified the identification number of the ID based shared library being
10321 compiled.  Specifying a value of 0 will generate more compact code, specifying
10322 other values will force the allocation of that number to the current
10323 library but is no more space or time efficient than omitting this option.
10324
10325 @item -msep-data
10326 @opindex msep-data
10327 Generate code that allows the data segment to be located in a different
10328 area of memory from the text segment.  This allows for execute in place in
10329 an environment without virtual memory management by eliminating relocations
10330 against the text section.
10331
10332 @item -mno-sep-data
10333 @opindex mno-sep-data
10334 Generate code that assumes that the data segment follows the text segment.
10335 This is the default.
10336
10337 @item -mlong-calls
10338 @itemx -mno-long-calls
10339 @opindex mlong-calls
10340 @opindex mno-long-calls
10341 Tells the compiler to perform function calls by first loading the
10342 address of the function into a register and then performing a subroutine
10343 call on this register.  This switch is needed if the target function
10344 will lie outside of the 24 bit addressing range of the offset based
10345 version of subroutine call instruction.
10346
10347 This feature is not enabled by default.  Specifying
10348 @option{-mno-long-calls} will restore the default behavior.  Note these
10349 switches have no effect on how the compiler generates code to handle
10350 function calls via function pointers.
10351
10352 @item -mfast-fp
10353 @opindex mfast-fp
10354 Link with the fast floating-point library. This library relaxes some of
10355 the IEEE floating-point standard's rules for checking inputs against
10356 Not-a-Number (NAN), in the interest of performance.
10357
10358 @item -minline-plt
10359 @opindex minline-plt
10360 Enable inlining of PLT entries in function calls to functions that are
10361 not known to bind locally.  It has no effect without @option{-mfdpic}.
10362
10363 @item -mmulticore
10364 @opindex mmulticore
10365 Build standalone application for multicore Blackfin processor. Proper
10366 start files and link scripts will be used to support multicore.
10367 This option defines @code{__BFIN_MULTICORE}. It can only be used with
10368 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
10369 @option{-mcorea} or @option{-mcoreb}. If it's used without
10370 @option{-mcorea} or @option{-mcoreb}, single application/dual core
10371 programming model is used. In this model, the main function of Core B
10372 should be named as coreb_main. If it's used with @option{-mcorea} or
10373 @option{-mcoreb}, one application per core programming model is used.
10374 If this option is not used, single core application programming
10375 model is used.
10376
10377 @item -mcorea
10378 @opindex mcorea
10379 Build standalone application for Core A of BF561 when using
10380 one application per core programming model. Proper start files
10381 and link scripts will be used to support Core A. This option
10382 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
10383
10384 @item -mcoreb
10385 @opindex mcoreb
10386 Build standalone application for Core B of BF561 when using
10387 one application per core programming model. Proper start files
10388 and link scripts will be used to support Core B. This option
10389 defines @code{__BFIN_COREB}. When this option is used, coreb_main
10390 should be used instead of main. It must be used with
10391 @option{-mmulticore}.
10392
10393 @item -msdram
10394 @opindex msdram
10395 Build standalone application for SDRAM. Proper start files and
10396 link scripts will be used to put the application into SDRAM.
10397 Loader should initialize SDRAM before loading the application
10398 into SDRAM. This option defines @code{__BFIN_SDRAM}.
10399
10400 @item -micplb
10401 @opindex micplb
10402 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
10403 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
10404 are enabled; for standalone applications the default is off.
10405 @end table
10406
10407 @node CRIS Options
10408 @subsection CRIS Options
10409 @cindex CRIS Options
10410
10411 These options are defined specifically for the CRIS ports.
10412
10413 @table @gcctabopt
10414 @item -march=@var{architecture-type}
10415 @itemx -mcpu=@var{architecture-type}
10416 @opindex march
10417 @opindex mcpu
10418 Generate code for the specified architecture.  The choices for
10419 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
10420 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
10421 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
10422 @samp{v10}.
10423
10424 @item -mtune=@var{architecture-type}
10425 @opindex mtune
10426 Tune to @var{architecture-type} everything applicable about the generated
10427 code, except for the ABI and the set of available instructions.  The
10428 choices for @var{architecture-type} are the same as for
10429 @option{-march=@var{architecture-type}}.
10430
10431 @item -mmax-stack-frame=@var{n}
10432 @opindex mmax-stack-frame
10433 Warn when the stack frame of a function exceeds @var{n} bytes.
10434
10435 @item -metrax4
10436 @itemx -metrax100
10437 @opindex metrax4
10438 @opindex metrax100
10439 The options @option{-metrax4} and @option{-metrax100} are synonyms for
10440 @option{-march=v3} and @option{-march=v8} respectively.
10441
10442 @item -mmul-bug-workaround
10443 @itemx -mno-mul-bug-workaround
10444 @opindex mmul-bug-workaround
10445 @opindex mno-mul-bug-workaround
10446 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
10447 models where it applies.  This option is active by default.
10448
10449 @item -mpdebug
10450 @opindex mpdebug
10451 Enable CRIS-specific verbose debug-related information in the assembly
10452 code.  This option also has the effect to turn off the @samp{#NO_APP}
10453 formatted-code indicator to the assembler at the beginning of the
10454 assembly file.
10455
10456 @item -mcc-init
10457 @opindex mcc-init
10458 Do not use condition-code results from previous instruction; always emit
10459 compare and test instructions before use of condition codes.
10460
10461 @item -mno-side-effects
10462 @opindex mno-side-effects
10463 Do not emit instructions with side-effects in addressing modes other than
10464 post-increment.
10465
10466 @item -mstack-align
10467 @itemx -mno-stack-align
10468 @itemx -mdata-align
10469 @itemx -mno-data-align
10470 @itemx -mconst-align
10471 @itemx -mno-const-align
10472 @opindex mstack-align
10473 @opindex mno-stack-align
10474 @opindex mdata-align
10475 @opindex mno-data-align
10476 @opindex mconst-align
10477 @opindex mno-const-align
10478 These options (no-options) arranges (eliminate arrangements) for the
10479 stack-frame, individual data and constants to be aligned for the maximum
10480 single data access size for the chosen CPU model.  The default is to
10481 arrange for 32-bit alignment.  ABI details such as structure layout are
10482 not affected by these options.
10483
10484 @item -m32-bit
10485 @itemx -m16-bit
10486 @itemx -m8-bit
10487 @opindex m32-bit
10488 @opindex m16-bit
10489 @opindex m8-bit
10490 Similar to the stack- data- and const-align options above, these options
10491 arrange for stack-frame, writable data and constants to all be 32-bit,
10492 16-bit or 8-bit aligned.  The default is 32-bit alignment.
10493
10494 @item -mno-prologue-epilogue
10495 @itemx -mprologue-epilogue
10496 @opindex mno-prologue-epilogue
10497 @opindex mprologue-epilogue
10498 With @option{-mno-prologue-epilogue}, the normal function prologue and
10499 epilogue that sets up the stack-frame are omitted and no return
10500 instructions or return sequences are generated in the code.  Use this
10501 option only together with visual inspection of the compiled code: no
10502 warnings or errors are generated when call-saved registers must be saved,
10503 or storage for local variable needs to be allocated.
10504
10505 @item -mno-gotplt
10506 @itemx -mgotplt
10507 @opindex mno-gotplt
10508 @opindex mgotplt
10509 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
10510 instruction sequences that load addresses for functions from the PLT part
10511 of the GOT rather than (traditional on other architectures) calls to the
10512 PLT@.  The default is @option{-mgotplt}.
10513
10514 @item -melf
10515 @opindex melf
10516 Legacy no-op option only recognized with the cris-axis-elf and
10517 cris-axis-linux-gnu targets.
10518
10519 @item -mlinux
10520 @opindex mlinux
10521 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
10522
10523 @item -sim
10524 @opindex sim
10525 This option, recognized for the cris-axis-elf arranges
10526 to link with input-output functions from a simulator library.  Code,
10527 initialized data and zero-initialized data are allocated consecutively.
10528
10529 @item -sim2
10530 @opindex sim2
10531 Like @option{-sim}, but pass linker options to locate initialized data at
10532 0x40000000 and zero-initialized data at 0x80000000.
10533 @end table
10534
10535 @node CRX Options
10536 @subsection CRX Options
10537 @cindex CRX Options
10538
10539 These options are defined specifically for the CRX ports.
10540
10541 @table @gcctabopt
10542
10543 @item -mmac
10544 @opindex mmac
10545 Enable the use of multiply-accumulate instructions. Disabled by default.
10546
10547 @item -mpush-args
10548 @opindex mpush-args
10549 Push instructions will be used to pass outgoing arguments when functions
10550 are called. Enabled by default.
10551 @end table
10552
10553 @node Darwin Options
10554 @subsection Darwin Options
10555 @cindex Darwin options
10556
10557 These options are defined for all architectures running the Darwin operating
10558 system.
10559
10560 FSF GCC on Darwin does not create ``fat'' object files; it will create
10561 an object file for the single architecture that it was built to
10562 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
10563 @option{-arch} options are used; it does so by running the compiler or
10564 linker multiple times and joining the results together with
10565 @file{lipo}.
10566
10567 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
10568 @samp{i686}) is determined by the flags that specify the ISA
10569 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
10570 @option{-force_cpusubtype_ALL} option can be used to override this.
10571
10572 The Darwin tools vary in their behavior when presented with an ISA
10573 mismatch.  The assembler, @file{as}, will only permit instructions to
10574 be used that are valid for the subtype of the file it is generating,
10575 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
10576 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
10577 and print an error if asked to create a shared library with a less
10578 restrictive subtype than its input files (for instance, trying to put
10579 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
10580 for executables, @file{ld}, will quietly give the executable the most
10581 restrictive subtype of any of its input files.
10582
10583 @table @gcctabopt
10584 @item -F@var{dir}
10585 @opindex F
10586 Add the framework directory @var{dir} to the head of the list of
10587 directories to be searched for header files.  These directories are
10588 interleaved with those specified by @option{-I} options and are
10589 scanned in a left-to-right order.
10590
10591 A framework directory is a directory with frameworks in it.  A
10592 framework is a directory with a @samp{"Headers"} and/or
10593 @samp{"PrivateHeaders"} directory contained directly in it that ends
10594 in @samp{".framework"}.  The name of a framework is the name of this
10595 directory excluding the @samp{".framework"}.  Headers associated with
10596 the framework are found in one of those two directories, with
10597 @samp{"Headers"} being searched first.  A subframework is a framework
10598 directory that is in a framework's @samp{"Frameworks"} directory.
10599 Includes of subframework headers can only appear in a header of a
10600 framework that contains the subframework, or in a sibling subframework
10601 header.  Two subframeworks are siblings if they occur in the same
10602 framework.  A subframework should not have the same name as a
10603 framework, a warning will be issued if this is violated.  Currently a
10604 subframework cannot have subframeworks, in the future, the mechanism
10605 may be extended to support this.  The standard frameworks can be found
10606 in @samp{"/System/Library/Frameworks"} and
10607 @samp{"/Library/Frameworks"}.  An example include looks like
10608 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
10609 the name of the framework and header.h is found in the
10610 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
10611
10612 @item -iframework@var{dir}
10613 @opindex iframework
10614 Like @option{-F} except the directory is a treated as a system
10615 directory.  The main difference between this @option{-iframework} and
10616 @option{-F} is that with @option{-iframework} the compiler does not
10617 warn about constructs contained within header files found via
10618 @var{dir}.  This option is valid only for the C family of languages.
10619
10620 @item -gused
10621 @opindex gused
10622 Emit debugging information for symbols that are used.  For STABS
10623 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
10624 This is by default ON@.
10625
10626 @item -gfull
10627 @opindex gfull
10628 Emit debugging information for all symbols and types.
10629
10630 @item -mmacosx-version-min=@var{version}
10631 The earliest version of MacOS X that this executable will run on
10632 is @var{version}.  Typical values of @var{version} include @code{10.1},
10633 @code{10.2}, and @code{10.3.9}.
10634
10635 If the compiler was built to use the system's headers by default,
10636 then the default for this option is the system version on which the
10637 compiler is running, otherwise the default is to make choices which
10638 are compatible with as many systems and code bases as possible.
10639
10640 @item -mkernel
10641 @opindex mkernel
10642 Enable kernel development mode.  The @option{-mkernel} option sets
10643 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
10644 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
10645 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
10646 applicable.  This mode also sets @option{-mno-altivec},
10647 @option{-msoft-float}, @option{-fno-builtin} and
10648 @option{-mlong-branch} for PowerPC targets.
10649
10650 @item -mone-byte-bool
10651 @opindex mone-byte-bool
10652 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
10653 By default @samp{sizeof(bool)} is @samp{4} when compiling for
10654 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
10655 option has no effect on x86.
10656
10657 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
10658 to generate code that is not binary compatible with code generated
10659 without that switch.  Using this switch may require recompiling all
10660 other modules in a program, including system libraries.  Use this
10661 switch to conform to a non-default data model.
10662
10663 @item -mfix-and-continue
10664 @itemx -ffix-and-continue
10665 @itemx -findirect-data
10666 @opindex mfix-and-continue
10667 @opindex ffix-and-continue
10668 @opindex findirect-data
10669 Generate code suitable for fast turn around development.  Needed to
10670 enable gdb to dynamically load @code{.o} files into already running
10671 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
10672 are provided for backwards compatibility.
10673
10674 @item -all_load
10675 @opindex all_load
10676 Loads all members of static archive libraries.
10677 See man ld(1) for more information.
10678
10679 @item -arch_errors_fatal
10680 @opindex arch_errors_fatal
10681 Cause the errors having to do with files that have the wrong architecture
10682 to be fatal.
10683
10684 @item -bind_at_load
10685 @opindex bind_at_load
10686 Causes the output file to be marked such that the dynamic linker will
10687 bind all undefined references when the file is loaded or launched.
10688
10689 @item -bundle
10690 @opindex bundle
10691 Produce a Mach-o bundle format file.
10692 See man ld(1) for more information.
10693
10694 @item -bundle_loader @var{executable}
10695 @opindex bundle_loader
10696 This option specifies the @var{executable} that will be loading the build
10697 output file being linked.  See man ld(1) for more information.
10698
10699 @item -dynamiclib
10700 @opindex dynamiclib
10701 When passed this option, GCC will produce a dynamic library instead of
10702 an executable when linking, using the Darwin @file{libtool} command.
10703
10704 @item -force_cpusubtype_ALL
10705 @opindex force_cpusubtype_ALL
10706 This causes GCC's output file to have the @var{ALL} subtype, instead of
10707 one controlled by the @option{-mcpu} or @option{-march} option.
10708
10709 @item -allowable_client  @var{client_name}
10710 @itemx -client_name
10711 @itemx -compatibility_version
10712 @itemx -current_version
10713 @itemx -dead_strip
10714 @itemx -dependency-file
10715 @itemx -dylib_file
10716 @itemx -dylinker_install_name
10717 @itemx -dynamic
10718 @itemx -exported_symbols_list
10719 @itemx -filelist
10720 @itemx -flat_namespace
10721 @itemx -force_flat_namespace
10722 @itemx -headerpad_max_install_names
10723 @itemx -image_base
10724 @itemx -init
10725 @itemx -install_name
10726 @itemx -keep_private_externs
10727 @itemx -multi_module
10728 @itemx -multiply_defined
10729 @itemx -multiply_defined_unused
10730 @itemx -noall_load
10731 @itemx -no_dead_strip_inits_and_terms
10732 @itemx -nofixprebinding
10733 @itemx -nomultidefs
10734 @itemx -noprebind
10735 @itemx -noseglinkedit
10736 @itemx -pagezero_size
10737 @itemx -prebind
10738 @itemx -prebind_all_twolevel_modules
10739 @itemx -private_bundle
10740 @itemx -read_only_relocs
10741 @itemx -sectalign
10742 @itemx -sectobjectsymbols
10743 @itemx -whyload
10744 @itemx -seg1addr
10745 @itemx -sectcreate
10746 @itemx -sectobjectsymbols
10747 @itemx -sectorder
10748 @itemx -segaddr
10749 @itemx -segs_read_only_addr
10750 @itemx -segs_read_write_addr
10751 @itemx -seg_addr_table
10752 @itemx -seg_addr_table_filename
10753 @itemx -seglinkedit
10754 @itemx -segprot
10755 @itemx -segs_read_only_addr
10756 @itemx -segs_read_write_addr
10757 @itemx -single_module
10758 @itemx -static
10759 @itemx -sub_library
10760 @itemx -sub_umbrella
10761 @itemx -twolevel_namespace
10762 @itemx -umbrella
10763 @itemx -undefined
10764 @itemx -unexported_symbols_list
10765 @itemx -weak_reference_mismatches
10766 @itemx -whatsloaded
10767 @opindex allowable_client
10768 @opindex client_name
10769 @opindex compatibility_version
10770 @opindex current_version
10771 @opindex dead_strip
10772 @opindex dependency-file
10773 @opindex dylib_file
10774 @opindex dylinker_install_name
10775 @opindex dynamic
10776 @opindex exported_symbols_list
10777 @opindex filelist
10778 @opindex flat_namespace
10779 @opindex force_flat_namespace
10780 @opindex headerpad_max_install_names
10781 @opindex image_base
10782 @opindex init
10783 @opindex install_name
10784 @opindex keep_private_externs
10785 @opindex multi_module
10786 @opindex multiply_defined
10787 @opindex multiply_defined_unused
10788 @opindex noall_load
10789 @opindex no_dead_strip_inits_and_terms
10790 @opindex nofixprebinding
10791 @opindex nomultidefs
10792 @opindex noprebind
10793 @opindex noseglinkedit
10794 @opindex pagezero_size
10795 @opindex prebind
10796 @opindex prebind_all_twolevel_modules
10797 @opindex private_bundle
10798 @opindex read_only_relocs
10799 @opindex sectalign
10800 @opindex sectobjectsymbols
10801 @opindex whyload
10802 @opindex seg1addr
10803 @opindex sectcreate
10804 @opindex sectobjectsymbols
10805 @opindex sectorder
10806 @opindex segaddr
10807 @opindex segs_read_only_addr
10808 @opindex segs_read_write_addr
10809 @opindex seg_addr_table
10810 @opindex seg_addr_table_filename
10811 @opindex seglinkedit
10812 @opindex segprot
10813 @opindex segs_read_only_addr
10814 @opindex segs_read_write_addr
10815 @opindex single_module
10816 @opindex static
10817 @opindex sub_library
10818 @opindex sub_umbrella
10819 @opindex twolevel_namespace
10820 @opindex umbrella
10821 @opindex undefined
10822 @opindex unexported_symbols_list
10823 @opindex weak_reference_mismatches
10824 @opindex whatsloaded
10825 These options are passed to the Darwin linker.  The Darwin linker man page
10826 describes them in detail.
10827 @end table
10828
10829 @node DEC Alpha Options
10830 @subsection DEC Alpha Options
10831
10832 These @samp{-m} options are defined for the DEC Alpha implementations:
10833
10834 @table @gcctabopt
10835 @item -mno-soft-float
10836 @itemx -msoft-float
10837 @opindex mno-soft-float
10838 @opindex msoft-float
10839 Use (do not use) the hardware floating-point instructions for
10840 floating-point operations.  When @option{-msoft-float} is specified,
10841 functions in @file{libgcc.a} will be used to perform floating-point
10842 operations.  Unless they are replaced by routines that emulate the
10843 floating-point operations, or compiled in such a way as to call such
10844 emulations routines, these routines will issue floating-point
10845 operations.   If you are compiling for an Alpha without floating-point
10846 operations, you must ensure that the library is built so as not to call
10847 them.
10848
10849 Note that Alpha implementations without floating-point operations are
10850 required to have floating-point registers.
10851
10852 @item -mfp-reg
10853 @itemx -mno-fp-regs
10854 @opindex mfp-reg
10855 @opindex mno-fp-regs
10856 Generate code that uses (does not use) the floating-point register set.
10857 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
10858 register set is not used, floating point operands are passed in integer
10859 registers as if they were integers and floating-point results are passed
10860 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
10861 so any function with a floating-point argument or return value called by code
10862 compiled with @option{-mno-fp-regs} must also be compiled with that
10863 option.
10864
10865 A typical use of this option is building a kernel that does not use,
10866 and hence need not save and restore, any floating-point registers.
10867
10868 @item -mieee
10869 @opindex mieee
10870 The Alpha architecture implements floating-point hardware optimized for
10871 maximum performance.  It is mostly compliant with the IEEE floating
10872 point standard.  However, for full compliance, software assistance is
10873 required.  This option generates code fully IEEE compliant code
10874 @emph{except} that the @var{inexact-flag} is not maintained (see below).
10875 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
10876 defined during compilation.  The resulting code is less efficient but is
10877 able to correctly support denormalized numbers and exceptional IEEE
10878 values such as not-a-number and plus/minus infinity.  Other Alpha
10879 compilers call this option @option{-ieee_with_no_inexact}.
10880
10881 @item -mieee-with-inexact
10882 @opindex mieee-with-inexact
10883 This is like @option{-mieee} except the generated code also maintains
10884 the IEEE @var{inexact-flag}.  Turning on this option causes the
10885 generated code to implement fully-compliant IEEE math.  In addition to
10886 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
10887 macro.  On some Alpha implementations the resulting code may execute
10888 significantly slower than the code generated by default.  Since there is
10889 very little code that depends on the @var{inexact-flag}, you should
10890 normally not specify this option.  Other Alpha compilers call this
10891 option @option{-ieee_with_inexact}.
10892
10893 @item -mfp-trap-mode=@var{trap-mode}
10894 @opindex mfp-trap-mode
10895 This option controls what floating-point related traps are enabled.
10896 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
10897 The trap mode can be set to one of four values:
10898
10899 @table @samp
10900 @item n
10901 This is the default (normal) setting.  The only traps that are enabled
10902 are the ones that cannot be disabled in software (e.g., division by zero
10903 trap).
10904
10905 @item u
10906 In addition to the traps enabled by @samp{n}, underflow traps are enabled
10907 as well.
10908
10909 @item su
10910 Like @samp{u}, but the instructions are marked to be safe for software
10911 completion (see Alpha architecture manual for details).
10912
10913 @item sui
10914 Like @samp{su}, but inexact traps are enabled as well.
10915 @end table
10916
10917 @item -mfp-rounding-mode=@var{rounding-mode}
10918 @opindex mfp-rounding-mode
10919 Selects the IEEE rounding mode.  Other Alpha compilers call this option
10920 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
10921 of:
10922
10923 @table @samp
10924 @item n
10925 Normal IEEE rounding mode.  Floating point numbers are rounded towards
10926 the nearest machine number or towards the even machine number in case
10927 of a tie.
10928
10929 @item m
10930 Round towards minus infinity.
10931
10932 @item c
10933 Chopped rounding mode.  Floating point numbers are rounded towards zero.
10934
10935 @item d
10936 Dynamic rounding mode.  A field in the floating point control register
10937 (@var{fpcr}, see Alpha architecture reference manual) controls the
10938 rounding mode in effect.  The C library initializes this register for
10939 rounding towards plus infinity.  Thus, unless your program modifies the
10940 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
10941 @end table
10942
10943 @item -mtrap-precision=@var{trap-precision}
10944 @opindex mtrap-precision
10945 In the Alpha architecture, floating point traps are imprecise.  This
10946 means without software assistance it is impossible to recover from a
10947 floating trap and program execution normally needs to be terminated.
10948 GCC can generate code that can assist operating system trap handlers
10949 in determining the exact location that caused a floating point trap.
10950 Depending on the requirements of an application, different levels of
10951 precisions can be selected:
10952
10953 @table @samp
10954 @item p
10955 Program precision.  This option is the default and means a trap handler
10956 can only identify which program caused a floating point exception.
10957
10958 @item f
10959 Function precision.  The trap handler can determine the function that
10960 caused a floating point exception.
10961
10962 @item i
10963 Instruction precision.  The trap handler can determine the exact
10964 instruction that caused a floating point exception.
10965 @end table
10966
10967 Other Alpha compilers provide the equivalent options called
10968 @option{-scope_safe} and @option{-resumption_safe}.
10969
10970 @item -mieee-conformant
10971 @opindex mieee-conformant
10972 This option marks the generated code as IEEE conformant.  You must not
10973 use this option unless you also specify @option{-mtrap-precision=i} and either
10974 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
10975 is to emit the line @samp{.eflag 48} in the function prologue of the
10976 generated assembly file.  Under DEC Unix, this has the effect that
10977 IEEE-conformant math library routines will be linked in.
10978
10979 @item -mbuild-constants
10980 @opindex mbuild-constants
10981 Normally GCC examines a 32- or 64-bit integer constant to
10982 see if it can construct it from smaller constants in two or three
10983 instructions.  If it cannot, it will output the constant as a literal and
10984 generate code to load it from the data segment at runtime.
10985
10986 Use this option to require GCC to construct @emph{all} integer constants
10987 using code, even if it takes more instructions (the maximum is six).
10988
10989 You would typically use this option to build a shared library dynamic
10990 loader.  Itself a shared library, it must relocate itself in memory
10991 before it can find the variables and constants in its own data segment.
10992
10993 @item -malpha-as
10994 @itemx -mgas
10995 @opindex malpha-as
10996 @opindex mgas
10997 Select whether to generate code to be assembled by the vendor-supplied
10998 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
10999
11000 @item -mbwx
11001 @itemx -mno-bwx
11002 @itemx -mcix
11003 @itemx -mno-cix
11004 @itemx -mfix
11005 @itemx -mno-fix
11006 @itemx -mmax
11007 @itemx -mno-max
11008 @opindex mbwx
11009 @opindex mno-bwx
11010 @opindex mcix
11011 @opindex mno-cix
11012 @opindex mfix
11013 @opindex mno-fix
11014 @opindex mmax
11015 @opindex mno-max
11016 Indicate whether GCC should generate code to use the optional BWX,
11017 CIX, FIX and MAX instruction sets.  The default is to use the instruction
11018 sets supported by the CPU type specified via @option{-mcpu=} option or that
11019 of the CPU on which GCC was built if none was specified.
11020
11021 @item -mfloat-vax
11022 @itemx -mfloat-ieee
11023 @opindex mfloat-vax
11024 @opindex mfloat-ieee
11025 Generate code that uses (does not use) VAX F and G floating point
11026 arithmetic instead of IEEE single and double precision.
11027
11028 @item -mexplicit-relocs
11029 @itemx -mno-explicit-relocs
11030 @opindex mexplicit-relocs
11031 @opindex mno-explicit-relocs
11032 Older Alpha assemblers provided no way to generate symbol relocations
11033 except via assembler macros.  Use of these macros does not allow
11034 optimal instruction scheduling.  GNU binutils as of version 2.12
11035 supports a new syntax that allows the compiler to explicitly mark
11036 which relocations should apply to which instructions.  This option
11037 is mostly useful for debugging, as GCC detects the capabilities of
11038 the assembler when it is built and sets the default accordingly.
11039
11040 @item -msmall-data
11041 @itemx -mlarge-data
11042 @opindex msmall-data
11043 @opindex mlarge-data
11044 When @option{-mexplicit-relocs} is in effect, static data is
11045 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
11046 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
11047 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
11048 16-bit relocations off of the @code{$gp} register.  This limits the
11049 size of the small data area to 64KB, but allows the variables to be
11050 directly accessed via a single instruction.
11051
11052 The default is @option{-mlarge-data}.  With this option the data area
11053 is limited to just below 2GB@.  Programs that require more than 2GB of
11054 data must use @code{malloc} or @code{mmap} to allocate the data in the
11055 heap instead of in the program's data segment.
11056
11057 When generating code for shared libraries, @option{-fpic} implies
11058 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
11059
11060 @item -msmall-text
11061 @itemx -mlarge-text
11062 @opindex msmall-text
11063 @opindex mlarge-text
11064 When @option{-msmall-text} is used, the compiler assumes that the
11065 code of the entire program (or shared library) fits in 4MB, and is
11066 thus reachable with a branch instruction.  When @option{-msmall-data}
11067 is used, the compiler can assume that all local symbols share the
11068 same @code{$gp} value, and thus reduce the number of instructions
11069 required for a function call from 4 to 1.
11070
11071 The default is @option{-mlarge-text}.
11072
11073 @item -mcpu=@var{cpu_type}
11074 @opindex mcpu
11075 Set the instruction set and instruction scheduling parameters for
11076 machine type @var{cpu_type}.  You can specify either the @samp{EV}
11077 style name or the corresponding chip number.  GCC supports scheduling
11078 parameters for the EV4, EV5 and EV6 family of processors and will
11079 choose the default values for the instruction set from the processor
11080 you specify.  If you do not specify a processor type, GCC will default
11081 to the processor on which the compiler was built.
11082
11083 Supported values for @var{cpu_type} are
11084
11085 @table @samp
11086 @item ev4
11087 @itemx ev45
11088 @itemx 21064
11089 Schedules as an EV4 and has no instruction set extensions.
11090
11091 @item ev5
11092 @itemx 21164
11093 Schedules as an EV5 and has no instruction set extensions.
11094
11095 @item ev56
11096 @itemx 21164a
11097 Schedules as an EV5 and supports the BWX extension.
11098
11099 @item pca56
11100 @itemx 21164pc
11101 @itemx 21164PC
11102 Schedules as an EV5 and supports the BWX and MAX extensions.
11103
11104 @item ev6
11105 @itemx 21264
11106 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
11107
11108 @item ev67
11109 @itemx 21264a
11110 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
11111 @end table
11112
11113 Native Linux/GNU toolchains also support the value @samp{native},
11114 which selects the best architecture option for the host processor.
11115 @option{-mcpu=native} has no effect if GCC does not recognize
11116 the processor.
11117
11118 @item -mtune=@var{cpu_type}
11119 @opindex mtune
11120 Set only the instruction scheduling parameters for machine type
11121 @var{cpu_type}.  The instruction set is not changed.
11122
11123 Native Linux/GNU toolchains also support the value @samp{native},
11124 which selects the best architecture option for the host processor.
11125 @option{-mtune=native} has no effect if GCC does not recognize
11126 the processor.
11127
11128 @item -mmemory-latency=@var{time}
11129 @opindex mmemory-latency
11130 Sets the latency the scheduler should assume for typical memory
11131 references as seen by the application.  This number is highly
11132 dependent on the memory access patterns used by the application
11133 and the size of the external cache on the machine.
11134
11135 Valid options for @var{time} are
11136
11137 @table @samp
11138 @item @var{number}
11139 A decimal number representing clock cycles.
11140
11141 @item L1
11142 @itemx L2
11143 @itemx L3
11144 @itemx main
11145 The compiler contains estimates of the number of clock cycles for
11146 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
11147 (also called Dcache, Scache, and Bcache), as well as to main memory.
11148 Note that L3 is only valid for EV5.
11149
11150 @end table
11151 @end table
11152
11153 @node DEC Alpha/VMS Options
11154 @subsection DEC Alpha/VMS Options
11155
11156 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
11157
11158 @table @gcctabopt
11159 @item -mvms-return-codes
11160 @opindex mvms-return-codes
11161 Return VMS condition codes from main.  The default is to return POSIX
11162 style condition (e.g.@: error) codes.
11163
11164 @item -mdebug-main=@var{prefix}
11165 @opindex mdebug-main=@var{prefix}
11166 Flag the first routine whose name starts with @var{prefix} as the main
11167 routine for the debugger.
11168
11169 @item -mmalloc64
11170 @opindex mmalloc64
11171 Default to 64bit memory allocation routines.
11172 @end table
11173
11174 @node FR30 Options
11175 @subsection FR30 Options
11176 @cindex FR30 Options
11177
11178 These options are defined specifically for the FR30 port.
11179
11180 @table @gcctabopt
11181
11182 @item -msmall-model
11183 @opindex msmall-model
11184 Use the small address space model.  This can produce smaller code, but
11185 it does assume that all symbolic values and addresses will fit into a
11186 20-bit range.
11187
11188 @item -mno-lsim
11189 @opindex mno-lsim
11190 Assume that run-time support has been provided and so there is no need
11191 to include the simulator library (@file{libsim.a}) on the linker
11192 command line.
11193
11194 @end table
11195
11196 @node FRV Options
11197 @subsection FRV Options
11198 @cindex FRV Options
11199
11200 @table @gcctabopt
11201 @item -mgpr-32
11202 @opindex mgpr-32
11203
11204 Only use the first 32 general purpose registers.
11205
11206 @item -mgpr-64
11207 @opindex mgpr-64
11208
11209 Use all 64 general purpose registers.
11210
11211 @item -mfpr-32
11212 @opindex mfpr-32
11213
11214 Use only the first 32 floating point registers.
11215
11216 @item -mfpr-64
11217 @opindex mfpr-64
11218
11219 Use all 64 floating point registers
11220
11221 @item -mhard-float
11222 @opindex mhard-float
11223
11224 Use hardware instructions for floating point operations.
11225
11226 @item -msoft-float
11227 @opindex msoft-float
11228
11229 Use library routines for floating point operations.
11230
11231 @item -malloc-cc
11232 @opindex malloc-cc
11233
11234 Dynamically allocate condition code registers.
11235
11236 @item -mfixed-cc
11237 @opindex mfixed-cc
11238
11239 Do not try to dynamically allocate condition code registers, only
11240 use @code{icc0} and @code{fcc0}.
11241
11242 @item -mdword
11243 @opindex mdword
11244
11245 Change ABI to use double word insns.
11246
11247 @item -mno-dword
11248 @opindex mno-dword
11249
11250 Do not use double word instructions.
11251
11252 @item -mdouble
11253 @opindex mdouble
11254
11255 Use floating point double instructions.
11256
11257 @item -mno-double
11258 @opindex mno-double
11259
11260 Do not use floating point double instructions.
11261
11262 @item -mmedia
11263 @opindex mmedia
11264
11265 Use media instructions.
11266
11267 @item -mno-media
11268 @opindex mno-media
11269
11270 Do not use media instructions.
11271
11272 @item -mmuladd
11273 @opindex mmuladd
11274
11275 Use multiply and add/subtract instructions.
11276
11277 @item -mno-muladd
11278 @opindex mno-muladd
11279
11280 Do not use multiply and add/subtract instructions.
11281
11282 @item -mfdpic
11283 @opindex mfdpic
11284
11285 Select the FDPIC ABI, that uses function descriptors to represent
11286 pointers to functions.  Without any PIC/PIE-related options, it
11287 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
11288 assumes GOT entries and small data are within a 12-bit range from the
11289 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
11290 are computed with 32 bits.
11291 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11292
11293 @item -minline-plt
11294 @opindex minline-plt
11295
11296 Enable inlining of PLT entries in function calls to functions that are
11297 not known to bind locally.  It has no effect without @option{-mfdpic}.
11298 It's enabled by default if optimizing for speed and compiling for
11299 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
11300 optimization option such as @option{-O3} or above is present in the
11301 command line.
11302
11303 @item -mTLS
11304 @opindex mTLS
11305
11306 Assume a large TLS segment when generating thread-local code.
11307
11308 @item -mtls
11309 @opindex mtls
11310
11311 Do not assume a large TLS segment when generating thread-local code.
11312
11313 @item -mgprel-ro
11314 @opindex mgprel-ro
11315
11316 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
11317 that is known to be in read-only sections.  It's enabled by default,
11318 except for @option{-fpic} or @option{-fpie}: even though it may help
11319 make the global offset table smaller, it trades 1 instruction for 4.
11320 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
11321 one of which may be shared by multiple symbols, and it avoids the need
11322 for a GOT entry for the referenced symbol, so it's more likely to be a
11323 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
11324
11325 @item -multilib-library-pic
11326 @opindex multilib-library-pic
11327
11328 Link with the (library, not FD) pic libraries.  It's implied by
11329 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
11330 @option{-fpic} without @option{-mfdpic}.  You should never have to use
11331 it explicitly.
11332
11333 @item -mlinked-fp
11334 @opindex mlinked-fp
11335
11336 Follow the EABI requirement of always creating a frame pointer whenever
11337 a stack frame is allocated.  This option is enabled by default and can
11338 be disabled with @option{-mno-linked-fp}.
11339
11340 @item -mlong-calls
11341 @opindex mlong-calls
11342
11343 Use indirect addressing to call functions outside the current
11344 compilation unit.  This allows the functions to be placed anywhere
11345 within the 32-bit address space.
11346
11347 @item -malign-labels
11348 @opindex malign-labels
11349
11350 Try to align labels to an 8-byte boundary by inserting nops into the
11351 previous packet.  This option only has an effect when VLIW packing
11352 is enabled.  It doesn't create new packets; it merely adds nops to
11353 existing ones.
11354
11355 @item -mlibrary-pic
11356 @opindex mlibrary-pic
11357
11358 Generate position-independent EABI code.
11359
11360 @item -macc-4
11361 @opindex macc-4
11362
11363 Use only the first four media accumulator registers.
11364
11365 @item -macc-8
11366 @opindex macc-8
11367
11368 Use all eight media accumulator registers.
11369
11370 @item -mpack
11371 @opindex mpack
11372
11373 Pack VLIW instructions.
11374
11375 @item -mno-pack
11376 @opindex mno-pack
11377
11378 Do not pack VLIW instructions.
11379
11380 @item -mno-eflags
11381 @opindex mno-eflags
11382
11383 Do not mark ABI switches in e_flags.
11384
11385 @item -mcond-move
11386 @opindex mcond-move
11387
11388 Enable the use of conditional-move instructions (default).
11389
11390 This switch is mainly for debugging the compiler and will likely be removed
11391 in a future version.
11392
11393 @item -mno-cond-move
11394 @opindex mno-cond-move
11395
11396 Disable the use of conditional-move instructions.
11397
11398 This switch is mainly for debugging the compiler and will likely be removed
11399 in a future version.
11400
11401 @item -mscc
11402 @opindex mscc
11403
11404 Enable the use of conditional set instructions (default).
11405
11406 This switch is mainly for debugging the compiler and will likely be removed
11407 in a future version.
11408
11409 @item -mno-scc
11410 @opindex mno-scc
11411
11412 Disable the use of conditional set instructions.
11413
11414 This switch is mainly for debugging the compiler and will likely be removed
11415 in a future version.
11416
11417 @item -mcond-exec
11418 @opindex mcond-exec
11419
11420 Enable the use of conditional execution (default).
11421
11422 This switch is mainly for debugging the compiler and will likely be removed
11423 in a future version.
11424
11425 @item -mno-cond-exec
11426 @opindex mno-cond-exec
11427
11428 Disable the use of conditional execution.
11429
11430 This switch is mainly for debugging the compiler and will likely be removed
11431 in a future version.
11432
11433 @item -mvliw-branch
11434 @opindex mvliw-branch
11435
11436 Run a pass to pack branches into VLIW instructions (default).
11437
11438 This switch is mainly for debugging the compiler and will likely be removed
11439 in a future version.
11440
11441 @item -mno-vliw-branch
11442 @opindex mno-vliw-branch
11443
11444 Do not run a pass to pack branches into VLIW instructions.
11445
11446 This switch is mainly for debugging the compiler and will likely be removed
11447 in a future version.
11448
11449 @item -mmulti-cond-exec
11450 @opindex mmulti-cond-exec
11451
11452 Enable optimization of @code{&&} and @code{||} in conditional execution
11453 (default).
11454
11455 This switch is mainly for debugging the compiler and will likely be removed
11456 in a future version.
11457
11458 @item -mno-multi-cond-exec
11459 @opindex mno-multi-cond-exec
11460
11461 Disable optimization of @code{&&} and @code{||} in conditional execution.
11462
11463 This switch is mainly for debugging the compiler and will likely be removed
11464 in a future version.
11465
11466 @item -mnested-cond-exec
11467 @opindex mnested-cond-exec
11468
11469 Enable nested conditional execution optimizations (default).
11470
11471 This switch is mainly for debugging the compiler and will likely be removed
11472 in a future version.
11473
11474 @item -mno-nested-cond-exec
11475 @opindex mno-nested-cond-exec
11476
11477 Disable nested conditional execution optimizations.
11478
11479 This switch is mainly for debugging the compiler and will likely be removed
11480 in a future version.
11481
11482 @item -moptimize-membar
11483 @opindex moptimize-membar
11484
11485 This switch removes redundant @code{membar} instructions from the
11486 compiler generated code.  It is enabled by default.
11487
11488 @item -mno-optimize-membar
11489 @opindex mno-optimize-membar
11490
11491 This switch disables the automatic removal of redundant @code{membar}
11492 instructions from the generated code.
11493
11494 @item -mtomcat-stats
11495 @opindex mtomcat-stats
11496
11497 Cause gas to print out tomcat statistics.
11498
11499 @item -mcpu=@var{cpu}
11500 @opindex mcpu
11501
11502 Select the processor type for which to generate code.  Possible values are
11503 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
11504 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
11505
11506 @end table
11507
11508 @node GNU/Linux Options
11509 @subsection GNU/Linux Options
11510
11511 These @samp{-m} options are defined for GNU/Linux targets:
11512
11513 @table @gcctabopt
11514 @item -mglibc
11515 @opindex mglibc
11516 Use the GNU C library.  This is the default except
11517 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
11518
11519 @item -muclibc
11520 @opindex muclibc
11521 Use uClibc C library.  This is the default on
11522 @samp{*-*-linux-*uclibc*} targets.
11523
11524 @item -mbionic
11525 @opindex mbionic
11526 Use Bionic C library.  This is the default on
11527 @samp{*-*-linux-*android*} targets.
11528
11529 @item -mandroid
11530 @opindex mandroid
11531 Compile code compatible with Android platform.  This is the default on
11532 @samp{*-*-linux-*android*} targets.
11533
11534 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
11535 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
11536 this option makes the GCC driver pass Android-specific options to the linker.
11537 Finally, this option causes the preprocessor macro @code{__ANDROID__}
11538 to be defined.
11539
11540 @item -tno-android-cc
11541 @opindex tno-android-cc
11542 Disable compilation effects of @option{-mandroid}, i.e., do not enable
11543 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
11544 @option{-fno-rtti} by default.
11545
11546 @item -tno-android-ld
11547 @opindex tno-android-ld
11548 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
11549 linking options to the linker.
11550
11551 @end table
11552
11553 @node H8/300 Options
11554 @subsection H8/300 Options
11555
11556 These @samp{-m} options are defined for the H8/300 implementations:
11557
11558 @table @gcctabopt
11559 @item -mrelax
11560 @opindex mrelax
11561 Shorten some address references at link time, when possible; uses the
11562 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
11563 ld, Using ld}, for a fuller description.
11564
11565 @item -mh
11566 @opindex mh
11567 Generate code for the H8/300H@.
11568
11569 @item -ms
11570 @opindex ms
11571 Generate code for the H8S@.
11572
11573 @item -mn
11574 @opindex mn
11575 Generate code for the H8S and H8/300H in the normal mode.  This switch
11576 must be used either with @option{-mh} or @option{-ms}.
11577
11578 @item -ms2600
11579 @opindex ms2600
11580 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
11581
11582 @item -mint32
11583 @opindex mint32
11584 Make @code{int} data 32 bits by default.
11585
11586 @item -malign-300
11587 @opindex malign-300
11588 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
11589 The default for the H8/300H and H8S is to align longs and floats on 4
11590 byte boundaries.
11591 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
11592 This option has no effect on the H8/300.
11593 @end table
11594
11595 @node HPPA Options
11596 @subsection HPPA Options
11597 @cindex HPPA Options
11598
11599 These @samp{-m} options are defined for the HPPA family of computers:
11600
11601 @table @gcctabopt
11602 @item -march=@var{architecture-type}
11603 @opindex march
11604 Generate code for the specified architecture.  The choices for
11605 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
11606 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
11607 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
11608 architecture option for your machine.  Code compiled for lower numbered
11609 architectures will run on higher numbered architectures, but not the
11610 other way around.
11611
11612 @item -mpa-risc-1-0
11613 @itemx -mpa-risc-1-1
11614 @itemx -mpa-risc-2-0
11615 @opindex mpa-risc-1-0
11616 @opindex mpa-risc-1-1
11617 @opindex mpa-risc-2-0
11618 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
11619
11620 @item -mbig-switch
11621 @opindex mbig-switch
11622 Generate code suitable for big switch tables.  Use this option only if
11623 the assembler/linker complain about out of range branches within a switch
11624 table.
11625
11626 @item -mjump-in-delay
11627 @opindex mjump-in-delay
11628 Fill delay slots of function calls with unconditional jump instructions
11629 by modifying the return pointer for the function call to be the target
11630 of the conditional jump.
11631
11632 @item -mdisable-fpregs
11633 @opindex mdisable-fpregs
11634 Prevent floating point registers from being used in any manner.  This is
11635 necessary for compiling kernels which perform lazy context switching of
11636 floating point registers.  If you use this option and attempt to perform
11637 floating point operations, the compiler will abort.
11638
11639 @item -mdisable-indexing
11640 @opindex mdisable-indexing
11641 Prevent the compiler from using indexing address modes.  This avoids some
11642 rather obscure problems when compiling MIG generated code under MACH@.
11643
11644 @item -mno-space-regs
11645 @opindex mno-space-regs
11646 Generate code that assumes the target has no space registers.  This allows
11647 GCC to generate faster indirect calls and use unscaled index address modes.
11648
11649 Such code is suitable for level 0 PA systems and kernels.
11650
11651 @item -mfast-indirect-calls
11652 @opindex mfast-indirect-calls
11653 Generate code that assumes calls never cross space boundaries.  This
11654 allows GCC to emit code which performs faster indirect calls.
11655
11656 This option will not work in the presence of shared libraries or nested
11657 functions.
11658
11659 @item -mfixed-range=@var{register-range}
11660 @opindex mfixed-range
11661 Generate code treating the given register range as fixed registers.
11662 A fixed register is one that the register allocator can not use.  This is
11663 useful when compiling kernel code.  A register range is specified as
11664 two registers separated by a dash.  Multiple register ranges can be
11665 specified separated by a comma.
11666
11667 @item -mlong-load-store
11668 @opindex mlong-load-store
11669 Generate 3-instruction load and store sequences as sometimes required by
11670 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
11671 the HP compilers.
11672
11673 @item -mportable-runtime
11674 @opindex mportable-runtime
11675 Use the portable calling conventions proposed by HP for ELF systems.
11676
11677 @item -mgas
11678 @opindex mgas
11679 Enable the use of assembler directives only GAS understands.
11680
11681 @item -mschedule=@var{cpu-type}
11682 @opindex mschedule
11683 Schedule code according to the constraints for the machine type
11684 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
11685 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
11686 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
11687 proper scheduling option for your machine.  The default scheduling is
11688 @samp{8000}.
11689
11690 @item -mlinker-opt
11691 @opindex mlinker-opt
11692 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
11693 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
11694 linkers in which they give bogus error messages when linking some programs.
11695
11696 @item -msoft-float
11697 @opindex msoft-float
11698 Generate output containing library calls for floating point.
11699 @strong{Warning:} the requisite libraries are not available for all HPPA
11700 targets.  Normally the facilities of the machine's usual C compiler are
11701 used, but this cannot be done directly in cross-compilation.  You must make
11702 your own arrangements to provide suitable library functions for
11703 cross-compilation.
11704
11705 @option{-msoft-float} changes the calling convention in the output file;
11706 therefore, it is only useful if you compile @emph{all} of a program with
11707 this option.  In particular, you need to compile @file{libgcc.a}, the
11708 library that comes with GCC, with @option{-msoft-float} in order for
11709 this to work.
11710
11711 @item -msio
11712 @opindex msio
11713 Generate the predefine, @code{_SIO}, for server IO@.  The default is
11714 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
11715 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
11716 options are available under HP-UX and HI-UX@.
11717
11718 @item -mgnu-ld
11719 @opindex mgnu-ld
11720 Use GNU ld specific options.  This passes @option{-shared} to ld when
11721 building a shared library.  It is the default when GCC is configured,
11722 explicitly or implicitly, with the GNU linker.  This option does not
11723 have any affect on which ld is called, it only changes what parameters
11724 are passed to that ld.  The ld that is called is determined by the
11725 @option{--with-ld} configure option, GCC's program search path, and
11726 finally by the user's @env{PATH}.  The linker used by GCC can be printed
11727 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
11728 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11729
11730 @item -mhp-ld
11731 @opindex mhp-ld
11732 Use HP ld specific options.  This passes @option{-b} to ld when building
11733 a shared library and passes @option{+Accept TypeMismatch} to ld on all
11734 links.  It is the default when GCC is configured, explicitly or
11735 implicitly, with the HP linker.  This option does not have any affect on
11736 which ld is called, it only changes what parameters are passed to that
11737 ld.  The ld that is called is determined by the @option{--with-ld}
11738 configure option, GCC's program search path, and finally by the user's
11739 @env{PATH}.  The linker used by GCC can be printed using @samp{which
11740 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
11741 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11742
11743 @item -mlong-calls
11744 @opindex mno-long-calls
11745 Generate code that uses long call sequences.  This ensures that a call
11746 is always able to reach linker generated stubs.  The default is to generate
11747 long calls only when the distance from the call site to the beginning
11748 of the function or translation unit, as the case may be, exceeds a
11749 predefined limit set by the branch type being used.  The limits for
11750 normal calls are 7,600,000 and 240,000 bytes, respectively for the
11751 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
11752 240,000 bytes.
11753
11754 Distances are measured from the beginning of functions when using the
11755 @option{-ffunction-sections} option, or when using the @option{-mgas}
11756 and @option{-mno-portable-runtime} options together under HP-UX with
11757 the SOM linker.
11758
11759 It is normally not desirable to use this option as it will degrade
11760 performance.  However, it may be useful in large applications,
11761 particularly when partial linking is used to build the application.
11762
11763 The types of long calls used depends on the capabilities of the
11764 assembler and linker, and the type of code being generated.  The
11765 impact on systems that support long absolute calls, and long pic
11766 symbol-difference or pc-relative calls should be relatively small.
11767 However, an indirect call is used on 32-bit ELF systems in pic code
11768 and it is quite long.
11769
11770 @item -munix=@var{unix-std}
11771 @opindex march
11772 Generate compiler predefines and select a startfile for the specified
11773 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
11774 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
11775 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
11776 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
11777 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
11778 and later.
11779
11780 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
11781 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
11782 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
11783 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
11784 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
11785 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
11786
11787 It is @emph{important} to note that this option changes the interfaces
11788 for various library routines.  It also affects the operational behavior
11789 of the C library.  Thus, @emph{extreme} care is needed in using this
11790 option.
11791
11792 Library code that is intended to operate with more than one UNIX
11793 standard must test, set and restore the variable @var{__xpg4_extended_mask}
11794 as appropriate.  Most GNU software doesn't provide this capability.
11795
11796 @item -nolibdld
11797 @opindex nolibdld
11798 Suppress the generation of link options to search libdld.sl when the
11799 @option{-static} option is specified on HP-UX 10 and later.
11800
11801 @item -static
11802 @opindex static
11803 The HP-UX implementation of setlocale in libc has a dependency on
11804 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
11805 when the @option{-static} option is specified, special link options
11806 are needed to resolve this dependency.
11807
11808 On HP-UX 10 and later, the GCC driver adds the necessary options to
11809 link with libdld.sl when the @option{-static} option is specified.
11810 This causes the resulting binary to be dynamic.  On the 64-bit port,
11811 the linkers generate dynamic binaries by default in any case.  The
11812 @option{-nolibdld} option can be used to prevent the GCC driver from
11813 adding these link options.
11814
11815 @item -threads
11816 @opindex threads
11817 Add support for multithreading with the @dfn{dce thread} library
11818 under HP-UX@.  This option sets flags for both the preprocessor and
11819 linker.
11820 @end table
11821
11822 @node i386 and x86-64 Options
11823 @subsection Intel 386 and AMD x86-64 Options
11824 @cindex i386 Options
11825 @cindex x86-64 Options
11826 @cindex Intel 386 Options
11827 @cindex AMD x86-64 Options
11828
11829 These @samp{-m} options are defined for the i386 and x86-64 family of
11830 computers:
11831
11832 @table @gcctabopt
11833 @item -mtune=@var{cpu-type}
11834 @opindex mtune
11835 Tune to @var{cpu-type} everything applicable about the generated code, except
11836 for the ABI and the set of available instructions.  The choices for
11837 @var{cpu-type} are:
11838 @table @emph
11839 @item generic
11840 Produce code optimized for the most common IA32/AMD64/EM64T processors.
11841 If you know the CPU on which your code will run, then you should use
11842 the corresponding @option{-mtune} option instead of
11843 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
11844 of your application will have, then you should use this option.
11845
11846 As new processors are deployed in the marketplace, the behavior of this
11847 option will change.  Therefore, if you upgrade to a newer version of
11848 GCC, the code generated option will change to reflect the processors
11849 that were most common when that version of GCC was released.
11850
11851 There is no @option{-march=generic} option because @option{-march}
11852 indicates the instruction set the compiler can use, and there is no
11853 generic instruction set applicable to all processors.  In contrast,
11854 @option{-mtune} indicates the processor (or, in this case, collection of
11855 processors) for which the code is optimized.
11856 @item native
11857 This selects the CPU to tune for at compilation time by determining
11858 the processor type of the compiling machine.  Using @option{-mtune=native}
11859 will produce code optimized for the local machine under the constraints
11860 of the selected instruction set.  Using @option{-march=native} will
11861 enable all instruction subsets supported by the local machine (hence
11862 the result might not run on different machines).
11863 @item i386
11864 Original Intel's i386 CPU@.
11865 @item i486
11866 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
11867 @item i586, pentium
11868 Intel Pentium CPU with no MMX support.
11869 @item pentium-mmx
11870 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
11871 @item pentiumpro
11872 Intel PentiumPro CPU@.
11873 @item i686
11874 Same as @code{generic}, but when used as @code{march} option, PentiumPro
11875 instruction set will be used, so the code will run on all i686 family chips.
11876 @item pentium2
11877 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
11878 @item pentium3, pentium3m
11879 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
11880 support.
11881 @item pentium-m
11882 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
11883 support.  Used by Centrino notebooks.
11884 @item pentium4, pentium4m
11885 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
11886 @item prescott
11887 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
11888 set support.
11889 @item nocona
11890 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
11891 SSE2 and SSE3 instruction set support.
11892 @item core2
11893 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11894 instruction set support.
11895 @item atom
11896 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11897 instruction set support.
11898 @item k6
11899 AMD K6 CPU with MMX instruction set support.
11900 @item k6-2, k6-3
11901 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
11902 @item athlon, athlon-tbird
11903 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
11904 support.
11905 @item athlon-4, athlon-xp, athlon-mp
11906 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
11907 instruction set support.
11908 @item k8, opteron, athlon64, athlon-fx
11909 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
11910 MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit instruction set extensions.)
11911 @item k8-sse3, opteron-sse3, athlon64-sse3
11912 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
11913 @item amdfam10, barcelona
11914 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
11915 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
11916 instruction set extensions.)
11917 @item winchip-c6
11918 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
11919 set support.
11920 @item winchip2
11921 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
11922 instruction set support.
11923 @item c3
11924 Via C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
11925 implemented for this chip.)
11926 @item c3-2
11927 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
11928 implemented for this chip.)
11929 @item geode
11930 Embedded AMD CPU with MMX and 3DNow!@: instruction set support.
11931 @end table
11932
11933 While picking a specific @var{cpu-type} will schedule things appropriately
11934 for that particular chip, the compiler will not generate any code that
11935 does not run on the i386 without the @option{-march=@var{cpu-type}} option
11936 being used.
11937
11938 @item -march=@var{cpu-type}
11939 @opindex march
11940 Generate instructions for the machine type @var{cpu-type}.  The choices
11941 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
11942 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
11943
11944 @item -mcpu=@var{cpu-type}
11945 @opindex mcpu
11946 A deprecated synonym for @option{-mtune}.
11947
11948 @item -mfpmath=@var{unit}
11949 @opindex mfpmath
11950 Generate floating point arithmetics for selected unit @var{unit}.  The choices
11951 for @var{unit} are:
11952
11953 @table @samp
11954 @item 387
11955 Use the standard 387 floating point coprocessor present majority of chips and
11956 emulated otherwise.  Code compiled with this option will run almost everywhere.
11957 The temporary results are computed in 80bit precision instead of precision
11958 specified by the type resulting in slightly different results compared to most
11959 of other chips.  See @option{-ffloat-store} for more detailed description.
11960
11961 This is the default choice for i386 compiler.
11962
11963 @item sse
11964 Use scalar floating point instructions present in the SSE instruction set.
11965 This instruction set is supported by Pentium3 and newer chips, in the AMD line
11966 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
11967 instruction set supports only single precision arithmetics, thus the double and
11968 extended precision arithmetics is still done using 387.  Later version, present
11969 only in Pentium4 and the future AMD x86-64 chips supports double precision
11970 arithmetics too.
11971
11972 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
11973 or @option{-msse2} switches to enable SSE extensions and make this option
11974 effective.  For the x86-64 compiler, these extensions are enabled by default.
11975
11976 The resulting code should be considerably faster in the majority of cases and avoid
11977 the numerical instability problems of 387 code, but may break some existing
11978 code that expects temporaries to be 80bit.
11979
11980 This is the default choice for the x86-64 compiler.
11981
11982 @item sse,387
11983 @itemx sse+387
11984 @itemx both
11985 Attempt to utilize both instruction sets at once.  This effectively double the
11986 amount of available registers and on chips with separate execution units for
11987 387 and SSE the execution resources too.  Use this option with care, as it is
11988 still experimental, because the GCC register allocator does not model separate
11989 functional units well resulting in instable performance.
11990 @end table
11991
11992 @item -masm=@var{dialect}
11993 @opindex masm=@var{dialect}
11994 Output asm instructions using selected @var{dialect}.  Supported
11995 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
11996 not support @samp{intel}.
11997
11998 @item -mieee-fp
11999 @itemx -mno-ieee-fp
12000 @opindex mieee-fp
12001 @opindex mno-ieee-fp
12002 Control whether or not the compiler uses IEEE floating point
12003 comparisons.  These handle correctly the case where the result of a
12004 comparison is unordered.
12005
12006 @item -msoft-float
12007 @opindex msoft-float
12008 Generate output containing library calls for floating point.
12009 @strong{Warning:} the requisite libraries are not part of GCC@.
12010 Normally the facilities of the machine's usual C compiler are used, but
12011 this can't be done directly in cross-compilation.  You must make your
12012 own arrangements to provide suitable library functions for
12013 cross-compilation.
12014
12015 On machines where a function returns floating point results in the 80387
12016 register stack, some floating point opcodes may be emitted even if
12017 @option{-msoft-float} is used.
12018
12019 @item -mno-fp-ret-in-387
12020 @opindex mno-fp-ret-in-387
12021 Do not use the FPU registers for return values of functions.
12022
12023 The usual calling convention has functions return values of types
12024 @code{float} and @code{double} in an FPU register, even if there
12025 is no FPU@.  The idea is that the operating system should emulate
12026 an FPU@.
12027
12028 The option @option{-mno-fp-ret-in-387} causes such values to be returned
12029 in ordinary CPU registers instead.
12030
12031 @item -mno-fancy-math-387
12032 @opindex mno-fancy-math-387
12033 Some 387 emulators do not support the @code{sin}, @code{cos} and
12034 @code{sqrt} instructions for the 387.  Specify this option to avoid
12035 generating those instructions.  This option is the default on FreeBSD,
12036 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
12037 indicates that the target cpu will always have an FPU and so the
12038 instruction will not need emulation.  As of revision 2.6.1, these
12039 instructions are not generated unless you also use the
12040 @option{-funsafe-math-optimizations} switch.
12041
12042 @item -malign-double
12043 @itemx -mno-align-double
12044 @opindex malign-double
12045 @opindex mno-align-double
12046 Control whether GCC aligns @code{double}, @code{long double}, and
12047 @code{long long} variables on a two word boundary or a one word
12048 boundary.  Aligning @code{double} variables on a two word boundary will
12049 produce code that runs somewhat faster on a @samp{Pentium} at the
12050 expense of more memory.
12051
12052 On x86-64, @option{-malign-double} is enabled by default.
12053
12054 @strong{Warning:} if you use the @option{-malign-double} switch,
12055 structures containing the above types will be aligned differently than
12056 the published application binary interface specifications for the 386
12057 and will not be binary compatible with structures in code compiled
12058 without that switch.
12059
12060 @item -m96bit-long-double
12061 @itemx -m128bit-long-double
12062 @opindex m96bit-long-double
12063 @opindex m128bit-long-double
12064 These switches control the size of @code{long double} type.  The i386
12065 application binary interface specifies the size to be 96 bits,
12066 so @option{-m96bit-long-double} is the default in 32 bit mode.
12067
12068 Modern architectures (Pentium and newer) would prefer @code{long double}
12069 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
12070 conforming to the ABI, this would not be possible.  So specifying a
12071 @option{-m128bit-long-double} will align @code{long double}
12072 to a 16 byte boundary by padding the @code{long double} with an additional
12073 32 bit zero.
12074
12075 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
12076 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
12077
12078 Notice that neither of these options enable any extra precision over the x87
12079 standard of 80 bits for a @code{long double}.
12080
12081 @strong{Warning:} if you override the default value for your target ABI, the
12082 structures and arrays containing @code{long double} variables will change
12083 their size as well as function calling convention for function taking
12084 @code{long double} will be modified.  Hence they will not be binary
12085 compatible with arrays or structures in code compiled without that switch.
12086
12087 @item -mlarge-data-threshold=@var{number}
12088 @opindex mlarge-data-threshold=@var{number}
12089 When @option{-mcmodel=medium} is specified, the data greater than
12090 @var{threshold} are placed in large data section.  This value must be the
12091 same across all object linked into the binary and defaults to 65535.
12092
12093 @item -mrtd
12094 @opindex mrtd
12095 Use a different function-calling convention, in which functions that
12096 take a fixed number of arguments return with the @code{ret} @var{num}
12097 instruction, which pops their arguments while returning.  This saves one
12098 instruction in the caller since there is no need to pop the arguments
12099 there.
12100
12101 You can specify that an individual function is called with this calling
12102 sequence with the function attribute @samp{stdcall}.  You can also
12103 override the @option{-mrtd} option by using the function attribute
12104 @samp{cdecl}.  @xref{Function Attributes}.
12105
12106 @strong{Warning:} this calling convention is incompatible with the one
12107 normally used on Unix, so you cannot use it if you need to call
12108 libraries compiled with the Unix compiler.
12109
12110 Also, you must provide function prototypes for all functions that
12111 take variable numbers of arguments (including @code{printf});
12112 otherwise incorrect code will be generated for calls to those
12113 functions.
12114
12115 In addition, seriously incorrect code will result if you call a
12116 function with too many arguments.  (Normally, extra arguments are
12117 harmlessly ignored.)
12118
12119 @item -mregparm=@var{num}
12120 @opindex mregparm
12121 Control how many registers are used to pass integer arguments.  By
12122 default, no registers are used to pass arguments, and at most 3
12123 registers can be used.  You can control this behavior for a specific
12124 function by using the function attribute @samp{regparm}.
12125 @xref{Function Attributes}.
12126
12127 @strong{Warning:} if you use this switch, and
12128 @var{num} is nonzero, then you must build all modules with the same
12129 value, including any libraries.  This includes the system libraries and
12130 startup modules.
12131
12132 @item -msseregparm
12133 @opindex msseregparm
12134 Use SSE register passing conventions for float and double arguments
12135 and return values.  You can control this behavior for a specific
12136 function by using the function attribute @samp{sseregparm}.
12137 @xref{Function Attributes}.
12138
12139 @strong{Warning:} if you use this switch then you must build all
12140 modules with the same value, including any libraries.  This includes
12141 the system libraries and startup modules.
12142
12143 @item -mpc32
12144 @itemx -mpc64
12145 @itemx -mpc80
12146 @opindex mpc32
12147 @opindex mpc64
12148 @opindex mpc80
12149
12150 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
12151 is specified, the significands of results of floating-point operations are
12152 rounded to 24 bits (single precision); @option{-mpc64} rounds the
12153 significands of results of floating-point operations to 53 bits (double
12154 precision) and @option{-mpc80} rounds the significands of results of
12155 floating-point operations to 64 bits (extended double precision), which is
12156 the default.  When this option is used, floating-point operations in higher
12157 precisions are not available to the programmer without setting the FPU
12158 control word explicitly.
12159
12160 Setting the rounding of floating-point operations to less than the default
12161 80 bits can speed some programs by 2% or more.  Note that some mathematical
12162 libraries assume that extended precision (80 bit) floating-point operations
12163 are enabled by default; routines in such libraries could suffer significant
12164 loss of accuracy, typically through so-called "catastrophic cancellation",
12165 when this option is used to set the precision to less than extended precision.
12166
12167 @item -mstackrealign
12168 @opindex mstackrealign
12169 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
12170 option will generate an alternate prologue and epilogue that realigns the
12171 runtime stack if necessary.  This supports mixing legacy codes that keep
12172 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
12173 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
12174 applicable to individual functions.
12175
12176 @item -mpreferred-stack-boundary=@var{num}
12177 @opindex mpreferred-stack-boundary
12178 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
12179 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
12180 the default is 4 (16 bytes or 128 bits).
12181
12182 @item -mincoming-stack-boundary=@var{num}
12183 @opindex mincoming-stack-boundary
12184 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
12185 boundary.  If @option{-mincoming-stack-boundary} is not specified,
12186 the one specified by @option{-mpreferred-stack-boundary} will be used.
12187
12188 On Pentium and PentiumPro, @code{double} and @code{long double} values
12189 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
12190 suffer significant run time performance penalties.  On Pentium III, the
12191 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
12192 properly if it is not 16 byte aligned.
12193
12194 To ensure proper alignment of this values on the stack, the stack boundary
12195 must be as aligned as that required by any value stored on the stack.
12196 Further, every function must be generated such that it keeps the stack
12197 aligned.  Thus calling a function compiled with a higher preferred
12198 stack boundary from a function compiled with a lower preferred stack
12199 boundary will most likely misalign the stack.  It is recommended that
12200 libraries that use callbacks always use the default setting.
12201
12202 This extra alignment does consume extra stack space, and generally
12203 increases code size.  Code that is sensitive to stack space usage, such
12204 as embedded systems and operating system kernels, may want to reduce the
12205 preferred alignment to @option{-mpreferred-stack-boundary=2}.
12206
12207 @item -mmmx
12208 @itemx -mno-mmx
12209 @itemx -msse
12210 @itemx -mno-sse
12211 @itemx -msse2
12212 @itemx -mno-sse2
12213 @itemx -msse3
12214 @itemx -mno-sse3
12215 @itemx -mssse3
12216 @itemx -mno-ssse3
12217 @itemx -msse4.1
12218 @itemx -mno-sse4.1
12219 @itemx -msse4.2
12220 @itemx -mno-sse4.2
12221 @itemx -msse4
12222 @itemx -mno-sse4
12223 @itemx -mavx
12224 @itemx -mno-avx
12225 @itemx -maes
12226 @itemx -mno-aes
12227 @itemx -mpclmul
12228 @itemx -mno-pclmul
12229 @itemx -msse4a
12230 @itemx -mno-sse4a
12231 @itemx -mfma4
12232 @itemx -mno-fma4
12233 @itemx -mxop
12234 @itemx -mno-xop
12235 @itemx -mlwp
12236 @itemx -mno-lwp
12237 @itemx -m3dnow
12238 @itemx -mno-3dnow
12239 @itemx -mpopcnt
12240 @itemx -mno-popcnt
12241 @itemx -mabm
12242 @itemx -mno-abm
12243 @opindex mmmx
12244 @opindex mno-mmx
12245 @opindex msse
12246 @opindex mno-sse
12247 @opindex m3dnow
12248 @opindex mno-3dnow
12249 These switches enable or disable the use of instructions in the MMX,
12250 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, FMA4, XOP,
12251 LWP, ABM or 3DNow!@: extended instruction sets.
12252 These extensions are also available as built-in functions: see
12253 @ref{X86 Built-in Functions}, for details of the functions enabled and
12254 disabled by these switches.
12255
12256 To have SSE/SSE2 instructions generated automatically from floating-point
12257 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
12258
12259 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
12260 generates new AVX instructions or AVX equivalence for all SSEx instructions
12261 when needed.
12262
12263 These options will enable GCC to use these extended instructions in
12264 generated code, even without @option{-mfpmath=sse}.  Applications which
12265 perform runtime CPU detection must compile separate files for each
12266 supported architecture, using the appropriate flags.  In particular,
12267 the file containing the CPU detection code should be compiled without
12268 these options.
12269
12270 @item -mfused-madd
12271 @itemx -mno-fused-madd
12272 @opindex mfused-madd
12273 @opindex mno-fused-madd
12274 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12275 instructions.  The default is to use these instructions.
12276
12277 @item -mcld
12278 @opindex mcld
12279 This option instructs GCC to emit a @code{cld} instruction in the prologue
12280 of functions that use string instructions.  String instructions depend on
12281 the DF flag to select between autoincrement or autodecrement mode.  While the
12282 ABI specifies the DF flag to be cleared on function entry, some operating
12283 systems violate this specification by not clearing the DF flag in their
12284 exception dispatchers.  The exception handler can be invoked with the DF flag
12285 set which leads to wrong direction mode, when string instructions are used.
12286 This option can be enabled by default on 32-bit x86 targets by configuring
12287 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
12288 instructions can be suppressed with the @option{-mno-cld} compiler option
12289 in this case.
12290
12291 @item -mcx16
12292 @opindex mcx16
12293 This option will enable GCC to use CMPXCHG16B instruction in generated code.
12294 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
12295 data types.  This is useful for high resolution counters that could be updated
12296 by multiple processors (or cores).  This instruction is generated as part of
12297 atomic built-in functions: see @ref{Atomic Builtins} for details.
12298
12299 @item -msahf
12300 @opindex msahf
12301 This option will enable GCC to use SAHF instruction in generated 64-bit code.
12302 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
12303 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
12304 SAHF are load and store instructions, respectively, for certain status flags.
12305 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
12306 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
12307
12308 @item -mmovbe
12309 @opindex mmovbe
12310 This option will enable GCC to use movbe instruction to implement
12311 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
12312
12313 @item -mcrc32
12314 @opindex mcrc32
12315 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
12316 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
12317 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
12318
12319 @item -mrecip
12320 @opindex mrecip
12321 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
12322 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
12323 to increase precision instead of DIVSS and SQRTSS (and their vectorized
12324 variants) for single precision floating point arguments.  These instructions
12325 are generated only when @option{-funsafe-math-optimizations} is enabled
12326 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
12327 Note that while the throughput of the sequence is higher than the throughput
12328 of the non-reciprocal instruction, the precision of the sequence can be
12329 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
12330
12331 Note that GCC implements 1.0f/sqrtf(x) in terms of RSQRTSS (or RSQRTPS)
12332 already with @option{-ffast-math} (or the above option combination), and
12333 doesn't need @option{-mrecip}.
12334
12335 @item -mveclibabi=@var{type}
12336 @opindex mveclibabi
12337 Specifies the ABI type to use for vectorizing intrinsics using an
12338 external library.  Supported types are @code{svml} for the Intel short
12339 vector math library and @code{acml} for the AMD math core library style
12340 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
12341 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
12342 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
12343 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
12344 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
12345 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
12346 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
12347 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
12348 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
12349 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
12350 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
12351 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
12352 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
12353 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
12354 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
12355 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
12356 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
12357 compatible library will have to be specified at link time.
12358
12359 @item -mabi=@var{name}
12360 @opindex mabi
12361 Generate code for the specified calling convention.  Permissible values
12362 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
12363 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
12364 ABI when targeting Windows.  On all other systems, the default is the
12365 SYSV ABI.  You can control this behavior for a specific function by
12366 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
12367 @xref{Function Attributes}.
12368
12369 @item -mpush-args
12370 @itemx -mno-push-args
12371 @opindex mpush-args
12372 @opindex mno-push-args
12373 Use PUSH operations to store outgoing parameters.  This method is shorter
12374 and usually equally fast as method using SUB/MOV operations and is enabled
12375 by default.  In some cases disabling it may improve performance because of
12376 improved scheduling and reduced dependencies.
12377
12378 @item -maccumulate-outgoing-args
12379 @opindex maccumulate-outgoing-args
12380 If enabled, the maximum amount of space required for outgoing arguments will be
12381 computed in the function prologue.  This is faster on most modern CPUs
12382 because of reduced dependencies, improved scheduling and reduced stack usage
12383 when preferred stack boundary is not equal to 2.  The drawback is a notable
12384 increase in code size.  This switch implies @option{-mno-push-args}.
12385
12386 @item -mthreads
12387 @opindex mthreads
12388 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
12389 on thread-safe exception handling must compile and link all code with the
12390 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
12391 @option{-D_MT}; when linking, it links in a special thread helper library
12392 @option{-lmingwthrd} which cleans up per thread exception handling data.
12393
12394 @item -mno-align-stringops
12395 @opindex mno-align-stringops
12396 Do not align destination of inlined string operations.  This switch reduces
12397 code size and improves performance in case the destination is already aligned,
12398 but GCC doesn't know about it.
12399
12400 @item -minline-all-stringops
12401 @opindex minline-all-stringops
12402 By default GCC inlines string operations only when destination is known to be
12403 aligned at least to 4 byte boundary.  This enables more inlining, increase code
12404 size, but may improve performance of code that depends on fast memcpy, strlen
12405 and memset for short lengths.
12406
12407 @item -minline-stringops-dynamically
12408 @opindex minline-stringops-dynamically
12409 For string operation of unknown size, inline runtime checks so for small
12410 blocks inline code is used, while for large blocks library call is used.
12411
12412 @item -mstringop-strategy=@var{alg}
12413 @opindex mstringop-strategy=@var{alg}
12414 Overwrite internal decision heuristic about particular algorithm to inline
12415 string operation with.  The allowed values are @code{rep_byte},
12416 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
12417 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
12418 expanding inline loop, @code{libcall} for always expanding library call.
12419
12420 @item -momit-leaf-frame-pointer
12421 @opindex momit-leaf-frame-pointer
12422 Don't keep the frame pointer in a register for leaf functions.  This
12423 avoids the instructions to save, set up and restore frame pointers and
12424 makes an extra register available in leaf functions.  The option
12425 @option{-fomit-frame-pointer} removes the frame pointer for all functions
12426 which might make debugging harder.
12427
12428 @item -mtls-direct-seg-refs
12429 @itemx -mno-tls-direct-seg-refs
12430 @opindex mtls-direct-seg-refs
12431 Controls whether TLS variables may be accessed with offsets from the
12432 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
12433 or whether the thread base pointer must be added.  Whether or not this
12434 is legal depends on the operating system, and whether it maps the
12435 segment to cover the entire TLS area.
12436
12437 For systems that use GNU libc, the default is on.
12438
12439 @item -msse2avx
12440 @itemx -mno-sse2avx
12441 @opindex msse2avx
12442 Specify that the assembler should encode SSE instructions with VEX
12443 prefix.  The option @option{-mavx} turns this on by default.
12444 @end table
12445
12446 These @samp{-m} switches are supported in addition to the above
12447 on AMD x86-64 processors in 64-bit environments.
12448
12449 @table @gcctabopt
12450 @item -m32
12451 @itemx -m64
12452 @opindex m32
12453 @opindex m64
12454 Generate code for a 32-bit or 64-bit environment.
12455 The 32-bit environment sets int, long and pointer to 32 bits and
12456 generates code that runs on any i386 system.
12457 The 64-bit environment sets int to 32 bits and long and pointer
12458 to 64 bits and generates code for AMD's x86-64 architecture. For
12459 darwin only the -m64 option turns off the @option{-fno-pic} and
12460 @option{-mdynamic-no-pic} options.
12461
12462 @item -mno-red-zone
12463 @opindex mno-red-zone
12464 Do not use a so called red zone for x86-64 code.  The red zone is mandated
12465 by the x86-64 ABI, it is a 128-byte area beyond the location of the
12466 stack pointer that will not be modified by signal or interrupt handlers
12467 and therefore can be used for temporary data without adjusting the stack
12468 pointer.  The flag @option{-mno-red-zone} disables this red zone.
12469
12470 @item -mcmodel=small
12471 @opindex mcmodel=small
12472 Generate code for the small code model: the program and its symbols must
12473 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
12474 Programs can be statically or dynamically linked.  This is the default
12475 code model.
12476
12477 @item -mcmodel=kernel
12478 @opindex mcmodel=kernel
12479 Generate code for the kernel code model.  The kernel runs in the
12480 negative 2 GB of the address space.
12481 This model has to be used for Linux kernel code.
12482
12483 @item -mcmodel=medium
12484 @opindex mcmodel=medium
12485 Generate code for the medium model: The program is linked in the lower 2
12486 GB of the address space.  Small symbols are also placed there.  Symbols
12487 with sizes larger than @option{-mlarge-data-threshold} are put into
12488 large data or bss sections and can be located above 2GB.  Programs can
12489 be statically or dynamically linked.
12490
12491 @item -mcmodel=large
12492 @opindex mcmodel=large
12493 Generate code for the large model: This model makes no assumptions
12494 about addresses and sizes of sections.
12495 @end table
12496
12497 @node IA-64 Options
12498 @subsection IA-64 Options
12499 @cindex IA-64 Options
12500
12501 These are the @samp{-m} options defined for the Intel IA-64 architecture.
12502
12503 @table @gcctabopt
12504 @item -mbig-endian
12505 @opindex mbig-endian
12506 Generate code for a big endian target.  This is the default for HP-UX@.
12507
12508 @item -mlittle-endian
12509 @opindex mlittle-endian
12510 Generate code for a little endian target.  This is the default for AIX5
12511 and GNU/Linux.
12512
12513 @item -mgnu-as
12514 @itemx -mno-gnu-as
12515 @opindex mgnu-as
12516 @opindex mno-gnu-as
12517 Generate (or don't) code for the GNU assembler.  This is the default.
12518 @c Also, this is the default if the configure option @option{--with-gnu-as}
12519 @c is used.
12520
12521 @item -mgnu-ld
12522 @itemx -mno-gnu-ld
12523 @opindex mgnu-ld
12524 @opindex mno-gnu-ld
12525 Generate (or don't) code for the GNU linker.  This is the default.
12526 @c Also, this is the default if the configure option @option{--with-gnu-ld}
12527 @c is used.
12528
12529 @item -mno-pic
12530 @opindex mno-pic
12531 Generate code that does not use a global pointer register.  The result
12532 is not position independent code, and violates the IA-64 ABI@.
12533
12534 @item -mvolatile-asm-stop
12535 @itemx -mno-volatile-asm-stop
12536 @opindex mvolatile-asm-stop
12537 @opindex mno-volatile-asm-stop
12538 Generate (or don't) a stop bit immediately before and after volatile asm
12539 statements.
12540
12541 @item -mregister-names
12542 @itemx -mno-register-names
12543 @opindex mregister-names
12544 @opindex mno-register-names
12545 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
12546 the stacked registers.  This may make assembler output more readable.
12547
12548 @item -mno-sdata
12549 @itemx -msdata
12550 @opindex mno-sdata
12551 @opindex msdata
12552 Disable (or enable) optimizations that use the small data section.  This may
12553 be useful for working around optimizer bugs.
12554
12555 @item -mconstant-gp
12556 @opindex mconstant-gp
12557 Generate code that uses a single constant global pointer value.  This is
12558 useful when compiling kernel code.
12559
12560 @item -mauto-pic
12561 @opindex mauto-pic
12562 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
12563 This is useful when compiling firmware code.
12564
12565 @item -minline-float-divide-min-latency
12566 @opindex minline-float-divide-min-latency
12567 Generate code for inline divides of floating point values
12568 using the minimum latency algorithm.
12569
12570 @item -minline-float-divide-max-throughput
12571 @opindex minline-float-divide-max-throughput
12572 Generate code for inline divides of floating point values
12573 using the maximum throughput algorithm.
12574
12575 @item -mno-inline-float-divide
12576 @opindex mno-inline-float-divide
12577 Do not generate inline code for divides of floating point values.
12578
12579 @item -minline-int-divide-min-latency
12580 @opindex minline-int-divide-min-latency
12581 Generate code for inline divides of integer values
12582 using the minimum latency algorithm.
12583
12584 @item -minline-int-divide-max-throughput
12585 @opindex minline-int-divide-max-throughput
12586 Generate code for inline divides of integer values
12587 using the maximum throughput algorithm.
12588
12589 @item -mno-inline-int-divide
12590 @opindex mno-inline-int-divide
12591 Do not generate inline code for divides of integer values.
12592
12593 @item -minline-sqrt-min-latency
12594 @opindex minline-sqrt-min-latency
12595 Generate code for inline square roots
12596 using the minimum latency algorithm.
12597
12598 @item -minline-sqrt-max-throughput
12599 @opindex minline-sqrt-max-throughput
12600 Generate code for inline square roots
12601 using the maximum throughput algorithm.
12602
12603 @item -mno-inline-sqrt
12604 @opindex mno-inline-sqrt
12605 Do not generate inline code for sqrt.
12606
12607 @item -mfused-madd
12608 @itemx -mno-fused-madd
12609 @opindex mfused-madd
12610 @opindex mno-fused-madd
12611 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12612 instructions.  The default is to use these instructions.
12613
12614 @item -mno-dwarf2-asm
12615 @itemx -mdwarf2-asm
12616 @opindex mno-dwarf2-asm
12617 @opindex mdwarf2-asm
12618 Don't (or do) generate assembler code for the DWARF2 line number debugging
12619 info.  This may be useful when not using the GNU assembler.
12620
12621 @item -mearly-stop-bits
12622 @itemx -mno-early-stop-bits
12623 @opindex mearly-stop-bits
12624 @opindex mno-early-stop-bits
12625 Allow stop bits to be placed earlier than immediately preceding the
12626 instruction that triggered the stop bit.  This can improve instruction
12627 scheduling, but does not always do so.
12628
12629 @item -mfixed-range=@var{register-range}
12630 @opindex mfixed-range
12631 Generate code treating the given register range as fixed registers.
12632 A fixed register is one that the register allocator can not use.  This is
12633 useful when compiling kernel code.  A register range is specified as
12634 two registers separated by a dash.  Multiple register ranges can be
12635 specified separated by a comma.
12636
12637 @item -mtls-size=@var{tls-size}
12638 @opindex mtls-size
12639 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
12640 64.
12641
12642 @item -mtune=@var{cpu-type}
12643 @opindex mtune
12644 Tune the instruction scheduling for a particular CPU, Valid values are
12645 itanium, itanium1, merced, itanium2, and mckinley.
12646
12647 @item -milp32
12648 @itemx -mlp64
12649 @opindex milp32
12650 @opindex mlp64
12651 Generate code for a 32-bit or 64-bit environment.
12652 The 32-bit environment sets int, long and pointer to 32 bits.
12653 The 64-bit environment sets int to 32 bits and long and pointer
12654 to 64 bits.  These are HP-UX specific flags.
12655
12656 @item -mno-sched-br-data-spec
12657 @itemx -msched-br-data-spec
12658 @opindex mno-sched-br-data-spec
12659 @opindex msched-br-data-spec
12660 (Dis/En)able data speculative scheduling before reload.
12661 This will result in generation of the ld.a instructions and
12662 the corresponding check instructions (ld.c / chk.a).
12663 The default is 'disable'.
12664
12665 @item -msched-ar-data-spec
12666 @itemx -mno-sched-ar-data-spec
12667 @opindex msched-ar-data-spec
12668 @opindex mno-sched-ar-data-spec
12669 (En/Dis)able data speculative scheduling after reload.
12670 This will result in generation of the ld.a instructions and
12671 the corresponding check instructions (ld.c / chk.a).
12672 The default is 'enable'.
12673
12674 @item -mno-sched-control-spec
12675 @itemx -msched-control-spec
12676 @opindex mno-sched-control-spec
12677 @opindex msched-control-spec
12678 (Dis/En)able control speculative scheduling.  This feature is
12679 available only during region scheduling (i.e.@: before reload).
12680 This will result in generation of the ld.s instructions and
12681 the corresponding check instructions chk.s .
12682 The default is 'disable'.
12683
12684 @item -msched-br-in-data-spec
12685 @itemx -mno-sched-br-in-data-spec
12686 @opindex msched-br-in-data-spec
12687 @opindex mno-sched-br-in-data-spec
12688 (En/Dis)able speculative scheduling of the instructions that
12689 are dependent on the data speculative loads before reload.
12690 This is effective only with @option{-msched-br-data-spec} enabled.
12691 The default is 'enable'.
12692
12693 @item -msched-ar-in-data-spec
12694 @itemx -mno-sched-ar-in-data-spec
12695 @opindex msched-ar-in-data-spec
12696 @opindex mno-sched-ar-in-data-spec
12697 (En/Dis)able speculative scheduling of the instructions that
12698 are dependent on the data speculative loads after reload.
12699 This is effective only with @option{-msched-ar-data-spec} enabled.
12700 The default is 'enable'.
12701
12702 @item -msched-in-control-spec
12703 @itemx -mno-sched-in-control-spec
12704 @opindex msched-in-control-spec
12705 @opindex mno-sched-in-control-spec
12706 (En/Dis)able speculative scheduling of the instructions that
12707 are dependent on the control speculative loads.
12708 This is effective only with @option{-msched-control-spec} enabled.
12709 The default is 'enable'.
12710
12711 @item -mno-sched-prefer-non-data-spec-insns
12712 @itemx -msched-prefer-non-data-spec-insns
12713 @opindex mno-sched-prefer-non-data-spec-insns
12714 @opindex msched-prefer-non-data-spec-insns
12715 If enabled, data speculative instructions will be chosen for schedule
12716 only if there are no other choices at the moment.  This will make
12717 the use of the data speculation much more conservative.
12718 The default is 'disable'.
12719
12720 @item -mno-sched-prefer-non-control-spec-insns
12721 @itemx -msched-prefer-non-control-spec-insns
12722 @opindex mno-sched-prefer-non-control-spec-insns
12723 @opindex msched-prefer-non-control-spec-insns
12724 If enabled, control speculative instructions will be chosen for schedule
12725 only if there are no other choices at the moment.  This will make
12726 the use of the control speculation much more conservative.
12727 The default is 'disable'.
12728
12729 @item -mno-sched-count-spec-in-critical-path
12730 @itemx -msched-count-spec-in-critical-path
12731 @opindex mno-sched-count-spec-in-critical-path
12732 @opindex msched-count-spec-in-critical-path
12733 If enabled, speculative dependencies will be considered during
12734 computation of the instructions priorities.  This will make the use of the
12735 speculation a bit more conservative.
12736 The default is 'disable'.
12737
12738 @item -msched-spec-ldc
12739 @opindex msched-spec-ldc
12740 Use a simple data speculation check.  This option is on by default.
12741
12742 @item -msched-control-spec-ldc
12743 @opindex msched-spec-ldc
12744 Use a simple check for control speculation.  This option is on by default.
12745
12746 @item -msched-stop-bits-after-every-cycle
12747 @opindex msched-stop-bits-after-every-cycle
12748 Place a stop bit after every cycle when scheduling.  This option is on
12749 by default.
12750
12751 @item -msched-fp-mem-deps-zero-cost
12752 @opindex msched-fp-mem-deps-zero-cost
12753 Assume that floating-point stores and loads are not likely to cause a conflict
12754 when placed into the same instruction group.  This option is disabled by
12755 default.
12756
12757 @item -msel-sched-dont-check-control-spec
12758 @opindex msel-sched-dont-check-control-spec
12759 Generate checks for control speculation in selective scheduling.
12760 This flag is disabled by default.
12761
12762 @item -msched-max-memory-insns=@var{max-insns}
12763 @opindex msched-max-memory-insns
12764 Limit on the number of memory insns per instruction group, giving lower
12765 priority to subsequent memory insns attempting to schedule in the same
12766 instruction group. Frequently useful to prevent cache bank conflicts.
12767 The default value is 1.
12768
12769 @item -msched-max-memory-insns-hard-limit
12770 @opindex msched-max-memory-insns-hard-limit
12771 Disallow more than `msched-max-memory-insns' in instruction group.
12772 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
12773 when limit is reached but may still schedule memory operations.
12774
12775 @end table
12776
12777 @node IA-64/VMS Options
12778 @subsection IA-64/VMS Options
12779
12780 These @samp{-m} options are defined for the IA-64/VMS implementations:
12781
12782 @table @gcctabopt
12783 @item -mvms-return-codes
12784 @opindex mvms-return-codes
12785 Return VMS condition codes from main. The default is to return POSIX
12786 style condition (e.g.@ error) codes.
12787
12788 @item -mdebug-main=@var{prefix}
12789 @opindex mdebug-main=@var{prefix}
12790 Flag the first routine whose name starts with @var{prefix} as the main
12791 routine for the debugger.
12792
12793 @item -mmalloc64
12794 @opindex mmalloc64
12795 Default to 64bit memory allocation routines.
12796 @end table
12797
12798 @node LM32 Options
12799 @subsection LM32 Options
12800 @cindex LM32 options
12801
12802 These @option{-m} options are defined for the Lattice Mico32 architecture:
12803
12804 @table @gcctabopt
12805 @item -mbarrel-shift-enabled
12806 @opindex mbarrel-shift-enabled
12807 Enable barrel-shift instructions.
12808
12809 @item -mdivide-enabled
12810 @opindex mdivide-enabled
12811 Enable divide and modulus instructions.
12812
12813 @item -mmultiply-enabled
12814 @opindex multiply-enabled
12815 Enable multiply instructions.
12816
12817 @item -msign-extend-enabled
12818 @opindex msign-extend-enabled
12819 Enable sign extend instructions.
12820
12821 @item -muser-enabled
12822 @opindex muser-enabled
12823 Enable user-defined instructions.
12824
12825 @end table
12826
12827 @node M32C Options
12828 @subsection M32C Options
12829 @cindex M32C options
12830
12831 @table @gcctabopt
12832 @item -mcpu=@var{name}
12833 @opindex mcpu=
12834 Select the CPU for which code is generated.  @var{name} may be one of
12835 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
12836 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
12837 the M32C/80 series.
12838
12839 @item -msim
12840 @opindex msim
12841 Specifies that the program will be run on the simulator.  This causes
12842 an alternate runtime library to be linked in which supports, for
12843 example, file I/O@.  You must not use this option when generating
12844 programs that will run on real hardware; you must provide your own
12845 runtime library for whatever I/O functions are needed.
12846
12847 @item -memregs=@var{number}
12848 @opindex memregs=
12849 Specifies the number of memory-based pseudo-registers GCC will use
12850 during code generation.  These pseudo-registers will be used like real
12851 registers, so there is a tradeoff between GCC's ability to fit the
12852 code into available registers, and the performance penalty of using
12853 memory instead of registers.  Note that all modules in a program must
12854 be compiled with the same value for this option.  Because of that, you
12855 must not use this option with the default runtime libraries gcc
12856 builds.
12857
12858 @end table
12859
12860 @node M32R/D Options
12861 @subsection M32R/D Options
12862 @cindex M32R/D options
12863
12864 These @option{-m} options are defined for Renesas M32R/D architectures:
12865
12866 @table @gcctabopt
12867 @item -m32r2
12868 @opindex m32r2
12869 Generate code for the M32R/2@.
12870
12871 @item -m32rx
12872 @opindex m32rx
12873 Generate code for the M32R/X@.
12874
12875 @item -m32r
12876 @opindex m32r
12877 Generate code for the M32R@.  This is the default.
12878
12879 @item -mmodel=small
12880 @opindex mmodel=small
12881 Assume all objects live in the lower 16MB of memory (so that their addresses
12882 can be loaded with the @code{ld24} instruction), and assume all subroutines
12883 are reachable with the @code{bl} instruction.
12884 This is the default.
12885
12886 The addressability of a particular object can be set with the
12887 @code{model} attribute.
12888
12889 @item -mmodel=medium
12890 @opindex mmodel=medium
12891 Assume objects may be anywhere in the 32-bit address space (the compiler
12892 will generate @code{seth/add3} instructions to load their addresses), and
12893 assume all subroutines are reachable with the @code{bl} instruction.
12894
12895 @item -mmodel=large
12896 @opindex mmodel=large
12897 Assume objects may be anywhere in the 32-bit address space (the compiler
12898 will generate @code{seth/add3} instructions to load their addresses), and
12899 assume subroutines may not be reachable with the @code{bl} instruction
12900 (the compiler will generate the much slower @code{seth/add3/jl}
12901 instruction sequence).
12902
12903 @item -msdata=none
12904 @opindex msdata=none
12905 Disable use of the small data area.  Variables will be put into
12906 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
12907 @code{section} attribute has been specified).
12908 This is the default.
12909
12910 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
12911 Objects may be explicitly put in the small data area with the
12912 @code{section} attribute using one of these sections.
12913
12914 @item -msdata=sdata
12915 @opindex msdata=sdata
12916 Put small global and static data in the small data area, but do not
12917 generate special code to reference them.
12918
12919 @item -msdata=use
12920 @opindex msdata=use
12921 Put small global and static data in the small data area, and generate
12922 special instructions to reference them.
12923
12924 @item -G @var{num}
12925 @opindex G
12926 @cindex smaller data references
12927 Put global and static objects less than or equal to @var{num} bytes
12928 into the small data or bss sections instead of the normal data or bss
12929 sections.  The default value of @var{num} is 8.
12930 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
12931 for this option to have any effect.
12932
12933 All modules should be compiled with the same @option{-G @var{num}} value.
12934 Compiling with different values of @var{num} may or may not work; if it
12935 doesn't the linker will give an error message---incorrect code will not be
12936 generated.
12937
12938 @item -mdebug
12939 @opindex mdebug
12940 Makes the M32R specific code in the compiler display some statistics
12941 that might help in debugging programs.
12942
12943 @item -malign-loops
12944 @opindex malign-loops
12945 Align all loops to a 32-byte boundary.
12946
12947 @item -mno-align-loops
12948 @opindex mno-align-loops
12949 Do not enforce a 32-byte alignment for loops.  This is the default.
12950
12951 @item -missue-rate=@var{number}
12952 @opindex missue-rate=@var{number}
12953 Issue @var{number} instructions per cycle.  @var{number} can only be 1
12954 or 2.
12955
12956 @item -mbranch-cost=@var{number}
12957 @opindex mbranch-cost=@var{number}
12958 @var{number} can only be 1 or 2.  If it is 1 then branches will be
12959 preferred over conditional code, if it is 2, then the opposite will
12960 apply.
12961
12962 @item -mflush-trap=@var{number}
12963 @opindex mflush-trap=@var{number}
12964 Specifies the trap number to use to flush the cache.  The default is
12965 12.  Valid numbers are between 0 and 15 inclusive.
12966
12967 @item -mno-flush-trap
12968 @opindex mno-flush-trap
12969 Specifies that the cache cannot be flushed by using a trap.
12970
12971 @item -mflush-func=@var{name}
12972 @opindex mflush-func=@var{name}
12973 Specifies the name of the operating system function to call to flush
12974 the cache.  The default is @emph{_flush_cache}, but a function call
12975 will only be used if a trap is not available.
12976
12977 @item -mno-flush-func
12978 @opindex mno-flush-func
12979 Indicates that there is no OS function for flushing the cache.
12980
12981 @end table
12982
12983 @node M680x0 Options
12984 @subsection M680x0 Options
12985 @cindex M680x0 options
12986
12987 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
12988 The default settings depend on which architecture was selected when
12989 the compiler was configured; the defaults for the most common choices
12990 are given below.
12991
12992 @table @gcctabopt
12993 @item -march=@var{arch}
12994 @opindex march
12995 Generate code for a specific M680x0 or ColdFire instruction set
12996 architecture.  Permissible values of @var{arch} for M680x0
12997 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
12998 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
12999 architectures are selected according to Freescale's ISA classification
13000 and the permissible values are: @samp{isaa}, @samp{isaaplus},
13001 @samp{isab} and @samp{isac}.
13002
13003 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
13004 code for a ColdFire target.  The @var{arch} in this macro is one of the
13005 @option{-march} arguments given above.
13006
13007 When used together, @option{-march} and @option{-mtune} select code
13008 that runs on a family of similar processors but that is optimized
13009 for a particular microarchitecture.
13010
13011 @item -mcpu=@var{cpu}
13012 @opindex mcpu
13013 Generate code for a specific M680x0 or ColdFire processor.
13014 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
13015 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
13016 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
13017 below, which also classifies the CPUs into families:
13018
13019 @multitable @columnfractions 0.20 0.80
13020 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
13021 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
13022 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
13023 @item @samp{5206e} @tab @samp{5206e}
13024 @item @samp{5208} @tab @samp{5207} @samp{5208}
13025 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
13026 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
13027 @item @samp{5216} @tab @samp{5214} @samp{5216}
13028 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
13029 @item @samp{5225} @tab @samp{5224} @samp{5225}
13030 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
13031 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
13032 @item @samp{5249} @tab @samp{5249}
13033 @item @samp{5250} @tab @samp{5250}
13034 @item @samp{5271} @tab @samp{5270} @samp{5271}
13035 @item @samp{5272} @tab @samp{5272}
13036 @item @samp{5275} @tab @samp{5274} @samp{5275}
13037 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
13038 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
13039 @item @samp{5307} @tab @samp{5307}
13040 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
13041 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
13042 @item @samp{5407} @tab @samp{5407}
13043 @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}
13044 @end multitable
13045
13046 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
13047 @var{arch} is compatible with @var{cpu}.  Other combinations of
13048 @option{-mcpu} and @option{-march} are rejected.
13049
13050 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
13051 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
13052 where the value of @var{family} is given by the table above.
13053
13054 @item -mtune=@var{tune}
13055 @opindex mtune
13056 Tune the code for a particular microarchitecture, within the
13057 constraints set by @option{-march} and @option{-mcpu}.
13058 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
13059 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
13060 and @samp{cpu32}.  The ColdFire microarchitectures
13061 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
13062
13063 You can also use @option{-mtune=68020-40} for code that needs
13064 to run relatively well on 68020, 68030 and 68040 targets.
13065 @option{-mtune=68020-60} is similar but includes 68060 targets
13066 as well.  These two options select the same tuning decisions as
13067 @option{-m68020-40} and @option{-m68020-60} respectively.
13068
13069 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
13070 when tuning for 680x0 architecture @var{arch}.  It also defines
13071 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
13072 option is used.  If gcc is tuning for a range of architectures,
13073 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
13074 it defines the macros for every architecture in the range.
13075
13076 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
13077 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
13078 of the arguments given above.
13079
13080 @item -m68000
13081 @itemx -mc68000
13082 @opindex m68000
13083 @opindex mc68000
13084 Generate output for a 68000.  This is the default
13085 when the compiler is configured for 68000-based systems.
13086 It is equivalent to @option{-march=68000}.
13087
13088 Use this option for microcontrollers with a 68000 or EC000 core,
13089 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
13090
13091 @item -m68010
13092 @opindex m68010
13093 Generate output for a 68010.  This is the default
13094 when the compiler is configured for 68010-based systems.
13095 It is equivalent to @option{-march=68010}.
13096
13097 @item -m68020
13098 @itemx -mc68020
13099 @opindex m68020
13100 @opindex mc68020
13101 Generate output for a 68020.  This is the default
13102 when the compiler is configured for 68020-based systems.
13103 It is equivalent to @option{-march=68020}.
13104
13105 @item -m68030
13106 @opindex m68030
13107 Generate output for a 68030.  This is the default when the compiler is
13108 configured for 68030-based systems.  It is equivalent to
13109 @option{-march=68030}.
13110
13111 @item -m68040
13112 @opindex m68040
13113 Generate output for a 68040.  This is the default when the compiler is
13114 configured for 68040-based systems.  It is equivalent to
13115 @option{-march=68040}.
13116
13117 This option inhibits the use of 68881/68882 instructions that have to be
13118 emulated by software on the 68040.  Use this option if your 68040 does not
13119 have code to emulate those instructions.
13120
13121 @item -m68060
13122 @opindex m68060
13123 Generate output for a 68060.  This is the default when the compiler is
13124 configured for 68060-based systems.  It is equivalent to
13125 @option{-march=68060}.
13126
13127 This option inhibits the use of 68020 and 68881/68882 instructions that
13128 have to be emulated by software on the 68060.  Use this option if your 68060
13129 does not have code to emulate those instructions.
13130
13131 @item -mcpu32
13132 @opindex mcpu32
13133 Generate output for a CPU32.  This is the default
13134 when the compiler is configured for CPU32-based systems.
13135 It is equivalent to @option{-march=cpu32}.
13136
13137 Use this option for microcontrollers with a
13138 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
13139 68336, 68340, 68341, 68349 and 68360.
13140
13141 @item -m5200
13142 @opindex m5200
13143 Generate output for a 520X ColdFire CPU@.  This is the default
13144 when the compiler is configured for 520X-based systems.
13145 It is equivalent to @option{-mcpu=5206}, and is now deprecated
13146 in favor of that option.
13147
13148 Use this option for microcontroller with a 5200 core, including
13149 the MCF5202, MCF5203, MCF5204 and MCF5206.
13150
13151 @item -m5206e
13152 @opindex m5206e
13153 Generate output for a 5206e ColdFire CPU@.  The option is now
13154 deprecated in favor of the equivalent @option{-mcpu=5206e}.
13155
13156 @item -m528x
13157 @opindex m528x
13158 Generate output for a member of the ColdFire 528X family.
13159 The option is now deprecated in favor of the equivalent
13160 @option{-mcpu=528x}.
13161
13162 @item -m5307
13163 @opindex m5307
13164 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
13165 in favor of the equivalent @option{-mcpu=5307}.
13166
13167 @item -m5407
13168 @opindex m5407
13169 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
13170 in favor of the equivalent @option{-mcpu=5407}.
13171
13172 @item -mcfv4e
13173 @opindex mcfv4e
13174 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
13175 This includes use of hardware floating point instructions.
13176 The option is equivalent to @option{-mcpu=547x}, and is now
13177 deprecated in favor of that option.
13178
13179 @item -m68020-40
13180 @opindex m68020-40
13181 Generate output for a 68040, without using any of the new instructions.
13182 This results in code which can run relatively efficiently on either a
13183 68020/68881 or a 68030 or a 68040.  The generated code does use the
13184 68881 instructions that are emulated on the 68040.
13185
13186 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
13187
13188 @item -m68020-60
13189 @opindex m68020-60
13190 Generate output for a 68060, without using any of the new instructions.
13191 This results in code which can run relatively efficiently on either a
13192 68020/68881 or a 68030 or a 68040.  The generated code does use the
13193 68881 instructions that are emulated on the 68060.
13194
13195 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
13196
13197 @item -mhard-float
13198 @itemx -m68881
13199 @opindex mhard-float
13200 @opindex m68881
13201 Generate floating-point instructions.  This is the default for 68020
13202 and above, and for ColdFire devices that have an FPU@.  It defines the
13203 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
13204 on ColdFire targets.
13205
13206 @item -msoft-float
13207 @opindex msoft-float
13208 Do not generate floating-point instructions; use library calls instead.
13209 This is the default for 68000, 68010, and 68832 targets.  It is also
13210 the default for ColdFire devices that have no FPU.
13211
13212 @item -mdiv
13213 @itemx -mno-div
13214 @opindex mdiv
13215 @opindex mno-div
13216 Generate (do not generate) ColdFire hardware divide and remainder
13217 instructions.  If @option{-march} is used without @option{-mcpu},
13218 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
13219 architectures.  Otherwise, the default is taken from the target CPU
13220 (either the default CPU, or the one specified by @option{-mcpu}).  For
13221 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
13222 @option{-mcpu=5206e}.
13223
13224 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
13225
13226 @item -mshort
13227 @opindex mshort
13228 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13229 Additionally, parameters passed on the stack are also aligned to a
13230 16-bit boundary even on targets whose API mandates promotion to 32-bit.
13231
13232 @item -mno-short
13233 @opindex mno-short
13234 Do not consider type @code{int} to be 16 bits wide.  This is the default.
13235
13236 @item -mnobitfield
13237 @itemx -mno-bitfield
13238 @opindex mnobitfield
13239 @opindex mno-bitfield
13240 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
13241 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
13242
13243 @item -mbitfield
13244 @opindex mbitfield
13245 Do use the bit-field instructions.  The @option{-m68020} option implies
13246 @option{-mbitfield}.  This is the default if you use a configuration
13247 designed for a 68020.
13248
13249 @item -mrtd
13250 @opindex mrtd
13251 Use a different function-calling convention, in which functions
13252 that take a fixed number of arguments return with the @code{rtd}
13253 instruction, which pops their arguments while returning.  This
13254 saves one instruction in the caller since there is no need to pop
13255 the arguments there.
13256
13257 This calling convention is incompatible with the one normally
13258 used on Unix, so you cannot use it if you need to call libraries
13259 compiled with the Unix compiler.
13260
13261 Also, you must provide function prototypes for all functions that
13262 take variable numbers of arguments (including @code{printf});
13263 otherwise incorrect code will be generated for calls to those
13264 functions.
13265
13266 In addition, seriously incorrect code will result if you call a
13267 function with too many arguments.  (Normally, extra arguments are
13268 harmlessly ignored.)
13269
13270 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
13271 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
13272
13273 @item -mno-rtd
13274 @opindex mno-rtd
13275 Do not use the calling conventions selected by @option{-mrtd}.
13276 This is the default.
13277
13278 @item -malign-int
13279 @itemx -mno-align-int
13280 @opindex malign-int
13281 @opindex mno-align-int
13282 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
13283 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
13284 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
13285 Aligning variables on 32-bit boundaries produces code that runs somewhat
13286 faster on processors with 32-bit busses at the expense of more memory.
13287
13288 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
13289 align structures containing the above types  differently than
13290 most published application binary interface specifications for the m68k.
13291
13292 @item -mpcrel
13293 @opindex mpcrel
13294 Use the pc-relative addressing mode of the 68000 directly, instead of
13295 using a global offset table.  At present, this option implies @option{-fpic},
13296 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
13297 not presently supported with @option{-mpcrel}, though this could be supported for
13298 68020 and higher processors.
13299
13300 @item -mno-strict-align
13301 @itemx -mstrict-align
13302 @opindex mno-strict-align
13303 @opindex mstrict-align
13304 Do not (do) assume that unaligned memory references will be handled by
13305 the system.
13306
13307 @item -msep-data
13308 Generate code that allows the data segment to be located in a different
13309 area of memory from the text segment.  This allows for execute in place in
13310 an environment without virtual memory management.  This option implies
13311 @option{-fPIC}.
13312
13313 @item -mno-sep-data
13314 Generate code that assumes that the data segment follows the text segment.
13315 This is the default.
13316
13317 @item -mid-shared-library
13318 Generate code that supports shared libraries via the library ID method.
13319 This allows for execute in place and shared libraries in an environment
13320 without virtual memory management.  This option implies @option{-fPIC}.
13321
13322 @item -mno-id-shared-library
13323 Generate code that doesn't assume ID based shared libraries are being used.
13324 This is the default.
13325
13326 @item -mshared-library-id=n
13327 Specified the identification number of the ID based shared library being
13328 compiled.  Specifying a value of 0 will generate more compact code, specifying
13329 other values will force the allocation of that number to the current
13330 library but is no more space or time efficient than omitting this option.
13331
13332 @item -mxgot
13333 @itemx -mno-xgot
13334 @opindex mxgot
13335 @opindex mno-xgot
13336 When generating position-independent code for ColdFire, generate code
13337 that works if the GOT has more than 8192 entries.  This code is
13338 larger and slower than code generated without this option.  On M680x0
13339 processors, this option is not needed; @option{-fPIC} suffices.
13340
13341 GCC normally uses a single instruction to load values from the GOT@.
13342 While this is relatively efficient, it only works if the GOT
13343 is smaller than about 64k.  Anything larger causes the linker
13344 to report an error such as:
13345
13346 @cindex relocation truncated to fit (ColdFire)
13347 @smallexample
13348 relocation truncated to fit: R_68K_GOT16O foobar
13349 @end smallexample
13350
13351 If this happens, you should recompile your code with @option{-mxgot}.
13352 It should then work with very large GOTs.  However, code generated with
13353 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
13354 the value of a global symbol.
13355
13356 Note that some linkers, including newer versions of the GNU linker,
13357 can create multiple GOTs and sort GOT entries.  If you have such a linker,
13358 you should only need to use @option{-mxgot} when compiling a single
13359 object file that accesses more than 8192 GOT entries.  Very few do.
13360
13361 These options have no effect unless GCC is generating
13362 position-independent code.
13363
13364 @end table
13365
13366 @node M68hc1x Options
13367 @subsection M68hc1x Options
13368 @cindex M68hc1x options
13369
13370 These are the @samp{-m} options defined for the 68hc11 and 68hc12
13371 microcontrollers.  The default values for these options depends on
13372 which style of microcontroller was selected when the compiler was configured;
13373 the defaults for the most common choices are given below.
13374
13375 @table @gcctabopt
13376 @item -m6811
13377 @itemx -m68hc11
13378 @opindex m6811
13379 @opindex m68hc11
13380 Generate output for a 68HC11.  This is the default
13381 when the compiler is configured for 68HC11-based systems.
13382
13383 @item -m6812
13384 @itemx -m68hc12
13385 @opindex m6812
13386 @opindex m68hc12
13387 Generate output for a 68HC12.  This is the default
13388 when the compiler is configured for 68HC12-based systems.
13389
13390 @item -m68S12
13391 @itemx -m68hcs12
13392 @opindex m68S12
13393 @opindex m68hcs12
13394 Generate output for a 68HCS12.
13395
13396 @item -mauto-incdec
13397 @opindex mauto-incdec
13398 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
13399 addressing modes.
13400
13401 @item -minmax
13402 @itemx -mnominmax
13403 @opindex minmax
13404 @opindex mnominmax
13405 Enable the use of 68HC12 min and max instructions.
13406
13407 @item -mlong-calls
13408 @itemx -mno-long-calls
13409 @opindex mlong-calls
13410 @opindex mno-long-calls
13411 Treat all calls as being far away (near).  If calls are assumed to be
13412 far away, the compiler will use the @code{call} instruction to
13413 call a function and the @code{rtc} instruction for returning.
13414
13415 @item -mshort
13416 @opindex mshort
13417 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13418
13419 @item -msoft-reg-count=@var{count}
13420 @opindex msoft-reg-count
13421 Specify the number of pseudo-soft registers which are used for the
13422 code generation.  The maximum number is 32.  Using more pseudo-soft
13423 register may or may not result in better code depending on the program.
13424 The default is 4 for 68HC11 and 2 for 68HC12.
13425
13426 @end table
13427
13428 @node MCore Options
13429 @subsection MCore Options
13430 @cindex MCore options
13431
13432 These are the @samp{-m} options defined for the Motorola M*Core
13433 processors.
13434
13435 @table @gcctabopt
13436
13437 @item -mhardlit
13438 @itemx -mno-hardlit
13439 @opindex mhardlit
13440 @opindex mno-hardlit
13441 Inline constants into the code stream if it can be done in two
13442 instructions or less.
13443
13444 @item -mdiv
13445 @itemx -mno-div
13446 @opindex mdiv
13447 @opindex mno-div
13448 Use the divide instruction.  (Enabled by default).
13449
13450 @item -mrelax-immediate
13451 @itemx -mno-relax-immediate
13452 @opindex mrelax-immediate
13453 @opindex mno-relax-immediate
13454 Allow arbitrary sized immediates in bit operations.
13455
13456 @item -mwide-bitfields
13457 @itemx -mno-wide-bitfields
13458 @opindex mwide-bitfields
13459 @opindex mno-wide-bitfields
13460 Always treat bit-fields as int-sized.
13461
13462 @item -m4byte-functions
13463 @itemx -mno-4byte-functions
13464 @opindex m4byte-functions
13465 @opindex mno-4byte-functions
13466 Force all functions to be aligned to a four byte boundary.
13467
13468 @item -mcallgraph-data
13469 @itemx -mno-callgraph-data
13470 @opindex mcallgraph-data
13471 @opindex mno-callgraph-data
13472 Emit callgraph information.
13473
13474 @item -mslow-bytes
13475 @itemx -mno-slow-bytes
13476 @opindex mslow-bytes
13477 @opindex mno-slow-bytes
13478 Prefer word access when reading byte quantities.
13479
13480 @item -mlittle-endian
13481 @itemx -mbig-endian
13482 @opindex mlittle-endian
13483 @opindex mbig-endian
13484 Generate code for a little endian target.
13485
13486 @item -m210
13487 @itemx -m340
13488 @opindex m210
13489 @opindex m340
13490 Generate code for the 210 processor.
13491
13492 @item -mno-lsim
13493 @opindex mno-lsim
13494 Assume that run-time support has been provided and so omit the
13495 simulator library (@file{libsim.a)} from the linker command line.
13496
13497 @item -mstack-increment=@var{size}
13498 @opindex mstack-increment
13499 Set the maximum amount for a single stack increment operation.  Large
13500 values can increase the speed of programs which contain functions
13501 that need a large amount of stack space, but they can also trigger a
13502 segmentation fault if the stack is extended too much.  The default
13503 value is 0x1000.
13504
13505 @end table
13506
13507 @node MeP Options
13508 @subsection MeP Options
13509 @cindex MeP options
13510
13511 @table @gcctabopt
13512
13513 @item -mabsdiff
13514 @opindex mabsdiff
13515 Enables the @code{abs} instruction, which is the absolute difference
13516 between two registers.
13517
13518 @item -mall-opts
13519 @opindex mall-opts
13520 Enables all the optional instructions - average, multiply, divide, bit
13521 operations, leading zero, absolute difference, min/max, clip, and
13522 saturation.
13523
13524
13525 @item -maverage
13526 @opindex maverage
13527 Enables the @code{ave} instruction, which computes the average of two
13528 registers.
13529
13530 @item -mbased=@var{n}
13531 @opindex mbased=
13532 Variables of size @var{n} bytes or smaller will be placed in the
13533 @code{.based} section by default.  Based variables use the @code{$tp}
13534 register as a base register, and there is a 128 byte limit to the
13535 @code{.based} section.
13536
13537 @item -mbitops
13538 @opindex mbitops
13539 Enables the bit operation instructions - bit test (@code{btstm}), set
13540 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
13541 test-and-set (@code{tas}).
13542
13543 @item -mc=@var{name}
13544 @opindex mc=
13545 Selects which section constant data will be placed in.  @var{name} may
13546 be @code{tiny}, @code{near}, or @code{far}.
13547
13548 @item -mclip
13549 @opindex mclip
13550 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
13551 useful unless you also provide @code{-mminmax}.
13552
13553 @item -mconfig=@var{name}
13554 @opindex mconfig=
13555 Selects one of the build-in core configurations.  Each MeP chip has
13556 one or more modules in it; each module has a core CPU and a variety of
13557 coprocessors, optional instructions, and peripherals.  The
13558 @code{MeP-Integrator} tool, not part of GCC, provides these
13559 configurations through this option; using this option is the same as
13560 using all the corresponding command line options.  The default
13561 configuration is @code{default}.
13562
13563 @item -mcop
13564 @opindex mcop
13565 Enables the coprocessor instructions.  By default, this is a 32-bit
13566 coprocessor.  Note that the coprocessor is normally enabled via the
13567 @code{-mconfig=} option.
13568
13569 @item -mcop32
13570 @opindex mcop32
13571 Enables the 32-bit coprocessor's instructions.
13572
13573 @item -mcop64
13574 @opindex mcop64
13575 Enables the 64-bit coprocessor's instructions.
13576
13577 @item -mivc2
13578 @opindex mivc2
13579 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
13580
13581 @item -mdc
13582 @opindex mdc
13583 Causes constant variables to be placed in the @code{.near} section.
13584
13585 @item -mdiv
13586 @opindex mdiv
13587 Enables the @code{div} and @code{divu} instructions.
13588
13589 @item -meb
13590 @opindex meb
13591 Generate big-endian code.
13592
13593 @item -mel
13594 @opindex mel
13595 Generate little-endian code.
13596
13597 @item -mio-volatile
13598 @opindex mio-volatile
13599 Tells the compiler that any variable marked with the @code{io}
13600 attribute is to be considered volatile.
13601
13602 @item -ml
13603 @opindex ml
13604 Causes variables to be assigned to the @code{.far} section by default.
13605
13606 @item -mleadz
13607 @opindex mleadz
13608 Enables the @code{leadz} (leading zero) instruction.
13609
13610 @item -mm
13611 @opindex mm
13612 Causes variables to be assigned to the @code{.near} section by default.
13613
13614 @item -mminmax
13615 @opindex mminmax
13616 Enables the @code{min} and @code{max} instructions.
13617
13618 @item -mmult
13619 @opindex mmult
13620 Enables the multiplication and multiply-accumulate instructions.
13621
13622 @item -mno-opts
13623 @opindex mno-opts
13624 Disables all the optional instructions enabled by @code{-mall-opts}.
13625
13626 @item -mrepeat
13627 @opindex mrepeat
13628 Enables the @code{repeat} and @code{erepeat} instructions, used for
13629 low-overhead looping.
13630
13631 @item -ms
13632 @opindex ms
13633 Causes all variables to default to the @code{.tiny} section.  Note
13634 that there is a 65536 byte limit to this section.  Accesses to these
13635 variables use the @code{%gp} base register.
13636
13637 @item -msatur
13638 @opindex msatur
13639 Enables the saturation instructions.  Note that the compiler does not
13640 currently generate these itself, but this option is included for
13641 compatibility with other tools, like @code{as}.
13642
13643 @item -msdram
13644 @opindex msdram
13645 Link the SDRAM-based runtime instead of the default ROM-based runtime.
13646
13647 @item -msim
13648 @opindex msim
13649 Link the simulator runtime libraries.
13650
13651 @item -msimnovec
13652 @opindex msimnovec
13653 Link the simulator runtime libraries, excluding built-in support
13654 for reset and exception vectors and tables.
13655
13656 @item -mtf
13657 @opindex mtf
13658 Causes all functions to default to the @code{.far} section.  Without
13659 this option, functions default to the @code{.near} section.
13660
13661 @item -mtiny=@var{n}
13662 @opindex mtiny=
13663 Variables that are @var{n} bytes or smaller will be allocated to the
13664 @code{.tiny} section.  These variables use the @code{$gp} base
13665 register.  The default for this option is 4, but note that there's a
13666 65536 byte limit to the @code{.tiny} section.
13667
13668 @end table
13669
13670 @node MIPS Options
13671 @subsection MIPS Options
13672 @cindex MIPS options
13673
13674 @table @gcctabopt
13675
13676 @item -EB
13677 @opindex EB
13678 Generate big-endian code.
13679
13680 @item -EL
13681 @opindex EL
13682 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
13683 configurations.
13684
13685 @item -march=@var{arch}
13686 @opindex march
13687 Generate code that will run on @var{arch}, which can be the name of a
13688 generic MIPS ISA, or the name of a particular processor.
13689 The ISA names are:
13690 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
13691 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
13692 The processor names are:
13693 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
13694 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
13695 @samp{5kc}, @samp{5kf},
13696 @samp{20kc},
13697 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
13698 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
13699 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
13700 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
13701 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
13702 @samp{loongson2e}, @samp{loongson2f},
13703 @samp{m4k},
13704 @samp{octeon},
13705 @samp{orion},
13706 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
13707 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
13708 @samp{rm7000}, @samp{rm9000},
13709 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
13710 @samp{sb1},
13711 @samp{sr71000},
13712 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
13713 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
13714 and @samp{xlr}.
13715 The special value @samp{from-abi} selects the
13716 most compatible architecture for the selected ABI (that is,
13717 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
13718
13719 Native Linux/GNU toolchains also support the value @samp{native},
13720 which selects the best architecture option for the host processor.
13721 @option{-march=native} has no effect if GCC does not recognize
13722 the processor.
13723
13724 In processor names, a final @samp{000} can be abbreviated as @samp{k}
13725 (for example, @samp{-march=r2k}).  Prefixes are optional, and
13726 @samp{vr} may be written @samp{r}.
13727
13728 Names of the form @samp{@var{n}f2_1} refer to processors with
13729 FPUs clocked at half the rate of the core, names of the form
13730 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
13731 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
13732 processors with FPUs clocked a ratio of 3:2 with respect to the core.
13733 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
13734 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
13735 accepted as synonyms for @samp{@var{n}f1_1}.
13736
13737 GCC defines two macros based on the value of this option.  The first
13738 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
13739 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
13740 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
13741 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
13742 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
13743
13744 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
13745 above.  In other words, it will have the full prefix and will not
13746 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
13747 the macro names the resolved architecture (either @samp{"mips1"} or
13748 @samp{"mips3"}).  It names the default architecture when no
13749 @option{-march} option is given.
13750
13751 @item -mtune=@var{arch}
13752 @opindex mtune
13753 Optimize for @var{arch}.  Among other things, this option controls
13754 the way instructions are scheduled, and the perceived cost of arithmetic
13755 operations.  The list of @var{arch} values is the same as for
13756 @option{-march}.
13757
13758 When this option is not used, GCC will optimize for the processor
13759 specified by @option{-march}.  By using @option{-march} and
13760 @option{-mtune} together, it is possible to generate code that will
13761 run on a family of processors, but optimize the code for one
13762 particular member of that family.
13763
13764 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
13765 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
13766 @samp{-march} ones described above.
13767
13768 @item -mips1
13769 @opindex mips1
13770 Equivalent to @samp{-march=mips1}.
13771
13772 @item -mips2
13773 @opindex mips2
13774 Equivalent to @samp{-march=mips2}.
13775
13776 @item -mips3
13777 @opindex mips3
13778 Equivalent to @samp{-march=mips3}.
13779
13780 @item -mips4
13781 @opindex mips4
13782 Equivalent to @samp{-march=mips4}.
13783
13784 @item -mips32
13785 @opindex mips32
13786 Equivalent to @samp{-march=mips32}.
13787
13788 @item -mips32r2
13789 @opindex mips32r2
13790 Equivalent to @samp{-march=mips32r2}.
13791
13792 @item -mips64
13793 @opindex mips64
13794 Equivalent to @samp{-march=mips64}.
13795
13796 @item -mips64r2
13797 @opindex mips64r2
13798 Equivalent to @samp{-march=mips64r2}.
13799
13800 @item -mips16
13801 @itemx -mno-mips16
13802 @opindex mips16
13803 @opindex mno-mips16
13804 Generate (do not generate) MIPS16 code.  If GCC is targetting a
13805 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
13806
13807 MIPS16 code generation can also be controlled on a per-function basis
13808 by means of @code{mips16} and @code{nomips16} attributes.
13809 @xref{Function Attributes}, for more information.
13810
13811 @item -mflip-mips16
13812 @opindex mflip-mips16
13813 Generate MIPS16 code on alternating functions.  This option is provided
13814 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
13815 not intended for ordinary use in compiling user code.
13816
13817 @item -minterlink-mips16
13818 @itemx -mno-interlink-mips16
13819 @opindex minterlink-mips16
13820 @opindex mno-interlink-mips16
13821 Require (do not require) that non-MIPS16 code be link-compatible with
13822 MIPS16 code.
13823
13824 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
13825 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
13826 therefore disables direct jumps unless GCC knows that the target of the
13827 jump is not MIPS16.
13828
13829 @item -mabi=32
13830 @itemx -mabi=o64
13831 @itemx -mabi=n32
13832 @itemx -mabi=64
13833 @itemx -mabi=eabi
13834 @opindex mabi=32
13835 @opindex mabi=o64
13836 @opindex mabi=n32
13837 @opindex mabi=64
13838 @opindex mabi=eabi
13839 Generate code for the given ABI@.
13840
13841 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
13842 generates 64-bit code when you select a 64-bit architecture, but you
13843 can use @option{-mgp32} to get 32-bit code instead.
13844
13845 For information about the O64 ABI, see
13846 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
13847
13848 GCC supports a variant of the o32 ABI in which floating-point registers
13849 are 64 rather than 32 bits wide.  You can select this combination with
13850 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
13851 and @samp{mfhc1} instructions and is therefore only supported for
13852 MIPS32R2 processors.
13853
13854 The register assignments for arguments and return values remain the
13855 same, but each scalar value is passed in a single 64-bit register
13856 rather than a pair of 32-bit registers.  For example, scalar
13857 floating-point values are returned in @samp{$f0} only, not a
13858 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
13859 remains the same, but all 64 bits are saved.
13860
13861 @item -mabicalls
13862 @itemx -mno-abicalls
13863 @opindex mabicalls
13864 @opindex mno-abicalls
13865 Generate (do not generate) code that is suitable for SVR4-style
13866 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
13867 systems.
13868
13869 @item -mshared
13870 @itemx -mno-shared
13871 Generate (do not generate) code that is fully position-independent,
13872 and that can therefore be linked into shared libraries.  This option
13873 only affects @option{-mabicalls}.
13874
13875 All @option{-mabicalls} code has traditionally been position-independent,
13876 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
13877 as an extension, the GNU toolchain allows executables to use absolute
13878 accesses for locally-binding symbols.  It can also use shorter GP
13879 initialization sequences and generate direct calls to locally-defined
13880 functions.  This mode is selected by @option{-mno-shared}.
13881
13882 @option{-mno-shared} depends on binutils 2.16 or higher and generates
13883 objects that can only be linked by the GNU linker.  However, the option
13884 does not affect the ABI of the final executable; it only affects the ABI
13885 of relocatable objects.  Using @option{-mno-shared} will generally make
13886 executables both smaller and quicker.
13887
13888 @option{-mshared} is the default.
13889
13890 @item -mplt
13891 @itemx -mno-plt
13892 @opindex mplt
13893 @opindex mno-plt
13894 Assume (do not assume) that the static and dynamic linkers
13895 support PLTs and copy relocations.  This option only affects
13896 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
13897 has no effect without @samp{-msym32}.
13898
13899 You can make @option{-mplt} the default by configuring
13900 GCC with @option{--with-mips-plt}.  The default is
13901 @option{-mno-plt} otherwise.
13902
13903 @item -mxgot
13904 @itemx -mno-xgot
13905 @opindex mxgot
13906 @opindex mno-xgot
13907 Lift (do not lift) the usual restrictions on the size of the global
13908 offset table.
13909
13910 GCC normally uses a single instruction to load values from the GOT@.
13911 While this is relatively efficient, it will only work if the GOT
13912 is smaller than about 64k.  Anything larger will cause the linker
13913 to report an error such as:
13914
13915 @cindex relocation truncated to fit (MIPS)
13916 @smallexample
13917 relocation truncated to fit: R_MIPS_GOT16 foobar
13918 @end smallexample
13919
13920 If this happens, you should recompile your code with @option{-mxgot}.
13921 It should then work with very large GOTs, although it will also be
13922 less efficient, since it will take three instructions to fetch the
13923 value of a global symbol.
13924
13925 Note that some linkers can create multiple GOTs.  If you have such a
13926 linker, you should only need to use @option{-mxgot} when a single object
13927 file accesses more than 64k's worth of GOT entries.  Very few do.
13928
13929 These options have no effect unless GCC is generating position
13930 independent code.
13931
13932 @item -mgp32
13933 @opindex mgp32
13934 Assume that general-purpose registers are 32 bits wide.
13935
13936 @item -mgp64
13937 @opindex mgp64
13938 Assume that general-purpose registers are 64 bits wide.
13939
13940 @item -mfp32
13941 @opindex mfp32
13942 Assume that floating-point registers are 32 bits wide.
13943
13944 @item -mfp64
13945 @opindex mfp64
13946 Assume that floating-point registers are 64 bits wide.
13947
13948 @item -mhard-float
13949 @opindex mhard-float
13950 Use floating-point coprocessor instructions.
13951
13952 @item -msoft-float
13953 @opindex msoft-float
13954 Do not use floating-point coprocessor instructions.  Implement
13955 floating-point calculations using library calls instead.
13956
13957 @item -msingle-float
13958 @opindex msingle-float
13959 Assume that the floating-point coprocessor only supports single-precision
13960 operations.
13961
13962 @item -mdouble-float
13963 @opindex mdouble-float
13964 Assume that the floating-point coprocessor supports double-precision
13965 operations.  This is the default.
13966
13967 @item -mllsc
13968 @itemx -mno-llsc
13969 @opindex mllsc
13970 @opindex mno-llsc
13971 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
13972 implement atomic memory built-in functions.  When neither option is
13973 specified, GCC will use the instructions if the target architecture
13974 supports them.
13975
13976 @option{-mllsc} is useful if the runtime environment can emulate the
13977 instructions and @option{-mno-llsc} can be useful when compiling for
13978 nonstandard ISAs.  You can make either option the default by
13979 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
13980 respectively.  @option{--with-llsc} is the default for some
13981 configurations; see the installation documentation for details.
13982
13983 @item -mdsp
13984 @itemx -mno-dsp
13985 @opindex mdsp
13986 @opindex mno-dsp
13987 Use (do not use) revision 1 of the MIPS DSP ASE@.
13988 @xref{MIPS DSP Built-in Functions}.  This option defines the
13989 preprocessor macro @samp{__mips_dsp}.  It also defines
13990 @samp{__mips_dsp_rev} to 1.
13991
13992 @item -mdspr2
13993 @itemx -mno-dspr2
13994 @opindex mdspr2
13995 @opindex mno-dspr2
13996 Use (do not use) revision 2 of the MIPS DSP ASE@.
13997 @xref{MIPS DSP Built-in Functions}.  This option defines the
13998 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
13999 It also defines @samp{__mips_dsp_rev} to 2.
14000
14001 @item -msmartmips
14002 @itemx -mno-smartmips
14003 @opindex msmartmips
14004 @opindex mno-smartmips
14005 Use (do not use) the MIPS SmartMIPS ASE.
14006
14007 @item -mpaired-single
14008 @itemx -mno-paired-single
14009 @opindex mpaired-single
14010 @opindex mno-paired-single
14011 Use (do not use) paired-single floating-point instructions.
14012 @xref{MIPS Paired-Single Support}.  This option requires
14013 hardware floating-point support to be enabled.
14014
14015 @item -mdmx
14016 @itemx -mno-mdmx
14017 @opindex mdmx
14018 @opindex mno-mdmx
14019 Use (do not use) MIPS Digital Media Extension instructions.
14020 This option can only be used when generating 64-bit code and requires
14021 hardware floating-point support to be enabled.
14022
14023 @item -mips3d
14024 @itemx -mno-mips3d
14025 @opindex mips3d
14026 @opindex mno-mips3d
14027 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
14028 The option @option{-mips3d} implies @option{-mpaired-single}.
14029
14030 @item -mmt
14031 @itemx -mno-mt
14032 @opindex mmt
14033 @opindex mno-mt
14034 Use (do not use) MT Multithreading instructions.
14035
14036 @item -mlong64
14037 @opindex mlong64
14038 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
14039 an explanation of the default and the way that the pointer size is
14040 determined.
14041
14042 @item -mlong32
14043 @opindex mlong32
14044 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
14045
14046 The default size of @code{int}s, @code{long}s and pointers depends on
14047 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
14048 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
14049 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
14050 or the same size as integer registers, whichever is smaller.
14051
14052 @item -msym32
14053 @itemx -mno-sym32
14054 @opindex msym32
14055 @opindex mno-sym32
14056 Assume (do not assume) that all symbols have 32-bit values, regardless
14057 of the selected ABI@.  This option is useful in combination with
14058 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
14059 to generate shorter and faster references to symbolic addresses.
14060
14061 @item -G @var{num}
14062 @opindex G
14063 Put definitions of externally-visible data in a small data section
14064 if that data is no bigger than @var{num} bytes.  GCC can then access
14065 the data more efficiently; see @option{-mgpopt} for details.
14066
14067 The default @option{-G} option depends on the configuration.
14068
14069 @item -mlocal-sdata
14070 @itemx -mno-local-sdata
14071 @opindex mlocal-sdata
14072 @opindex mno-local-sdata
14073 Extend (do not extend) the @option{-G} behavior to local data too,
14074 such as to static variables in C@.  @option{-mlocal-sdata} is the
14075 default for all configurations.
14076
14077 If the linker complains that an application is using too much small data,
14078 you might want to try rebuilding the less performance-critical parts with
14079 @option{-mno-local-sdata}.  You might also want to build large
14080 libraries with @option{-mno-local-sdata}, so that the libraries leave
14081 more room for the main program.
14082
14083 @item -mextern-sdata
14084 @itemx -mno-extern-sdata
14085 @opindex mextern-sdata
14086 @opindex mno-extern-sdata
14087 Assume (do not assume) that externally-defined data will be in
14088 a small data section if that data is within the @option{-G} limit.
14089 @option{-mextern-sdata} is the default for all configurations.
14090
14091 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
14092 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
14093 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
14094 is placed in a small data section.  If @var{Var} is defined by another
14095 module, you must either compile that module with a high-enough
14096 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
14097 definition.  If @var{Var} is common, you must link the application
14098 with a high-enough @option{-G} setting.
14099
14100 The easiest way of satisfying these restrictions is to compile
14101 and link every module with the same @option{-G} option.  However,
14102 you may wish to build a library that supports several different
14103 small data limits.  You can do this by compiling the library with
14104 the highest supported @option{-G} setting and additionally using
14105 @option{-mno-extern-sdata} to stop the library from making assumptions
14106 about externally-defined data.
14107
14108 @item -mgpopt
14109 @itemx -mno-gpopt
14110 @opindex mgpopt
14111 @opindex mno-gpopt
14112 Use (do not use) GP-relative accesses for symbols that are known to be
14113 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
14114 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
14115 configurations.
14116
14117 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
14118 might not hold the value of @code{_gp}.  For example, if the code is
14119 part of a library that might be used in a boot monitor, programs that
14120 call boot monitor routines will pass an unknown value in @code{$gp}.
14121 (In such situations, the boot monitor itself would usually be compiled
14122 with @option{-G0}.)
14123
14124 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
14125 @option{-mno-extern-sdata}.
14126
14127 @item -membedded-data
14128 @itemx -mno-embedded-data
14129 @opindex membedded-data
14130 @opindex mno-embedded-data
14131 Allocate variables to the read-only data section first if possible, then
14132 next in the small data section if possible, otherwise in data.  This gives
14133 slightly slower code than the default, but reduces the amount of RAM required
14134 when executing, and thus may be preferred for some embedded systems.
14135
14136 @item -muninit-const-in-rodata
14137 @itemx -mno-uninit-const-in-rodata
14138 @opindex muninit-const-in-rodata
14139 @opindex mno-uninit-const-in-rodata
14140 Put uninitialized @code{const} variables in the read-only data section.
14141 This option is only meaningful in conjunction with @option{-membedded-data}.
14142
14143 @item -mcode-readable=@var{setting}
14144 @opindex mcode-readable
14145 Specify whether GCC may generate code that reads from executable sections.
14146 There are three possible settings:
14147
14148 @table @gcctabopt
14149 @item -mcode-readable=yes
14150 Instructions may freely access executable sections.  This is the
14151 default setting.
14152
14153 @item -mcode-readable=pcrel
14154 MIPS16 PC-relative load instructions can access executable sections,
14155 but other instructions must not do so.  This option is useful on 4KSc
14156 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
14157 It is also useful on processors that can be configured to have a dual
14158 instruction/data SRAM interface and that, like the M4K, automatically
14159 redirect PC-relative loads to the instruction RAM.
14160
14161 @item -mcode-readable=no
14162 Instructions must not access executable sections.  This option can be
14163 useful on targets that are configured to have a dual instruction/data
14164 SRAM interface but that (unlike the M4K) do not automatically redirect
14165 PC-relative loads to the instruction RAM.
14166 @end table
14167
14168 @item -msplit-addresses
14169 @itemx -mno-split-addresses
14170 @opindex msplit-addresses
14171 @opindex mno-split-addresses
14172 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
14173 relocation operators.  This option has been superseded by
14174 @option{-mexplicit-relocs} but is retained for backwards compatibility.
14175
14176 @item -mexplicit-relocs
14177 @itemx -mno-explicit-relocs
14178 @opindex mexplicit-relocs
14179 @opindex mno-explicit-relocs
14180 Use (do not use) assembler relocation operators when dealing with symbolic
14181 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
14182 is to use assembler macros instead.
14183
14184 @option{-mexplicit-relocs} is the default if GCC was configured
14185 to use an assembler that supports relocation operators.
14186
14187 @item -mcheck-zero-division
14188 @itemx -mno-check-zero-division
14189 @opindex mcheck-zero-division
14190 @opindex mno-check-zero-division
14191 Trap (do not trap) on integer division by zero.
14192
14193 The default is @option{-mcheck-zero-division}.
14194
14195 @item -mdivide-traps
14196 @itemx -mdivide-breaks
14197 @opindex mdivide-traps
14198 @opindex mdivide-breaks
14199 MIPS systems check for division by zero by generating either a
14200 conditional trap or a break instruction.  Using traps results in
14201 smaller code, but is only supported on MIPS II and later.  Also, some
14202 versions of the Linux kernel have a bug that prevents trap from
14203 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
14204 allow conditional traps on architectures that support them and
14205 @option{-mdivide-breaks} to force the use of breaks.
14206
14207 The default is usually @option{-mdivide-traps}, but this can be
14208 overridden at configure time using @option{--with-divide=breaks}.
14209 Divide-by-zero checks can be completely disabled using
14210 @option{-mno-check-zero-division}.
14211
14212 @item -mmemcpy
14213 @itemx -mno-memcpy
14214 @opindex mmemcpy
14215 @opindex mno-memcpy
14216 Force (do not force) the use of @code{memcpy()} for non-trivial block
14217 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
14218 most constant-sized copies.
14219
14220 @item -mlong-calls
14221 @itemx -mno-long-calls
14222 @opindex mlong-calls
14223 @opindex mno-long-calls
14224 Disable (do not disable) use of the @code{jal} instruction.  Calling
14225 functions using @code{jal} is more efficient but requires the caller
14226 and callee to be in the same 256 megabyte segment.
14227
14228 This option has no effect on abicalls code.  The default is
14229 @option{-mno-long-calls}.
14230
14231 @item -mmad
14232 @itemx -mno-mad
14233 @opindex mmad
14234 @opindex mno-mad
14235 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
14236 instructions, as provided by the R4650 ISA@.
14237
14238 @item -mfused-madd
14239 @itemx -mno-fused-madd
14240 @opindex mfused-madd
14241 @opindex mno-fused-madd
14242 Enable (disable) use of the floating point multiply-accumulate
14243 instructions, when they are available.  The default is
14244 @option{-mfused-madd}.
14245
14246 When multiply-accumulate instructions are used, the intermediate
14247 product is calculated to infinite precision and is not subject to
14248 the FCSR Flush to Zero bit.  This may be undesirable in some
14249 circumstances.
14250
14251 @item -nocpp
14252 @opindex nocpp
14253 Tell the MIPS assembler to not run its preprocessor over user
14254 assembler files (with a @samp{.s} suffix) when assembling them.
14255
14256 @item -mfix-r4000
14257 @itemx -mno-fix-r4000
14258 @opindex mfix-r4000
14259 @opindex mno-fix-r4000
14260 Work around certain R4000 CPU errata:
14261 @itemize @minus
14262 @item
14263 A double-word or a variable shift may give an incorrect result if executed
14264 immediately after starting an integer division.
14265 @item
14266 A double-word or a variable shift may give an incorrect result if executed
14267 while an integer multiplication is in progress.
14268 @item
14269 An integer division may give an incorrect result if started in a delay slot
14270 of a taken branch or a jump.
14271 @end itemize
14272
14273 @item -mfix-r4400
14274 @itemx -mno-fix-r4400
14275 @opindex mfix-r4400
14276 @opindex mno-fix-r4400
14277 Work around certain R4400 CPU errata:
14278 @itemize @minus
14279 @item
14280 A double-word or a variable shift may give an incorrect result if executed
14281 immediately after starting an integer division.
14282 @end itemize
14283
14284 @item -mfix-r10000
14285 @itemx -mno-fix-r10000
14286 @opindex mfix-r10000
14287 @opindex mno-fix-r10000
14288 Work around certain R10000 errata:
14289 @itemize @minus
14290 @item
14291 @code{ll}/@code{sc} sequences may not behave atomically on revisions
14292 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
14293 @end itemize
14294
14295 This option can only be used if the target architecture supports
14296 branch-likely instructions.  @option{-mfix-r10000} is the default when
14297 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
14298 otherwise.
14299
14300 @item -mfix-vr4120
14301 @itemx -mno-fix-vr4120
14302 @opindex mfix-vr4120
14303 Work around certain VR4120 errata:
14304 @itemize @minus
14305 @item
14306 @code{dmultu} does not always produce the correct result.
14307 @item
14308 @code{div} and @code{ddiv} do not always produce the correct result if one
14309 of the operands is negative.
14310 @end itemize
14311 The workarounds for the division errata rely on special functions in
14312 @file{libgcc.a}.  At present, these functions are only provided by
14313 the @code{mips64vr*-elf} configurations.
14314
14315 Other VR4120 errata require a nop to be inserted between certain pairs of
14316 instructions.  These errata are handled by the assembler, not by GCC itself.
14317
14318 @item -mfix-vr4130
14319 @opindex mfix-vr4130
14320 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
14321 workarounds are implemented by the assembler rather than by GCC,
14322 although GCC will avoid using @code{mflo} and @code{mfhi} if the
14323 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
14324 instructions are available instead.
14325
14326 @item -mfix-sb1
14327 @itemx -mno-fix-sb1
14328 @opindex mfix-sb1
14329 Work around certain SB-1 CPU core errata.
14330 (This flag currently works around the SB-1 revision 2
14331 ``F1'' and ``F2'' floating point errata.)
14332
14333 @item -mr10k-cache-barrier=@var{setting}
14334 @opindex mr10k-cache-barrier
14335 Specify whether GCC should insert cache barriers to avoid the
14336 side-effects of speculation on R10K processors.
14337
14338 In common with many processors, the R10K tries to predict the outcome
14339 of a conditional branch and speculatively executes instructions from
14340 the ``taken'' branch.  It later aborts these instructions if the
14341 predicted outcome was wrong.  However, on the R10K, even aborted
14342 instructions can have side effects.
14343
14344 This problem only affects kernel stores and, depending on the system,
14345 kernel loads.  As an example, a speculatively-executed store may load
14346 the target memory into cache and mark the cache line as dirty, even if
14347 the store itself is later aborted.  If a DMA operation writes to the
14348 same area of memory before the ``dirty'' line is flushed, the cached
14349 data will overwrite the DMA-ed data.  See the R10K processor manual
14350 for a full description, including other potential problems.
14351
14352 One workaround is to insert cache barrier instructions before every memory
14353 access that might be speculatively executed and that might have side
14354 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
14355 controls GCC's implementation of this workaround.  It assumes that
14356 aborted accesses to any byte in the following regions will not have
14357 side effects:
14358
14359 @enumerate
14360 @item
14361 the memory occupied by the current function's stack frame;
14362
14363 @item
14364 the memory occupied by an incoming stack argument;
14365
14366 @item
14367 the memory occupied by an object with a link-time-constant address.
14368 @end enumerate
14369
14370 It is the kernel's responsibility to ensure that speculative
14371 accesses to these regions are indeed safe.
14372
14373 If the input program contains a function declaration such as:
14374
14375 @smallexample
14376 void foo (void);
14377 @end smallexample
14378
14379 then the implementation of @code{foo} must allow @code{j foo} and
14380 @code{jal foo} to be executed speculatively.  GCC honors this
14381 restriction for functions it compiles itself.  It expects non-GCC
14382 functions (such as hand-written assembly code) to do the same.
14383
14384 The option has three forms:
14385
14386 @table @gcctabopt
14387 @item -mr10k-cache-barrier=load-store
14388 Insert a cache barrier before a load or store that might be
14389 speculatively executed and that might have side effects even
14390 if aborted.
14391
14392 @item -mr10k-cache-barrier=store
14393 Insert a cache barrier before a store that might be speculatively
14394 executed and that might have side effects even if aborted.
14395
14396 @item -mr10k-cache-barrier=none
14397 Disable the insertion of cache barriers.  This is the default setting.
14398 @end table
14399
14400 @item -mflush-func=@var{func}
14401 @itemx -mno-flush-func
14402 @opindex mflush-func
14403 Specifies the function to call to flush the I and D caches, or to not
14404 call any such function.  If called, the function must take the same
14405 arguments as the common @code{_flush_func()}, that is, the address of the
14406 memory range for which the cache is being flushed, the size of the
14407 memory range, and the number 3 (to flush both caches).  The default
14408 depends on the target GCC was configured for, but commonly is either
14409 @samp{_flush_func} or @samp{__cpu_flush}.
14410
14411 @item mbranch-cost=@var{num}
14412 @opindex mbranch-cost
14413 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14414 This cost is only a heuristic and is not guaranteed to produce
14415 consistent results across releases.  A zero cost redundantly selects
14416 the default, which is based on the @option{-mtune} setting.
14417
14418 @item -mbranch-likely
14419 @itemx -mno-branch-likely
14420 @opindex mbranch-likely
14421 @opindex mno-branch-likely
14422 Enable or disable use of Branch Likely instructions, regardless of the
14423 default for the selected architecture.  By default, Branch Likely
14424 instructions may be generated if they are supported by the selected
14425 architecture.  An exception is for the MIPS32 and MIPS64 architectures
14426 and processors which implement those architectures; for those, Branch
14427 Likely instructions will not be generated by default because the MIPS32
14428 and MIPS64 architectures specifically deprecate their use.
14429
14430 @item -mfp-exceptions
14431 @itemx -mno-fp-exceptions
14432 @opindex mfp-exceptions
14433 Specifies whether FP exceptions are enabled.  This affects how we schedule
14434 FP instructions for some processors.  The default is that FP exceptions are
14435 enabled.
14436
14437 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
14438 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
14439 FP pipe.
14440
14441 @item -mvr4130-align
14442 @itemx -mno-vr4130-align
14443 @opindex mvr4130-align
14444 The VR4130 pipeline is two-way superscalar, but can only issue two
14445 instructions together if the first one is 8-byte aligned.  When this
14446 option is enabled, GCC will align pairs of instructions that it
14447 thinks should execute in parallel.
14448
14449 This option only has an effect when optimizing for the VR4130.
14450 It normally makes code faster, but at the expense of making it bigger.
14451 It is enabled by default at optimization level @option{-O3}.
14452
14453 @item -msynci
14454 @itemx -mno-synci
14455 @opindex msynci
14456 Enable (disable) generation of @code{synci} instructions on
14457 architectures that support it.  The @code{synci} instructions (if
14458 enabled) will be generated when @code{__builtin___clear_cache()} is
14459 compiled.
14460
14461 This option defaults to @code{-mno-synci}, but the default can be
14462 overridden by configuring with @code{--with-synci}.
14463
14464 When compiling code for single processor systems, it is generally safe
14465 to use @code{synci}.  However, on many multi-core (SMP) systems, it
14466 will not invalidate the instruction caches on all cores and may lead
14467 to undefined behavior.
14468
14469 @item -mrelax-pic-calls
14470 @itemx -mno-relax-pic-calls
14471 @opindex mrelax-pic-calls
14472 Try to turn PIC calls that are normally dispatched via register
14473 @code{$25} into direct calls.  This is only possible if the linker can
14474 resolve the destination at link-time and if the destination is within
14475 range for a direct call.
14476
14477 @option{-mrelax-pic-calls} is the default if GCC was configured to use
14478 an assembler and a linker that supports the @code{.reloc} assembly
14479 directive and @code{-mexplicit-relocs} is in effect.  With
14480 @code{-mno-explicit-relocs}, this optimization can be performed by the
14481 assembler and the linker alone without help from the compiler.
14482
14483 @item -mmcount-ra-address
14484 @itemx -mno-mcount-ra-address
14485 @opindex mmcount-ra-address
14486 @opindex mno-mcount-ra-address
14487 Emit (do not emit) code that allows @code{_mcount} to modify the
14488 calling function's return address.  When enabled, this option extends
14489 the usual @code{_mcount} interface with a new @var{ra-address}
14490 parameter, which has type @code{intptr_t *} and is passed in register
14491 @code{$12}.  @code{_mcount} can then modify the return address by
14492 doing both of the following:
14493 @itemize
14494 @item
14495 Returning the new address in register @code{$31}.
14496 @item
14497 Storing the new address in @code{*@var{ra-address}},
14498 if @var{ra-address} is nonnull.
14499 @end itemize
14500
14501 The default is @option{-mno-mcount-ra-address}.
14502
14503 @end table
14504
14505 @node MMIX Options
14506 @subsection MMIX Options
14507 @cindex MMIX Options
14508
14509 These options are defined for the MMIX:
14510
14511 @table @gcctabopt
14512 @item -mlibfuncs
14513 @itemx -mno-libfuncs
14514 @opindex mlibfuncs
14515 @opindex mno-libfuncs
14516 Specify that intrinsic library functions are being compiled, passing all
14517 values in registers, no matter the size.
14518
14519 @item -mepsilon
14520 @itemx -mno-epsilon
14521 @opindex mepsilon
14522 @opindex mno-epsilon
14523 Generate floating-point comparison instructions that compare with respect
14524 to the @code{rE} epsilon register.
14525
14526 @item -mabi=mmixware
14527 @itemx -mabi=gnu
14528 @opindex mabi=mmixware
14529 @opindex mabi=gnu
14530 Generate code that passes function parameters and return values that (in
14531 the called function) are seen as registers @code{$0} and up, as opposed to
14532 the GNU ABI which uses global registers @code{$231} and up.
14533
14534 @item -mzero-extend
14535 @itemx -mno-zero-extend
14536 @opindex mzero-extend
14537 @opindex mno-zero-extend
14538 When reading data from memory in sizes shorter than 64 bits, use (do not
14539 use) zero-extending load instructions by default, rather than
14540 sign-extending ones.
14541
14542 @item -mknuthdiv
14543 @itemx -mno-knuthdiv
14544 @opindex mknuthdiv
14545 @opindex mno-knuthdiv
14546 Make the result of a division yielding a remainder have the same sign as
14547 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
14548 remainder follows the sign of the dividend.  Both methods are
14549 arithmetically valid, the latter being almost exclusively used.
14550
14551 @item -mtoplevel-symbols
14552 @itemx -mno-toplevel-symbols
14553 @opindex mtoplevel-symbols
14554 @opindex mno-toplevel-symbols
14555 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
14556 code can be used with the @code{PREFIX} assembly directive.
14557
14558 @item -melf
14559 @opindex melf
14560 Generate an executable in the ELF format, rather than the default
14561 @samp{mmo} format used by the @command{mmix} simulator.
14562
14563 @item -mbranch-predict
14564 @itemx -mno-branch-predict
14565 @opindex mbranch-predict
14566 @opindex mno-branch-predict
14567 Use (do not use) the probable-branch instructions, when static branch
14568 prediction indicates a probable branch.
14569
14570 @item -mbase-addresses
14571 @itemx -mno-base-addresses
14572 @opindex mbase-addresses
14573 @opindex mno-base-addresses
14574 Generate (do not generate) code that uses @emph{base addresses}.  Using a
14575 base address automatically generates a request (handled by the assembler
14576 and the linker) for a constant to be set up in a global register.  The
14577 register is used for one or more base address requests within the range 0
14578 to 255 from the value held in the register.  The generally leads to short
14579 and fast code, but the number of different data items that can be
14580 addressed is limited.  This means that a program that uses lots of static
14581 data may require @option{-mno-base-addresses}.
14582
14583 @item -msingle-exit
14584 @itemx -mno-single-exit
14585 @opindex msingle-exit
14586 @opindex mno-single-exit
14587 Force (do not force) generated code to have a single exit point in each
14588 function.
14589 @end table
14590
14591 @node MN10300 Options
14592 @subsection MN10300 Options
14593 @cindex MN10300 options
14594
14595 These @option{-m} options are defined for Matsushita MN10300 architectures:
14596
14597 @table @gcctabopt
14598 @item -mmult-bug
14599 @opindex mmult-bug
14600 Generate code to avoid bugs in the multiply instructions for the MN10300
14601 processors.  This is the default.
14602
14603 @item -mno-mult-bug
14604 @opindex mno-mult-bug
14605 Do not generate code to avoid bugs in the multiply instructions for the
14606 MN10300 processors.
14607
14608 @item -mam33
14609 @opindex mam33
14610 Generate code which uses features specific to the AM33 processor.
14611
14612 @item -mno-am33
14613 @opindex mno-am33
14614 Do not generate code which uses features specific to the AM33 processor.  This
14615 is the default.
14616
14617 @item -mreturn-pointer-on-d0
14618 @opindex mreturn-pointer-on-d0
14619 When generating a function which returns a pointer, return the pointer
14620 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
14621 only in a0, and attempts to call such functions without a prototype
14622 would result in errors.  Note that this option is on by default; use
14623 @option{-mno-return-pointer-on-d0} to disable it.
14624
14625 @item -mno-crt0
14626 @opindex mno-crt0
14627 Do not link in the C run-time initialization object file.
14628
14629 @item -mrelax
14630 @opindex mrelax
14631 Indicate to the linker that it should perform a relaxation optimization pass
14632 to shorten branches, calls and absolute memory addresses.  This option only
14633 has an effect when used on the command line for the final link step.
14634
14635 This option makes symbolic debugging impossible.
14636 @end table
14637
14638 @node PDP-11 Options
14639 @subsection PDP-11 Options
14640 @cindex PDP-11 Options
14641
14642 These options are defined for the PDP-11:
14643
14644 @table @gcctabopt
14645 @item -mfpu
14646 @opindex mfpu
14647 Use hardware FPP floating point.  This is the default.  (FIS floating
14648 point on the PDP-11/40 is not supported.)
14649
14650 @item -msoft-float
14651 @opindex msoft-float
14652 Do not use hardware floating point.
14653
14654 @item -mac0
14655 @opindex mac0
14656 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
14657
14658 @item -mno-ac0
14659 @opindex mno-ac0
14660 Return floating-point results in memory.  This is the default.
14661
14662 @item -m40
14663 @opindex m40
14664 Generate code for a PDP-11/40.
14665
14666 @item -m45
14667 @opindex m45
14668 Generate code for a PDP-11/45.  This is the default.
14669
14670 @item -m10
14671 @opindex m10
14672 Generate code for a PDP-11/10.
14673
14674 @item -mbcopy-builtin
14675 @opindex mbcopy-builtin
14676 Use inline @code{movmemhi} patterns for copying memory.  This is the
14677 default.
14678
14679 @item -mbcopy
14680 @opindex mbcopy
14681 Do not use inline @code{movmemhi} patterns for copying memory.
14682
14683 @item -mint16
14684 @itemx -mno-int32
14685 @opindex mint16
14686 @opindex mno-int32
14687 Use 16-bit @code{int}.  This is the default.
14688
14689 @item -mint32
14690 @itemx -mno-int16
14691 @opindex mint32
14692 @opindex mno-int16
14693 Use 32-bit @code{int}.
14694
14695 @item -mfloat64
14696 @itemx -mno-float32
14697 @opindex mfloat64
14698 @opindex mno-float32
14699 Use 64-bit @code{float}.  This is the default.
14700
14701 @item -mfloat32
14702 @itemx -mno-float64
14703 @opindex mfloat32
14704 @opindex mno-float64
14705 Use 32-bit @code{float}.
14706
14707 @item -mabshi
14708 @opindex mabshi
14709 Use @code{abshi2} pattern.  This is the default.
14710
14711 @item -mno-abshi
14712 @opindex mno-abshi
14713 Do not use @code{abshi2} pattern.
14714
14715 @item -mbranch-expensive
14716 @opindex mbranch-expensive
14717 Pretend that branches are expensive.  This is for experimenting with
14718 code generation only.
14719
14720 @item -mbranch-cheap
14721 @opindex mbranch-cheap
14722 Do not pretend that branches are expensive.  This is the default.
14723
14724 @item -msplit
14725 @opindex msplit
14726 Generate code for a system with split I&D@.
14727
14728 @item -mno-split
14729 @opindex mno-split
14730 Generate code for a system without split I&D@.  This is the default.
14731
14732 @item -munix-asm
14733 @opindex munix-asm
14734 Use Unix assembler syntax.  This is the default when configured for
14735 @samp{pdp11-*-bsd}.
14736
14737 @item -mdec-asm
14738 @opindex mdec-asm
14739 Use DEC assembler syntax.  This is the default when configured for any
14740 PDP-11 target other than @samp{pdp11-*-bsd}.
14741 @end table
14742
14743 @node picoChip Options
14744 @subsection picoChip Options
14745 @cindex picoChip options
14746
14747 These @samp{-m} options are defined for picoChip implementations:
14748
14749 @table @gcctabopt
14750
14751 @item -mae=@var{ae_type}
14752 @opindex mcpu
14753 Set the instruction set, register set, and instruction scheduling
14754 parameters for array element type @var{ae_type}.  Supported values
14755 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
14756
14757 @option{-mae=ANY} selects a completely generic AE type.  Code
14758 generated with this option will run on any of the other AE types.  The
14759 code will not be as efficient as it would be if compiled for a specific
14760 AE type, and some types of operation (e.g., multiplication) will not
14761 work properly on all types of AE.
14762
14763 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
14764 for compiled code, and is the default.
14765
14766 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
14767 option may suffer from poor performance of byte (char) manipulation,
14768 since the DSP AE does not provide hardware support for byte load/stores.
14769
14770 @item -msymbol-as-address
14771 Enable the compiler to directly use a symbol name as an address in a
14772 load/store instruction, without first loading it into a
14773 register.  Typically, the use of this option will generate larger
14774 programs, which run faster than when the option isn't used.  However, the
14775 results vary from program to program, so it is left as a user option,
14776 rather than being permanently enabled.
14777
14778 @item -mno-inefficient-warnings
14779 Disables warnings about the generation of inefficient code.  These
14780 warnings can be generated, for example, when compiling code which
14781 performs byte-level memory operations on the MAC AE type.  The MAC AE has
14782 no hardware support for byte-level memory operations, so all byte
14783 load/stores must be synthesized from word load/store operations.  This is
14784 inefficient and a warning will be generated indicating to the programmer
14785 that they should rewrite the code to avoid byte operations, or to target
14786 an AE type which has the necessary hardware support.  This option enables
14787 the warning to be turned off.
14788
14789 @end table
14790
14791 @node PowerPC Options
14792 @subsection PowerPC Options
14793 @cindex PowerPC options
14794
14795 These are listed under @xref{RS/6000 and PowerPC Options}.
14796
14797 @node RS/6000 and PowerPC Options
14798 @subsection IBM RS/6000 and PowerPC Options
14799 @cindex RS/6000 and PowerPC Options
14800 @cindex IBM RS/6000 and PowerPC Options
14801
14802 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
14803 @table @gcctabopt
14804 @item -mpower
14805 @itemx -mno-power
14806 @itemx -mpower2
14807 @itemx -mno-power2
14808 @itemx -mpowerpc
14809 @itemx -mno-powerpc
14810 @itemx -mpowerpc-gpopt
14811 @itemx -mno-powerpc-gpopt
14812 @itemx -mpowerpc-gfxopt
14813 @itemx -mno-powerpc-gfxopt
14814 @itemx -mpowerpc64
14815 @itemx -mno-powerpc64
14816 @itemx -mmfcrf
14817 @itemx -mno-mfcrf
14818 @itemx -mpopcntb
14819 @itemx -mno-popcntb
14820 @itemx -mpopcntd
14821 @itemx -mno-popcntd
14822 @itemx -mfprnd
14823 @itemx -mno-fprnd
14824 @itemx -mcmpb
14825 @itemx -mno-cmpb
14826 @itemx -mmfpgpr
14827 @itemx -mno-mfpgpr
14828 @itemx -mhard-dfp
14829 @itemx -mno-hard-dfp
14830 @opindex mpower
14831 @opindex mno-power
14832 @opindex mpower2
14833 @opindex mno-power2
14834 @opindex mpowerpc
14835 @opindex mno-powerpc
14836 @opindex mpowerpc-gpopt
14837 @opindex mno-powerpc-gpopt
14838 @opindex mpowerpc-gfxopt
14839 @opindex mno-powerpc-gfxopt
14840 @opindex mpowerpc64
14841 @opindex mno-powerpc64
14842 @opindex mmfcrf
14843 @opindex mno-mfcrf
14844 @opindex mpopcntb
14845 @opindex mno-popcntb
14846 @opindex mpopcntd
14847 @opindex mno-popcntd
14848 @opindex mfprnd
14849 @opindex mno-fprnd
14850 @opindex mcmpb
14851 @opindex mno-cmpb
14852 @opindex mmfpgpr
14853 @opindex mno-mfpgpr
14854 @opindex mhard-dfp
14855 @opindex mno-hard-dfp
14856 GCC supports two related instruction set architectures for the
14857 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
14858 instructions supported by the @samp{rios} chip set used in the original
14859 RS/6000 systems and the @dfn{PowerPC} instruction set is the
14860 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
14861 the IBM 4xx, 6xx, and follow-on microprocessors.
14862
14863 Neither architecture is a subset of the other.  However there is a
14864 large common subset of instructions supported by both.  An MQ
14865 register is included in processors supporting the POWER architecture.
14866
14867 You use these options to specify which instructions are available on the
14868 processor you are using.  The default value of these options is
14869 determined when configuring GCC@.  Specifying the
14870 @option{-mcpu=@var{cpu_type}} overrides the specification of these
14871 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
14872 rather than the options listed above.
14873
14874 The @option{-mpower} option allows GCC to generate instructions that
14875 are found only in the POWER architecture and to use the MQ register.
14876 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
14877 to generate instructions that are present in the POWER2 architecture but
14878 not the original POWER architecture.
14879
14880 The @option{-mpowerpc} option allows GCC to generate instructions that
14881 are found only in the 32-bit subset of the PowerPC architecture.
14882 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
14883 GCC to use the optional PowerPC architecture instructions in the
14884 General Purpose group, including floating-point square root.  Specifying
14885 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
14886 use the optional PowerPC architecture instructions in the Graphics
14887 group, including floating-point select.
14888
14889 The @option{-mmfcrf} option allows GCC to generate the move from
14890 condition register field instruction implemented on the POWER4
14891 processor and other processors that support the PowerPC V2.01
14892 architecture.
14893 The @option{-mpopcntb} option allows GCC to generate the popcount and
14894 double precision FP reciprocal estimate instruction implemented on the
14895 POWER5 processor and other processors that support the PowerPC V2.02
14896 architecture.
14897 The @option{-mpopcntd} option allows GCC to generate the popcount
14898 instruction implemented on the POWER7 processor and other processors
14899 that support the PowerPC V2.06 architecture.
14900 The @option{-mfprnd} option allows GCC to generate the FP round to
14901 integer instructions implemented on the POWER5+ processor and other
14902 processors that support the PowerPC V2.03 architecture.
14903 The @option{-mcmpb} option allows GCC to generate the compare bytes
14904 instruction implemented on the POWER6 processor and other processors
14905 that support the PowerPC V2.05 architecture.
14906 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
14907 general purpose register instructions implemented on the POWER6X
14908 processor and other processors that support the extended PowerPC V2.05
14909 architecture.
14910 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
14911 point instructions implemented on some POWER processors.
14912
14913 The @option{-mpowerpc64} option allows GCC to generate the additional
14914 64-bit instructions that are found in the full PowerPC64 architecture
14915 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
14916 @option{-mno-powerpc64}.
14917
14918 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
14919 will use only the instructions in the common subset of both
14920 architectures plus some special AIX common-mode calls, and will not use
14921 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
14922 permits GCC to use any instruction from either architecture and to
14923 allow use of the MQ register; specify this for the Motorola MPC601.
14924
14925 @item -mnew-mnemonics
14926 @itemx -mold-mnemonics
14927 @opindex mnew-mnemonics
14928 @opindex mold-mnemonics
14929 Select which mnemonics to use in the generated assembler code.  With
14930 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
14931 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
14932 assembler mnemonics defined for the POWER architecture.  Instructions
14933 defined in only one architecture have only one mnemonic; GCC uses that
14934 mnemonic irrespective of which of these options is specified.
14935
14936 GCC defaults to the mnemonics appropriate for the architecture in
14937 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
14938 value of these option.  Unless you are building a cross-compiler, you
14939 should normally not specify either @option{-mnew-mnemonics} or
14940 @option{-mold-mnemonics}, but should instead accept the default.
14941
14942 @item -mcpu=@var{cpu_type}
14943 @opindex mcpu
14944 Set architecture type, register usage, choice of mnemonics, and
14945 instruction scheduling parameters for machine type @var{cpu_type}.
14946 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
14947 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
14948 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
14949 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
14950 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
14951 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
14952 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
14953 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
14954 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
14955 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
14956 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
14957
14958 @option{-mcpu=common} selects a completely generic processor.  Code
14959 generated under this option will run on any POWER or PowerPC processor.
14960 GCC will use only the instructions in the common subset of both
14961 architectures, and will not use the MQ register.  GCC assumes a generic
14962 processor model for scheduling purposes.
14963
14964 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
14965 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
14966 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
14967 types, with an appropriate, generic processor model assumed for
14968 scheduling purposes.
14969
14970 The other options specify a specific processor.  Code generated under
14971 those options will run best on that processor, and may not run at all on
14972 others.
14973
14974 The @option{-mcpu} options automatically enable or disable the
14975 following options:
14976
14977 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
14978 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
14979 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
14980 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
14981
14982 The particular options set for any particular CPU will vary between
14983 compiler versions, depending on what setting seems to produce optimal
14984 code for that CPU; it doesn't necessarily reflect the actual hardware's
14985 capabilities.  If you wish to set an individual option to a particular
14986 value, you may specify it after the @option{-mcpu} option, like
14987 @samp{-mcpu=970 -mno-altivec}.
14988
14989 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
14990 not enabled or disabled by the @option{-mcpu} option at present because
14991 AIX does not have full support for these options.  You may still
14992 enable or disable them individually if you're sure it'll work in your
14993 environment.
14994
14995 @item -mtune=@var{cpu_type}
14996 @opindex mtune
14997 Set the instruction scheduling parameters for machine type
14998 @var{cpu_type}, but do not set the architecture type, register usage, or
14999 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
15000 values for @var{cpu_type} are used for @option{-mtune} as for
15001 @option{-mcpu}.  If both are specified, the code generated will use the
15002 architecture, registers, and mnemonics set by @option{-mcpu}, but the
15003 scheduling parameters set by @option{-mtune}.
15004
15005 @item -mcmodel=small
15006 @opindex mcmodel=small
15007 Generate PowerPC64 code for the small model: The TOC is limited to
15008 64k.
15009
15010 @item -mcmodel=large
15011 @opindex mcmodel=large
15012 Generate PowerPC64 code for the large model: The TOC may be up to 4G
15013 in size.  Other data and code is only limited by the 64-bit address
15014 space.
15015
15016 @item -maltivec
15017 @itemx -mno-altivec
15018 @opindex maltivec
15019 @opindex mno-altivec
15020 Generate code that uses (does not use) AltiVec instructions, and also
15021 enable the use of built-in functions that allow more direct access to
15022 the AltiVec instruction set.  You may also need to set
15023 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
15024 enhancements.
15025
15026 @item -mvrsave
15027 @itemx -mno-vrsave
15028 @opindex mvrsave
15029 @opindex mno-vrsave
15030 Generate VRSAVE instructions when generating AltiVec code.
15031
15032 @item -mgen-cell-microcode
15033 @opindex mgen-cell-microcode
15034 Generate Cell microcode instructions
15035
15036 @item -mwarn-cell-microcode
15037 @opindex mwarn-cell-microcode
15038 Warning when a Cell microcode instruction is going to emitted.  An example
15039 of a Cell microcode instruction is a variable shift.
15040
15041 @item -msecure-plt
15042 @opindex msecure-plt
15043 Generate code that allows ld and ld.so to build executables and shared
15044 libraries with non-exec .plt and .got sections.  This is a PowerPC
15045 32-bit SYSV ABI option.
15046
15047 @item -mbss-plt
15048 @opindex mbss-plt
15049 Generate code that uses a BSS .plt section that ld.so fills in, and
15050 requires .plt and .got sections that are both writable and executable.
15051 This is a PowerPC 32-bit SYSV ABI option.
15052
15053 @item -misel
15054 @itemx -mno-isel
15055 @opindex misel
15056 @opindex mno-isel
15057 This switch enables or disables the generation of ISEL instructions.
15058
15059 @item -misel=@var{yes/no}
15060 This switch has been deprecated.  Use @option{-misel} and
15061 @option{-mno-isel} instead.
15062
15063 @item -mspe
15064 @itemx -mno-spe
15065 @opindex mspe
15066 @opindex mno-spe
15067 This switch enables or disables the generation of SPE simd
15068 instructions.
15069
15070 @item -mpaired
15071 @itemx -mno-paired
15072 @opindex mpaired
15073 @opindex mno-paired
15074 This switch enables or disables the generation of PAIRED simd
15075 instructions.
15076
15077 @item -mspe=@var{yes/no}
15078 This option has been deprecated.  Use @option{-mspe} and
15079 @option{-mno-spe} instead.
15080
15081 @item -mvsx
15082 @itemx -mno-vsx
15083 @opindex mvsx
15084 @opindex mno-vsx
15085 Generate code that uses (does not use) vector/scalar (VSX)
15086 instructions, and also enable the use of built-in functions that allow
15087 more direct access to the VSX instruction set.
15088
15089 @item -mfloat-gprs=@var{yes/single/double/no}
15090 @itemx -mfloat-gprs
15091 @opindex mfloat-gprs
15092 This switch enables or disables the generation of floating point
15093 operations on the general purpose registers for architectures that
15094 support it.
15095
15096 The argument @var{yes} or @var{single} enables the use of
15097 single-precision floating point operations.
15098
15099 The argument @var{double} enables the use of single and
15100 double-precision floating point operations.
15101
15102 The argument @var{no} disables floating point operations on the
15103 general purpose registers.
15104
15105 This option is currently only available on the MPC854x.
15106
15107 @item -m32
15108 @itemx -m64
15109 @opindex m32
15110 @opindex m64
15111 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
15112 targets (including GNU/Linux).  The 32-bit environment sets int, long
15113 and pointer to 32 bits and generates code that runs on any PowerPC
15114 variant.  The 64-bit environment sets int to 32 bits and long and
15115 pointer to 64 bits, and generates code for PowerPC64, as for
15116 @option{-mpowerpc64}.
15117
15118 @item -mfull-toc
15119 @itemx -mno-fp-in-toc
15120 @itemx -mno-sum-in-toc
15121 @itemx -mminimal-toc
15122 @opindex mfull-toc
15123 @opindex mno-fp-in-toc
15124 @opindex mno-sum-in-toc
15125 @opindex mminimal-toc
15126 Modify generation of the TOC (Table Of Contents), which is created for
15127 every executable file.  The @option{-mfull-toc} option is selected by
15128 default.  In that case, GCC will allocate at least one TOC entry for
15129 each unique non-automatic variable reference in your program.  GCC
15130 will also place floating-point constants in the TOC@.  However, only
15131 16,384 entries are available in the TOC@.
15132
15133 If you receive a linker error message that saying you have overflowed
15134 the available TOC space, you can reduce the amount of TOC space used
15135 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
15136 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
15137 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
15138 generate code to calculate the sum of an address and a constant at
15139 run-time instead of putting that sum into the TOC@.  You may specify one
15140 or both of these options.  Each causes GCC to produce very slightly
15141 slower and larger code at the expense of conserving TOC space.
15142
15143 If you still run out of space in the TOC even when you specify both of
15144 these options, specify @option{-mminimal-toc} instead.  This option causes
15145 GCC to make only one TOC entry for every file.  When you specify this
15146 option, GCC will produce code that is slower and larger but which
15147 uses extremely little TOC space.  You may wish to use this option
15148 only on files that contain less frequently executed code.
15149
15150 @item -maix64
15151 @itemx -maix32
15152 @opindex maix64
15153 @opindex maix32
15154 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
15155 @code{long} type, and the infrastructure needed to support them.
15156 Specifying @option{-maix64} implies @option{-mpowerpc64} and
15157 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
15158 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
15159
15160 @item -mxl-compat
15161 @itemx -mno-xl-compat
15162 @opindex mxl-compat
15163 @opindex mno-xl-compat
15164 Produce code that conforms more closely to IBM XL compiler semantics
15165 when using AIX-compatible ABI@.  Pass floating-point arguments to
15166 prototyped functions beyond the register save area (RSA) on the stack
15167 in addition to argument FPRs.  Do not assume that most significant
15168 double in 128-bit long double value is properly rounded when comparing
15169 values and converting to double.  Use XL symbol names for long double
15170 support routines.
15171
15172 The AIX calling convention was extended but not initially documented to
15173 handle an obscure K&R C case of calling a function that takes the
15174 address of its arguments with fewer arguments than declared.  IBM XL
15175 compilers access floating point arguments which do not fit in the
15176 RSA from the stack when a subroutine is compiled without
15177 optimization.  Because always storing floating-point arguments on the
15178 stack is inefficient and rarely needed, this option is not enabled by
15179 default and only is necessary when calling subroutines compiled by IBM
15180 XL compilers without optimization.
15181
15182 @item -mpe
15183 @opindex mpe
15184 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
15185 application written to use message passing with special startup code to
15186 enable the application to run.  The system must have PE installed in the
15187 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
15188 must be overridden with the @option{-specs=} option to specify the
15189 appropriate directory location.  The Parallel Environment does not
15190 support threads, so the @option{-mpe} option and the @option{-pthread}
15191 option are incompatible.
15192
15193 @item -malign-natural
15194 @itemx -malign-power
15195 @opindex malign-natural
15196 @opindex malign-power
15197 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
15198 @option{-malign-natural} overrides the ABI-defined alignment of larger
15199 types, such as floating-point doubles, on their natural size-based boundary.
15200 The option @option{-malign-power} instructs GCC to follow the ABI-specified
15201 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
15202
15203 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
15204 is not supported.
15205
15206 @item -msoft-float
15207 @itemx -mhard-float
15208 @opindex msoft-float
15209 @opindex mhard-float
15210 Generate code that does not use (uses) the floating-point register set.
15211 Software floating point emulation is provided if you use the
15212 @option{-msoft-float} option, and pass the option to GCC when linking.
15213
15214 @item -msingle-float
15215 @itemx -mdouble-float
15216 @opindex msingle-float
15217 @opindex mdouble-float
15218 Generate code for single or double-precision floating point operations.
15219 @option{-mdouble-float} implies @option{-msingle-float}.
15220
15221 @item -msimple-fpu
15222 @opindex msimple-fpu
15223 Do not generate sqrt and div instructions for hardware floating point unit.
15224
15225 @item -mfpu
15226 @opindex mfpu
15227 Specify type of floating point unit.  Valid values are @var{sp_lite}
15228 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
15229 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
15230 and @var{dp_full} (equivalent to -mdouble-float).
15231
15232 @item -mxilinx-fpu
15233 @opindex mxilinx-fpu
15234 Perform optimizations for floating point unit on Xilinx PPC 405/440.
15235
15236 @item -mmultiple
15237 @itemx -mno-multiple
15238 @opindex mmultiple
15239 @opindex mno-multiple
15240 Generate code that uses (does not use) the load multiple word
15241 instructions and the store multiple word instructions.  These
15242 instructions are generated by default on POWER systems, and not
15243 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
15244 endian PowerPC systems, since those instructions do not work when the
15245 processor is in little endian mode.  The exceptions are PPC740 and
15246 PPC750 which permit the instructions usage in little endian mode.
15247
15248 @item -mstring
15249 @itemx -mno-string
15250 @opindex mstring
15251 @opindex mno-string
15252 Generate code that uses (does not use) the load string instructions
15253 and the store string word instructions to save multiple registers and
15254 do small block moves.  These instructions are generated by default on
15255 POWER systems, and not generated on PowerPC systems.  Do not use
15256 @option{-mstring} on little endian PowerPC systems, since those
15257 instructions do not work when the processor is in little endian mode.
15258 The exceptions are PPC740 and PPC750 which permit the instructions
15259 usage in little endian mode.
15260
15261 @item -mupdate
15262 @itemx -mno-update
15263 @opindex mupdate
15264 @opindex mno-update
15265 Generate code that uses (does not use) the load or store instructions
15266 that update the base register to the address of the calculated memory
15267 location.  These instructions are generated by default.  If you use
15268 @option{-mno-update}, there is a small window between the time that the
15269 stack pointer is updated and the address of the previous frame is
15270 stored, which means code that walks the stack frame across interrupts or
15271 signals may get corrupted data.
15272
15273 @item -mavoid-indexed-addresses
15274 @itemx -mno-avoid-indexed-addresses
15275 @opindex mavoid-indexed-addresses
15276 @opindex mno-avoid-indexed-addresses
15277 Generate code that tries to avoid (not avoid) the use of indexed load
15278 or store instructions. These instructions can incur a performance
15279 penalty on Power6 processors in certain situations, such as when
15280 stepping through large arrays that cross a 16M boundary.  This option
15281 is enabled by default when targetting Power6 and disabled otherwise.
15282
15283 @item -mfused-madd
15284 @itemx -mno-fused-madd
15285 @opindex mfused-madd
15286 @opindex mno-fused-madd
15287 Generate code that uses (does not use) the floating point multiply and
15288 accumulate instructions.  These instructions are generated by default if
15289 hardware floating is used.
15290
15291 @item -mmulhw
15292 @itemx -mno-mulhw
15293 @opindex mmulhw
15294 @opindex mno-mulhw
15295 Generate code that uses (does not use) the half-word multiply and
15296 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
15297 These instructions are generated by default when targetting those
15298 processors.
15299
15300 @item -mdlmzb
15301 @itemx -mno-dlmzb
15302 @opindex mdlmzb
15303 @opindex mno-dlmzb
15304 Generate code that uses (does not use) the string-search @samp{dlmzb}
15305 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
15306 generated by default when targetting those processors.
15307
15308 @item -mno-bit-align
15309 @itemx -mbit-align
15310 @opindex mno-bit-align
15311 @opindex mbit-align
15312 On System V.4 and embedded PowerPC systems do not (do) force structures
15313 and unions that contain bit-fields to be aligned to the base type of the
15314 bit-field.
15315
15316 For example, by default a structure containing nothing but 8
15317 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
15318 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
15319 the structure would be aligned to a 1 byte boundary and be one byte in
15320 size.
15321
15322 @item -mno-strict-align
15323 @itemx -mstrict-align
15324 @opindex mno-strict-align
15325 @opindex mstrict-align
15326 On System V.4 and embedded PowerPC systems do not (do) assume that
15327 unaligned memory references will be handled by the system.
15328
15329 @item -mrelocatable
15330 @itemx -mno-relocatable
15331 @opindex mrelocatable
15332 @opindex mno-relocatable
15333 On embedded PowerPC systems generate code that allows (does not allow)
15334 the program to be relocated to a different address at runtime.  If you
15335 use @option{-mrelocatable} on any module, all objects linked together must
15336 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
15337
15338 @item -mrelocatable-lib
15339 @itemx -mno-relocatable-lib
15340 @opindex mrelocatable-lib
15341 @opindex mno-relocatable-lib
15342 On embedded PowerPC systems generate code that allows (does not allow)
15343 the program to be relocated to a different address at runtime.  Modules
15344 compiled with @option{-mrelocatable-lib} can be linked with either modules
15345 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
15346 with modules compiled with the @option{-mrelocatable} options.
15347
15348 @item -mno-toc
15349 @itemx -mtoc
15350 @opindex mno-toc
15351 @opindex mtoc
15352 On System V.4 and embedded PowerPC systems do not (do) assume that
15353 register 2 contains a pointer to a global area pointing to the addresses
15354 used in the program.
15355
15356 @item -mlittle
15357 @itemx -mlittle-endian
15358 @opindex mlittle
15359 @opindex mlittle-endian
15360 On System V.4 and embedded PowerPC systems compile code for the
15361 processor in little endian mode.  The @option{-mlittle-endian} option is
15362 the same as @option{-mlittle}.
15363
15364 @item -mbig
15365 @itemx -mbig-endian
15366 @opindex mbig
15367 @opindex mbig-endian
15368 On System V.4 and embedded PowerPC systems compile code for the
15369 processor in big endian mode.  The @option{-mbig-endian} option is
15370 the same as @option{-mbig}.
15371
15372 @item -mdynamic-no-pic
15373 @opindex mdynamic-no-pic
15374 On Darwin and Mac OS X systems, compile code so that it is not
15375 relocatable, but that its external references are relocatable.  The
15376 resulting code is suitable for applications, but not shared
15377 libraries.
15378
15379 @item -mprioritize-restricted-insns=@var{priority}
15380 @opindex mprioritize-restricted-insns
15381 This option controls the priority that is assigned to
15382 dispatch-slot restricted instructions during the second scheduling
15383 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
15384 @var{no/highest/second-highest} priority to dispatch slot restricted
15385 instructions.
15386
15387 @item -msched-costly-dep=@var{dependence_type}
15388 @opindex msched-costly-dep
15389 This option controls which dependences are considered costly
15390 by the target during instruction scheduling.  The argument
15391 @var{dependence_type} takes one of the following values:
15392 @var{no}: no dependence is costly,
15393 @var{all}: all dependences are costly,
15394 @var{true_store_to_load}: a true dependence from store to load is costly,
15395 @var{store_to_load}: any dependence from store to load is costly,
15396 @var{number}: any dependence which latency >= @var{number} is costly.
15397
15398 @item -minsert-sched-nops=@var{scheme}
15399 @opindex minsert-sched-nops
15400 This option controls which nop insertion scheme will be used during
15401 the second scheduling pass.  The argument @var{scheme} takes one of the
15402 following values:
15403 @var{no}: Don't insert nops.
15404 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
15405 according to the scheduler's grouping.
15406 @var{regroup_exact}: Insert nops to force costly dependent insns into
15407 separate groups.  Insert exactly as many nops as needed to force an insn
15408 to a new group, according to the estimated processor grouping.
15409 @var{number}: Insert nops to force costly dependent insns into
15410 separate groups.  Insert @var{number} nops to force an insn to a new group.
15411
15412 @item -mcall-sysv
15413 @opindex mcall-sysv
15414 On System V.4 and embedded PowerPC systems compile code using calling
15415 conventions that adheres to the March 1995 draft of the System V
15416 Application Binary Interface, PowerPC processor supplement.  This is the
15417 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
15418
15419 @item -mcall-sysv-eabi
15420 @itemx -mcall-eabi
15421 @opindex mcall-sysv-eabi
15422 @opindex mcall-eabi
15423 Specify both @option{-mcall-sysv} and @option{-meabi} options.
15424
15425 @item -mcall-sysv-noeabi
15426 @opindex mcall-sysv-noeabi
15427 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
15428
15429 @item -mcall-aixdesc
15430 @opindex m
15431 On System V.4 and embedded PowerPC systems compile code for the AIX
15432 operating system.
15433
15434 @item -mcall-linux
15435 @opindex mcall-linux
15436 On System V.4 and embedded PowerPC systems compile code for the
15437 Linux-based GNU system.
15438
15439 @item -mcall-gnu
15440 @opindex mcall-gnu
15441 On System V.4 and embedded PowerPC systems compile code for the
15442 Hurd-based GNU system.
15443
15444 @item -mcall-freebsd
15445 @opindex mcall-freebsd
15446 On System V.4 and embedded PowerPC systems compile code for the
15447 FreeBSD operating system.
15448
15449 @item -mcall-netbsd
15450 @opindex mcall-netbsd
15451 On System V.4 and embedded PowerPC systems compile code for the
15452 NetBSD operating system.
15453
15454 @item -mcall-openbsd
15455 @opindex mcall-netbsd
15456 On System V.4 and embedded PowerPC systems compile code for the
15457 OpenBSD operating system.
15458
15459 @item -maix-struct-return
15460 @opindex maix-struct-return
15461 Return all structures in memory (as specified by the AIX ABI)@.
15462
15463 @item -msvr4-struct-return
15464 @opindex msvr4-struct-return
15465 Return structures smaller than 8 bytes in registers (as specified by the
15466 SVR4 ABI)@.
15467
15468 @item -mabi=@var{abi-type}
15469 @opindex mabi
15470 Extend the current ABI with a particular extension, or remove such extension.
15471 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
15472 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
15473
15474 @item -mabi=spe
15475 @opindex mabi=spe
15476 Extend the current ABI with SPE ABI extensions.  This does not change
15477 the default ABI, instead it adds the SPE ABI extensions to the current
15478 ABI@.
15479
15480 @item -mabi=no-spe
15481 @opindex mabi=no-spe
15482 Disable Booke SPE ABI extensions for the current ABI@.
15483
15484 @item -mabi=ibmlongdouble
15485 @opindex mabi=ibmlongdouble
15486 Change the current ABI to use IBM extended precision long double.
15487 This is a PowerPC 32-bit SYSV ABI option.
15488
15489 @item -mabi=ieeelongdouble
15490 @opindex mabi=ieeelongdouble
15491 Change the current ABI to use IEEE extended precision long double.
15492 This is a PowerPC 32-bit Linux ABI option.
15493
15494 @item -mprototype
15495 @itemx -mno-prototype
15496 @opindex mprototype
15497 @opindex mno-prototype
15498 On System V.4 and embedded PowerPC systems assume that all calls to
15499 variable argument functions are properly prototyped.  Otherwise, the
15500 compiler must insert an instruction before every non prototyped call to
15501 set or clear bit 6 of the condition code register (@var{CR}) to
15502 indicate whether floating point values were passed in the floating point
15503 registers in case the function takes a variable arguments.  With
15504 @option{-mprototype}, only calls to prototyped variable argument functions
15505 will set or clear the bit.
15506
15507 @item -msim
15508 @opindex msim
15509 On embedded PowerPC systems, assume that the startup module is called
15510 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
15511 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
15512 configurations.
15513
15514 @item -mmvme
15515 @opindex mmvme
15516 On embedded PowerPC systems, assume that the startup module is called
15517 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
15518 @file{libc.a}.
15519
15520 @item -mads
15521 @opindex mads
15522 On embedded PowerPC systems, assume that the startup module is called
15523 @file{crt0.o} and the standard C libraries are @file{libads.a} and
15524 @file{libc.a}.
15525
15526 @item -myellowknife
15527 @opindex myellowknife
15528 On embedded PowerPC systems, assume that the startup module is called
15529 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
15530 @file{libc.a}.
15531
15532 @item -mvxworks
15533 @opindex mvxworks
15534 On System V.4 and embedded PowerPC systems, specify that you are
15535 compiling for a VxWorks system.
15536
15537 @item -memb
15538 @opindex memb
15539 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
15540 header to indicate that @samp{eabi} extended relocations are used.
15541
15542 @item -meabi
15543 @itemx -mno-eabi
15544 @opindex meabi
15545 @opindex mno-eabi
15546 On System V.4 and embedded PowerPC systems do (do not) adhere to the
15547 Embedded Applications Binary Interface (eabi) which is a set of
15548 modifications to the System V.4 specifications.  Selecting @option{-meabi}
15549 means that the stack is aligned to an 8 byte boundary, a function
15550 @code{__eabi} is called to from @code{main} to set up the eabi
15551 environment, and the @option{-msdata} option can use both @code{r2} and
15552 @code{r13} to point to two separate small data areas.  Selecting
15553 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
15554 do not call an initialization function from @code{main}, and the
15555 @option{-msdata} option will only use @code{r13} to point to a single
15556 small data area.  The @option{-meabi} option is on by default if you
15557 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
15558
15559 @item -msdata=eabi
15560 @opindex msdata=eabi
15561 On System V.4 and embedded PowerPC systems, put small initialized
15562 @code{const} global and static data in the @samp{.sdata2} section, which
15563 is pointed to by register @code{r2}.  Put small initialized
15564 non-@code{const} global and static data in the @samp{.sdata} section,
15565 which is pointed to by register @code{r13}.  Put small uninitialized
15566 global and static data in the @samp{.sbss} section, which is adjacent to
15567 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
15568 incompatible with the @option{-mrelocatable} option.  The
15569 @option{-msdata=eabi} option also sets the @option{-memb} option.
15570
15571 @item -msdata=sysv
15572 @opindex msdata=sysv
15573 On System V.4 and embedded PowerPC systems, put small global and static
15574 data in the @samp{.sdata} section, which is pointed to by register
15575 @code{r13}.  Put small uninitialized global and static data in the
15576 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
15577 The @option{-msdata=sysv} option is incompatible with the
15578 @option{-mrelocatable} option.
15579
15580 @item -msdata=default
15581 @itemx -msdata
15582 @opindex msdata=default
15583 @opindex msdata
15584 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
15585 compile code the same as @option{-msdata=eabi}, otherwise compile code the
15586 same as @option{-msdata=sysv}.
15587
15588 @item -msdata=data
15589 @opindex msdata=data
15590 On System V.4 and embedded PowerPC systems, put small global
15591 data in the @samp{.sdata} section.  Put small uninitialized global
15592 data in the @samp{.sbss} section.  Do not use register @code{r13}
15593 to address small data however.  This is the default behavior unless
15594 other @option{-msdata} options are used.
15595
15596 @item -msdata=none
15597 @itemx -mno-sdata
15598 @opindex msdata=none
15599 @opindex mno-sdata
15600 On embedded PowerPC systems, put all initialized global and static data
15601 in the @samp{.data} section, and all uninitialized data in the
15602 @samp{.bss} section.
15603
15604 @item -G @var{num}
15605 @opindex G
15606 @cindex smaller data references (PowerPC)
15607 @cindex .sdata/.sdata2 references (PowerPC)
15608 On embedded PowerPC systems, put global and static items less than or
15609 equal to @var{num} bytes into the small data or bss sections instead of
15610 the normal data or bss section.  By default, @var{num} is 8.  The
15611 @option{-G @var{num}} switch is also passed to the linker.
15612 All modules should be compiled with the same @option{-G @var{num}} value.
15613
15614 @item -mregnames
15615 @itemx -mno-regnames
15616 @opindex mregnames
15617 @opindex mno-regnames
15618 On System V.4 and embedded PowerPC systems do (do not) emit register
15619 names in the assembly language output using symbolic forms.
15620
15621 @item -mlongcall
15622 @itemx -mno-longcall
15623 @opindex mlongcall
15624 @opindex mno-longcall
15625 By default assume that all calls are far away so that a longer more
15626 expensive calling sequence is required.  This is required for calls
15627 further than 32 megabytes (33,554,432 bytes) from the current location.
15628 A short call will be generated if the compiler knows
15629 the call cannot be that far away.  This setting can be overridden by
15630 the @code{shortcall} function attribute, or by @code{#pragma
15631 longcall(0)}.
15632
15633 Some linkers are capable of detecting out-of-range calls and generating
15634 glue code on the fly.  On these systems, long calls are unnecessary and
15635 generate slower code.  As of this writing, the AIX linker can do this,
15636 as can the GNU linker for PowerPC/64.  It is planned to add this feature
15637 to the GNU linker for 32-bit PowerPC systems as well.
15638
15639 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
15640 callee, L42'', plus a ``branch island'' (glue code).  The two target
15641 addresses represent the callee and the ``branch island''.  The
15642 Darwin/PPC linker will prefer the first address and generate a ``bl
15643 callee'' if the PPC ``bl'' instruction will reach the callee directly;
15644 otherwise, the linker will generate ``bl L42'' to call the ``branch
15645 island''.  The ``branch island'' is appended to the body of the
15646 calling function; it computes the full 32-bit address of the callee
15647 and jumps to it.
15648
15649 On Mach-O (Darwin) systems, this option directs the compiler emit to
15650 the glue for every direct call, and the Darwin linker decides whether
15651 to use or discard it.
15652
15653 In the future, we may cause GCC to ignore all longcall specifications
15654 when the linker is known to generate glue.
15655
15656 @item -mtls-markers
15657 @itemx -mno-tls-markers
15658 @opindex mtls-markers
15659 @opindex mno-tls-markers
15660 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
15661 specifying the function argument.  The relocation allows ld to
15662 reliably associate function call with argument setup instructions for
15663 TLS optimization, which in turn allows gcc to better schedule the
15664 sequence.
15665
15666 @item -pthread
15667 @opindex pthread
15668 Adds support for multithreading with the @dfn{pthreads} library.
15669 This option sets flags for both the preprocessor and linker.
15670
15671 @item -mrecip
15672 @itemx -mno-recip
15673 @opindex mrecip
15674 This option will enable GCC to use the reciprocal estimate and
15675 reciprocal square root estimate instructions with additional
15676 Newton-Raphson steps to increase precision instead of doing a divide or
15677 square root and divide for floating point arguments.  You should use
15678 the @option{-ffast-math} option when using @option{-mrecip} (or at
15679 least @option{-funsafe-math-optimizations},
15680 @option{-finite-math-only}, @option{-freciprocal-math} and
15681 @option{-fno-trapping-math}).  Note that while the throughput of the
15682 sequence is generally higher than the throughput of the non-reciprocal
15683 instruction, the precision of the sequence can be decreased by up to 2
15684 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
15685 roots.
15686
15687 @item -mrecip=@var{opt}
15688 @opindex mrecip=opt
15689 This option allows to control which reciprocal estimate instructions
15690 may be used.  @var{opt} is a comma separated list of options, that may
15691 be preceeded by a @code{!} to invert the option:
15692 @code{all}: enable all estimate instructions,
15693 @code{default}: enable the default instructions, equvalent to @option{-mrecip},
15694 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
15695 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
15696 @code{divf}: enable the single precision reciprocal approximation instructions;
15697 @code{divd}: enable the double precision reciprocal approximation instructions;
15698 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
15699 @code{rsqrtf}: enable the single precision reciprocal square root approximation instructions;
15700 @code{rsqrtd}: enable the double precision reciprocal square root approximation instructions;
15701
15702 So for example, @option{-mrecip=all,!rsqrtd} would enable the
15703 all of the reciprocal estimate instructions, except for the
15704 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
15705 which handle the double precision reciprocal square root calculations.
15706
15707 @item -mrecip-precision
15708 @itemx -mno-recip-precision
15709 @opindex mrecip-precision
15710 Assume (do not assume) that the reciprocal estimate instructions
15711 provide higher precision estimates than is mandated by the powerpc
15712 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
15713 automatically selects @option{-mrecip-precision}.  The double
15714 precision square root estimate instructions are not generated by
15715 default on low precision machines, since they do not provide an
15716 estimate that converges after three steps.
15717 @end table
15718
15719 @node RX Options
15720 @subsection RX Options
15721 @cindex RX Options
15722
15723 These command line options are defined for RX targets:
15724
15725 @table @gcctabopt
15726 @item -m64bit-doubles
15727 @itemx -m32bit-doubles
15728 @opindex m64bit-doubles
15729 @opindex m32bit-doubles
15730 Make the @code{double} data type be 64-bits (@option{-m64bit-doubles})
15731 or 32-bits (@option{-m32bit-doubles}) in size.  The default is
15732 @option{-m32bit-doubles}.  @emph{Note} RX floating point hardware only
15733 works on 32-bit values, which is why the default is
15734 @option{-m32bit-doubles}.
15735
15736 @item -fpu
15737 @itemx -nofpu
15738 @opindex fpu
15739 @opindex nofpu
15740 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
15741 floating point hardware.  The default is enabled for the @var{RX600}
15742 series and disabled for the @var{RX200} series.
15743
15744 Floating point instructions will only be generated for 32-bit floating
15745 point values however, so if the @option{-m64bit-doubles} option is in
15746 use then the FPU hardware will not be used for doubles.
15747
15748 @emph{Note} If the @option{-fpu} option is enabled then
15749 @option{-funsafe-math-optimizations} is also enabled automatically.
15750 This is because the RX FPU instructions are themselves unsafe.
15751
15752 @item -mcpu=@var{name}
15753 @itemx -patch=@var{name}
15754 @opindex -mcpu
15755 @opindex -patch
15756 Selects the type of RX CPU to be targeted.  Currently three types are
15757 supported, the generic @var{RX600} and @var{RX200} series hardware and
15758 the specific @var{RX610} cpu.  The default is @var{RX600}.
15759
15760 The only difference between @var{RX600} and @var{RX610} is that the
15761 @var{RX610} does not support the @code{MVTIPL} instruction.
15762
15763 The @var{RX200} series does not have a hardware floating point unit
15764 and so @option{-nofpu} is enabled by default when this type is
15765 selected.
15766
15767 @item -mbig-endian-data
15768 @itemx -mlittle-endian-data
15769 @opindex mbig-endian-data
15770 @opindex mlittle-endian-data
15771 Store data (but not code) in the big-endian format.  The default is
15772 @option{-mlittle-endian-data}, ie to store data in the little endian
15773 format.
15774
15775 @item -msmall-data-limit=@var{N}
15776 @opindex msmall-data-limit
15777 Specifies the maximum size in bytes of global and static variables
15778 which can be placed into the small data area.  Using the small data
15779 area can lead to smaller and faster code, but the size of area is
15780 limited and it is up to the programmer to ensure that the area does
15781 not overflow.  Also when the small data area is used one of the RX's
15782 registers (@code{r13}) is reserved for use pointing to this area, so
15783 it is no longer available for use by the compiler.  This could result
15784 in slower and/or larger code if variables which once could have been
15785 held in @code{r13} are now pushed onto the stack.
15786
15787 Note, common variables (variables which have not been initialised) and
15788 constants are not placed into the small data area as they are assigned
15789 to other sections in the output executable.
15790
15791 The default value is zero, which disables this feature.  Note, this
15792 feature is not enabled by default with higher optimization levels
15793 (@option{-O2} etc) because of the potentially detrimental effects of
15794 reserving register @code{r13}.  It is up to the programmer to
15795 experiment and discover whether this feature is of benefit to their
15796 program.
15797
15798 @item -msim
15799 @itemx -mno-sim
15800 @opindex msim
15801 @opindex mno-sim
15802 Use the simulator runtime.  The default is to use the libgloss board
15803 specific runtime.
15804
15805 @item -mas100-syntax
15806 @itemx -mno-as100-syntax
15807 @opindex mas100-syntax
15808 @opindex mno-as100-syntax
15809 When generating assembler output use a syntax that is compatible with
15810 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
15811 assembler but it has some restrictions so generating it is not the
15812 default option.
15813
15814 @item -mmax-constant-size=@var{N}
15815 @opindex mmax-constant-size
15816 Specifies the maximum size, in bytes, of a constant that can be used as
15817 an operand in a RX instruction.  Although the RX instruction set does
15818 allow constants of up to 4 bytes in length to be used in instructions,
15819 a longer value equates to a longer instruction.  Thus in some
15820 circumstances it can be beneficial to restrict the size of constants
15821 that are used in instructions.  Constants that are too big are instead
15822 placed into a constant pool and referenced via register indirection.
15823
15824 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
15825 or 4 means that constants of any size are allowed.
15826
15827 @item -mrelax
15828 @opindex mrelax
15829 Enable linker relaxation.  Linker relaxation is a process whereby the
15830 linker will attempt to reduce the size of a program by finding shorter
15831 versions of various instructions.  Disabled by default.
15832
15833 @item -mint-register=@var{N}
15834 @opindex mint-register
15835 Specify the number of registers to reserve for fast interrupt handler
15836 functions.  The value @var{N} can be between 0 and 4.  A value of 1
15837 means that register @code{r13} will be reserved for the exclusive use
15838 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
15839 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
15840 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
15841 A value of 0, the default, does not reserve any registers.
15842
15843 @item -msave-acc-in-interrupts
15844 @opindex msave-acc-in-interrupts
15845 Specifies that interrupt handler functions should preserve the
15846 accumulator register.  This is only necessary if normal code might use
15847 the accumulator register, for example because it performs 64-bit
15848 multiplications.  The default is to ignore the accumulator as this
15849 makes the interrupt handlers faster.
15850
15851 @end table
15852
15853 @emph{Note:} The generic GCC command line @option{-ffixed-@var{reg}}
15854 has special significance to the RX port when used with the
15855 @code{interrupt} function attribute.  This attribute indicates a
15856 function intended to process fast interrupts.  GCC will will ensure
15857 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
15858 and/or @code{r13} and only provided that the normal use of the
15859 corresponding registers have been restricted via the
15860 @option{-ffixed-@var{reg}} or @option{-mint-register} command line
15861 options.
15862
15863 @node S/390 and zSeries Options
15864 @subsection S/390 and zSeries Options
15865 @cindex S/390 and zSeries Options
15866
15867 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
15868
15869 @table @gcctabopt
15870 @item -mhard-float
15871 @itemx -msoft-float
15872 @opindex mhard-float
15873 @opindex msoft-float
15874 Use (do not use) the hardware floating-point instructions and registers
15875 for floating-point operations.  When @option{-msoft-float} is specified,
15876 functions in @file{libgcc.a} will be used to perform floating-point
15877 operations.  When @option{-mhard-float} is specified, the compiler
15878 generates IEEE floating-point instructions.  This is the default.
15879
15880 @item -mhard-dfp
15881 @itemx -mno-hard-dfp
15882 @opindex mhard-dfp
15883 @opindex mno-hard-dfp
15884 Use (do not use) the hardware decimal-floating-point instructions for
15885 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
15886 specified, functions in @file{libgcc.a} will be used to perform
15887 decimal-floating-point operations.  When @option{-mhard-dfp} is
15888 specified, the compiler generates decimal-floating-point hardware
15889 instructions.  This is the default for @option{-march=z9-ec} or higher.
15890
15891 @item -mlong-double-64
15892 @itemx -mlong-double-128
15893 @opindex mlong-double-64
15894 @opindex mlong-double-128
15895 These switches control the size of @code{long double} type. A size
15896 of 64bit makes the @code{long double} type equivalent to the @code{double}
15897 type. This is the default.
15898
15899 @item -mbackchain
15900 @itemx -mno-backchain
15901 @opindex mbackchain
15902 @opindex mno-backchain
15903 Store (do not store) the address of the caller's frame as backchain pointer
15904 into the callee's stack frame.
15905 A backchain may be needed to allow debugging using tools that do not understand
15906 DWARF-2 call frame information.
15907 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
15908 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
15909 the backchain is placed into the topmost word of the 96/160 byte register
15910 save area.
15911
15912 In general, code compiled with @option{-mbackchain} is call-compatible with
15913 code compiled with @option{-mmo-backchain}; however, use of the backchain
15914 for debugging purposes usually requires that the whole binary is built with
15915 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
15916 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
15917 to build a linux kernel use @option{-msoft-float}.
15918
15919 The default is to not maintain the backchain.
15920
15921 @item -mpacked-stack
15922 @itemx -mno-packed-stack
15923 @opindex mpacked-stack
15924 @opindex mno-packed-stack
15925 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
15926 specified, the compiler uses the all fields of the 96/160 byte register save
15927 area only for their default purpose; unused fields still take up stack space.
15928 When @option{-mpacked-stack} is specified, register save slots are densely
15929 packed at the top of the register save area; unused space is reused for other
15930 purposes, allowing for more efficient use of the available stack space.
15931 However, when @option{-mbackchain} is also in effect, the topmost word of
15932 the save area is always used to store the backchain, and the return address
15933 register is always saved two words below the backchain.
15934
15935 As long as the stack frame backchain is not used, code generated with
15936 @option{-mpacked-stack} is call-compatible with code generated with
15937 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
15938 S/390 or zSeries generated code that uses the stack frame backchain at run
15939 time, not just for debugging purposes.  Such code is not call-compatible
15940 with code compiled with @option{-mpacked-stack}.  Also, note that the
15941 combination of @option{-mbackchain},
15942 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
15943 to build a linux kernel use @option{-msoft-float}.
15944
15945 The default is to not use the packed stack layout.
15946
15947 @item -msmall-exec
15948 @itemx -mno-small-exec
15949 @opindex msmall-exec
15950 @opindex mno-small-exec
15951 Generate (or do not generate) code using the @code{bras} instruction
15952 to do subroutine calls.
15953 This only works reliably if the total executable size does not
15954 exceed 64k.  The default is to use the @code{basr} instruction instead,
15955 which does not have this limitation.
15956
15957 @item -m64
15958 @itemx -m31
15959 @opindex m64
15960 @opindex m31
15961 When @option{-m31} is specified, generate code compliant to the
15962 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
15963 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
15964 particular to generate 64-bit instructions.  For the @samp{s390}
15965 targets, the default is @option{-m31}, while the @samp{s390x}
15966 targets default to @option{-m64}.
15967
15968 @item -mzarch
15969 @itemx -mesa
15970 @opindex mzarch
15971 @opindex mesa
15972 When @option{-mzarch} is specified, generate code using the
15973 instructions available on z/Architecture.
15974 When @option{-mesa} is specified, generate code using the
15975 instructions available on ESA/390.  Note that @option{-mesa} is
15976 not possible with @option{-m64}.
15977 When generating code compliant to the GNU/Linux for S/390 ABI,
15978 the default is @option{-mesa}.  When generating code compliant
15979 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
15980
15981 @item -mmvcle
15982 @itemx -mno-mvcle
15983 @opindex mmvcle
15984 @opindex mno-mvcle
15985 Generate (or do not generate) code using the @code{mvcle} instruction
15986 to perform block moves.  When @option{-mno-mvcle} is specified,
15987 use a @code{mvc} loop instead.  This is the default unless optimizing for
15988 size.
15989
15990 @item -mdebug
15991 @itemx -mno-debug
15992 @opindex mdebug
15993 @opindex mno-debug
15994 Print (or do not print) additional debug information when compiling.
15995 The default is to not print debug information.
15996
15997 @item -march=@var{cpu-type}
15998 @opindex march
15999 Generate code that will run on @var{cpu-type}, which is the name of a system
16000 representing a certain processor type.  Possible values for
16001 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
16002 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
16003 When generating code using the instructions available on z/Architecture,
16004 the default is @option{-march=z900}.  Otherwise, the default is
16005 @option{-march=g5}.
16006
16007 @item -mtune=@var{cpu-type}
16008 @opindex mtune
16009 Tune to @var{cpu-type} everything applicable about the generated code,
16010 except for the ABI and the set of available instructions.
16011 The list of @var{cpu-type} values is the same as for @option{-march}.
16012 The default is the value used for @option{-march}.
16013
16014 @item -mtpf-trace
16015 @itemx -mno-tpf-trace
16016 @opindex mtpf-trace
16017 @opindex mno-tpf-trace
16018 Generate code that adds (does not add) in TPF OS specific branches to trace
16019 routines in the operating system.  This option is off by default, even
16020 when compiling for the TPF OS@.
16021
16022 @item -mfused-madd
16023 @itemx -mno-fused-madd
16024 @opindex mfused-madd
16025 @opindex mno-fused-madd
16026 Generate code that uses (does not use) the floating point multiply and
16027 accumulate instructions.  These instructions are generated by default if
16028 hardware floating point is used.
16029
16030 @item -mwarn-framesize=@var{framesize}
16031 @opindex mwarn-framesize
16032 Emit a warning if the current function exceeds the given frame size.  Because
16033 this is a compile time check it doesn't need to be a real problem when the program
16034 runs.  It is intended to identify functions which most probably cause
16035 a stack overflow.  It is useful to be used in an environment with limited stack
16036 size e.g.@: the linux kernel.
16037
16038 @item -mwarn-dynamicstack
16039 @opindex mwarn-dynamicstack
16040 Emit a warning if the function calls alloca or uses dynamically
16041 sized arrays.  This is generally a bad idea with a limited stack size.
16042
16043 @item -mstack-guard=@var{stack-guard}
16044 @itemx -mstack-size=@var{stack-size}
16045 @opindex mstack-guard
16046 @opindex mstack-size
16047 If these options are provided the s390 back end emits additional instructions in
16048 the function prologue which trigger a trap if the stack size is @var{stack-guard}
16049 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
16050 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
16051 the frame size of the compiled function is chosen.
16052 These options are intended to be used to help debugging stack overflow problems.
16053 The additionally emitted code causes only little overhead and hence can also be
16054 used in production like systems without greater performance degradation.  The given
16055 values have to be exact powers of 2 and @var{stack-size} has to be greater than
16056 @var{stack-guard} without exceeding 64k.
16057 In order to be efficient the extra code makes the assumption that the stack starts
16058 at an address aligned to the value given by @var{stack-size}.
16059 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
16060 @end table
16061
16062 @node Score Options
16063 @subsection Score Options
16064 @cindex Score Options
16065
16066 These options are defined for Score implementations:
16067
16068 @table @gcctabopt
16069 @item -meb
16070 @opindex meb
16071 Compile code for big endian mode.  This is the default.
16072
16073 @item -mel
16074 @opindex mel
16075 Compile code for little endian mode.
16076
16077 @item -mnhwloop
16078 @opindex mnhwloop
16079 Disable generate bcnz instruction.
16080
16081 @item -muls
16082 @opindex muls
16083 Enable generate unaligned load and store instruction.
16084
16085 @item -mmac
16086 @opindex mmac
16087 Enable the use of multiply-accumulate instructions. Disabled by default.
16088
16089 @item -mscore5
16090 @opindex mscore5
16091 Specify the SCORE5 as the target architecture.
16092
16093 @item -mscore5u
16094 @opindex mscore5u
16095 Specify the SCORE5U of the target architecture.
16096
16097 @item -mscore7
16098 @opindex mscore7
16099 Specify the SCORE7 as the target architecture. This is the default.
16100
16101 @item -mscore7d
16102 @opindex mscore7d
16103 Specify the SCORE7D as the target architecture.
16104 @end table
16105
16106 @node SH Options
16107 @subsection SH Options
16108
16109 These @samp{-m} options are defined for the SH implementations:
16110
16111 @table @gcctabopt
16112 @item -m1
16113 @opindex m1
16114 Generate code for the SH1.
16115
16116 @item -m2
16117 @opindex m2
16118 Generate code for the SH2.
16119
16120 @item -m2e
16121 Generate code for the SH2e.
16122
16123 @item -m2a-nofpu
16124 @opindex m2a-nofpu
16125 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
16126 that the floating-point unit is not used.
16127
16128 @item -m2a-single-only
16129 @opindex m2a-single-only
16130 Generate code for the SH2a-FPU, in such a way that no double-precision
16131 floating point operations are used.
16132
16133 @item -m2a-single
16134 @opindex m2a-single
16135 Generate code for the SH2a-FPU assuming the floating-point unit is in
16136 single-precision mode by default.
16137
16138 @item -m2a
16139 @opindex m2a
16140 Generate code for the SH2a-FPU assuming the floating-point unit is in
16141 double-precision mode by default.
16142
16143 @item -m3
16144 @opindex m3
16145 Generate code for the SH3.
16146
16147 @item -m3e
16148 @opindex m3e
16149 Generate code for the SH3e.
16150
16151 @item -m4-nofpu
16152 @opindex m4-nofpu
16153 Generate code for the SH4 without a floating-point unit.
16154
16155 @item -m4-single-only
16156 @opindex m4-single-only
16157 Generate code for the SH4 with a floating-point unit that only
16158 supports single-precision arithmetic.
16159
16160 @item -m4-single
16161 @opindex m4-single
16162 Generate code for the SH4 assuming the floating-point unit is in
16163 single-precision mode by default.
16164
16165 @item -m4
16166 @opindex m4
16167 Generate code for the SH4.
16168
16169 @item -m4a-nofpu
16170 @opindex m4a-nofpu
16171 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
16172 floating-point unit is not used.
16173
16174 @item -m4a-single-only
16175 @opindex m4a-single-only
16176 Generate code for the SH4a, in such a way that no double-precision
16177 floating point operations are used.
16178
16179 @item -m4a-single
16180 @opindex m4a-single
16181 Generate code for the SH4a assuming the floating-point unit is in
16182 single-precision mode by default.
16183
16184 @item -m4a
16185 @opindex m4a
16186 Generate code for the SH4a.
16187
16188 @item -m4al
16189 @opindex m4al
16190 Same as @option{-m4a-nofpu}, except that it implicitly passes
16191 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
16192 instructions at the moment.
16193
16194 @item -mb
16195 @opindex mb
16196 Compile code for the processor in big endian mode.
16197
16198 @item -ml
16199 @opindex ml
16200 Compile code for the processor in little endian mode.
16201
16202 @item -mdalign
16203 @opindex mdalign
16204 Align doubles at 64-bit boundaries.  Note that this changes the calling
16205 conventions, and thus some functions from the standard C library will
16206 not work unless you recompile it first with @option{-mdalign}.
16207
16208 @item -mrelax
16209 @opindex mrelax
16210 Shorten some address references at link time, when possible; uses the
16211 linker option @option{-relax}.
16212
16213 @item -mbigtable
16214 @opindex mbigtable
16215 Use 32-bit offsets in @code{switch} tables.  The default is to use
16216 16-bit offsets.
16217
16218 @item -mbitops
16219 @opindex mbitops
16220 Enable the use of bit manipulation instructions on SH2A.
16221
16222 @item -mfmovd
16223 @opindex mfmovd
16224 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
16225 alignment constraints.
16226
16227 @item -mhitachi
16228 @opindex mhitachi
16229 Comply with the calling conventions defined by Renesas.
16230
16231 @item -mrenesas
16232 @opindex mhitachi
16233 Comply with the calling conventions defined by Renesas.
16234
16235 @item -mno-renesas
16236 @opindex mhitachi
16237 Comply with the calling conventions defined for GCC before the Renesas
16238 conventions were available.  This option is the default for all
16239 targets of the SH toolchain except for @samp{sh-symbianelf}.
16240
16241 @item -mnomacsave
16242 @opindex mnomacsave
16243 Mark the @code{MAC} register as call-clobbered, even if
16244 @option{-mhitachi} is given.
16245
16246 @item -mieee
16247 @opindex mieee
16248 Increase IEEE-compliance of floating-point code.
16249 At the moment, this is equivalent to @option{-fno-finite-math-only}.
16250 When generating 16 bit SH opcodes, getting IEEE-conforming results for
16251 comparisons of NANs / infinities incurs extra overhead in every
16252 floating point comparison, therefore the default is set to
16253 @option{-ffinite-math-only}.
16254
16255 @item -minline-ic_invalidate
16256 @opindex minline-ic_invalidate
16257 Inline code to invalidate instruction cache entries after setting up
16258 nested function trampolines.
16259 This option has no effect if -musermode is in effect and the selected
16260 code generation option (e.g. -m4) does not allow the use of the icbi
16261 instruction.
16262 If the selected code generation option does not allow the use of the icbi
16263 instruction, and -musermode is not in effect, the inlined code will
16264 manipulate the instruction cache address array directly with an associative
16265 write.  This not only requires privileged mode, but it will also
16266 fail if the cache line had been mapped via the TLB and has become unmapped.
16267
16268 @item -misize
16269 @opindex misize
16270 Dump instruction size and location in the assembly code.
16271
16272 @item -mpadstruct
16273 @opindex mpadstruct
16274 This option is deprecated.  It pads structures to multiple of 4 bytes,
16275 which is incompatible with the SH ABI@.
16276
16277 @item -mspace
16278 @opindex mspace
16279 Optimize for space instead of speed.  Implied by @option{-Os}.
16280
16281 @item -mprefergot
16282 @opindex mprefergot
16283 When generating position-independent code, emit function calls using
16284 the Global Offset Table instead of the Procedure Linkage Table.
16285
16286 @item -musermode
16287 @opindex musermode
16288 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
16289 if the inlined code would not work in user mode.
16290 This is the default when the target is @code{sh-*-linux*}.
16291
16292 @item -multcost=@var{number}
16293 @opindex multcost=@var{number}
16294 Set the cost to assume for a multiply insn.
16295
16296 @item -mdiv=@var{strategy}
16297 @opindex mdiv=@var{strategy}
16298 Set the division strategy to use for SHmedia code.  @var{strategy} must be
16299 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
16300 inv:call2, inv:fp .
16301 "fp" performs the operation in floating point.  This has a very high latency,
16302 but needs only a few instructions, so it might be a good choice if
16303 your code has enough easily exploitable ILP to allow the compiler to
16304 schedule the floating point instructions together with other instructions.
16305 Division by zero causes a floating point exception.
16306 "inv" uses integer operations to calculate the inverse of the divisor,
16307 and then multiplies the dividend with the inverse.  This strategy allows
16308 cse and hoisting of the inverse calculation.  Division by zero calculates
16309 an unspecified result, but does not trap.
16310 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
16311 have been found, or if the entire operation has been hoisted to the same
16312 place, the last stages of the inverse calculation are intertwined with the
16313 final multiply to reduce the overall latency, at the expense of using a few
16314 more instructions, and thus offering fewer scheduling opportunities with
16315 other code.
16316 "call" calls a library function that usually implements the inv:minlat
16317 strategy.
16318 This gives high code density for m5-*media-nofpu compilations.
16319 "call2" uses a different entry point of the same library function, where it
16320 assumes that a pointer to a lookup table has already been set up, which
16321 exposes the pointer load to cse / code hoisting optimizations.
16322 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
16323 code generation, but if the code stays unoptimized, revert to the "call",
16324 "call2", or "fp" strategies, respectively.  Note that the
16325 potentially-trapping side effect of division by zero is carried by a
16326 separate instruction, so it is possible that all the integer instructions
16327 are hoisted out, but the marker for the side effect stays where it is.
16328 A recombination to fp operations or a call is not possible in that case.
16329 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
16330 that the inverse calculation was nor separated from the multiply, they speed
16331 up division where the dividend fits into 20 bits (plus sign where applicable),
16332 by inserting a test to skip a number of operations in this case; this test
16333 slows down the case of larger dividends.  inv20u assumes the case of a such
16334 a small dividend to be unlikely, and inv20l assumes it to be likely.
16335
16336 @item -maccumulate-outgoing-args
16337 @opindex maccumulate-outgoing-args
16338 Reserve space once for outgoing arguments in the function prologue rather 
16339 than around each call.  Generally beneficial for performance and size.  Also
16340 needed for unwinding to avoid changing the stack frame around conditional code.
16341
16342 @item -mdivsi3_libfunc=@var{name}
16343 @opindex mdivsi3_libfunc=@var{name}
16344 Set the name of the library function used for 32 bit signed division to
16345 @var{name}.  This only affect the name used in the call and inv:call
16346 division strategies, and the compiler will still expect the same
16347 sets of input/output/clobbered registers as if this option was not present.
16348
16349 @item -mfixed-range=@var{register-range}
16350 @opindex mfixed-range
16351 Generate code treating the given register range as fixed registers.
16352 A fixed register is one that the register allocator can not use.  This is
16353 useful when compiling kernel code.  A register range is specified as
16354 two registers separated by a dash.  Multiple register ranges can be
16355 specified separated by a comma.
16356
16357 @item -madjust-unroll
16358 @opindex madjust-unroll
16359 Throttle unrolling to avoid thrashing target registers.
16360 This option only has an effect if the gcc code base supports the
16361 TARGET_ADJUST_UNROLL_MAX target hook.
16362
16363 @item -mindexed-addressing
16364 @opindex mindexed-addressing
16365 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
16366 This is only safe if the hardware and/or OS implement 32 bit wrap-around
16367 semantics for the indexed addressing mode.  The architecture allows the
16368 implementation of processors with 64 bit MMU, which the OS could use to
16369 get 32 bit addressing, but since no current hardware implementation supports
16370 this or any other way to make the indexed addressing mode safe to use in
16371 the 32 bit ABI, the default is -mno-indexed-addressing.
16372
16373 @item -mgettrcost=@var{number}
16374 @opindex mgettrcost=@var{number}
16375 Set the cost assumed for the gettr instruction to @var{number}.
16376 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
16377
16378 @item -mpt-fixed
16379 @opindex mpt-fixed
16380 Assume pt* instructions won't trap.  This will generally generate better
16381 scheduled code, but is unsafe on current hardware.  The current architecture
16382 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
16383 This has the unintentional effect of making it unsafe to schedule ptabs /
16384 ptrel before a branch, or hoist it out of a loop.  For example,
16385 __do_global_ctors, a part of libgcc that runs constructors at program
16386 startup, calls functions in a list which is delimited by @minus{}1.  With the
16387 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
16388 That means that all the constructors will be run a bit quicker, but when
16389 the loop comes to the end of the list, the program crashes because ptabs
16390 loads @minus{}1 into a target register.  Since this option is unsafe for any
16391 hardware implementing the current architecture specification, the default
16392 is -mno-pt-fixed.  Unless the user specifies a specific cost with
16393 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
16394 this deters register allocation using target registers for storing
16395 ordinary integers.
16396
16397 @item -minvalid-symbols
16398 @opindex minvalid-symbols
16399 Assume symbols might be invalid.  Ordinary function symbols generated by
16400 the compiler will always be valid to load with movi/shori/ptabs or
16401 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
16402 to generate symbols that will cause ptabs / ptrel to trap.
16403 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
16404 It will then prevent cross-basic-block cse, hoisting and most scheduling
16405 of symbol loads.  The default is @option{-mno-invalid-symbols}.
16406 @end table
16407
16408 @node SPARC Options
16409 @subsection SPARC Options
16410 @cindex SPARC options
16411
16412 These @samp{-m} options are supported on the SPARC:
16413
16414 @table @gcctabopt
16415 @item -mno-app-regs
16416 @itemx -mapp-regs
16417 @opindex mno-app-regs
16418 @opindex mapp-regs
16419 Specify @option{-mapp-regs} to generate output using the global registers
16420 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
16421 is the default.
16422
16423 To be fully SVR4 ABI compliant at the cost of some performance loss,
16424 specify @option{-mno-app-regs}.  You should compile libraries and system
16425 software with this option.
16426
16427 @item -mfpu
16428 @itemx -mhard-float
16429 @opindex mfpu
16430 @opindex mhard-float
16431 Generate output containing floating point instructions.  This is the
16432 default.
16433
16434 @item -mno-fpu
16435 @itemx -msoft-float
16436 @opindex mno-fpu
16437 @opindex msoft-float
16438 Generate output containing library calls for floating point.
16439 @strong{Warning:} the requisite libraries are not available for all SPARC
16440 targets.  Normally the facilities of the machine's usual C compiler are
16441 used, but this cannot be done directly in cross-compilation.  You must make
16442 your own arrangements to provide suitable library functions for
16443 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
16444 @samp{sparclite-*-*} do provide software floating point support.
16445
16446 @option{-msoft-float} changes the calling convention in the output file;
16447 therefore, it is only useful if you compile @emph{all} of a program with
16448 this option.  In particular, you need to compile @file{libgcc.a}, the
16449 library that comes with GCC, with @option{-msoft-float} in order for
16450 this to work.
16451
16452 @item -mhard-quad-float
16453 @opindex mhard-quad-float
16454 Generate output containing quad-word (long double) floating point
16455 instructions.
16456
16457 @item -msoft-quad-float
16458 @opindex msoft-quad-float
16459 Generate output containing library calls for quad-word (long double)
16460 floating point instructions.  The functions called are those specified
16461 in the SPARC ABI@.  This is the default.
16462
16463 As of this writing, there are no SPARC implementations that have hardware
16464 support for the quad-word floating point instructions.  They all invoke
16465 a trap handler for one of these instructions, and then the trap handler
16466 emulates the effect of the instruction.  Because of the trap handler overhead,
16467 this is much slower than calling the ABI library routines.  Thus the
16468 @option{-msoft-quad-float} option is the default.
16469
16470 @item -mno-unaligned-doubles
16471 @itemx -munaligned-doubles
16472 @opindex mno-unaligned-doubles
16473 @opindex munaligned-doubles
16474 Assume that doubles have 8 byte alignment.  This is the default.
16475
16476 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
16477 alignment only if they are contained in another type, or if they have an
16478 absolute address.  Otherwise, it assumes they have 4 byte alignment.
16479 Specifying this option avoids some rare compatibility problems with code
16480 generated by other compilers.  It is not the default because it results
16481 in a performance loss, especially for floating point code.
16482
16483 @item -mno-faster-structs
16484 @itemx -mfaster-structs
16485 @opindex mno-faster-structs
16486 @opindex mfaster-structs
16487 With @option{-mfaster-structs}, the compiler assumes that structures
16488 should have 8 byte alignment.  This enables the use of pairs of
16489 @code{ldd} and @code{std} instructions for copies in structure
16490 assignment, in place of twice as many @code{ld} and @code{st} pairs.
16491 However, the use of this changed alignment directly violates the SPARC
16492 ABI@.  Thus, it's intended only for use on targets where the developer
16493 acknowledges that their resulting code will not be directly in line with
16494 the rules of the ABI@.
16495
16496 @item -mimpure-text
16497 @opindex mimpure-text
16498 @option{-mimpure-text}, used in addition to @option{-shared}, tells
16499 the compiler to not pass @option{-z text} to the linker when linking a
16500 shared object.  Using this option, you can link position-dependent
16501 code into a shared object.
16502
16503 @option{-mimpure-text} suppresses the ``relocations remain against
16504 allocatable but non-writable sections'' linker error message.
16505 However, the necessary relocations will trigger copy-on-write, and the
16506 shared object is not actually shared across processes.  Instead of
16507 using @option{-mimpure-text}, you should compile all source code with
16508 @option{-fpic} or @option{-fPIC}.
16509
16510 This option is only available on SunOS and Solaris.
16511
16512 @item -mcpu=@var{cpu_type}
16513 @opindex mcpu
16514 Set the instruction set, register set, and instruction scheduling parameters
16515 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
16516 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
16517 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
16518 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
16519 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
16520
16521 Default instruction scheduling parameters are used for values that select
16522 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
16523 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
16524
16525 Here is a list of each supported architecture and their supported
16526 implementations.
16527
16528 @smallexample
16529     v7:             cypress
16530     v8:             supersparc, hypersparc
16531     sparclite:      f930, f934, sparclite86x
16532     sparclet:       tsc701
16533     v9:             ultrasparc, ultrasparc3, niagara, niagara2
16534 @end smallexample
16535
16536 By default (unless configured otherwise), GCC generates code for the V7
16537 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
16538 additionally optimizes it for the Cypress CY7C602 chip, as used in the
16539 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
16540 SPARCStation 1, 2, IPX etc.
16541
16542 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
16543 architecture.  The only difference from V7 code is that the compiler emits
16544 the integer multiply and integer divide instructions which exist in SPARC-V8
16545 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
16546 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
16547 2000 series.
16548
16549 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
16550 the SPARC architecture.  This adds the integer multiply, integer divide step
16551 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
16552 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
16553 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
16554 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
16555 MB86934 chip, which is the more recent SPARClite with FPU@.
16556
16557 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
16558 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
16559 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
16560 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
16561 optimizes it for the TEMIC SPARClet chip.
16562
16563 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
16564 architecture.  This adds 64-bit integer and floating-point move instructions,
16565 3 additional floating-point condition code registers and conditional move
16566 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
16567 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
16568 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
16569 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
16570 @option{-mcpu=niagara}, the compiler additionally optimizes it for
16571 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
16572 additionally optimizes it for Sun UltraSPARC T2 chips.
16573
16574 @item -mtune=@var{cpu_type}
16575 @opindex mtune
16576 Set the instruction scheduling parameters for machine type
16577 @var{cpu_type}, but do not set the instruction set or register set that the
16578 option @option{-mcpu=@var{cpu_type}} would.
16579
16580 The same values for @option{-mcpu=@var{cpu_type}} can be used for
16581 @option{-mtune=@var{cpu_type}}, but the only useful values are those
16582 that select a particular cpu implementation.  Those are @samp{cypress},
16583 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
16584 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
16585 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
16586
16587 @item -mv8plus
16588 @itemx -mno-v8plus
16589 @opindex mv8plus
16590 @opindex mno-v8plus
16591 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
16592 difference from the V8 ABI is that the global and out registers are
16593 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
16594 mode for all SPARC-V9 processors.
16595
16596 @item -mvis
16597 @itemx -mno-vis
16598 @opindex mvis
16599 @opindex mno-vis
16600 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
16601 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
16602 @end table
16603
16604 These @samp{-m} options are supported in addition to the above
16605 on SPARC-V9 processors in 64-bit environments:
16606
16607 @table @gcctabopt
16608 @item -mlittle-endian
16609 @opindex mlittle-endian
16610 Generate code for a processor running in little-endian mode.  It is only
16611 available for a few configurations and most notably not on Solaris and Linux.
16612
16613 @item -m32
16614 @itemx -m64
16615 @opindex m32
16616 @opindex m64
16617 Generate code for a 32-bit or 64-bit environment.
16618 The 32-bit environment sets int, long and pointer to 32 bits.
16619 The 64-bit environment sets int to 32 bits and long and pointer
16620 to 64 bits.
16621
16622 @item -mcmodel=medlow
16623 @opindex mcmodel=medlow
16624 Generate code for the Medium/Low code model: 64-bit addresses, programs
16625 must be linked in the low 32 bits of memory.  Programs can be statically
16626 or dynamically linked.
16627
16628 @item -mcmodel=medmid
16629 @opindex mcmodel=medmid
16630 Generate code for the Medium/Middle code model: 64-bit addresses, programs
16631 must be linked in the low 44 bits of memory, the text and data segments must
16632 be less than 2GB in size and the data segment must be located within 2GB of
16633 the text segment.
16634
16635 @item -mcmodel=medany
16636 @opindex mcmodel=medany
16637 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
16638 may be linked anywhere in memory, the text and data segments must be less
16639 than 2GB in size and the data segment must be located within 2GB of the
16640 text segment.
16641
16642 @item -mcmodel=embmedany
16643 @opindex mcmodel=embmedany
16644 Generate code for the Medium/Anywhere code model for embedded systems:
16645 64-bit addresses, the text and data segments must be less than 2GB in
16646 size, both starting anywhere in memory (determined at link time).  The
16647 global register %g4 points to the base of the data segment.  Programs
16648 are statically linked and PIC is not supported.
16649
16650 @item -mstack-bias
16651 @itemx -mno-stack-bias
16652 @opindex mstack-bias
16653 @opindex mno-stack-bias
16654 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
16655 frame pointer if present, are offset by @minus{}2047 which must be added back
16656 when making stack frame references.  This is the default in 64-bit mode.
16657 Otherwise, assume no such offset is present.
16658 @end table
16659
16660 These switches are supported in addition to the above on Solaris:
16661
16662 @table @gcctabopt
16663 @item -threads
16664 @opindex threads
16665 Add support for multithreading using the Solaris threads library.  This
16666 option sets flags for both the preprocessor and linker.  This option does
16667 not affect the thread safety of object code produced by the compiler or
16668 that of libraries supplied with it.
16669
16670 @item -pthreads
16671 @opindex pthreads
16672 Add support for multithreading using the POSIX threads library.  This
16673 option sets flags for both the preprocessor and linker.  This option does
16674 not affect the thread safety of object code produced  by the compiler or
16675 that of libraries supplied with it.
16676
16677 @item -pthread
16678 @opindex pthread
16679 This is a synonym for @option{-pthreads}.
16680 @end table
16681
16682 @node SPU Options
16683 @subsection SPU Options
16684 @cindex SPU options
16685
16686 These @samp{-m} options are supported on the SPU:
16687
16688 @table @gcctabopt
16689 @item -mwarn-reloc
16690 @itemx -merror-reloc
16691 @opindex mwarn-reloc
16692 @opindex merror-reloc
16693
16694 The loader for SPU does not handle dynamic relocations.  By default, GCC
16695 will give an error when it generates code that requires a dynamic
16696 relocation.  @option{-mno-error-reloc} disables the error,
16697 @option{-mwarn-reloc} will generate a warning instead.
16698
16699 @item -msafe-dma
16700 @itemx -munsafe-dma
16701 @opindex msafe-dma
16702 @opindex munsafe-dma
16703
16704 Instructions which initiate or test completion of DMA must not be
16705 reordered with respect to loads and stores of the memory which is being
16706 accessed.  Users typically address this problem using the volatile
16707 keyword, but that can lead to inefficient code in places where the
16708 memory is known to not change.  Rather than mark the memory as volatile
16709 we treat the DMA instructions as potentially effecting all memory.  With
16710 @option{-munsafe-dma} users must use the volatile keyword to protect
16711 memory accesses.
16712
16713 @item -mbranch-hints
16714 @opindex mbranch-hints
16715
16716 By default, GCC will generate a branch hint instruction to avoid
16717 pipeline stalls for always taken or probably taken branches.  A hint
16718 will not be generated closer than 8 instructions away from its branch.
16719 There is little reason to disable them, except for debugging purposes,
16720 or to make an object a little bit smaller.
16721
16722 @item -msmall-mem
16723 @itemx -mlarge-mem
16724 @opindex msmall-mem
16725 @opindex mlarge-mem
16726
16727 By default, GCC generates code assuming that addresses are never larger
16728 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
16729 a full 32 bit address.
16730
16731 @item -mstdmain
16732 @opindex mstdmain
16733
16734 By default, GCC links against startup code that assumes the SPU-style
16735 main function interface (which has an unconventional parameter list).
16736 With @option{-mstdmain}, GCC will link your program against startup
16737 code that assumes a C99-style interface to @code{main}, including a
16738 local copy of @code{argv} strings.
16739
16740 @item -mfixed-range=@var{register-range}
16741 @opindex mfixed-range
16742 Generate code treating the given register range as fixed registers.
16743 A fixed register is one that the register allocator can not use.  This is
16744 useful when compiling kernel code.  A register range is specified as
16745 two registers separated by a dash.  Multiple register ranges can be
16746 specified separated by a comma.
16747
16748 @item -mea32
16749 @itemx -mea64
16750 @opindex mea32
16751 @opindex mea64
16752 Compile code assuming that pointers to the PPU address space accessed
16753 via the @code{__ea} named address space qualifier are either 32 or 64
16754 bits wide.  The default is 32 bits.  As this is an ABI changing option,
16755 all object code in an executable must be compiled with the same setting.
16756
16757 @item -maddress-space-conversion
16758 @itemx -mno-address-space-conversion
16759 @opindex maddress-space-conversion
16760 @opindex mno-address-space-conversion
16761 Allow/disallow treating the @code{__ea} address space as superset
16762 of the generic address space.  This enables explicit type casts
16763 between @code{__ea} and generic pointer as well as implicit
16764 conversions of generic pointers to @code{__ea} pointers.  The
16765 default is to allow address space pointer conversions.
16766
16767 @item -mcache-size=@var{cache-size}
16768 @opindex mcache-size
16769 This option controls the version of libgcc that the compiler links to an
16770 executable and selects a software-managed cache for accessing variables
16771 in the @code{__ea} address space with a particular cache size.  Possible
16772 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
16773 and @samp{128}.  The default cache size is 64KB.
16774
16775 @item -matomic-updates
16776 @itemx -mno-atomic-updates
16777 @opindex matomic-updates
16778 @opindex mno-atomic-updates
16779 This option controls the version of libgcc that the compiler links to an
16780 executable and selects whether atomic updates to the software-managed
16781 cache of PPU-side variables are used.  If you use atomic updates, changes
16782 to a PPU variable from SPU code using the @code{__ea} named address space
16783 qualifier will not interfere with changes to other PPU variables residing
16784 in the same cache line from PPU code.  If you do not use atomic updates,
16785 such interference may occur; however, writing back cache lines will be
16786 more efficient.  The default behavior is to use atomic updates.
16787
16788 @item -mdual-nops
16789 @itemx -mdual-nops=@var{n}
16790 @opindex mdual-nops
16791 By default, GCC will insert nops to increase dual issue when it expects
16792 it to increase performance.  @var{n} can be a value from 0 to 10.  A
16793 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
16794 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
16795
16796 @item -mhint-max-nops=@var{n}
16797 @opindex mhint-max-nops
16798 Maximum number of nops to insert for a branch hint.  A branch hint must
16799 be at least 8 instructions away from the branch it is effecting.  GCC
16800 will insert up to @var{n} nops to enforce this, otherwise it will not
16801 generate the branch hint.
16802
16803 @item -mhint-max-distance=@var{n}
16804 @opindex mhint-max-distance
16805 The encoding of the branch hint instruction limits the hint to be within
16806 256 instructions of the branch it is effecting.  By default, GCC makes
16807 sure it is within 125.
16808
16809 @item -msafe-hints
16810 @opindex msafe-hints
16811 Work around a hardware bug which causes the SPU to stall indefinitely.
16812 By default, GCC will insert the @code{hbrp} instruction to make sure
16813 this stall won't happen.
16814
16815 @end table
16816
16817 @node System V Options
16818 @subsection Options for System V
16819
16820 These additional options are available on System V Release 4 for
16821 compatibility with other compilers on those systems:
16822
16823 @table @gcctabopt
16824 @item -G
16825 @opindex G
16826 Create a shared object.
16827 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
16828
16829 @item -Qy
16830 @opindex Qy
16831 Identify the versions of each tool used by the compiler, in a
16832 @code{.ident} assembler directive in the output.
16833
16834 @item -Qn
16835 @opindex Qn
16836 Refrain from adding @code{.ident} directives to the output file (this is
16837 the default).
16838
16839 @item -YP,@var{dirs}
16840 @opindex YP
16841 Search the directories @var{dirs}, and no others, for libraries
16842 specified with @option{-l}.
16843
16844 @item -Ym,@var{dir}
16845 @opindex Ym
16846 Look in the directory @var{dir} to find the M4 preprocessor.
16847 The assembler uses this option.
16848 @c This is supposed to go with a -Yd for predefined M4 macro files, but
16849 @c the generic assembler that comes with Solaris takes just -Ym.
16850 @end table
16851
16852 @node V850 Options
16853 @subsection V850 Options
16854 @cindex V850 Options
16855
16856 These @samp{-m} options are defined for V850 implementations:
16857
16858 @table @gcctabopt
16859 @item -mlong-calls
16860 @itemx -mno-long-calls
16861 @opindex mlong-calls
16862 @opindex mno-long-calls
16863 Treat all calls as being far away (near).  If calls are assumed to be
16864 far away, the compiler will always load the functions address up into a
16865 register, and call indirect through the pointer.
16866
16867 @item -mno-ep
16868 @itemx -mep
16869 @opindex mno-ep
16870 @opindex mep
16871 Do not optimize (do optimize) basic blocks that use the same index
16872 pointer 4 or more times to copy pointer into the @code{ep} register, and
16873 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
16874 option is on by default if you optimize.
16875
16876 @item -mno-prolog-function
16877 @itemx -mprolog-function
16878 @opindex mno-prolog-function
16879 @opindex mprolog-function
16880 Do not use (do use) external functions to save and restore registers
16881 at the prologue and epilogue of a function.  The external functions
16882 are slower, but use less code space if more than one function saves
16883 the same number of registers.  The @option{-mprolog-function} option
16884 is on by default if you optimize.
16885
16886 @item -mspace
16887 @opindex mspace
16888 Try to make the code as small as possible.  At present, this just turns
16889 on the @option{-mep} and @option{-mprolog-function} options.
16890
16891 @item -mtda=@var{n}
16892 @opindex mtda
16893 Put static or global variables whose size is @var{n} bytes or less into
16894 the tiny data area that register @code{ep} points to.  The tiny data
16895 area can hold up to 256 bytes in total (128 bytes for byte references).
16896
16897 @item -msda=@var{n}
16898 @opindex msda
16899 Put static or global variables whose size is @var{n} bytes or less into
16900 the small data area that register @code{gp} points to.  The small data
16901 area can hold up to 64 kilobytes.
16902
16903 @item -mzda=@var{n}
16904 @opindex mzda
16905 Put static or global variables whose size is @var{n} bytes or less into
16906 the first 32 kilobytes of memory.
16907
16908 @item -mv850
16909 @opindex mv850
16910 Specify that the target processor is the V850.
16911
16912 @item -mbig-switch
16913 @opindex mbig-switch
16914 Generate code suitable for big switch tables.  Use this option only if
16915 the assembler/linker complain about out of range branches within a switch
16916 table.
16917
16918 @item -mapp-regs
16919 @opindex mapp-regs
16920 This option will cause r2 and r5 to be used in the code generated by
16921 the compiler.  This setting is the default.
16922
16923 @item -mno-app-regs
16924 @opindex mno-app-regs
16925 This option will cause r2 and r5 to be treated as fixed registers.
16926
16927 @item -mv850e1
16928 @opindex mv850e1
16929 Specify that the target processor is the V850E1.  The preprocessor
16930 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
16931 this option is used.
16932
16933 @item -mv850e
16934 @opindex mv850e
16935 Specify that the target processor is the V850E@.  The preprocessor
16936 constant @samp{__v850e__} will be defined if this option is used.
16937
16938 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
16939 are defined then a default target processor will be chosen and the
16940 relevant @samp{__v850*__} preprocessor constant will be defined.
16941
16942 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
16943 defined, regardless of which processor variant is the target.
16944
16945 @item -mdisable-callt
16946 @opindex mdisable-callt
16947 This option will suppress generation of the CALLT instruction for the
16948 v850e and v850e1 flavors of the v850 architecture.  The default is
16949 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
16950
16951 @end table
16952
16953 @node VAX Options
16954 @subsection VAX Options
16955 @cindex VAX options
16956
16957 These @samp{-m} options are defined for the VAX:
16958
16959 @table @gcctabopt
16960 @item -munix
16961 @opindex munix
16962 Do not output certain jump instructions (@code{aobleq} and so on)
16963 that the Unix assembler for the VAX cannot handle across long
16964 ranges.
16965
16966 @item -mgnu
16967 @opindex mgnu
16968 Do output those jump instructions, on the assumption that you
16969 will assemble with the GNU assembler.
16970
16971 @item -mg
16972 @opindex mg
16973 Output code for g-format floating point numbers instead of d-format.
16974 @end table
16975
16976 @node VxWorks Options
16977 @subsection VxWorks Options
16978 @cindex VxWorks Options
16979
16980 The options in this section are defined for all VxWorks targets.
16981 Options specific to the target hardware are listed with the other
16982 options for that target.
16983
16984 @table @gcctabopt
16985 @item -mrtp
16986 @opindex mrtp
16987 GCC can generate code for both VxWorks kernels and real time processes
16988 (RTPs).  This option switches from the former to the latter.  It also
16989 defines the preprocessor macro @code{__RTP__}.
16990
16991 @item -non-static
16992 @opindex non-static
16993 Link an RTP executable against shared libraries rather than static
16994 libraries.  The options @option{-static} and @option{-shared} can
16995 also be used for RTPs (@pxref{Link Options}); @option{-static}
16996 is the default.
16997
16998 @item -Bstatic
16999 @itemx -Bdynamic
17000 @opindex Bstatic
17001 @opindex Bdynamic
17002 These options are passed down to the linker.  They are defined for
17003 compatibility with Diab.
17004
17005 @item -Xbind-lazy
17006 @opindex Xbind-lazy
17007 Enable lazy binding of function calls.  This option is equivalent to
17008 @option{-Wl,-z,now} and is defined for compatibility with Diab.
17009
17010 @item -Xbind-now
17011 @opindex Xbind-now
17012 Disable lazy binding of function calls.  This option is the default and
17013 is defined for compatibility with Diab.
17014 @end table
17015
17016 @node x86-64 Options
17017 @subsection x86-64 Options
17018 @cindex x86-64 options
17019
17020 These are listed under @xref{i386 and x86-64 Options}.
17021
17022 @node i386 and x86-64 Windows Options
17023 @subsection i386 and x86-64 Windows Options
17024 @cindex i386 and x86-64 Windows Options
17025
17026 These additional options are available for Windows targets:
17027
17028 @table @gcctabopt
17029 @item -mconsole
17030 @opindex mconsole
17031 This option is available for Cygwin and MinGW targets.  It
17032 specifies that a console application is to be generated, by
17033 instructing the linker to set the PE header subsystem type
17034 required for console applications.
17035 This is the default behavior for Cygwin and MinGW targets.
17036
17037 @item -mcygwin
17038 @opindex mcygwin
17039 This option is available for Cygwin targets.  It specifies that
17040 the Cygwin internal interface is to be used for predefined
17041 preprocessor macros, C runtime libraries and related linker
17042 paths and options.  For Cygwin targets this is the default behavior.
17043 This option is deprecated and will be removed in a future release.
17044
17045 @item -mno-cygwin
17046 @opindex mno-cygwin
17047 This option is available for Cygwin targets.  It specifies that
17048 the MinGW internal interface is to be used instead of Cygwin's, by
17049 setting MinGW-related predefined macros and linker paths and default
17050 library options.
17051 This option is deprecated and will be removed in a future release.
17052
17053 @item -mdll
17054 @opindex mdll
17055 This option is available for Cygwin and MinGW targets.  It
17056 specifies that a DLL - a dynamic link library - is to be
17057 generated, enabling the selection of the required runtime
17058 startup object and entry point.
17059
17060 @item -mnop-fun-dllimport
17061 @opindex mnop-fun-dllimport
17062 This option is available for Cygwin and MinGW targets.  It
17063 specifies that the dllimport attribute should be ignored.
17064
17065 @item -mthread
17066 @opindex mthread
17067 This option is available for MinGW targets. It specifies
17068 that MinGW-specific thread support is to be used.
17069
17070 @item -municode
17071 @opindex municode
17072 This option is available for mingw-w64 targets.  It specifies
17073 that the UNICODE macro is getting pre-defined and that the
17074 unicode capable runtime startup code is chosen.
17075
17076 @item -mwin32
17077 @opindex mwin32
17078 This option is available for Cygwin and MinGW targets.  It
17079 specifies that the typical Windows pre-defined macros are to
17080 be set in the pre-processor, but does not influence the choice
17081 of runtime library/startup code.
17082
17083 @item -mwindows
17084 @opindex mwindows
17085 This option is available for Cygwin and MinGW targets.  It
17086 specifies that a GUI application is to be generated by
17087 instructing the linker to set the PE header subsystem type
17088 appropriately.
17089
17090 @item -fno-set-stack-executable
17091 @opindex fno-set-stack-executable
17092 This option is available for MinGW targets. It specifies that
17093 the executable flag for stack used by nested functions isn't
17094 set. This is necessary for binaries running in kernel mode of
17095 Windows, as there the user32 API, which is used to set executable
17096 privileges, isn't available.
17097
17098 @item -mpe-aligned-commons
17099 @opindex mpe-aligned-commons
17100 This option is available for Cygwin and MinGW targets.  It
17101 specifies that the GNU extension to the PE file format that
17102 permits the correct alignment of COMMON variables should be
17103 used when generating code.  It will be enabled by default if
17104 GCC detects that the target assembler found during configuration
17105 supports the feature.
17106 @end table
17107
17108 See also under @ref{i386 and x86-64 Options} for standard options.
17109
17110 @node Xstormy16 Options
17111 @subsection Xstormy16 Options
17112 @cindex Xstormy16 Options
17113
17114 These options are defined for Xstormy16:
17115
17116 @table @gcctabopt
17117 @item -msim
17118 @opindex msim
17119 Choose startup files and linker script suitable for the simulator.
17120 @end table
17121
17122 @node Xtensa Options
17123 @subsection Xtensa Options
17124 @cindex Xtensa Options
17125
17126 These options are supported for Xtensa targets:
17127
17128 @table @gcctabopt
17129 @item -mconst16
17130 @itemx -mno-const16
17131 @opindex mconst16
17132 @opindex mno-const16
17133 Enable or disable use of @code{CONST16} instructions for loading
17134 constant values.  The @code{CONST16} instruction is currently not a
17135 standard option from Tensilica.  When enabled, @code{CONST16}
17136 instructions are always used in place of the standard @code{L32R}
17137 instructions.  The use of @code{CONST16} is enabled by default only if
17138 the @code{L32R} instruction is not available.
17139
17140 @item -mfused-madd
17141 @itemx -mno-fused-madd
17142 @opindex mfused-madd
17143 @opindex mno-fused-madd
17144 Enable or disable use of fused multiply/add and multiply/subtract
17145 instructions in the floating-point option.  This has no effect if the
17146 floating-point option is not also enabled.  Disabling fused multiply/add
17147 and multiply/subtract instructions forces the compiler to use separate
17148 instructions for the multiply and add/subtract operations.  This may be
17149 desirable in some cases where strict IEEE 754-compliant results are
17150 required: the fused multiply add/subtract instructions do not round the
17151 intermediate result, thereby producing results with @emph{more} bits of
17152 precision than specified by the IEEE standard.  Disabling fused multiply
17153 add/subtract instructions also ensures that the program output is not
17154 sensitive to the compiler's ability to combine multiply and add/subtract
17155 operations.
17156
17157 @item -mserialize-volatile
17158 @itemx -mno-serialize-volatile
17159 @opindex mserialize-volatile
17160 @opindex mno-serialize-volatile
17161 When this option is enabled, GCC inserts @code{MEMW} instructions before
17162 @code{volatile} memory references to guarantee sequential consistency.
17163 The default is @option{-mserialize-volatile}.  Use
17164 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
17165
17166 @item -mforce-no-pic
17167 @opindex mforce-no-pic
17168 For targets, like GNU/Linux, where all user-mode Xtensa code must be
17169 position-independent code (PIC), this option disables PIC for compiling
17170 kernel code.
17171
17172 @item -mtext-section-literals
17173 @itemx -mno-text-section-literals
17174 @opindex mtext-section-literals
17175 @opindex mno-text-section-literals
17176 Control the treatment of literal pools.  The default is
17177 @option{-mno-text-section-literals}, which places literals in a separate
17178 section in the output file.  This allows the literal pool to be placed
17179 in a data RAM/ROM, and it also allows the linker to combine literal
17180 pools from separate object files to remove redundant literals and
17181 improve code size.  With @option{-mtext-section-literals}, the literals
17182 are interspersed in the text section in order to keep them as close as
17183 possible to their references.  This may be necessary for large assembly
17184 files.
17185
17186 @item -mtarget-align
17187 @itemx -mno-target-align
17188 @opindex mtarget-align
17189 @opindex mno-target-align
17190 When this option is enabled, GCC instructs the assembler to
17191 automatically align instructions to reduce branch penalties at the
17192 expense of some code density.  The assembler attempts to widen density
17193 instructions to align branch targets and the instructions following call
17194 instructions.  If there are not enough preceding safe density
17195 instructions to align a target, no widening will be performed.  The
17196 default is @option{-mtarget-align}.  These options do not affect the
17197 treatment of auto-aligned instructions like @code{LOOP}, which the
17198 assembler will always align, either by widening density instructions or
17199 by inserting no-op instructions.
17200
17201 @item -mlongcalls
17202 @itemx -mno-longcalls
17203 @opindex mlongcalls
17204 @opindex mno-longcalls
17205 When this option is enabled, GCC instructs the assembler to translate
17206 direct calls to indirect calls unless it can determine that the target
17207 of a direct call is in the range allowed by the call instruction.  This
17208 translation typically occurs for calls to functions in other source
17209 files.  Specifically, the assembler translates a direct @code{CALL}
17210 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
17211 The default is @option{-mno-longcalls}.  This option should be used in
17212 programs where the call target can potentially be out of range.  This
17213 option is implemented in the assembler, not the compiler, so the
17214 assembly code generated by GCC will still show direct call
17215 instructions---look at the disassembled object code to see the actual
17216 instructions.  Note that the assembler will use an indirect call for
17217 every cross-file call, not just those that really will be out of range.
17218 @end table
17219
17220 @node zSeries Options
17221 @subsection zSeries Options
17222 @cindex zSeries options
17223
17224 These are listed under @xref{S/390 and zSeries Options}.
17225
17226 @node Code Gen Options
17227 @section Options for Code Generation Conventions
17228 @cindex code generation conventions
17229 @cindex options, code generation
17230 @cindex run-time options
17231
17232 These machine-independent options control the interface conventions
17233 used in code generation.
17234
17235 Most of them have both positive and negative forms; the negative form
17236 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
17237 one of the forms is listed---the one which is not the default.  You
17238 can figure out the other form by either removing @samp{no-} or adding
17239 it.
17240
17241 @table @gcctabopt
17242 @item -fbounds-check
17243 @opindex fbounds-check
17244 For front-ends that support it, generate additional code to check that
17245 indices used to access arrays are within the declared range.  This is
17246 currently only supported by the Java and Fortran front-ends, where
17247 this option defaults to true and false respectively.
17248
17249 @item -ftrapv
17250 @opindex ftrapv
17251 This option generates traps for signed overflow on addition, subtraction,
17252 multiplication operations.
17253
17254 @item -fwrapv
17255 @opindex fwrapv
17256 This option instructs the compiler to assume that signed arithmetic
17257 overflow of addition, subtraction and multiplication wraps around
17258 using twos-complement representation.  This flag enables some optimizations
17259 and disables others.  This option is enabled by default for the Java
17260 front-end, as required by the Java language specification.
17261
17262 @item -fexceptions
17263 @opindex fexceptions
17264 Enable exception handling.  Generates extra code needed to propagate
17265 exceptions.  For some targets, this implies GCC will generate frame
17266 unwind information for all functions, which can produce significant data
17267 size overhead, although it does not affect execution.  If you do not
17268 specify this option, GCC will enable it by default for languages like
17269 C++ which normally require exception handling, and disable it for
17270 languages like C that do not normally require it.  However, you may need
17271 to enable this option when compiling C code that needs to interoperate
17272 properly with exception handlers written in C++.  You may also wish to
17273 disable this option if you are compiling older C++ programs that don't
17274 use exception handling.
17275
17276 @item -fnon-call-exceptions
17277 @opindex fnon-call-exceptions
17278 Generate code that allows trapping instructions to throw exceptions.
17279 Note that this requires platform-specific runtime support that does
17280 not exist everywhere.  Moreover, it only allows @emph{trapping}
17281 instructions to throw exceptions, i.e.@: memory references or floating
17282 point instructions.  It does not allow exceptions to be thrown from
17283 arbitrary signal handlers such as @code{SIGALRM}.
17284
17285 @item -funwind-tables
17286 @opindex funwind-tables
17287 Similar to @option{-fexceptions}, except that it will just generate any needed
17288 static data, but will not affect the generated code in any other way.
17289 You will normally not enable this option; instead, a language processor
17290 that needs this handling would enable it on your behalf.
17291
17292 @item -fasynchronous-unwind-tables
17293 @opindex fasynchronous-unwind-tables
17294 Generate unwind table in dwarf2 format, if supported by target machine.  The
17295 table is exact at each instruction boundary, so it can be used for stack
17296 unwinding from asynchronous events (such as debugger or garbage collector).
17297
17298 @item -fpcc-struct-return
17299 @opindex fpcc-struct-return
17300 Return ``short'' @code{struct} and @code{union} values in memory like
17301 longer ones, rather than in registers.  This convention is less
17302 efficient, but it has the advantage of allowing intercallability between
17303 GCC-compiled files and files compiled with other compilers, particularly
17304 the Portable C Compiler (pcc).
17305
17306 The precise convention for returning structures in memory depends
17307 on the target configuration macros.
17308
17309 Short structures and unions are those whose size and alignment match
17310 that of some integer type.
17311
17312 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
17313 switch is not binary compatible with code compiled with the
17314 @option{-freg-struct-return} switch.
17315 Use it to conform to a non-default application binary interface.
17316
17317 @item -freg-struct-return
17318 @opindex freg-struct-return
17319 Return @code{struct} and @code{union} values in registers when possible.
17320 This is more efficient for small structures than
17321 @option{-fpcc-struct-return}.
17322
17323 If you specify neither @option{-fpcc-struct-return} nor
17324 @option{-freg-struct-return}, GCC defaults to whichever convention is
17325 standard for the target.  If there is no standard convention, GCC
17326 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
17327 the principal compiler.  In those cases, we can choose the standard, and
17328 we chose the more efficient register return alternative.
17329
17330 @strong{Warning:} code compiled with the @option{-freg-struct-return}
17331 switch is not binary compatible with code compiled with the
17332 @option{-fpcc-struct-return} switch.
17333 Use it to conform to a non-default application binary interface.
17334
17335 @item -fshort-enums
17336 @opindex fshort-enums
17337 Allocate to an @code{enum} type only as many bytes as it needs for the
17338 declared range of possible values.  Specifically, the @code{enum} type
17339 will be equivalent to the smallest integer type which has enough room.
17340
17341 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
17342 code that is not binary compatible with code generated without that switch.
17343 Use it to conform to a non-default application binary interface.
17344
17345 @item -fshort-double
17346 @opindex fshort-double
17347 Use the same size for @code{double} as for @code{float}.
17348
17349 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
17350 code that is not binary compatible with code generated without that switch.
17351 Use it to conform to a non-default application binary interface.
17352
17353 @item -fshort-wchar
17354 @opindex fshort-wchar
17355 Override the underlying type for @samp{wchar_t} to be @samp{short
17356 unsigned int} instead of the default for the target.  This option is
17357 useful for building programs to run under WINE@.
17358
17359 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
17360 code that is not binary compatible with code generated without that switch.
17361 Use it to conform to a non-default application binary interface.
17362
17363 @item -fno-common
17364 @opindex fno-common
17365 In C code, controls the placement of uninitialized global variables.
17366 Unix C compilers have traditionally permitted multiple definitions of
17367 such variables in different compilation units by placing the variables
17368 in a common block.
17369 This is the behavior specified by @option{-fcommon}, and is the default
17370 for GCC on most targets.
17371 On the other hand, this behavior is not required by ISO C, and on some
17372 targets may carry a speed or code size penalty on variable references.
17373 The @option{-fno-common} option specifies that the compiler should place
17374 uninitialized global variables in the data section of the object file,
17375 rather than generating them as common blocks.
17376 This has the effect that if the same variable is declared
17377 (without @code{extern}) in two different compilations,
17378 you will get a multiple-definition error when you link them.
17379 In this case, you must compile with @option{-fcommon} instead.
17380 Compiling with @option{-fno-common} is useful on targets for which
17381 it provides better performance, or if you wish to verify that the
17382 program will work on other systems which always treat uninitialized
17383 variable declarations this way.
17384
17385 @item -fno-ident
17386 @opindex fno-ident
17387 Ignore the @samp{#ident} directive.
17388
17389 @item -finhibit-size-directive
17390 @opindex finhibit-size-directive
17391 Don't output a @code{.size} assembler directive, or anything else that
17392 would cause trouble if the function is split in the middle, and the
17393 two halves are placed at locations far apart in memory.  This option is
17394 used when compiling @file{crtstuff.c}; you should not need to use it
17395 for anything else.
17396
17397 @item -fverbose-asm
17398 @opindex fverbose-asm
17399 Put extra commentary information in the generated assembly code to
17400 make it more readable.  This option is generally only of use to those
17401 who actually need to read the generated assembly code (perhaps while
17402 debugging the compiler itself).
17403
17404 @option{-fno-verbose-asm}, the default, causes the
17405 extra information to be omitted and is useful when comparing two assembler
17406 files.
17407
17408 @item -frecord-gcc-switches
17409 @opindex frecord-gcc-switches
17410 This switch causes the command line that was used to invoke the
17411 compiler to be recorded into the object file that is being created.
17412 This switch is only implemented on some targets and the exact format
17413 of the recording is target and binary file format dependent, but it
17414 usually takes the form of a section containing ASCII text.  This
17415 switch is related to the @option{-fverbose-asm} switch, but that
17416 switch only records information in the assembler output file as
17417 comments, so it never reaches the object file.
17418
17419 @item -fpic
17420 @opindex fpic
17421 @cindex global offset table
17422 @cindex PIC
17423 Generate position-independent code (PIC) suitable for use in a shared
17424 library, if supported for the target machine.  Such code accesses all
17425 constant addresses through a global offset table (GOT)@.  The dynamic
17426 loader resolves the GOT entries when the program starts (the dynamic
17427 loader is not part of GCC; it is part of the operating system).  If
17428 the GOT size for the linked executable exceeds a machine-specific
17429 maximum size, you get an error message from the linker indicating that
17430 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
17431 instead.  (These maximums are 8k on the SPARC and 32k
17432 on the m68k and RS/6000.  The 386 has no such limit.)
17433
17434 Position-independent code requires special support, and therefore works
17435 only on certain machines.  For the 386, GCC supports PIC for System V
17436 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
17437 position-independent.
17438
17439 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17440 are defined to 1.
17441
17442 @item -fPIC
17443 @opindex fPIC
17444 If supported for the target machine, emit position-independent code,
17445 suitable for dynamic linking and avoiding any limit on the size of the
17446 global offset table.  This option makes a difference on the m68k,
17447 PowerPC and SPARC@.
17448
17449 Position-independent code requires special support, and therefore works
17450 only on certain machines.
17451
17452 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17453 are defined to 2.
17454
17455 @item -fpie
17456 @itemx -fPIE
17457 @opindex fpie
17458 @opindex fPIE
17459 These options are similar to @option{-fpic} and @option{-fPIC}, but
17460 generated position independent code can be only linked into executables.
17461 Usually these options are used when @option{-pie} GCC option will be
17462 used during linking.
17463
17464 @option{-fpie} and @option{-fPIE} both define the macros
17465 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
17466 for @option{-fpie} and 2 for @option{-fPIE}.
17467
17468 @item -fno-jump-tables
17469 @opindex fno-jump-tables
17470 Do not use jump tables for switch statements even where it would be
17471 more efficient than other code generation strategies.  This option is
17472 of use in conjunction with @option{-fpic} or @option{-fPIC} for
17473 building code which forms part of a dynamic linker and cannot
17474 reference the address of a jump table.  On some targets, jump tables
17475 do not require a GOT and this option is not needed.
17476
17477 @item -ffixed-@var{reg}
17478 @opindex ffixed
17479 Treat the register named @var{reg} as a fixed register; generated code
17480 should never refer to it (except perhaps as a stack pointer, frame
17481 pointer or in some other fixed role).
17482
17483 @var{reg} must be the name of a register.  The register names accepted
17484 are machine-specific and are defined in the @code{REGISTER_NAMES}
17485 macro in the machine description macro file.
17486
17487 This flag does not have a negative form, because it specifies a
17488 three-way choice.
17489
17490 @item -fcall-used-@var{reg}
17491 @opindex fcall-used
17492 Treat the register named @var{reg} as an allocable register that is
17493 clobbered by function calls.  It may be allocated for temporaries or
17494 variables that do not live across a call.  Functions compiled this way
17495 will not save and restore the register @var{reg}.
17496
17497 It is an error to used this flag with the frame pointer or stack pointer.
17498 Use of this flag for other registers that have fixed pervasive roles in
17499 the machine's execution model will produce disastrous results.
17500
17501 This flag does not have a negative form, because it specifies a
17502 three-way choice.
17503
17504 @item -fcall-saved-@var{reg}
17505 @opindex fcall-saved
17506 Treat the register named @var{reg} as an allocable register saved by
17507 functions.  It may be allocated even for temporaries or variables that
17508 live across a call.  Functions compiled this way will save and restore
17509 the register @var{reg} if they use it.
17510
17511 It is an error to used this flag with the frame pointer or stack pointer.
17512 Use of this flag for other registers that have fixed pervasive roles in
17513 the machine's execution model will produce disastrous results.
17514
17515 A different sort of disaster will result from the use of this flag for
17516 a register in which function values may be returned.
17517
17518 This flag does not have a negative form, because it specifies a
17519 three-way choice.
17520
17521 @item -fpack-struct[=@var{n}]
17522 @opindex fpack-struct
17523 Without a value specified, pack all structure members together without
17524 holes.  When a value is specified (which must be a small power of two), pack
17525 structure members according to this value, representing the maximum
17526 alignment (that is, objects with default alignment requirements larger than
17527 this will be output potentially unaligned at the next fitting location.
17528
17529 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
17530 code that is not binary compatible with code generated without that switch.
17531 Additionally, it makes the code suboptimal.
17532 Use it to conform to a non-default application binary interface.
17533
17534 @item -finstrument-functions
17535 @opindex finstrument-functions
17536 Generate instrumentation calls for entry and exit to functions.  Just
17537 after function entry and just before function exit, the following
17538 profiling functions will be called with the address of the current
17539 function and its call site.  (On some platforms,
17540 @code{__builtin_return_address} does not work beyond the current
17541 function, so the call site information may not be available to the
17542 profiling functions otherwise.)
17543
17544 @smallexample
17545 void __cyg_profile_func_enter (void *this_fn,
17546                                void *call_site);
17547 void __cyg_profile_func_exit  (void *this_fn,
17548                                void *call_site);
17549 @end smallexample
17550
17551 The first argument is the address of the start of the current function,
17552 which may be looked up exactly in the symbol table.
17553
17554 This instrumentation is also done for functions expanded inline in other
17555 functions.  The profiling calls will indicate where, conceptually, the
17556 inline function is entered and exited.  This means that addressable
17557 versions of such functions must be available.  If all your uses of a
17558 function are expanded inline, this may mean an additional expansion of
17559 code size.  If you use @samp{extern inline} in your C code, an
17560 addressable version of such functions must be provided.  (This is
17561 normally the case anyways, but if you get lucky and the optimizer always
17562 expands the functions inline, you might have gotten away without
17563 providing static copies.)
17564
17565 A function may be given the attribute @code{no_instrument_function}, in
17566 which case this instrumentation will not be done.  This can be used, for
17567 example, for the profiling functions listed above, high-priority
17568 interrupt routines, and any functions from which the profiling functions
17569 cannot safely be called (perhaps signal handlers, if the profiling
17570 routines generate output or allocate memory).
17571
17572 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
17573 @opindex finstrument-functions-exclude-file-list
17574
17575 Set the list of functions that are excluded from instrumentation (see
17576 the description of @code{-finstrument-functions}).  If the file that
17577 contains a function definition matches with one of @var{file}, then
17578 that function is not instrumented.  The match is done on substrings:
17579 if the @var{file} parameter is a substring of the file name, it is
17580 considered to be a match.
17581
17582 For example,
17583 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
17584 will exclude any inline function defined in files whose pathnames
17585 contain @code{/bits/stl} or @code{include/sys}.
17586
17587 If, for some reason, you want to include letter @code{','} in one of
17588 @var{sym}, write @code{'\,'}. For example,
17589 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
17590 (note the single quote surrounding the option).
17591
17592 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
17593 @opindex finstrument-functions-exclude-function-list
17594
17595 This is similar to @code{-finstrument-functions-exclude-file-list},
17596 but this option sets the list of function names to be excluded from
17597 instrumentation.  The function name to be matched is its user-visible
17598 name, such as @code{vector<int> blah(const vector<int> &)}, not the
17599 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
17600 match is done on substrings: if the @var{sym} parameter is a substring
17601 of the function name, it is considered to be a match.  For C99 and C++
17602 extended identifiers, the function name must be given in UTF-8, not
17603 using universal character names.
17604
17605 @item -fstack-check
17606 @opindex fstack-check
17607 Generate code to verify that you do not go beyond the boundary of the
17608 stack.  You should specify this flag if you are running in an
17609 environment with multiple threads, but only rarely need to specify it in
17610 a single-threaded environment since stack overflow is automatically
17611 detected on nearly all systems if there is only one stack.
17612
17613 Note that this switch does not actually cause checking to be done; the
17614 operating system or the language runtime must do that.  The switch causes
17615 generation of code to ensure that they see the stack being extended.
17616
17617 You can additionally specify a string parameter: @code{no} means no
17618 checking, @code{generic} means force the use of old-style checking,
17619 @code{specific} means use the best checking method and is equivalent
17620 to bare @option{-fstack-check}.
17621
17622 Old-style checking is a generic mechanism that requires no specific
17623 target support in the compiler but comes with the following drawbacks:
17624
17625 @enumerate
17626 @item
17627 Modified allocation strategy for large objects: they will always be
17628 allocated dynamically if their size exceeds a fixed threshold.
17629
17630 @item
17631 Fixed limit on the size of the static frame of functions: when it is
17632 topped by a particular function, stack checking is not reliable and
17633 a warning is issued by the compiler.
17634
17635 @item
17636 Inefficiency: because of both the modified allocation strategy and the
17637 generic implementation, the performances of the code are hampered.
17638 @end enumerate
17639
17640 Note that old-style stack checking is also the fallback method for
17641 @code{specific} if no target support has been added in the compiler.
17642
17643 @item -fstack-limit-register=@var{reg}
17644 @itemx -fstack-limit-symbol=@var{sym}
17645 @itemx -fno-stack-limit
17646 @opindex fstack-limit-register
17647 @opindex fstack-limit-symbol
17648 @opindex fno-stack-limit
17649 Generate code to ensure that the stack does not grow beyond a certain value,
17650 either the value of a register or the address of a symbol.  If the stack
17651 would grow beyond the value, a signal is raised.  For most targets,
17652 the signal is raised before the stack overruns the boundary, so
17653 it is possible to catch the signal without taking special precautions.
17654
17655 For instance, if the stack starts at absolute address @samp{0x80000000}
17656 and grows downwards, you can use the flags
17657 @option{-fstack-limit-symbol=__stack_limit} and
17658 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
17659 of 128KB@.  Note that this may only work with the GNU linker.
17660
17661 @item -fleading-underscore
17662 @opindex fleading-underscore
17663 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
17664 change the way C symbols are represented in the object file.  One use
17665 is to help link with legacy assembly code.
17666
17667 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
17668 generate code that is not binary compatible with code generated without that
17669 switch.  Use it to conform to a non-default application binary interface.
17670 Not all targets provide complete support for this switch.
17671
17672 @item -ftls-model=@var{model}
17673 @opindex ftls-model
17674 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
17675 The @var{model} argument should be one of @code{global-dynamic},
17676 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
17677
17678 The default without @option{-fpic} is @code{initial-exec}; with
17679 @option{-fpic} the default is @code{global-dynamic}.
17680
17681 @item -fvisibility=@var{default|internal|hidden|protected}
17682 @opindex fvisibility
17683 Set the default ELF image symbol visibility to the specified option---all
17684 symbols will be marked with this unless overridden within the code.
17685 Using this feature can very substantially improve linking and
17686 load times of shared object libraries, produce more optimized
17687 code, provide near-perfect API export and prevent symbol clashes.
17688 It is @strong{strongly} recommended that you use this in any shared objects
17689 you distribute.
17690
17691 Despite the nomenclature, @code{default} always means public ie;
17692 available to be linked against from outside the shared object.
17693 @code{protected} and @code{internal} are pretty useless in real-world
17694 usage so the only other commonly used option will be @code{hidden}.
17695 The default if @option{-fvisibility} isn't specified is
17696 @code{default}, i.e., make every
17697 symbol public---this causes the same behavior as previous versions of
17698 GCC@.
17699
17700 A good explanation of the benefits offered by ensuring ELF
17701 symbols have the correct visibility is given by ``How To Write
17702 Shared Libraries'' by Ulrich Drepper (which can be found at
17703 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
17704 solution made possible by this option to marking things hidden when
17705 the default is public is to make the default hidden and mark things
17706 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
17707 and @code{__attribute__ ((visibility("default")))} instead of
17708 @code{__declspec(dllexport)} you get almost identical semantics with
17709 identical syntax.  This is a great boon to those working with
17710 cross-platform projects.
17711
17712 For those adding visibility support to existing code, you may find
17713 @samp{#pragma GCC visibility} of use.  This works by you enclosing
17714 the declarations you wish to set visibility for with (for example)
17715 @samp{#pragma GCC visibility push(hidden)} and
17716 @samp{#pragma GCC visibility pop}.
17717 Bear in mind that symbol visibility should be viewed @strong{as
17718 part of the API interface contract} and thus all new code should
17719 always specify visibility when it is not the default ie; declarations
17720 only for use within the local DSO should @strong{always} be marked explicitly
17721 as hidden as so to avoid PLT indirection overheads---making this
17722 abundantly clear also aids readability and self-documentation of the code.
17723 Note that due to ISO C++ specification requirements, operator new and
17724 operator delete must always be of default visibility.
17725
17726 Be aware that headers from outside your project, in particular system
17727 headers and headers from any other library you use, may not be
17728 expecting to be compiled with visibility other than the default.  You
17729 may need to explicitly say @samp{#pragma GCC visibility push(default)}
17730 before including any such headers.
17731
17732 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
17733 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
17734 no modifications.  However, this means that calls to @samp{extern}
17735 functions with no explicit visibility will use the PLT, so it is more
17736 effective to use @samp{__attribute ((visibility))} and/or
17737 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
17738 declarations should be treated as hidden.
17739
17740 Note that @samp{-fvisibility} does affect C++ vague linkage
17741 entities. This means that, for instance, an exception class that will
17742 be thrown between DSOs must be explicitly marked with default
17743 visibility so that the @samp{type_info} nodes will be unified between
17744 the DSOs.
17745
17746 An overview of these techniques, their benefits and how to use them
17747 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
17748
17749 @item -fstrict-volatile-bitfields
17750 This option should be used if accesses to volatile bitfields (or other
17751 structure fields, although the compiler usually honors those types
17752 anyway) should use a single access in a mode of the same size as the
17753 container's type, aligned to a natural alignment if possible.  For
17754 example, targets with memory-mapped peripheral registers might require
17755 all such accesses to be 16 bits wide; with this flag the user could
17756 declare all peripheral bitfields as ``unsigned short'' (assuming short
17757 is 16 bits on these targets) to force GCC to use 16 bit accesses
17758 instead of, perhaps, a more efficient 32 bit access.
17759
17760 If this option is disabled, the compiler will use the most efficient
17761 instruction.  In the previous example, that might be a 32-bit load
17762 instruction, even though that will access bytes that do not contain
17763 any portion of the bitfield, or memory-mapped registers unrelated to
17764 the one being updated.
17765
17766 If the target requires strict alignment, and honoring the container
17767 type would require violating this alignment, a warning is issued.
17768 However, the access happens as the user requested, under the
17769 assumption that the user knows something about the target hardware
17770 that GCC is unaware of.
17771
17772 The default value of this option is determined by the application binary
17773 interface for the target processor.
17774
17775 @end table
17776
17777 @c man end
17778
17779 @node Environment Variables
17780 @section Environment Variables Affecting GCC
17781 @cindex environment variables
17782
17783 @c man begin ENVIRONMENT
17784 This section describes several environment variables that affect how GCC
17785 operates.  Some of them work by specifying directories or prefixes to use
17786 when searching for various kinds of files.  Some are used to specify other
17787 aspects of the compilation environment.
17788
17789 Note that you can also specify places to search using options such as
17790 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
17791 take precedence over places specified using environment variables, which
17792 in turn take precedence over those specified by the configuration of GCC@.
17793 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
17794 GNU Compiler Collection (GCC) Internals}.
17795
17796 @table @env
17797 @item LANG
17798 @itemx LC_CTYPE
17799 @c @itemx LC_COLLATE
17800 @itemx LC_MESSAGES
17801 @c @itemx LC_MONETARY
17802 @c @itemx LC_NUMERIC
17803 @c @itemx LC_TIME
17804 @itemx LC_ALL
17805 @findex LANG
17806 @findex LC_CTYPE
17807 @c @findex LC_COLLATE
17808 @findex LC_MESSAGES
17809 @c @findex LC_MONETARY
17810 @c @findex LC_NUMERIC
17811 @c @findex LC_TIME
17812 @findex LC_ALL
17813 @cindex locale
17814 These environment variables control the way that GCC uses
17815 localization information that allow GCC to work with different
17816 national conventions.  GCC inspects the locale categories
17817 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
17818 so.  These locale categories can be set to any value supported by your
17819 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
17820 Kingdom encoded in UTF-8.
17821
17822 The @env{LC_CTYPE} environment variable specifies character
17823 classification.  GCC uses it to determine the character boundaries in
17824 a string; this is needed for some multibyte encodings that contain quote
17825 and escape characters that would otherwise be interpreted as a string
17826 end or escape.
17827
17828 The @env{LC_MESSAGES} environment variable specifies the language to
17829 use in diagnostic messages.
17830
17831 If the @env{LC_ALL} environment variable is set, it overrides the value
17832 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
17833 and @env{LC_MESSAGES} default to the value of the @env{LANG}
17834 environment variable.  If none of these variables are set, GCC
17835 defaults to traditional C English behavior.
17836
17837 @item TMPDIR
17838 @findex TMPDIR
17839 If @env{TMPDIR} is set, it specifies the directory to use for temporary
17840 files.  GCC uses temporary files to hold the output of one stage of
17841 compilation which is to be used as input to the next stage: for example,
17842 the output of the preprocessor, which is the input to the compiler
17843 proper.
17844
17845 @item GCC_EXEC_PREFIX
17846 @findex GCC_EXEC_PREFIX
17847 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
17848 names of the subprograms executed by the compiler.  No slash is added
17849 when this prefix is combined with the name of a subprogram, but you can
17850 specify a prefix that ends with a slash if you wish.
17851
17852 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
17853 an appropriate prefix to use based on the pathname it was invoked with.
17854
17855 If GCC cannot find the subprogram using the specified prefix, it
17856 tries looking in the usual places for the subprogram.
17857
17858 The default value of @env{GCC_EXEC_PREFIX} is
17859 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
17860 the installed compiler. In many cases @var{prefix} is the value
17861 of @code{prefix} when you ran the @file{configure} script.
17862
17863 Other prefixes specified with @option{-B} take precedence over this prefix.
17864
17865 This prefix is also used for finding files such as @file{crt0.o} that are
17866 used for linking.
17867
17868 In addition, the prefix is used in an unusual way in finding the
17869 directories to search for header files.  For each of the standard
17870 directories whose name normally begins with @samp{/usr/local/lib/gcc}
17871 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
17872 replacing that beginning with the specified prefix to produce an
17873 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
17874 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
17875 These alternate directories are searched first; the standard directories
17876 come next. If a standard directory begins with the configured
17877 @var{prefix} then the value of @var{prefix} is replaced by
17878 @env{GCC_EXEC_PREFIX} when looking for header files.
17879
17880 @item COMPILER_PATH
17881 @findex COMPILER_PATH
17882 The value of @env{COMPILER_PATH} is a colon-separated list of
17883 directories, much like @env{PATH}.  GCC tries the directories thus
17884 specified when searching for subprograms, if it can't find the
17885 subprograms using @env{GCC_EXEC_PREFIX}.
17886
17887 @item LIBRARY_PATH
17888 @findex LIBRARY_PATH
17889 The value of @env{LIBRARY_PATH} is a colon-separated list of
17890 directories, much like @env{PATH}.  When configured as a native compiler,
17891 GCC tries the directories thus specified when searching for special
17892 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
17893 using GCC also uses these directories when searching for ordinary
17894 libraries for the @option{-l} option (but directories specified with
17895 @option{-L} come first).
17896
17897 @item LANG
17898 @findex LANG
17899 @cindex locale definition
17900 This variable is used to pass locale information to the compiler.  One way in
17901 which this information is used is to determine the character set to be used
17902 when character literals, string literals and comments are parsed in C and C++.
17903 When the compiler is configured to allow multibyte characters,
17904 the following values for @env{LANG} are recognized:
17905
17906 @table @samp
17907 @item C-JIS
17908 Recognize JIS characters.
17909 @item C-SJIS
17910 Recognize SJIS characters.
17911 @item C-EUCJP
17912 Recognize EUCJP characters.
17913 @end table
17914
17915 If @env{LANG} is not defined, or if it has some other value, then the
17916 compiler will use mblen and mbtowc as defined by the default locale to
17917 recognize and translate multibyte characters.
17918 @end table
17919
17920 @noindent
17921 Some additional environments variables affect the behavior of the
17922 preprocessor.
17923
17924 @include cppenv.texi
17925
17926 @c man end
17927
17928 @node Precompiled Headers
17929 @section Using Precompiled Headers
17930 @cindex precompiled headers
17931 @cindex speed of compilation
17932
17933 Often large projects have many header files that are included in every
17934 source file.  The time the compiler takes to process these header files
17935 over and over again can account for nearly all of the time required to
17936 build the project.  To make builds faster, GCC allows users to
17937 `precompile' a header file; then, if builds can use the precompiled
17938 header file they will be much faster.
17939
17940 To create a precompiled header file, simply compile it as you would any
17941 other file, if necessary using the @option{-x} option to make the driver
17942 treat it as a C or C++ header file.  You will probably want to use a
17943 tool like @command{make} to keep the precompiled header up-to-date when
17944 the headers it contains change.
17945
17946 A precompiled header file will be searched for when @code{#include} is
17947 seen in the compilation.  As it searches for the included file
17948 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
17949 compiler looks for a precompiled header in each directory just before it
17950 looks for the include file in that directory.  The name searched for is
17951 the name specified in the @code{#include} with @samp{.gch} appended.  If
17952 the precompiled header file can't be used, it is ignored.
17953
17954 For instance, if you have @code{#include "all.h"}, and you have
17955 @file{all.h.gch} in the same directory as @file{all.h}, then the
17956 precompiled header file will be used if possible, and the original
17957 header will be used otherwise.
17958
17959 Alternatively, you might decide to put the precompiled header file in a
17960 directory and use @option{-I} to ensure that directory is searched
17961 before (or instead of) the directory containing the original header.
17962 Then, if you want to check that the precompiled header file is always
17963 used, you can put a file of the same name as the original header in this
17964 directory containing an @code{#error} command.
17965
17966 This also works with @option{-include}.  So yet another way to use
17967 precompiled headers, good for projects not designed with precompiled
17968 header files in mind, is to simply take most of the header files used by
17969 a project, include them from another header file, precompile that header
17970 file, and @option{-include} the precompiled header.  If the header files
17971 have guards against multiple inclusion, they will be skipped because
17972 they've already been included (in the precompiled header).
17973
17974 If you need to precompile the same header file for different
17975 languages, targets, or compiler options, you can instead make a
17976 @emph{directory} named like @file{all.h.gch}, and put each precompiled
17977 header in the directory, perhaps using @option{-o}.  It doesn't matter
17978 what you call the files in the directory, every precompiled header in
17979 the directory will be considered.  The first precompiled header
17980 encountered in the directory that is valid for this compilation will
17981 be used; they're searched in no particular order.
17982
17983 There are many other possibilities, limited only by your imagination,
17984 good sense, and the constraints of your build system.
17985
17986 A precompiled header file can be used only when these conditions apply:
17987
17988 @itemize
17989 @item
17990 Only one precompiled header can be used in a particular compilation.
17991
17992 @item
17993 A precompiled header can't be used once the first C token is seen.  You
17994 can have preprocessor directives before a precompiled header; you can
17995 even include a precompiled header from inside another header, so long as
17996 there are no C tokens before the @code{#include}.
17997
17998 @item
17999 The precompiled header file must be produced for the same language as
18000 the current compilation.  You can't use a C precompiled header for a C++
18001 compilation.
18002
18003 @item
18004 The precompiled header file must have been produced by the same compiler
18005 binary as the current compilation is using.
18006
18007 @item
18008 Any macros defined before the precompiled header is included must
18009 either be defined in the same way as when the precompiled header was
18010 generated, or must not affect the precompiled header, which usually
18011 means that they don't appear in the precompiled header at all.
18012
18013 The @option{-D} option is one way to define a macro before a
18014 precompiled header is included; using a @code{#define} can also do it.
18015 There are also some options that define macros implicitly, like
18016 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
18017 defined this way.
18018
18019 @item If debugging information is output when using the precompiled
18020 header, using @option{-g} or similar, the same kind of debugging information
18021 must have been output when building the precompiled header.  However,
18022 a precompiled header built using @option{-g} can be used in a compilation
18023 when no debugging information is being output.
18024
18025 @item The same @option{-m} options must generally be used when building
18026 and using the precompiled header.  @xref{Submodel Options},
18027 for any cases where this rule is relaxed.
18028
18029 @item Each of the following options must be the same when building and using
18030 the precompiled header:
18031
18032 @gccoptlist{-fexceptions}
18033
18034 @item
18035 Some other command-line options starting with @option{-f},
18036 @option{-p}, or @option{-O} must be defined in the same way as when
18037 the precompiled header was generated.  At present, it's not clear
18038 which options are safe to change and which are not; the safest choice
18039 is to use exactly the same options when generating and using the
18040 precompiled header.  The following are known to be safe:
18041
18042 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
18043 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
18044 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
18045 -pedantic-errors}
18046
18047 @end itemize
18048
18049 For all of these except the last, the compiler will automatically
18050 ignore the precompiled header if the conditions aren't met.  If you
18051 find an option combination that doesn't work and doesn't cause the
18052 precompiled header to be ignored, please consider filing a bug report,
18053 see @ref{Bugs}.
18054
18055 If you do use differing options when generating and using the
18056 precompiled header, the actual behavior will be a mixture of the
18057 behavior for the options.  For instance, if you use @option{-g} to
18058 generate the precompiled header but not when using it, you may or may
18059 not get debugging information for routines in the precompiled header.