OSDN Git Service

* common.opt (fwhopr=): Update for -fwhopr=jobserver
[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  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
264 -Wuninitialized  -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 -fstack-usage  -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 -fgraphite-identity @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 @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 -ftree-bit-ccp @gol
384 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
385 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
386 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
387 -ftree-loop-if-convert-memory-writes -ftree-loop-im @gol
388 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
389 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
390 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
391 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
392 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
393 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
394 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
395 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
396 -fwhole-program -fwhopr[=@var{n}] -fwpa -fuse-linker-plugin @gol
397 --param @var{name}=@var{value}
398 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
399
400 @item Preprocessor Options
401 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
402 @gccoptlist{-A@var{question}=@var{answer} @gol
403 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
404 -C  -dD  -dI  -dM  -dN @gol
405 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
406 -idirafter @var{dir} @gol
407 -include @var{file}  -imacros @var{file} @gol
408 -iprefix @var{file}  -iwithprefix @var{dir} @gol
409 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
410 -imultilib @var{dir} -isysroot @var{dir} @gol
411 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
412 -P  -fworking-directory  -remap @gol
413 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
414 -Xpreprocessor @var{option}}
415
416 @item Assembler Option
417 @xref{Assembler Options,,Passing Options to the Assembler}.
418 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
419
420 @item Linker Options
421 @xref{Link Options,,Options for Linking}.
422 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
423 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
424 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
425 -shared-libgcc  -symbolic @gol
426 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
427 -u @var{symbol}}
428
429 @item Directory Options
430 @xref{Directory Options,,Options for Directory Search}.
431 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir}}
432 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I-
433 --sysroot=@var{dir}
434
435 @item Machine Dependent Options
436 @xref{Submodel Options,,Hardware Models and Configurations}.
437 @c This list is ordered alphanumerically by subsection name.
438 @c Try and put the significant identifier (CPU or system) first,
439 @c so users have a clue at guessing where the ones they want will be.
440
441 @emph{ARC Options}
442 @gccoptlist{-EB  -EL @gol
443 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
444 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
445
446 @emph{ARM Options}
447 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
448 -mabi=@var{name} @gol
449 -mapcs-stack-check  -mno-apcs-stack-check @gol
450 -mapcs-float  -mno-apcs-float @gol
451 -mapcs-reentrant  -mno-apcs-reentrant @gol
452 -msched-prolog  -mno-sched-prolog @gol
453 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
454 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
455 -mfp16-format=@var{name}
456 -mthumb-interwork  -mno-thumb-interwork @gol
457 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
458 -mstructure-size-boundary=@var{n} @gol
459 -mabort-on-noreturn @gol
460 -mlong-calls  -mno-long-calls @gol
461 -msingle-pic-base  -mno-single-pic-base @gol
462 -mpic-register=@var{reg} @gol
463 -mnop-fun-dllimport @gol
464 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
465 -mpoke-function-name @gol
466 -mthumb  -marm @gol
467 -mtpcs-frame  -mtpcs-leaf-frame @gol
468 -mcaller-super-interworking  -mcallee-super-interworking @gol
469 -mtp=@var{name} @gol
470 -mword-relocations @gol
471 -mfix-cortex-m3-ldrd}
472
473 @emph{AVR Options}
474 @gccoptlist{-mmcu=@var{mcu}  -mno-interrupts @gol
475 -mcall-prologues  -mtiny-stack  -mint8}
476
477 @emph{Blackfin Options}
478 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
479 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
480 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
481 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
482 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
483 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
484 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
485 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
486 -micplb}
487
488 @emph{CRIS Options}
489 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
490 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
491 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
492 -mstack-align  -mdata-align  -mconst-align @gol
493 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
494 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
495 -mmul-bug-workaround  -mno-mul-bug-workaround}
496
497 @emph{CRX Options}
498 @gccoptlist{-mmac -mpush-args}
499
500 @emph{Darwin Options}
501 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
502 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
503 -client_name  -compatibility_version  -current_version @gol
504 -dead_strip @gol
505 -dependency-file  -dylib_file  -dylinker_install_name @gol
506 -dynamic  -dynamiclib  -exported_symbols_list @gol
507 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
508 -force_flat_namespace  -headerpad_max_install_names @gol
509 -iframework @gol
510 -image_base  -init  -install_name  -keep_private_externs @gol
511 -multi_module  -multiply_defined  -multiply_defined_unused @gol
512 -noall_load   -no_dead_strip_inits_and_terms @gol
513 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
514 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
515 -private_bundle  -read_only_relocs  -sectalign @gol
516 -sectobjectsymbols  -whyload  -seg1addr @gol
517 -sectcreate  -sectobjectsymbols  -sectorder @gol
518 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
519 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
520 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
521 -single_module  -static  -sub_library  -sub_umbrella @gol
522 -twolevel_namespace  -umbrella  -undefined @gol
523 -unexported_symbols_list  -weak_reference_mismatches @gol
524 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
525 -mkernel -mone-byte-bool}
526
527 @emph{DEC Alpha Options}
528 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
529 -mieee  -mieee-with-inexact  -mieee-conformant @gol
530 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
531 -mtrap-precision=@var{mode}  -mbuild-constants @gol
532 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
533 -mbwx  -mmax  -mfix  -mcix @gol
534 -mfloat-vax  -mfloat-ieee @gol
535 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
536 -msmall-text  -mlarge-text @gol
537 -mmemory-latency=@var{time}}
538
539 @emph{DEC Alpha/VMS Options}
540 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
541
542 @emph{FR30 Options}
543 @gccoptlist{-msmall-model -mno-lsim}
544
545 @emph{FRV Options}
546 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
547 -mhard-float  -msoft-float @gol
548 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
549 -mdouble  -mno-double @gol
550 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
551 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
552 -mlinked-fp  -mlong-calls  -malign-labels @gol
553 -mlibrary-pic  -macc-4  -macc-8 @gol
554 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
555 -moptimize-membar -mno-optimize-membar @gol
556 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
557 -mvliw-branch  -mno-vliw-branch @gol
558 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
559 -mno-nested-cond-exec  -mtomcat-stats @gol
560 -mTLS -mtls @gol
561 -mcpu=@var{cpu}}
562
563 @emph{GNU/Linux Options}
564 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
565 -tno-android-cc -tno-android-ld}
566
567 @emph{H8/300 Options}
568 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
569
570 @emph{HPPA Options}
571 @gccoptlist{-march=@var{architecture-type} @gol
572 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
573 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
574 -mfixed-range=@var{register-range} @gol
575 -mjump-in-delay -mlinker-opt -mlong-calls @gol
576 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
577 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
578 -mno-jump-in-delay  -mno-long-load-store @gol
579 -mno-portable-runtime  -mno-soft-float @gol
580 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
581 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
582 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
583 -munix=@var{unix-std}  -nolibdld  -static  -threads}
584
585 @emph{i386 and x86-64 Options}
586 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
587 -mfpmath=@var{unit} @gol
588 -masm=@var{dialect}  -mno-fancy-math-387 @gol
589 -mno-fp-ret-in-387  -msoft-float @gol
590 -mno-wide-multiply  -mrtd  -malign-double @gol
591 -mpreferred-stack-boundary=@var{num}
592 -mincoming-stack-boundary=@var{num}
593 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip @gol
594 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
595 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfused-madd @gol
596 -msse4a -m3dnow -mpopcnt -mabm -mfma4 -mxop -mlwp @gol
597 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
598 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
599 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
600 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
601 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
602 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
603 -mcmodel=@var{code-model} -mabi=@var{name} @gol
604 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
605 -msse2avx -mfentry}
606
607 @emph{IA-64 Options}
608 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
609 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
610 -mconstant-gp  -mauto-pic  -mfused-madd @gol
611 -minline-float-divide-min-latency @gol
612 -minline-float-divide-max-throughput @gol
613 -mno-inline-float-divide @gol
614 -minline-int-divide-min-latency @gol
615 -minline-int-divide-max-throughput  @gol
616 -mno-inline-int-divide @gol
617 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
618 -mno-inline-sqrt @gol
619 -mdwarf2-asm -mearly-stop-bits @gol
620 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
621 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
622 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
623 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
624 -msched-spec-ldc -msched-spec-control-ldc @gol
625 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
626 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
627 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
628 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
629
630 @emph{IA-64/VMS Options}
631 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
632
633 @emph{LM32 Options}
634 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
635 -msign-extend-enabled -muser-enabled}
636
637 @emph{M32R/D Options}
638 @gccoptlist{-m32r2 -m32rx -m32r @gol
639 -mdebug @gol
640 -malign-loops -mno-align-loops @gol
641 -missue-rate=@var{number} @gol
642 -mbranch-cost=@var{number} @gol
643 -mmodel=@var{code-size-model-type} @gol
644 -msdata=@var{sdata-type} @gol
645 -mno-flush-func -mflush-func=@var{name} @gol
646 -mno-flush-trap -mflush-trap=@var{number} @gol
647 -G @var{num}}
648
649 @emph{M32C Options}
650 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
651
652 @emph{M680x0 Options}
653 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
654 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
655 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
656 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
657 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
658 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
659 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
660 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
661 -mxgot -mno-xgot}
662
663 @emph{M68hc1x Options}
664 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
665 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
666 -msoft-reg-count=@var{count}}
667
668 @emph{MCore Options}
669 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
670 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
671 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
672 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
673 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
674
675 @emph{MeP Options}
676 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
677 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
678 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
679 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
680 -mtiny=@var{n}}
681
682 @emph{MIPS Options}
683 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
684 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
685 -mips64  -mips64r2 @gol
686 -mips16  -mno-mips16  -mflip-mips16 @gol
687 -minterlink-mips16  -mno-interlink-mips16 @gol
688 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
689 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
690 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
691 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
692 -mfpu=@var{fpu-type} @gol
693 -msmartmips  -mno-smartmips @gol
694 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
695 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
696 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
697 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
698 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
699 -membedded-data  -mno-embedded-data @gol
700 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
701 -mcode-readable=@var{setting} @gol
702 -msplit-addresses  -mno-split-addresses @gol
703 -mexplicit-relocs  -mno-explicit-relocs @gol
704 -mcheck-zero-division  -mno-check-zero-division @gol
705 -mdivide-traps  -mdivide-breaks @gol
706 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
707 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
708 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
709 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
710 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
711 -mflush-func=@var{func}  -mno-flush-func @gol
712 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
713 -mfp-exceptions -mno-fp-exceptions @gol
714 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
715 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
716
717 @emph{MMIX Options}
718 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
719 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
720 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
721 -mno-base-addresses  -msingle-exit  -mno-single-exit}
722
723 @emph{MN10300 Options}
724 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
725 -mam33  -mno-am33 @gol
726 -mam33-2  -mno-am33-2 @gol
727 -mreturn-pointer-on-d0 @gol
728 -mno-crt0  -mrelax}
729
730 @emph{PDP-11 Options}
731 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
732 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
733 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
734 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
735 -mbranch-expensive  -mbranch-cheap @gol
736 -msplit  -mno-split  -munix-asm  -mdec-asm}
737
738 @emph{picoChip Options}
739 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
740 -msymbol-as-address -mno-inefficient-warnings}
741
742 @emph{PowerPC Options}
743 See RS/6000 and PowerPC Options.
744
745 @emph{RS/6000 and PowerPC Options}
746 @gccoptlist{-mcpu=@var{cpu-type} @gol
747 -mtune=@var{cpu-type} @gol
748 -mcmodel=@var{code-model} @gol
749 -mpower  -mno-power  -mpower2  -mno-power2 @gol
750 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
751 -maltivec  -mno-altivec @gol
752 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
753 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
754 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
755 -mfprnd  -mno-fprnd @gol
756 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
757 -mnew-mnemonics  -mold-mnemonics @gol
758 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
759 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
760 -malign-power  -malign-natural @gol
761 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
762 -msingle-float -mdouble-float -msimple-fpu @gol
763 -mstring  -mno-string  -mupdate  -mno-update @gol
764 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
765 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
766 -mstrict-align  -mno-strict-align  -mrelocatable @gol
767 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
768 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
769 -mdynamic-no-pic  -maltivec -mswdiv @gol
770 -mprioritize-restricted-insns=@var{priority} @gol
771 -msched-costly-dep=@var{dependence_type} @gol
772 -minsert-sched-nops=@var{scheme} @gol
773 -mcall-sysv  -mcall-netbsd @gol
774 -maix-struct-return  -msvr4-struct-return @gol
775 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
776 -mblock-move-inline-limit=@var{num} @gol
777 -misel -mno-isel @gol
778 -misel=yes  -misel=no @gol
779 -mspe -mno-spe @gol
780 -mspe=yes  -mspe=no @gol
781 -mpaired @gol
782 -mgen-cell-microcode -mwarn-cell-microcode @gol
783 -mvrsave -mno-vrsave @gol
784 -mmulhw -mno-mulhw @gol
785 -mdlmzb -mno-dlmzb @gol
786 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
787 -mprototype  -mno-prototype @gol
788 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
789 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
790 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision
791 -mno-recip-precision @gol
792 -mveclibabi=@var{type}}
793
794 @emph{RX Options}
795 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
796 -mcpu=@gol
797 -mbig-endian-data -mlittle-endian-data @gol
798 -msmall-data @gol
799 -msim  -mno-sim@gol
800 -mas100-syntax -mno-as100-syntax@gol
801 -mrelax@gol
802 -mmax-constant-size=@gol
803 -mint-register=@gol
804 -msave-acc-in-interrupts}
805
806 @emph{S/390 and zSeries Options}
807 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
808 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
809 -mlong-double-64 -mlong-double-128 @gol
810 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
811 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
812 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
813 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
814 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
815
816 @emph{Score Options}
817 @gccoptlist{-meb -mel @gol
818 -mnhwloop @gol
819 -muls @gol
820 -mmac @gol
821 -mscore5 -mscore5u -mscore7 -mscore7d}
822
823 @emph{SH Options}
824 @gccoptlist{-m1  -m2  -m2e @gol
825 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
826 -m3  -m3e @gol
827 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
828 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
829 -m5-64media  -m5-64media-nofpu @gol
830 -m5-32media  -m5-32media-nofpu @gol
831 -m5-compact  -m5-compact-nofpu @gol
832 -mb  -ml  -mdalign  -mrelax @gol
833 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
834 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
835 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
836 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
837 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
838 -maccumulate-outgoing-args -minvalid-symbols}
839
840 @emph{SPARC Options}
841 @gccoptlist{-mcpu=@var{cpu-type} @gol
842 -mtune=@var{cpu-type} @gol
843 -mcmodel=@var{code-model} @gol
844 -m32  -m64  -mapp-regs  -mno-app-regs @gol
845 -mfaster-structs  -mno-faster-structs @gol
846 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
847 -mhard-quad-float  -msoft-quad-float @gol
848 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
849 -mstack-bias  -mno-stack-bias @gol
850 -munaligned-doubles  -mno-unaligned-doubles @gol
851 -mv8plus  -mno-v8plus  -mvis  -mno-vis
852 -threads -pthreads -pthread}
853
854 @emph{SPU Options}
855 @gccoptlist{-mwarn-reloc -merror-reloc @gol
856 -msafe-dma -munsafe-dma @gol
857 -mbranch-hints @gol
858 -msmall-mem -mlarge-mem -mstdmain @gol
859 -mfixed-range=@var{register-range} @gol
860 -mea32 -mea64 @gol
861 -maddress-space-conversion -mno-address-space-conversion @gol
862 -mcache-size=@var{cache-size} @gol
863 -matomic-updates -mno-atomic-updates}
864
865 @emph{System V Options}
866 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
867
868 @emph{V850 Options}
869 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
870 -mprolog-function  -mno-prolog-function  -mspace @gol
871 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
872 -mapp-regs  -mno-app-regs @gol
873 -mdisable-callt  -mno-disable-callt @gol
874 -mv850e2v3 @gol
875 -mv850e2 @gol
876 -mv850e1 @gol
877 -mv850e @gol
878 -mv850  -mbig-switch}
879
880 @emph{VAX Options}
881 @gccoptlist{-mg  -mgnu  -munix}
882
883 @emph{VxWorks Options}
884 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
885 -Xbind-lazy  -Xbind-now}
886
887 @emph{x86-64 Options}
888 See i386 and x86-64 Options.
889
890 @emph{i386 and x86-64 Windows Options}
891 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
892 -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows
893 -fno-set-stack-executable}
894
895 @emph{Xstormy16 Options}
896 @gccoptlist{-msim}
897
898 @emph{Xtensa Options}
899 @gccoptlist{-mconst16 -mno-const16 @gol
900 -mfused-madd  -mno-fused-madd @gol
901 -mforce-no-pic @gol
902 -mserialize-volatile  -mno-serialize-volatile @gol
903 -mtext-section-literals  -mno-text-section-literals @gol
904 -mtarget-align  -mno-target-align @gol
905 -mlongcalls  -mno-longcalls}
906
907 @emph{zSeries Options}
908 See S/390 and zSeries Options.
909
910 @item Code Generation Options
911 @xref{Code Gen Options,,Options for Code Generation Conventions}.
912 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
913 -ffixed-@var{reg}  -fexceptions @gol
914 -fnon-call-exceptions  -funwind-tables @gol
915 -fasynchronous-unwind-tables @gol
916 -finhibit-size-directive  -finstrument-functions @gol
917 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
918 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
919 -fno-common  -fno-ident @gol
920 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
921 -fno-jump-tables @gol
922 -frecord-gcc-switches @gol
923 -freg-struct-return  -fshort-enums @gol
924 -fshort-double  -fshort-wchar @gol
925 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
926 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
927 -fno-stack-limit @gol
928 -fleading-underscore  -ftls-model=@var{model} @gol
929 -ftrapv  -fwrapv  -fbounds-check @gol
930 -fvisibility}
931 @end table
932
933 @menu
934 * Overall Options::     Controlling the kind of output:
935                         an executable, object files, assembler files,
936                         or preprocessed source.
937 * C Dialect Options::   Controlling the variant of C language compiled.
938 * C++ Dialect Options:: Variations on C++.
939 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
940                         and Objective-C++.
941 * Language Independent Options:: Controlling how diagnostics should be
942                         formatted.
943 * Warning Options::     How picky should the compiler be?
944 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
945 * Optimize Options::    How much optimization?
946 * Preprocessor Options:: Controlling header files and macro definitions.
947                          Also, getting dependency information for Make.
948 * Assembler Options::   Passing options to the assembler.
949 * Link Options::        Specifying libraries and so on.
950 * Directory Options::   Where to find header files and libraries.
951                         Where to find the compiler executable files.
952 * Spec Files::          How to pass switches to sub-processes.
953 * Target Options::      Running a cross-compiler, or an old version of GCC.
954 @end menu
955
956 @node Overall Options
957 @section Options Controlling the Kind of Output
958
959 Compilation can involve up to four stages: preprocessing, compilation
960 proper, assembly and linking, always in that order.  GCC is capable of
961 preprocessing and compiling several files either into several
962 assembler input files, or into one assembler input file; then each
963 assembler input file produces an object file, and linking combines all
964 the object files (those newly compiled, and those specified as input)
965 into an executable file.
966
967 @cindex file name suffix
968 For any given input file, the file name suffix determines what kind of
969 compilation is done:
970
971 @table @gcctabopt
972 @item @var{file}.c
973 C source code which must be preprocessed.
974
975 @item @var{file}.i
976 C source code which should not be preprocessed.
977
978 @item @var{file}.ii
979 C++ source code which should not be preprocessed.
980
981 @item @var{file}.m
982 Objective-C source code.  Note that you must link with the @file{libobjc}
983 library to make an Objective-C program work.
984
985 @item @var{file}.mi
986 Objective-C source code which should not be preprocessed.
987
988 @item @var{file}.mm
989 @itemx @var{file}.M
990 Objective-C++ source code.  Note that you must link with the @file{libobjc}
991 library to make an Objective-C++ program work.  Note that @samp{.M} refers
992 to a literal capital M@.
993
994 @item @var{file}.mii
995 Objective-C++ source code which should not be preprocessed.
996
997 @item @var{file}.h
998 C, C++, Objective-C or Objective-C++ header file to be turned into a
999 precompiled header (default), or C, C++ header file to be turned into an
1000 Ada spec (via the @option{-fdump-ada-spec} switch).
1001
1002 @item @var{file}.cc
1003 @itemx @var{file}.cp
1004 @itemx @var{file}.cxx
1005 @itemx @var{file}.cpp
1006 @itemx @var{file}.CPP
1007 @itemx @var{file}.c++
1008 @itemx @var{file}.C
1009 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
1010 the last two letters must both be literally @samp{x}.  Likewise,
1011 @samp{.C} refers to a literal capital C@.
1012
1013 @item @var{file}.mm
1014 @itemx @var{file}.M
1015 Objective-C++ source code which must be preprocessed.
1016
1017 @item @var{file}.mii
1018 Objective-C++ source code which should not be preprocessed.
1019
1020 @item @var{file}.hh
1021 @itemx @var{file}.H
1022 @itemx @var{file}.hp
1023 @itemx @var{file}.hxx
1024 @itemx @var{file}.hpp
1025 @itemx @var{file}.HPP
1026 @itemx @var{file}.h++
1027 @itemx @var{file}.tcc
1028 C++ header file to be turned into a precompiled header or Ada spec.
1029
1030 @item @var{file}.f
1031 @itemx @var{file}.for
1032 @itemx @var{file}.ftn
1033 Fixed form Fortran source code which should not be preprocessed.
1034
1035 @item @var{file}.F
1036 @itemx @var{file}.FOR
1037 @itemx @var{file}.fpp
1038 @itemx @var{file}.FPP
1039 @itemx @var{file}.FTN
1040 Fixed form Fortran source code which must be preprocessed (with the traditional
1041 preprocessor).
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 should not be preprocessed.
1048
1049 @item @var{file}.F90
1050 @itemx @var{file}.F95
1051 @itemx @var{file}.F03
1052 @itemx @var{file}.F08
1053 Free form Fortran source code which must be preprocessed (with the
1054 traditional preprocessor).
1055
1056 @c FIXME: Descriptions of Java file types.
1057 @c @var{file}.java
1058 @c @var{file}.class
1059 @c @var{file}.zip
1060 @c @var{file}.jar
1061
1062 @item @var{file}.ads
1063 Ada source code file which contains a library unit declaration (a
1064 declaration of a package, subprogram, or generic, or a generic
1065 instantiation), or a library unit renaming declaration (a package,
1066 generic, or subprogram renaming declaration).  Such files are also
1067 called @dfn{specs}.
1068
1069 @item @var{file}.adb
1070 Ada source code file containing a library unit body (a subprogram or
1071 package body).  Such files are also called @dfn{bodies}.
1072
1073 @c GCC also knows about some suffixes for languages not yet included:
1074 @c Pascal:
1075 @c @var{file}.p
1076 @c @var{file}.pas
1077 @c Ratfor:
1078 @c @var{file}.r
1079
1080 @item @var{file}.s
1081 Assembler code.
1082
1083 @item @var{file}.S
1084 @itemx @var{file}.sx
1085 Assembler code which must be preprocessed.
1086
1087 @item @var{other}
1088 An object file to be fed straight into linking.
1089 Any file name with no recognized suffix is treated this way.
1090 @end table
1091
1092 @opindex x
1093 You can specify the input language explicitly with the @option{-x} option:
1094
1095 @table @gcctabopt
1096 @item -x @var{language}
1097 Specify explicitly the @var{language} for the following input files
1098 (rather than letting the compiler choose a default based on the file
1099 name suffix).  This option applies to all following input files until
1100 the next @option{-x} option.  Possible values for @var{language} are:
1101 @smallexample
1102 c  c-header  c-cpp-output
1103 c++  c++-header  c++-cpp-output
1104 objective-c  objective-c-header  objective-c-cpp-output
1105 objective-c++ objective-c++-header objective-c++-cpp-output
1106 assembler  assembler-with-cpp
1107 ada
1108 f77  f77-cpp-input f95  f95-cpp-input
1109 java
1110 @end smallexample
1111
1112 @item -x none
1113 Turn off any specification of a language, so that subsequent files are
1114 handled according to their file name suffixes (as they are if @option{-x}
1115 has not been used at all).
1116
1117 @item -pass-exit-codes
1118 @opindex pass-exit-codes
1119 Normally the @command{gcc} program will exit with the code of 1 if any
1120 phase of the compiler returns a non-success return code.  If you specify
1121 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1122 numerically highest error produced by any phase that returned an error
1123 indication.  The C, C++, and Fortran frontends return 4, if an internal
1124 compiler error is encountered.
1125 @end table
1126
1127 If you only want some of the stages of compilation, you can use
1128 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1129 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1130 @command{gcc} is to stop.  Note that some combinations (for example,
1131 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1132
1133 @table @gcctabopt
1134 @item -c
1135 @opindex c
1136 Compile or assemble the source files, but do not link.  The linking
1137 stage simply is not done.  The ultimate output is in the form of an
1138 object file for each source file.
1139
1140 By default, the object file name for a source file is made by replacing
1141 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1142
1143 Unrecognized input files, not requiring compilation or assembly, are
1144 ignored.
1145
1146 @item -S
1147 @opindex S
1148 Stop after the stage of compilation proper; do not assemble.  The output
1149 is in the form of an assembler code file for each non-assembler input
1150 file specified.
1151
1152 By default, the assembler file name for a source file is made by
1153 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1154
1155 Input files that don't require compilation are ignored.
1156
1157 @item -E
1158 @opindex E
1159 Stop after the preprocessing stage; do not run the compiler proper.  The
1160 output is in the form of preprocessed source code, which is sent to the
1161 standard output.
1162
1163 Input files which don't require preprocessing are ignored.
1164
1165 @cindex output file option
1166 @item -o @var{file}
1167 @opindex o
1168 Place output in file @var{file}.  This applies regardless to whatever
1169 sort of output is being produced, whether it be an executable file,
1170 an object file, an assembler file or preprocessed C code.
1171
1172 If @option{-o} is not specified, the default is to put an executable
1173 file in @file{a.out}, the object file for
1174 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1175 assembler file in @file{@var{source}.s}, a precompiled header file in
1176 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1177 standard output.
1178
1179 @item -v
1180 @opindex v
1181 Print (on standard error output) the commands executed to run the stages
1182 of compilation.  Also print the version number of the compiler driver
1183 program and of the preprocessor and the compiler proper.
1184
1185 @item -###
1186 @opindex ###
1187 Like @option{-v} except the commands are not executed and arguments
1188 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1189 This is useful for shell scripts to capture the driver-generated command lines.
1190
1191 @item -pipe
1192 @opindex pipe
1193 Use pipes rather than temporary files for communication between the
1194 various stages of compilation.  This fails to work on some systems where
1195 the assembler is unable to read from a pipe; but the GNU assembler has
1196 no trouble.
1197
1198 @item -combine
1199 @opindex combine
1200 If you are compiling multiple source files, this option tells the driver
1201 to pass all the source files to the compiler at once (for those
1202 languages for which the compiler can handle this).  This will allow
1203 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1204 language for which this is supported is C@.  If you pass source files for
1205 multiple languages to the driver, using this option, the driver will invoke
1206 the compiler(s) that support IMA once each, passing each compiler all the
1207 source files appropriate for it.  For those languages that do not support
1208 IMA this option will be ignored, and the compiler will be invoked once for
1209 each source file in that language.  If you use this option in conjunction
1210 with @option{-save-temps}, the compiler will generate multiple
1211 pre-processed files
1212 (one for each source file), but only one (combined) @file{.o} or
1213 @file{.s} file.
1214
1215 @item --help
1216 @opindex help
1217 Print (on the standard output) a description of the command line options
1218 understood by @command{gcc}.  If the @option{-v} option is also specified
1219 then @option{--help} will also be passed on to the various processes
1220 invoked by @command{gcc}, so that they can display the command line options
1221 they accept.  If the @option{-Wextra} option has also been specified
1222 (prior to the @option{--help} option), then command line options which
1223 have no documentation associated with them will also be displayed.
1224
1225 @item --target-help
1226 @opindex target-help
1227 Print (on the standard output) a description of target-specific command
1228 line options for each tool.  For some targets extra target-specific
1229 information may also be printed.
1230
1231 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1232 Print (on the standard output) a description of the command line
1233 options understood by the compiler that fit into all specified classes
1234 and qualifiers.  These are the supported classes:
1235
1236 @table @asis
1237 @item @samp{optimizers}
1238 This will display all of the optimization options supported by the
1239 compiler.
1240
1241 @item @samp{warnings}
1242 This will display all of the options controlling warning messages
1243 produced by the compiler.
1244
1245 @item @samp{target}
1246 This will display target-specific options.  Unlike the
1247 @option{--target-help} option however, target-specific options of the
1248 linker and assembler will not be displayed.  This is because those
1249 tools do not currently support the extended @option{--help=} syntax.
1250
1251 @item @samp{params}
1252 This will display the values recognized by the @option{--param}
1253 option.
1254
1255 @item @var{language}
1256 This will display the options supported for @var{language}, where
1257 @var{language} is the name of one of the languages supported in this
1258 version of GCC.
1259
1260 @item @samp{common}
1261 This will display the options that are common to all languages.
1262 @end table
1263
1264 These are the supported qualifiers:
1265
1266 @table @asis
1267 @item @samp{undocumented}
1268 Display only those options which are undocumented.
1269
1270 @item @samp{joined}
1271 Display options which take an argument that appears after an equal
1272 sign in the same continuous piece of text, such as:
1273 @samp{--help=target}.
1274
1275 @item @samp{separate}
1276 Display options which take an argument that appears as a separate word
1277 following the original option, such as: @samp{-o output-file}.
1278 @end table
1279
1280 Thus for example to display all the undocumented target-specific
1281 switches supported by the compiler the following can be used:
1282
1283 @smallexample
1284 --help=target,undocumented
1285 @end smallexample
1286
1287 The sense of a qualifier can be inverted by prefixing it with the
1288 @samp{^} character, so for example to display all binary warning
1289 options (i.e., ones that are either on or off and that do not take an
1290 argument), which have a description the following can be used:
1291
1292 @smallexample
1293 --help=warnings,^joined,^undocumented
1294 @end smallexample
1295
1296 The argument to @option{--help=} should not consist solely of inverted
1297 qualifiers.
1298
1299 Combining several classes is possible, although this usually
1300 restricts the output by so much that there is nothing to display.  One
1301 case where it does work however is when one of the classes is
1302 @var{target}.  So for example to display all the target-specific
1303 optimization options the following can be used:
1304
1305 @smallexample
1306 --help=target,optimizers
1307 @end smallexample
1308
1309 The @option{--help=} option can be repeated on the command line.  Each
1310 successive use will display its requested class of options, skipping
1311 those that have already been displayed.
1312
1313 If the @option{-Q} option appears on the command line before the
1314 @option{--help=} option, then the descriptive text displayed by
1315 @option{--help=} is changed.  Instead of describing the displayed
1316 options, an indication is given as to whether the option is enabled,
1317 disabled or set to a specific value (assuming that the compiler
1318 knows this at the point where the @option{--help=} option is used).
1319
1320 Here is a truncated example from the ARM port of @command{gcc}:
1321
1322 @smallexample
1323   % gcc -Q -mabi=2 --help=target -c
1324   The following options are target specific:
1325   -mabi=                                2
1326   -mabort-on-noreturn                   [disabled]
1327   -mapcs                                [disabled]
1328 @end smallexample
1329
1330 The output is sensitive to the effects of previous command line
1331 options, so for example it is possible to find out which optimizations
1332 are enabled at @option{-O2} by using:
1333
1334 @smallexample
1335 -Q -O2 --help=optimizers
1336 @end smallexample
1337
1338 Alternatively you can discover which binary optimizations are enabled
1339 by @option{-O3} by using:
1340
1341 @smallexample
1342 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1343 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1344 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1345 @end smallexample
1346
1347 @item -no-canonical-prefixes
1348 @opindex no-canonical-prefixes
1349 Do not expand any symbolic links, resolve references to @samp{/../}
1350 or @samp{/./}, or make the path absolute when generating a relative
1351 prefix.
1352
1353 @item --version
1354 @opindex version
1355 Display the version number and copyrights of the invoked GCC@.
1356
1357 @item -wrapper
1358 @opindex wrapper
1359 Invoke all subcommands under a wrapper program. It takes a single
1360 comma separated list as an argument, which will be used to invoke
1361 the wrapper:
1362
1363 @smallexample
1364 gcc -c t.c -wrapper gdb,--args
1365 @end smallexample
1366
1367 This will invoke all subprograms of gcc under "gdb --args",
1368 thus cc1 invocation will be "gdb --args cc1 ...".
1369
1370 @item -fplugin=@var{name}.so
1371 Load the plugin code in file @var{name}.so, assumed to be a
1372 shared object to be dlopen'd by the compiler.  The base name of
1373 the shared object file is used to identify the plugin for the
1374 purposes of argument parsing (See
1375 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1376 Each plugin should define the callback functions specified in the
1377 Plugins API.
1378
1379 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1380 Define an argument called @var{key} with a value of @var{value}
1381 for the plugin called @var{name}.
1382
1383 @item -fdump-ada-spec@r{[}-slim@r{]}
1384 For C and C++ source and include files, generate corresponding Ada
1385 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1386 GNAT User's Guide}, which provides detailed documentation on this feature.
1387
1388 @include @value{srcdir}/../libiberty/at-file.texi
1389 @end table
1390
1391 @node Invoking G++
1392 @section Compiling C++ Programs
1393
1394 @cindex suffixes for C++ source
1395 @cindex C++ source file suffixes
1396 C++ source files conventionally use one of the suffixes @samp{.C},
1397 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1398 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1399 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1400 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1401 files with these names and compiles them as C++ programs even if you
1402 call the compiler the same way as for compiling C programs (usually
1403 with the name @command{gcc}).
1404
1405 @findex g++
1406 @findex c++
1407 However, the use of @command{gcc} does not add the C++ library.
1408 @command{g++} is a program that calls GCC and treats @samp{.c},
1409 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1410 files unless @option{-x} is used, and automatically specifies linking
1411 against the C++ library.  This program is also useful when
1412 precompiling a C header file with a @samp{.h} extension for use in C++
1413 compilations.  On many systems, @command{g++} is also installed with
1414 the name @command{c++}.
1415
1416 @cindex invoking @command{g++}
1417 When you compile C++ programs, you may specify many of the same
1418 command-line options that you use for compiling programs in any
1419 language; or command-line options meaningful for C and related
1420 languages; or options that are meaningful only for C++ programs.
1421 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1422 explanations of options for languages related to C@.
1423 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1424 explanations of options that are meaningful only for C++ programs.
1425
1426 @node C Dialect Options
1427 @section Options Controlling C Dialect
1428 @cindex dialect options
1429 @cindex language dialect options
1430 @cindex options, dialect
1431
1432 The following options control the dialect of C (or languages derived
1433 from C, such as C++, Objective-C and Objective-C++) that the compiler
1434 accepts:
1435
1436 @table @gcctabopt
1437 @cindex ANSI support
1438 @cindex ISO support
1439 @item -ansi
1440 @opindex ansi
1441 In C mode, this is equivalent to @samp{-std=c90}. In C++ mode, it is
1442 equivalent to @samp{-std=c++98}.
1443
1444 This turns off certain features of GCC that are incompatible with ISO
1445 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1446 such as the @code{asm} and @code{typeof} keywords, and
1447 predefined macros such as @code{unix} and @code{vax} that identify the
1448 type of system you are using.  It also enables the undesirable and
1449 rarely used ISO trigraph feature.  For the C compiler,
1450 it disables recognition of C++ style @samp{//} comments as well as
1451 the @code{inline} keyword.
1452
1453 The alternate keywords @code{__asm__}, @code{__extension__},
1454 @code{__inline__} and @code{__typeof__} continue to work despite
1455 @option{-ansi}.  You would not want to use them in an ISO C program, of
1456 course, but it is useful to put them in header files that might be included
1457 in compilations done with @option{-ansi}.  Alternate predefined macros
1458 such as @code{__unix__} and @code{__vax__} are also available, with or
1459 without @option{-ansi}.
1460
1461 The @option{-ansi} option does not cause non-ISO programs to be
1462 rejected gratuitously.  For that, @option{-pedantic} is required in
1463 addition to @option{-ansi}.  @xref{Warning Options}.
1464
1465 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1466 option is used.  Some header files may notice this macro and refrain
1467 from declaring certain functions or defining certain macros that the
1468 ISO standard doesn't call for; this is to avoid interfering with any
1469 programs that might use these names for other things.
1470
1471 Functions that would normally be built in but do not have semantics
1472 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1473 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1474 built-in functions provided by GCC}, for details of the functions
1475 affected.
1476
1477 @item -std=
1478 @opindex std
1479 Determine the language standard. @xref{Standards,,Language Standards
1480 Supported by GCC}, for details of these standard versions.  This option
1481 is currently only supported when compiling C or C++.
1482
1483 The compiler can accept several base standards, such as @samp{c90} or
1484 @samp{c++98}, and GNU dialects of those standards, such as
1485 @samp{gnu90} or @samp{gnu++98}.  By specifying a base standard, the
1486 compiler will accept all programs following that standard and those
1487 using GNU extensions that do not contradict it.  For example,
1488 @samp{-std=c90} turns off certain features of GCC that are
1489 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1490 keywords, but not other GNU extensions that do not have a meaning in
1491 ISO C90, such as omitting the middle term of a @code{?:}
1492 expression. On the other hand, by specifying a GNU dialect of a
1493 standard, all features the compiler support are enabled, even when
1494 those features change the meaning of the base standard and some
1495 strict-conforming programs may be rejected.  The particular standard
1496 is used by @option{-pedantic} to identify which features are GNU
1497 extensions given that version of the standard. For example
1498 @samp{-std=gnu90 -pedantic} would warn about C++ style @samp{//}
1499 comments, while @samp{-std=gnu99 -pedantic} would not.
1500
1501 A value for this option must be provided; possible values are
1502
1503 @table @samp
1504 @item c90
1505 @itemx c89
1506 @itemx iso9899:1990
1507 Support all ISO C90 programs (certain GNU extensions that conflict
1508 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1509
1510 @item iso9899:199409
1511 ISO C90 as modified in amendment 1.
1512
1513 @item c99
1514 @itemx c9x
1515 @itemx iso9899:1999
1516 @itemx iso9899:199x
1517 ISO C99.  Note that this standard is not yet fully supported; see
1518 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1519 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1520
1521 @item c1x
1522 ISO C1X, the draft of the next revision of the ISO C standard.
1523 Support is limited and experimental and features enabled by this
1524 option may be changed or removed if changed in or removed from the
1525 standard draft.
1526
1527 @item gnu90
1528 @itemx gnu89
1529 GNU dialect of ISO C90 (including some C99 features). This
1530 is the default for C code.
1531
1532 @item gnu99
1533 @itemx gnu9x
1534 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1535 this will become the default.  The name @samp{gnu9x} is deprecated.
1536
1537 @item gnu1x
1538 GNU dialect of ISO C1X.  Support is limited and experimental and
1539 features enabled by this option may be changed or removed if changed
1540 in or removed from the standard draft.
1541
1542 @item c++98
1543 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1544 C++ code.
1545
1546 @item gnu++98
1547 GNU dialect of @option{-std=c++98}.  This is the default for
1548 C++ code.
1549
1550 @item c++0x
1551 The working draft of the upcoming ISO C++0x standard. This option
1552 enables experimental features that are likely to be included in
1553 C++0x. The working draft is constantly changing, and any feature that is
1554 enabled by this flag may be removed from future versions of GCC if it is
1555 not part of the C++0x standard.
1556
1557 @item gnu++0x
1558 GNU dialect of @option{-std=c++0x}. This option enables
1559 experimental features that may be removed in future versions of GCC.
1560 @end table
1561
1562 @item -fgnu89-inline
1563 @opindex fgnu89-inline
1564 The option @option{-fgnu89-inline} tells GCC to use the traditional
1565 GNU semantics for @code{inline} functions when in C99 mode.
1566 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1567 is accepted and ignored by GCC versions 4.1.3 up to but not including
1568 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1569 C99 mode.  Using this option is roughly equivalent to adding the
1570 @code{gnu_inline} function attribute to all inline functions
1571 (@pxref{Function Attributes}).
1572
1573 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1574 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1575 specifies the default behavior).  This option was first supported in
1576 GCC 4.3.  This option is not supported in @option{-std=c90} or
1577 @option{-std=gnu90} mode.
1578
1579 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1580 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1581 in effect for @code{inline} functions.  @xref{Common Predefined
1582 Macros,,,cpp,The C Preprocessor}.
1583
1584 @item -aux-info @var{filename}
1585 @opindex aux-info
1586 Output to the given filename prototyped declarations for all functions
1587 declared and/or defined in a translation unit, including those in header
1588 files.  This option is silently ignored in any language other than C@.
1589
1590 Besides declarations, the file indicates, in comments, the origin of
1591 each declaration (source file and line), whether the declaration was
1592 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1593 @samp{O} for old, respectively, in the first character after the line
1594 number and the colon), and whether it came from a declaration or a
1595 definition (@samp{C} or @samp{F}, respectively, in the following
1596 character).  In the case of function definitions, a K&R-style list of
1597 arguments followed by their declarations is also provided, inside
1598 comments, after the declaration.
1599
1600 @item -fno-asm
1601 @opindex fno-asm
1602 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1603 keyword, so that code can use these words as identifiers.  You can use
1604 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1605 instead.  @option{-ansi} implies @option{-fno-asm}.
1606
1607 In C++, this switch only affects the @code{typeof} keyword, since
1608 @code{asm} and @code{inline} are standard keywords.  You may want to
1609 use the @option{-fno-gnu-keywords} flag instead, which has the same
1610 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1611 switch only affects the @code{asm} and @code{typeof} keywords, since
1612 @code{inline} is a standard keyword in ISO C99.
1613
1614 @item -fno-builtin
1615 @itemx -fno-builtin-@var{function}
1616 @opindex fno-builtin
1617 @cindex built-in functions
1618 Don't recognize built-in functions that do not begin with
1619 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1620 functions provided by GCC}, for details of the functions affected,
1621 including those which are not built-in functions when @option{-ansi} or
1622 @option{-std} options for strict ISO C conformance are used because they
1623 do not have an ISO standard meaning.
1624
1625 GCC normally generates special code to handle certain built-in functions
1626 more efficiently; for instance, calls to @code{alloca} may become single
1627 instructions that adjust the stack directly, and calls to @code{memcpy}
1628 may become inline copy loops.  The resulting code is often both smaller
1629 and faster, but since the function calls no longer appear as such, you
1630 cannot set a breakpoint on those calls, nor can you change the behavior
1631 of the functions by linking with a different library.  In addition,
1632 when a function is recognized as a built-in function, GCC may use
1633 information about that function to warn about problems with calls to
1634 that function, or to generate more efficient code, even if the
1635 resulting code still contains calls to that function.  For example,
1636 warnings are given with @option{-Wformat} for bad calls to
1637 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1638 known not to modify global memory.
1639
1640 With the @option{-fno-builtin-@var{function}} option
1641 only the built-in function @var{function} is
1642 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1643 function is named that is not built-in in this version of GCC, this
1644 option is ignored.  There is no corresponding
1645 @option{-fbuiltin-@var{function}} option; if you wish to enable
1646 built-in functions selectively when using @option{-fno-builtin} or
1647 @option{-ffreestanding}, you may define macros such as:
1648
1649 @smallexample
1650 #define abs(n)          __builtin_abs ((n))
1651 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1652 @end smallexample
1653
1654 @item -fhosted
1655 @opindex fhosted
1656 @cindex hosted environment
1657
1658 Assert that compilation takes place in a hosted environment.  This implies
1659 @option{-fbuiltin}.  A hosted environment is one in which the
1660 entire standard library is available, and in which @code{main} has a return
1661 type of @code{int}.  Examples are nearly everything except a kernel.
1662 This is equivalent to @option{-fno-freestanding}.
1663
1664 @item -ffreestanding
1665 @opindex ffreestanding
1666 @cindex hosted environment
1667
1668 Assert that compilation takes place in a freestanding environment.  This
1669 implies @option{-fno-builtin}.  A freestanding environment
1670 is one in which the standard library may not exist, and program startup may
1671 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1672 This is equivalent to @option{-fno-hosted}.
1673
1674 @xref{Standards,,Language Standards Supported by GCC}, for details of
1675 freestanding and hosted environments.
1676
1677 @item -fopenmp
1678 @opindex fopenmp
1679 @cindex openmp parallel
1680 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1681 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1682 compiler generates parallel code according to the OpenMP Application
1683 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1684 implies @option{-pthread}, and thus is only supported on targets that
1685 have support for @option{-pthread}.
1686
1687 @item -fms-extensions
1688 @opindex fms-extensions
1689 Accept some non-standard constructs used in Microsoft header files.
1690
1691 It allows for c++ that member-names in structures can be similiar
1692 to previous types declarations.
1693
1694 @smallexample
1695 typedef int UOW;
1696 struct ABC @{
1697   UOW UOW;
1698 @};
1699 @end smallexample
1700
1701 Some cases of unnamed fields in structures and unions are only
1702 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1703 fields within structs/unions}, for details.
1704
1705 @item -trigraphs
1706 @opindex trigraphs
1707 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1708 options for strict ISO C conformance) implies @option{-trigraphs}.
1709
1710 @item -no-integrated-cpp
1711 @opindex no-integrated-cpp
1712 Performs a compilation in two passes: preprocessing and compiling.  This
1713 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1714 @option{-B} option.  The user supplied compilation step can then add in
1715 an additional preprocessing step after normal preprocessing but before
1716 compiling.  The default is to use the integrated cpp (internal cpp)
1717
1718 The semantics of this option will change if "cc1", "cc1plus", and
1719 "cc1obj" are merged.
1720
1721 @cindex traditional C language
1722 @cindex C language, traditional
1723 @item -traditional
1724 @itemx -traditional-cpp
1725 @opindex traditional-cpp
1726 @opindex traditional
1727 Formerly, these options caused GCC to attempt to emulate a pre-standard
1728 C compiler.  They are now only supported with the @option{-E} switch.
1729 The preprocessor continues to support a pre-standard mode.  See the GNU
1730 CPP manual for details.
1731
1732 @item -fcond-mismatch
1733 @opindex fcond-mismatch
1734 Allow conditional expressions with mismatched types in the second and
1735 third arguments.  The value of such an expression is void.  This option
1736 is not supported for C++.
1737
1738 @item -flax-vector-conversions
1739 @opindex flax-vector-conversions
1740 Allow implicit conversions between vectors with differing numbers of
1741 elements and/or incompatible element types.  This option should not be
1742 used for new code.
1743
1744 @item -funsigned-char
1745 @opindex funsigned-char
1746 Let the type @code{char} be unsigned, like @code{unsigned char}.
1747
1748 Each kind of machine has a default for what @code{char} should
1749 be.  It is either like @code{unsigned char} by default or like
1750 @code{signed char} by default.
1751
1752 Ideally, a portable program should always use @code{signed char} or
1753 @code{unsigned char} when it depends on the signedness of an object.
1754 But many programs have been written to use plain @code{char} and
1755 expect it to be signed, or expect it to be unsigned, depending on the
1756 machines they were written for.  This option, and its inverse, let you
1757 make such a program work with the opposite default.
1758
1759 The type @code{char} is always a distinct type from each of
1760 @code{signed char} or @code{unsigned char}, even though its behavior
1761 is always just like one of those two.
1762
1763 @item -fsigned-char
1764 @opindex fsigned-char
1765 Let the type @code{char} be signed, like @code{signed char}.
1766
1767 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1768 the negative form of @option{-funsigned-char}.  Likewise, the option
1769 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1770
1771 @item -fsigned-bitfields
1772 @itemx -funsigned-bitfields
1773 @itemx -fno-signed-bitfields
1774 @itemx -fno-unsigned-bitfields
1775 @opindex fsigned-bitfields
1776 @opindex funsigned-bitfields
1777 @opindex fno-signed-bitfields
1778 @opindex fno-unsigned-bitfields
1779 These options control whether a bit-field is signed or unsigned, when the
1780 declaration does not use either @code{signed} or @code{unsigned}.  By
1781 default, such a bit-field is signed, because this is consistent: the
1782 basic integer types such as @code{int} are signed types.
1783 @end table
1784
1785 @node C++ Dialect Options
1786 @section Options Controlling C++ Dialect
1787
1788 @cindex compiler options, C++
1789 @cindex C++ options, command line
1790 @cindex options, C++
1791 This section describes the command-line options that are only meaningful
1792 for C++ programs; but you can also use most of the GNU compiler options
1793 regardless of what language your program is in.  For example, you
1794 might compile a file @code{firstClass.C} like this:
1795
1796 @smallexample
1797 g++ -g -frepo -O -c firstClass.C
1798 @end smallexample
1799
1800 @noindent
1801 In this example, only @option{-frepo} is an option meant
1802 only for C++ programs; you can use the other options with any
1803 language supported by GCC@.
1804
1805 Here is a list of options that are @emph{only} for compiling C++ programs:
1806
1807 @table @gcctabopt
1808
1809 @item -fabi-version=@var{n}
1810 @opindex fabi-version
1811 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1812 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1813 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1814 the version that conforms most closely to the C++ ABI specification.
1815 Therefore, the ABI obtained using version 0 will change as ABI bugs
1816 are fixed.
1817
1818 The default is version 2.
1819
1820 Version 3 corrects an error in mangling a constant address as a
1821 template argument.
1822
1823 Version 4 implements a standard mangling for vector types.
1824
1825 See also @option{-Wabi}.
1826
1827 @item -fno-access-control
1828 @opindex fno-access-control
1829 Turn off all access checking.  This switch is mainly useful for working
1830 around bugs in the access control code.
1831
1832 @item -fcheck-new
1833 @opindex fcheck-new
1834 Check that the pointer returned by @code{operator new} is non-null
1835 before attempting to modify the storage allocated.  This check is
1836 normally unnecessary because the C++ standard specifies that
1837 @code{operator new} will only return @code{0} if it is declared
1838 @samp{throw()}, in which case the compiler will always check the
1839 return value even without this option.  In all other cases, when
1840 @code{operator new} has a non-empty exception specification, memory
1841 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1842 @samp{new (nothrow)}.
1843
1844 @item -fconserve-space
1845 @opindex fconserve-space
1846 Put uninitialized or runtime-initialized global variables into the
1847 common segment, as C does.  This saves space in the executable at the
1848 cost of not diagnosing duplicate definitions.  If you compile with this
1849 flag and your program mysteriously crashes after @code{main()} has
1850 completed, you may have an object that is being destroyed twice because
1851 two definitions were merged.
1852
1853 This option is no longer useful on most targets, now that support has
1854 been added for putting variables into BSS without making them common.
1855
1856 @item -fno-deduce-init-list
1857 @opindex fno-deduce-init-list
1858 Disable deduction of a template type parameter as
1859 std::initializer_list from a brace-enclosed initializer list, i.e.
1860
1861 @smallexample
1862 template <class T> auto forward(T t) -> decltype (realfn (t))
1863 @{
1864   return realfn (t);
1865 @}
1866
1867 void f()
1868 @{
1869   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1870 @}
1871 @end smallexample
1872
1873 This option is present because this deduction is an extension to the
1874 current specification in the C++0x working draft, and there was
1875 some concern about potential overload resolution problems.
1876
1877 @item -ffriend-injection
1878 @opindex ffriend-injection
1879 Inject friend functions into the enclosing namespace, so that they are
1880 visible outside the scope of the class in which they are declared.
1881 Friend functions were documented to work this way in the old Annotated
1882 C++ Reference Manual, and versions of G++ before 4.1 always worked
1883 that way.  However, in ISO C++ a friend function which is not declared
1884 in an enclosing scope can only be found using argument dependent
1885 lookup.  This option causes friends to be injected as they were in
1886 earlier releases.
1887
1888 This option is for compatibility, and may be removed in a future
1889 release of G++.
1890
1891 @item -fno-elide-constructors
1892 @opindex fno-elide-constructors
1893 The C++ standard allows an implementation to omit creating a temporary
1894 which is only used to initialize another object of the same type.
1895 Specifying this option disables that optimization, and forces G++ to
1896 call the copy constructor in all cases.
1897
1898 @item -fno-enforce-eh-specs
1899 @opindex fno-enforce-eh-specs
1900 Don't generate code to check for violation of exception specifications
1901 at runtime.  This option violates the C++ standard, but may be useful
1902 for reducing code size in production builds, much like defining
1903 @samp{NDEBUG}.  This does not give user code permission to throw
1904 exceptions in violation of the exception specifications; the compiler
1905 will still optimize based on the specifications, so throwing an
1906 unexpected exception will result in undefined behavior.
1907
1908 @item -ffor-scope
1909 @itemx -fno-for-scope
1910 @opindex ffor-scope
1911 @opindex fno-for-scope
1912 If @option{-ffor-scope} is specified, the scope of variables declared in
1913 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1914 as specified by the C++ standard.
1915 If @option{-fno-for-scope} is specified, the scope of variables declared in
1916 a @i{for-init-statement} extends to the end of the enclosing scope,
1917 as was the case in old versions of G++, and other (traditional)
1918 implementations of C++.
1919
1920 The default if neither flag is given to follow the standard,
1921 but to allow and give a warning for old-style code that would
1922 otherwise be invalid, or have different behavior.
1923
1924 @item -fno-gnu-keywords
1925 @opindex fno-gnu-keywords
1926 Do not recognize @code{typeof} as a keyword, so that code can use this
1927 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1928 @option{-ansi} implies @option{-fno-gnu-keywords}.
1929
1930 @item -fno-implicit-templates
1931 @opindex fno-implicit-templates
1932 Never emit code for non-inline templates which are instantiated
1933 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1934 @xref{Template Instantiation}, for more information.
1935
1936 @item -fno-implicit-inline-templates
1937 @opindex fno-implicit-inline-templates
1938 Don't emit code for implicit instantiations of inline templates, either.
1939 The default is to handle inlines differently so that compiles with and
1940 without optimization will need the same set of explicit instantiations.
1941
1942 @item -fno-implement-inlines
1943 @opindex fno-implement-inlines
1944 To save space, do not emit out-of-line copies of inline functions
1945 controlled by @samp{#pragma implementation}.  This will cause linker
1946 errors if these functions are not inlined everywhere they are called.
1947
1948 @item -fms-extensions
1949 @opindex fms-extensions
1950 Disable pedantic warnings about constructs used in MFC, such as implicit
1951 int and getting a pointer to member function via non-standard syntax.
1952
1953 @item -fno-nonansi-builtins
1954 @opindex fno-nonansi-builtins
1955 Disable built-in declarations of functions that are not mandated by
1956 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1957 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1958
1959 @item -fnothrow-opt
1960 @opindex fnothrow-opt
1961 Treat a @code{throw()} exception specification as though it were a
1962 @code{noexcept} specification to reduce or eliminate the text size
1963 overhead relative to a function with no exception specification.  If
1964 the function has local variables of types with non-trivial
1965 destructors, the exception specification will actually make the
1966 function smaller because the EH cleanups for those variables can be
1967 optimized away.  The semantic effect is that an exception thrown out of
1968 a function with such an exception specification will result in a call
1969 to @code{terminate} rather than @code{unexpected}.
1970
1971 @item -fno-operator-names
1972 @opindex fno-operator-names
1973 Do not treat the operator name keywords @code{and}, @code{bitand},
1974 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1975 synonyms as keywords.
1976
1977 @item -fno-optional-diags
1978 @opindex fno-optional-diags
1979 Disable diagnostics that the standard says a compiler does not need to
1980 issue.  Currently, the only such diagnostic issued by G++ is the one for
1981 a name having multiple meanings within a class.
1982
1983 @item -fpermissive
1984 @opindex fpermissive
1985 Downgrade some diagnostics about nonconformant code from errors to
1986 warnings.  Thus, using @option{-fpermissive} will allow some
1987 nonconforming code to compile.
1988
1989 @item -fno-pretty-templates
1990 @opindex fno-pretty-templates
1991 When an error message refers to a specialization of a function
1992 template, the compiler will normally print the signature of the
1993 template followed by the template arguments and any typedefs or
1994 typenames in the signature (e.g. @code{void f(T) [with T = int]}
1995 rather than @code{void f(int)}) so that it's clear which template is
1996 involved.  When an error message refers to a specialization of a class
1997 template, the compiler will omit any template arguments which match
1998 the default template arguments for that template.  If either of these
1999 behaviors make it harder to understand the error message rather than
2000 easier, using @option{-fno-pretty-templates} will disable them.
2001
2002 @item -frepo
2003 @opindex frepo
2004 Enable automatic template instantiation at link time.  This option also
2005 implies @option{-fno-implicit-templates}.  @xref{Template
2006 Instantiation}, for more information.
2007
2008 @item -fno-rtti
2009 @opindex fno-rtti
2010 Disable generation of information about every class with virtual
2011 functions for use by the C++ runtime type identification features
2012 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2013 of the language, you can save some space by using this flag.  Note that
2014 exception handling uses the same information, but it will generate it as
2015 needed. The @samp{dynamic_cast} operator can still be used for casts that
2016 do not require runtime type information, i.e.@: casts to @code{void *} or to
2017 unambiguous base classes.
2018
2019 @item -fstats
2020 @opindex fstats
2021 Emit statistics about front-end processing at the end of the compilation.
2022 This information is generally only useful to the G++ development team.
2023
2024 @item -fstrict-enums
2025 @opindex fstrict-enums
2026 Allow the compiler to optimize using the assumption that a value of
2027 enumeration type can only be one of the values of the enumeration (as
2028 defined in the C++ standard; basically, a value which can be
2029 represented in the minimum number of bits needed to represent all the
2030 enumerators).  This assumption may not be valid if the program uses a
2031 cast to convert an arbitrary integer value to the enumeration type.
2032
2033 @item -ftemplate-depth=@var{n}
2034 @opindex ftemplate-depth
2035 Set the maximum instantiation depth for template classes to @var{n}.
2036 A limit on the template instantiation depth is needed to detect
2037 endless recursions during template class instantiation.  ANSI/ISO C++
2038 conforming programs must not rely on a maximum depth greater than 17
2039 (changed to 1024 in C++0x).
2040
2041 @item -fno-threadsafe-statics
2042 @opindex fno-threadsafe-statics
2043 Do not emit the extra code to use the routines specified in the C++
2044 ABI for thread-safe initialization of local statics.  You can use this
2045 option to reduce code size slightly in code that doesn't need to be
2046 thread-safe.
2047
2048 @item -fuse-cxa-atexit
2049 @opindex fuse-cxa-atexit
2050 Register destructors for objects with static storage duration with the
2051 @code{__cxa_atexit} function rather than the @code{atexit} function.
2052 This option is required for fully standards-compliant handling of static
2053 destructors, but will only work if your C library supports
2054 @code{__cxa_atexit}.
2055
2056 @item -fno-use-cxa-get-exception-ptr
2057 @opindex fno-use-cxa-get-exception-ptr
2058 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2059 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
2060 if the runtime routine is not available.
2061
2062 @item -fvisibility-inlines-hidden
2063 @opindex fvisibility-inlines-hidden
2064 This switch declares that the user does not attempt to compare
2065 pointers to inline methods where the addresses of the two functions
2066 were taken in different shared objects.
2067
2068 The effect of this is that GCC may, effectively, mark inline methods with
2069 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2070 appear in the export table of a DSO and do not require a PLT indirection
2071 when used within the DSO@.  Enabling this option can have a dramatic effect
2072 on load and link times of a DSO as it massively reduces the size of the
2073 dynamic export table when the library makes heavy use of templates.
2074
2075 The behavior of this switch is not quite the same as marking the
2076 methods as hidden directly, because it does not affect static variables
2077 local to the function or cause the compiler to deduce that
2078 the function is defined in only one shared object.
2079
2080 You may mark a method as having a visibility explicitly to negate the
2081 effect of the switch for that method.  For example, if you do want to
2082 compare pointers to a particular inline method, you might mark it as
2083 having default visibility.  Marking the enclosing class with explicit
2084 visibility will have no effect.
2085
2086 Explicitly instantiated inline methods are unaffected by this option
2087 as their linkage might otherwise cross a shared library boundary.
2088 @xref{Template Instantiation}.
2089
2090 @item -fvisibility-ms-compat
2091 @opindex fvisibility-ms-compat
2092 This flag attempts to use visibility settings to make GCC's C++
2093 linkage model compatible with that of Microsoft Visual Studio.
2094
2095 The flag makes these changes to GCC's linkage model:
2096
2097 @enumerate
2098 @item
2099 It sets the default visibility to @code{hidden}, like
2100 @option{-fvisibility=hidden}.
2101
2102 @item
2103 Types, but not their members, are not hidden by default.
2104
2105 @item
2106 The One Definition Rule is relaxed for types without explicit
2107 visibility specifications which are defined in more than one different
2108 shared object: those declarations are permitted if they would have
2109 been permitted when this option was not used.
2110 @end enumerate
2111
2112 In new code it is better to use @option{-fvisibility=hidden} and
2113 export those classes which are intended to be externally visible.
2114 Unfortunately it is possible for code to rely, perhaps accidentally,
2115 on the Visual Studio behavior.
2116
2117 Among the consequences of these changes are that static data members
2118 of the same type with the same name but defined in different shared
2119 objects will be different, so changing one will not change the other;
2120 and that pointers to function members defined in different shared
2121 objects may not compare equal.  When this flag is given, it is a
2122 violation of the ODR to define types with the same name differently.
2123
2124 @item -fno-weak
2125 @opindex fno-weak
2126 Do not use weak symbol support, even if it is provided by the linker.
2127 By default, G++ will use weak symbols if they are available.  This
2128 option exists only for testing, and should not be used by end-users;
2129 it will result in inferior code and has no benefits.  This option may
2130 be removed in a future release of G++.
2131
2132 @item -nostdinc++
2133 @opindex nostdinc++
2134 Do not search for header files in the standard directories specific to
2135 C++, but do still search the other standard directories.  (This option
2136 is used when building the C++ library.)
2137 @end table
2138
2139 In addition, these optimization, warning, and code generation options
2140 have meanings only for C++ programs:
2141
2142 @table @gcctabopt
2143 @item -fno-default-inline
2144 @opindex fno-default-inline
2145 Do not assume @samp{inline} for functions defined inside a class scope.
2146 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2147 functions will have linkage like inline functions; they just won't be
2148 inlined by default.
2149
2150 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2151 @opindex Wabi
2152 @opindex Wno-abi
2153 Warn when G++ generates code that is probably not compatible with the
2154 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2155 all such cases, there are probably some cases that are not warned about,
2156 even though G++ is generating incompatible code.  There may also be
2157 cases where warnings are emitted even though the code that is generated
2158 will be compatible.
2159
2160 You should rewrite your code to avoid these warnings if you are
2161 concerned about the fact that code generated by G++ may not be binary
2162 compatible with code generated by other compilers.
2163
2164 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2165
2166 @itemize @bullet
2167
2168 @item
2169 A template with a non-type template parameter of reference type is
2170 mangled incorrectly:
2171 @smallexample
2172 extern int N;
2173 template <int &> struct S @{@};
2174 void n (S<N>) @{2@}
2175 @end smallexample
2176
2177 This is fixed in @option{-fabi-version=3}.
2178
2179 @item
2180 SIMD vector types declared using @code{__attribute ((vector_size))} are
2181 mangled in a non-standard way that does not allow for overloading of
2182 functions taking vectors of different sizes.
2183
2184 The mangling is changed in @option{-fabi-version=4}.
2185 @end itemize
2186
2187 The known incompatibilities in @option{-fabi-version=1} include:
2188
2189 @itemize @bullet
2190
2191 @item
2192 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2193 pack data into the same byte as a base class.  For example:
2194
2195 @smallexample
2196 struct A @{ virtual void f(); int f1 : 1; @};
2197 struct B : public A @{ int f2 : 1; @};
2198 @end smallexample
2199
2200 @noindent
2201 In this case, G++ will place @code{B::f2} into the same byte
2202 as@code{A::f1}; other compilers will not.  You can avoid this problem
2203 by explicitly padding @code{A} so that its size is a multiple of the
2204 byte size on your platform; that will cause G++ and other compilers to
2205 layout @code{B} identically.
2206
2207 @item
2208 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2209 tail padding when laying out virtual bases.  For example:
2210
2211 @smallexample
2212 struct A @{ virtual void f(); char c1; @};
2213 struct B @{ B(); char c2; @};
2214 struct C : public A, public virtual B @{@};
2215 @end smallexample
2216
2217 @noindent
2218 In this case, G++ will not place @code{B} into the tail-padding for
2219 @code{A}; other compilers will.  You can avoid this problem by
2220 explicitly padding @code{A} so that its size is a multiple of its
2221 alignment (ignoring virtual base classes); that will cause G++ and other
2222 compilers to layout @code{C} identically.
2223
2224 @item
2225 Incorrect handling of bit-fields with declared widths greater than that
2226 of their underlying types, when the bit-fields appear in a union.  For
2227 example:
2228
2229 @smallexample
2230 union U @{ int i : 4096; @};
2231 @end smallexample
2232
2233 @noindent
2234 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2235 union too small by the number of bits in an @code{int}.
2236
2237 @item
2238 Empty classes can be placed at incorrect offsets.  For example:
2239
2240 @smallexample
2241 struct A @{@};
2242
2243 struct B @{
2244   A a;
2245   virtual void f ();
2246 @};
2247
2248 struct C : public B, public A @{@};
2249 @end smallexample
2250
2251 @noindent
2252 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2253 it should be placed at offset zero.  G++ mistakenly believes that the
2254 @code{A} data member of @code{B} is already at offset zero.
2255
2256 @item
2257 Names of template functions whose types involve @code{typename} or
2258 template template parameters can be mangled incorrectly.
2259
2260 @smallexample
2261 template <typename Q>
2262 void f(typename Q::X) @{@}
2263
2264 template <template <typename> class Q>
2265 void f(typename Q<int>::X) @{@}
2266 @end smallexample
2267
2268 @noindent
2269 Instantiations of these templates may be mangled incorrectly.
2270
2271 @end itemize
2272
2273 It also warns psABI related changes.  The known psABI changes at this
2274 point include:
2275
2276 @itemize @bullet
2277
2278 @item
2279 For SYSV/x86-64, when passing union with long double, it is changed to
2280 pass in memory as specified in psABI.  For example:
2281
2282 @smallexample
2283 union U @{
2284   long double ld;
2285   int i;
2286 @};
2287 @end smallexample
2288
2289 @noindent
2290 @code{union U} will always be passed in memory.
2291
2292 @end itemize
2293
2294 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2295 @opindex Wctor-dtor-privacy
2296 @opindex Wno-ctor-dtor-privacy
2297 Warn when a class seems unusable because all the constructors or
2298 destructors in that class are private, and it has neither friends nor
2299 public static member functions.
2300
2301 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2302 @opindex Wnoexcept
2303 @opindex Wno-noexcept
2304 Warn when a noexcept-expression evaluates to false because of a call
2305 to a function that does not have a non-throwing exception
2306 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2307 the compiler to never throw an exception.
2308
2309 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2310 @opindex Wnon-virtual-dtor
2311 @opindex Wno-non-virtual-dtor
2312 Warn when a class has virtual functions and accessible non-virtual
2313 destructor, in which case it would be possible but unsafe to delete
2314 an instance of a derived class through a pointer to the base class.
2315 This warning is also enabled if -Weffc++ is specified.
2316
2317 @item -Wreorder @r{(C++ and Objective-C++ only)}
2318 @opindex Wreorder
2319 @opindex Wno-reorder
2320 @cindex reordering, warning
2321 @cindex warning for reordering of member initializers
2322 Warn when the order of member initializers given in the code does not
2323 match the order in which they must be executed.  For instance:
2324
2325 @smallexample
2326 struct A @{
2327   int i;
2328   int j;
2329   A(): j (0), i (1) @{ @}
2330 @};
2331 @end smallexample
2332
2333 The compiler will rearrange the member initializers for @samp{i}
2334 and @samp{j} to match the declaration order of the members, emitting
2335 a warning to that effect.  This warning is enabled by @option{-Wall}.
2336 @end table
2337
2338 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2339
2340 @table @gcctabopt
2341 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2342 @opindex Weffc++
2343 @opindex Wno-effc++
2344 Warn about violations of the following style guidelines from Scott Meyers'
2345 @cite{Effective C++} book:
2346
2347 @itemize @bullet
2348 @item
2349 Item 11:  Define a copy constructor and an assignment operator for classes
2350 with dynamically allocated memory.
2351
2352 @item
2353 Item 12:  Prefer initialization to assignment in constructors.
2354
2355 @item
2356 Item 14:  Make destructors virtual in base classes.
2357
2358 @item
2359 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2360
2361 @item
2362 Item 23:  Don't try to return a reference when you must return an object.
2363
2364 @end itemize
2365
2366 Also warn about violations of the following style guidelines from
2367 Scott Meyers' @cite{More Effective C++} book:
2368
2369 @itemize @bullet
2370 @item
2371 Item 6:  Distinguish between prefix and postfix forms of increment and
2372 decrement operators.
2373
2374 @item
2375 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2376
2377 @end itemize
2378
2379 When selecting this option, be aware that the standard library
2380 headers do not obey all of these guidelines; use @samp{grep -v}
2381 to filter out those warnings.
2382
2383 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2384 @opindex Wstrict-null-sentinel
2385 @opindex Wno-strict-null-sentinel
2386 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2387 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2388 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2389 it is guaranteed to be of the same size as a pointer.  But this use is
2390 not portable across different compilers.
2391
2392 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2393 @opindex Wno-non-template-friend
2394 @opindex Wnon-template-friend
2395 Disable warnings when non-templatized friend functions are declared
2396 within a template.  Since the advent of explicit template specification
2397 support in G++, if the name of the friend is an unqualified-id (i.e.,
2398 @samp{friend foo(int)}), the C++ language specification demands that the
2399 friend declare or define an ordinary, nontemplate function.  (Section
2400 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2401 could be interpreted as a particular specialization of a templatized
2402 function.  Because this non-conforming behavior is no longer the default
2403 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2404 check existing code for potential trouble spots and is on by default.
2405 This new compiler behavior can be turned off with
2406 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2407 but disables the helpful warning.
2408
2409 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2410 @opindex Wold-style-cast
2411 @opindex Wno-old-style-cast
2412 Warn if an old-style (C-style) cast to a non-void type is used within
2413 a C++ program.  The new-style casts (@samp{dynamic_cast},
2414 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2415 less vulnerable to unintended effects and much easier to search for.
2416
2417 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2418 @opindex Woverloaded-virtual
2419 @opindex Wno-overloaded-virtual
2420 @cindex overloaded virtual fn, warning
2421 @cindex warning for overloaded virtual fn
2422 Warn when a function declaration hides virtual functions from a
2423 base class.  For example, in:
2424
2425 @smallexample
2426 struct A @{
2427   virtual void f();
2428 @};
2429
2430 struct B: public A @{
2431   void f(int);
2432 @};
2433 @end smallexample
2434
2435 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2436 like:
2437
2438 @smallexample
2439 B* b;
2440 b->f();
2441 @end smallexample
2442
2443 will fail to compile.
2444
2445 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2446 @opindex Wno-pmf-conversions
2447 @opindex Wpmf-conversions
2448 Disable the diagnostic for converting a bound pointer to member function
2449 to a plain pointer.
2450
2451 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2452 @opindex Wsign-promo
2453 @opindex Wno-sign-promo
2454 Warn when overload resolution chooses a promotion from unsigned or
2455 enumerated type to a signed type, over a conversion to an unsigned type of
2456 the same size.  Previous versions of G++ would try to preserve
2457 unsignedness, but the standard mandates the current behavior.
2458
2459 @smallexample
2460 struct A @{
2461   operator int ();
2462   A& operator = (int);
2463 @};
2464
2465 main ()
2466 @{
2467   A a,b;
2468   a = b;
2469 @}
2470 @end smallexample
2471
2472 In this example, G++ will synthesize a default @samp{A& operator =
2473 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2474 @end table
2475
2476 @node Objective-C and Objective-C++ Dialect Options
2477 @section Options Controlling Objective-C and Objective-C++ Dialects
2478
2479 @cindex compiler options, Objective-C and Objective-C++
2480 @cindex Objective-C and Objective-C++ options, command line
2481 @cindex options, Objective-C and Objective-C++
2482 (NOTE: This manual does not describe the Objective-C and Objective-C++
2483 languages themselves.  See @xref{Standards,,Language Standards
2484 Supported by GCC}, for references.)
2485
2486 This section describes the command-line options that are only meaningful
2487 for Objective-C and Objective-C++ programs, but you can also use most of
2488 the language-independent GNU compiler options.
2489 For example, you might compile a file @code{some_class.m} like this:
2490
2491 @smallexample
2492 gcc -g -fgnu-runtime -O -c some_class.m
2493 @end smallexample
2494
2495 @noindent
2496 In this example, @option{-fgnu-runtime} is an option meant only for
2497 Objective-C and Objective-C++ programs; you can use the other options with
2498 any language supported by GCC@.
2499
2500 Note that since Objective-C is an extension of the C language, Objective-C
2501 compilations may also use options specific to the C front-end (e.g.,
2502 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2503 C++-specific options (e.g., @option{-Wabi}).
2504
2505 Here is a list of options that are @emph{only} for compiling Objective-C
2506 and Objective-C++ programs:
2507
2508 @table @gcctabopt
2509 @item -fconstant-string-class=@var{class-name}
2510 @opindex fconstant-string-class
2511 Use @var{class-name} as the name of the class to instantiate for each
2512 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2513 class name is @code{NXConstantString} if the GNU runtime is being used, and
2514 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2515 @option{-fconstant-cfstrings} option, if also present, will override the
2516 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2517 to be laid out as constant CoreFoundation strings.
2518
2519 @item -fgnu-runtime
2520 @opindex fgnu-runtime
2521 Generate object code compatible with the standard GNU Objective-C
2522 runtime.  This is the default for most types of systems.
2523
2524 @item -fnext-runtime
2525 @opindex fnext-runtime
2526 Generate output compatible with the NeXT runtime.  This is the default
2527 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2528 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2529 used.
2530
2531 @item -fno-nil-receivers
2532 @opindex fno-nil-receivers
2533 Assume that all Objective-C message dispatches (e.g.,
2534 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2535 is not @code{nil}.  This allows for more efficient entry points in the runtime
2536 to be used.  Currently, this option is only available in conjunction with
2537 the NeXT runtime on Mac OS X 10.3 and later.
2538
2539 @item -fobjc-call-cxx-cdtors
2540 @opindex fobjc-call-cxx-cdtors
2541 For each Objective-C class, check if any of its instance variables is a
2542 C++ object with a non-trivial default constructor.  If so, synthesize a
2543 special @code{- (id) .cxx_construct} instance method that will run
2544 non-trivial default constructors on any such instance variables, in order,
2545 and then return @code{self}.  Similarly, check if any instance variable
2546 is a C++ object with a non-trivial destructor, and if so, synthesize a
2547 special @code{- (void) .cxx_destruct} method that will run
2548 all such default destructors, in reverse order.
2549
2550 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2551 thusly generated will only operate on instance variables declared in the
2552 current Objective-C class, and not those inherited from superclasses.  It
2553 is the responsibility of the Objective-C runtime to invoke all such methods
2554 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2555 will be invoked by the runtime immediately after a new object
2556 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2557 be invoked immediately before the runtime deallocates an object instance.
2558
2559 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2560 support for invoking the @code{- (id) .cxx_construct} and
2561 @code{- (void) .cxx_destruct} methods.
2562
2563 @item -fobjc-direct-dispatch
2564 @opindex fobjc-direct-dispatch
2565 Allow fast jumps to the message dispatcher.  On Darwin this is
2566 accomplished via the comm page.
2567
2568 @item -fobjc-exceptions
2569 @opindex fobjc-exceptions
2570 Enable syntactic support for structured exception handling in Objective-C,
2571 similar to what is offered by C++ and Java.  This option is
2572 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2573 earlier.
2574
2575 @smallexample
2576   @@try @{
2577     @dots{}
2578        @@throw expr;
2579     @dots{}
2580   @}
2581   @@catch (AnObjCClass *exc) @{
2582     @dots{}
2583       @@throw expr;
2584     @dots{}
2585       @@throw;
2586     @dots{}
2587   @}
2588   @@catch (AnotherClass *exc) @{
2589     @dots{}
2590   @}
2591   @@catch (id allOthers) @{
2592     @dots{}
2593   @}
2594   @@finally @{
2595     @dots{}
2596       @@throw expr;
2597     @dots{}
2598   @}
2599 @end smallexample
2600
2601 The @code{@@throw} statement may appear anywhere in an Objective-C or
2602 Objective-C++ program; when used inside of a @code{@@catch} block, the
2603 @code{@@throw} may appear without an argument (as shown above), in which case
2604 the object caught by the @code{@@catch} will be rethrown.
2605
2606 Note that only (pointers to) Objective-C objects may be thrown and
2607 caught using this scheme.  When an object is thrown, it will be caught
2608 by the nearest @code{@@catch} clause capable of handling objects of that type,
2609 analogously to how @code{catch} blocks work in C++ and Java.  A
2610 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2611 any and all Objective-C exceptions not caught by previous @code{@@catch}
2612 clauses (if any).
2613
2614 The @code{@@finally} clause, if present, will be executed upon exit from the
2615 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2616 regardless of whether any exceptions are thrown, caught or rethrown
2617 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2618 of the @code{finally} clause in Java.
2619
2620 There are several caveats to using the new exception mechanism:
2621
2622 @itemize @bullet
2623 @item
2624 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2625 idioms provided by the @code{NSException} class, the new
2626 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2627 systems, due to additional functionality needed in the (NeXT) Objective-C
2628 runtime.
2629
2630 @item
2631 As mentioned above, the new exceptions do not support handling
2632 types other than Objective-C objects.   Furthermore, when used from
2633 Objective-C++, the Objective-C exception model does not interoperate with C++
2634 exceptions at this time.  This means you cannot @code{@@throw} an exception
2635 from Objective-C and @code{catch} it in C++, or vice versa
2636 (i.e., @code{throw @dots{} @@catch}).
2637 @end itemize
2638
2639 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2640 blocks for thread-safe execution:
2641
2642 @smallexample
2643   @@synchronized (ObjCClass *guard) @{
2644     @dots{}
2645   @}
2646 @end smallexample
2647
2648 Upon entering the @code{@@synchronized} block, a thread of execution shall
2649 first check whether a lock has been placed on the corresponding @code{guard}
2650 object by another thread.  If it has, the current thread shall wait until
2651 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2652 the current thread will place its own lock on it, execute the code contained in
2653 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2654 making @code{guard} available to other threads).
2655
2656 Unlike Java, Objective-C does not allow for entire methods to be marked
2657 @code{@@synchronized}.  Note that throwing exceptions out of
2658 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2659 to be unlocked properly.
2660
2661 @item -fobjc-gc
2662 @opindex fobjc-gc
2663 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2664
2665 @item -freplace-objc-classes
2666 @opindex freplace-objc-classes
2667 Emit a special marker instructing @command{ld(1)} not to statically link in
2668 the resulting object file, and allow @command{dyld(1)} to load it in at
2669 run time instead.  This is used in conjunction with the Fix-and-Continue
2670 debugging mode, where the object file in question may be recompiled and
2671 dynamically reloaded in the course of program execution, without the need
2672 to restart the program itself.  Currently, Fix-and-Continue functionality
2673 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2674 and later.
2675
2676 @item -fzero-link
2677 @opindex fzero-link
2678 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2679 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2680 compile time) with static class references that get initialized at load time,
2681 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2682 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2683 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2684 for individual class implementations to be modified during program execution.
2685
2686 @item -gen-decls
2687 @opindex gen-decls
2688 Dump interface declarations for all classes seen in the source file to a
2689 file named @file{@var{sourcename}.decl}.
2690
2691 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2692 @opindex Wassign-intercept
2693 @opindex Wno-assign-intercept
2694 Warn whenever an Objective-C assignment is being intercepted by the
2695 garbage collector.
2696
2697 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2698 @opindex Wno-protocol
2699 @opindex Wprotocol
2700 If a class is declared to implement a protocol, a warning is issued for
2701 every method in the protocol that is not implemented by the class.  The
2702 default behavior is to issue a warning for every method not explicitly
2703 implemented in the class, even if a method implementation is inherited
2704 from the superclass.  If you use the @option{-Wno-protocol} option, then
2705 methods inherited from the superclass are considered to be implemented,
2706 and no warning is issued for them.
2707
2708 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2709 @opindex Wselector
2710 @opindex Wno-selector
2711 Warn if multiple methods of different types for the same selector are
2712 found during compilation.  The check is performed on the list of methods
2713 in the final stage of compilation.  Additionally, a check is performed
2714 for each selector appearing in a @code{@@selector(@dots{})}
2715 expression, and a corresponding method for that selector has been found
2716 during compilation.  Because these checks scan the method table only at
2717 the end of compilation, these warnings are not produced if the final
2718 stage of compilation is not reached, for example because an error is
2719 found during compilation, or because the @option{-fsyntax-only} option is
2720 being used.
2721
2722 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2723 @opindex Wstrict-selector-match
2724 @opindex Wno-strict-selector-match
2725 Warn if multiple methods with differing argument and/or return types are
2726 found for a given selector when attempting to send a message using this
2727 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2728 is off (which is the default behavior), the compiler will omit such warnings
2729 if any differences found are confined to types which share the same size
2730 and alignment.
2731
2732 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2733 @opindex Wundeclared-selector
2734 @opindex Wno-undeclared-selector
2735 Warn if a @code{@@selector(@dots{})} expression referring to an
2736 undeclared selector is found.  A selector is considered undeclared if no
2737 method with that name has been declared before the
2738 @code{@@selector(@dots{})} expression, either explicitly in an
2739 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2740 an @code{@@implementation} section.  This option always performs its
2741 checks as soon as a @code{@@selector(@dots{})} expression is found,
2742 while @option{-Wselector} only performs its checks in the final stage of
2743 compilation.  This also enforces the coding style convention
2744 that methods and selectors must be declared before being used.
2745
2746 @item -print-objc-runtime-info
2747 @opindex print-objc-runtime-info
2748 Generate C header describing the largest structure that is passed by
2749 value, if any.
2750
2751 @end table
2752
2753 @node Language Independent Options
2754 @section Options to Control Diagnostic Messages Formatting
2755 @cindex options to control diagnostics formatting
2756 @cindex diagnostic messages
2757 @cindex message formatting
2758
2759 Traditionally, diagnostic messages have been formatted irrespective of
2760 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2761 below can be used to control the diagnostic messages formatting
2762 algorithm, e.g.@: how many characters per line, how often source location
2763 information should be reported.  Right now, only the C++ front end can
2764 honor these options.  However it is expected, in the near future, that
2765 the remaining front ends would be able to digest them correctly.
2766
2767 @table @gcctabopt
2768 @item -fmessage-length=@var{n}
2769 @opindex fmessage-length
2770 Try to format error messages so that they fit on lines of about @var{n}
2771 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2772 the front ends supported by GCC@.  If @var{n} is zero, then no
2773 line-wrapping will be done; each error message will appear on a single
2774 line.
2775
2776 @opindex fdiagnostics-show-location
2777 @item -fdiagnostics-show-location=once
2778 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2779 reporter to emit @emph{once} source location information; that is, in
2780 case the message is too long to fit on a single physical line and has to
2781 be wrapped, the source location won't be emitted (as prefix) again,
2782 over and over, in subsequent continuation lines.  This is the default
2783 behavior.
2784
2785 @item -fdiagnostics-show-location=every-line
2786 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2787 messages reporter to emit the same source location information (as
2788 prefix) for physical lines that result from the process of breaking
2789 a message which is too long to fit on a single line.
2790
2791 @item -fdiagnostics-show-option
2792 @opindex fdiagnostics-show-option
2793 This option instructs the diagnostic machinery to add text to each
2794 diagnostic emitted, which indicates which command line option directly
2795 controls that diagnostic, when such an option is known to the
2796 diagnostic machinery.
2797
2798 @item -Wcoverage-mismatch
2799 @opindex Wcoverage-mismatch
2800 Warn if feedback profiles do not match when using the
2801 @option{-fprofile-use} option.
2802 If a source file was changed between @option{-fprofile-gen} and
2803 @option{-fprofile-use}, the files with the profile feedback can fail
2804 to match the source file and GCC can not use the profile feedback
2805 information.  By default, this warning is enabled and is treated as an
2806 error.  @option{-Wno-coverage-mismatch} can be used to disable the
2807 warning or @option{-Wno-error=coverage-mismatch} can be used to
2808 disable the error.  Disable the error for this warning can result in
2809 poorly optimized code, so disabling the error is useful only in the
2810 case of very minor changes such as bug fixes to an existing code-base.
2811 Completely disabling the warning is not recommended.
2812
2813 @end table
2814
2815 @node Warning Options
2816 @section Options to Request or Suppress Warnings
2817 @cindex options to control warnings
2818 @cindex warning messages
2819 @cindex messages, warning
2820 @cindex suppressing warnings
2821
2822 Warnings are diagnostic messages that report constructions which
2823 are not inherently erroneous but which are risky or suggest there
2824 may have been an error.
2825
2826 The following language-independent options do not enable specific
2827 warnings but control the kinds of diagnostics produced by GCC.
2828
2829 @table @gcctabopt
2830 @cindex syntax checking
2831 @item -fsyntax-only
2832 @opindex fsyntax-only
2833 Check the code for syntax errors, but don't do anything beyond that.
2834
2835 @item -w
2836 @opindex w
2837 Inhibit all warning messages.
2838
2839 @item -Werror
2840 @opindex Werror
2841 @opindex Wno-error
2842 Make all warnings into errors.
2843
2844 @item -Werror=
2845 @opindex Werror=
2846 @opindex Wno-error=
2847 Make the specified warning into an error.  The specifier for a warning
2848 is appended, for example @option{-Werror=switch} turns the warnings
2849 controlled by @option{-Wswitch} into errors.  This switch takes a
2850 negative form, to be used to negate @option{-Werror} for specific
2851 warnings, for example @option{-Wno-error=switch} makes
2852 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2853 is in effect.  You can use the @option{-fdiagnostics-show-option}
2854 option to have each controllable warning amended with the option which
2855 controls it, to determine what to use with this option.
2856
2857 Note that specifying @option{-Werror=}@var{foo} automatically implies
2858 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2859 imply anything.
2860
2861 @item -Wfatal-errors
2862 @opindex Wfatal-errors
2863 @opindex Wno-fatal-errors
2864 This option causes the compiler to abort compilation on the first error
2865 occurred rather than trying to keep going and printing further error
2866 messages.
2867
2868 @end table
2869
2870 You can request many specific warnings with options beginning
2871 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2872 implicit declarations.  Each of these specific warning options also
2873 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2874 example, @option{-Wno-implicit}.  This manual lists only one of the
2875 two forms, whichever is not the default.  For further,
2876 language-specific options also refer to @ref{C++ Dialect Options} and
2877 @ref{Objective-C and Objective-C++ Dialect Options}.
2878
2879 When an unrecognized warning option is requested (e.g.,
2880 @option{-Wunknown-warning}), GCC will emit a diagnostic stating
2881 that the option is not recognized.  However, if the @option{-Wno-} form
2882 is used, the behavior is slightly different: No diagnostic will be
2883 produced for @option{-Wno-unknown-warning} unless other diagnostics
2884 are being produced.  This allows the use of new @option{-Wno-} options
2885 with old compilers, but if something goes wrong, the compiler will
2886 warn that an unrecognized option was used.
2887
2888 @table @gcctabopt
2889 @item -pedantic
2890 @opindex pedantic
2891 Issue all the warnings demanded by strict ISO C and ISO C++;
2892 reject all programs that use forbidden extensions, and some other
2893 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2894 version of the ISO C standard specified by any @option{-std} option used.
2895
2896 Valid ISO C and ISO C++ programs should compile properly with or without
2897 this option (though a rare few will require @option{-ansi} or a
2898 @option{-std} option specifying the required version of ISO C)@.  However,
2899 without this option, certain GNU extensions and traditional C and C++
2900 features are supported as well.  With this option, they are rejected.
2901
2902 @option{-pedantic} does not cause warning messages for use of the
2903 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2904 warnings are also disabled in the expression that follows
2905 @code{__extension__}.  However, only system header files should use
2906 these escape routes; application programs should avoid them.
2907 @xref{Alternate Keywords}.
2908
2909 Some users try to use @option{-pedantic} to check programs for strict ISO
2910 C conformance.  They soon find that it does not do quite what they want:
2911 it finds some non-ISO practices, but not all---only those for which
2912 ISO C @emph{requires} a diagnostic, and some others for which
2913 diagnostics have been added.
2914
2915 A feature to report any failure to conform to ISO C might be useful in
2916 some instances, but would require considerable additional work and would
2917 be quite different from @option{-pedantic}.  We don't have plans to
2918 support such a feature in the near future.
2919
2920 Where the standard specified with @option{-std} represents a GNU
2921 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
2922 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2923 extended dialect is based.  Warnings from @option{-pedantic} are given
2924 where they are required by the base standard.  (It would not make sense
2925 for such warnings to be given only for features not in the specified GNU
2926 C dialect, since by definition the GNU dialects of C include all
2927 features the compiler supports with the given option, and there would be
2928 nothing to warn about.)
2929
2930 @item -pedantic-errors
2931 @opindex pedantic-errors
2932 Like @option{-pedantic}, except that errors are produced rather than
2933 warnings.
2934
2935 @item -Wall
2936 @opindex Wall
2937 @opindex Wno-all
2938 This enables all the warnings about constructions that some users
2939 consider questionable, and that are easy to avoid (or modify to
2940 prevent the warning), even in conjunction with macros.  This also
2941 enables some language-specific warnings described in @ref{C++ Dialect
2942 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2943
2944 @option{-Wall} turns on the following warning flags:
2945
2946 @gccoptlist{-Waddress   @gol
2947 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2948 -Wc++0x-compat  @gol
2949 -Wchar-subscripts  @gol
2950 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2951 -Wimplicit-int @r{(C and Objective-C only)} @gol
2952 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
2953 -Wcomment  @gol
2954 -Wformat   @gol
2955 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2956 -Wmissing-braces  @gol
2957 -Wnonnull  @gol
2958 -Wparentheses  @gol
2959 -Wpointer-sign  @gol
2960 -Wreorder   @gol
2961 -Wreturn-type  @gol
2962 -Wsequence-point  @gol
2963 -Wsign-compare @r{(only in C++)}  @gol
2964 -Wstrict-aliasing  @gol
2965 -Wstrict-overflow=1  @gol
2966 -Wswitch  @gol
2967 -Wtrigraphs  @gol
2968 -Wuninitialized  @gol
2969 -Wunknown-pragmas  @gol
2970 -Wunused-function  @gol
2971 -Wunused-label     @gol
2972 -Wunused-value     @gol
2973 -Wunused-variable  @gol
2974 -Wvolatile-register-var @gol
2975 }
2976
2977 Note that some warning flags are not implied by @option{-Wall}.  Some of
2978 them warn about constructions that users generally do not consider
2979 questionable, but which occasionally you might wish to check for;
2980 others warn about constructions that are necessary or hard to avoid in
2981 some cases, and there is no simple way to modify the code to suppress
2982 the warning. Some of them are enabled by @option{-Wextra} but many of
2983 them must be enabled individually.
2984
2985 @item -Wextra
2986 @opindex W
2987 @opindex Wextra
2988 @opindex Wno-extra
2989 This enables some extra warning flags that are not enabled by
2990 @option{-Wall}. (This option used to be called @option{-W}.  The older
2991 name is still supported, but the newer name is more descriptive.)
2992
2993 @gccoptlist{-Wclobbered  @gol
2994 -Wempty-body  @gol
2995 -Wignored-qualifiers @gol
2996 -Wmissing-field-initializers  @gol
2997 -Wmissing-parameter-type @r{(C only)}  @gol
2998 -Wold-style-declaration @r{(C only)}  @gol
2999 -Woverride-init  @gol
3000 -Wsign-compare  @gol
3001 -Wtype-limits  @gol
3002 -Wuninitialized  @gol
3003 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3004 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3005 }
3006
3007 The option @option{-Wextra} also prints warning messages for the
3008 following cases:
3009
3010 @itemize @bullet
3011
3012 @item
3013 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3014 @samp{>}, or @samp{>=}.
3015
3016 @item
3017 (C++ only) An enumerator and a non-enumerator both appear in a
3018 conditional expression.
3019
3020 @item
3021 (C++ only) Ambiguous virtual bases.
3022
3023 @item
3024 (C++ only) Subscripting an array which has been declared @samp{register}.
3025
3026 @item
3027 (C++ only) Taking the address of a variable which has been declared
3028 @samp{register}.
3029
3030 @item
3031 (C++ only) A base class is not initialized in a derived class' copy
3032 constructor.
3033
3034 @end itemize
3035
3036 @item -Wchar-subscripts
3037 @opindex Wchar-subscripts
3038 @opindex Wno-char-subscripts
3039 Warn if an array subscript has type @code{char}.  This is a common cause
3040 of error, as programmers often forget that this type is signed on some
3041 machines.
3042 This warning is enabled by @option{-Wall}.
3043
3044 @item -Wcomment
3045 @opindex Wcomment
3046 @opindex Wno-comment
3047 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3048 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3049 This warning is enabled by @option{-Wall}.
3050
3051 @item -Wno-cpp \
3052 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3053
3054 Suppress warning messages emitted by @code{#warning} directives.
3055
3056 @item -Wformat
3057 @opindex Wformat
3058 @opindex Wno-format
3059 @opindex ffreestanding
3060 @opindex fno-builtin
3061 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3062 the arguments supplied have types appropriate to the format string
3063 specified, and that the conversions specified in the format string make
3064 sense.  This includes standard functions, and others specified by format
3065 attributes (@pxref{Function Attributes}), in the @code{printf},
3066 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3067 not in the C standard) families (or other target-specific families).
3068 Which functions are checked without format attributes having been
3069 specified depends on the standard version selected, and such checks of
3070 functions without the attribute specified are disabled by
3071 @option{-ffreestanding} or @option{-fno-builtin}.
3072
3073 The formats are checked against the format features supported by GNU
3074 libc version 2.2.  These include all ISO C90 and C99 features, as well
3075 as features from the Single Unix Specification and some BSD and GNU
3076 extensions.  Other library implementations may not support all these
3077 features; GCC does not support warning about features that go beyond a
3078 particular library's limitations.  However, if @option{-pedantic} is used
3079 with @option{-Wformat}, warnings will be given about format features not
3080 in the selected standard version (but not for @code{strfmon} formats,
3081 since those are not in any version of the C standard).  @xref{C Dialect
3082 Options,,Options Controlling C Dialect}.
3083
3084 Since @option{-Wformat} also checks for null format arguments for
3085 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3086
3087 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3088 aspects of format checking, the options @option{-Wformat-y2k},
3089 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3090 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3091 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3092
3093 @item -Wformat-y2k
3094 @opindex Wformat-y2k
3095 @opindex Wno-format-y2k
3096 If @option{-Wformat} is specified, also warn about @code{strftime}
3097 formats which may yield only a two-digit year.
3098
3099 @item -Wno-format-contains-nul
3100 @opindex Wno-format-contains-nul
3101 @opindex Wformat-contains-nul
3102 If @option{-Wformat} is specified, do not warn about format strings that
3103 contain NUL bytes.
3104
3105 @item -Wno-format-extra-args
3106 @opindex Wno-format-extra-args
3107 @opindex Wformat-extra-args
3108 If @option{-Wformat} is specified, do not warn about excess arguments to a
3109 @code{printf} or @code{scanf} format function.  The C standard specifies
3110 that such arguments are ignored.
3111
3112 Where the unused arguments lie between used arguments that are
3113 specified with @samp{$} operand number specifications, normally
3114 warnings are still given, since the implementation could not know what
3115 type to pass to @code{va_arg} to skip the unused arguments.  However,
3116 in the case of @code{scanf} formats, this option will suppress the
3117 warning if the unused arguments are all pointers, since the Single
3118 Unix Specification says that such unused arguments are allowed.
3119
3120 @item -Wno-format-zero-length @r{(C and Objective-C only)}
3121 @opindex Wno-format-zero-length
3122 @opindex Wformat-zero-length
3123 If @option{-Wformat} is specified, do not warn about zero-length formats.
3124 The C standard specifies that zero-length formats are allowed.
3125
3126 @item -Wformat-nonliteral
3127 @opindex Wformat-nonliteral
3128 @opindex Wno-format-nonliteral
3129 If @option{-Wformat} is specified, also warn if the format string is not a
3130 string literal and so cannot be checked, unless the format function
3131 takes its format arguments as a @code{va_list}.
3132
3133 @item -Wformat-security
3134 @opindex Wformat-security
3135 @opindex Wno-format-security
3136 If @option{-Wformat} is specified, also warn about uses of format
3137 functions that represent possible security problems.  At present, this
3138 warns about calls to @code{printf} and @code{scanf} functions where the
3139 format string is not a string literal and there are no format arguments,
3140 as in @code{printf (foo);}.  This may be a security hole if the format
3141 string came from untrusted input and contains @samp{%n}.  (This is
3142 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3143 in future warnings may be added to @option{-Wformat-security} that are not
3144 included in @option{-Wformat-nonliteral}.)
3145
3146 @item -Wformat=2
3147 @opindex Wformat=2
3148 @opindex Wno-format=2
3149 Enable @option{-Wformat} plus format checks not included in
3150 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
3151 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3152
3153 @item -Wnonnull @r{(C and Objective-C only)}
3154 @opindex Wnonnull
3155 @opindex Wno-nonnull
3156 Warn about passing a null pointer for arguments marked as
3157 requiring a non-null value by the @code{nonnull} function attribute.
3158
3159 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3160 can be disabled with the @option{-Wno-nonnull} option.
3161
3162 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3163 @opindex Winit-self
3164 @opindex Wno-init-self
3165 Warn about uninitialized variables which are initialized with themselves.
3166 Note this option can only be used with the @option{-Wuninitialized} option.
3167
3168 For example, GCC will warn about @code{i} being uninitialized in the
3169 following snippet only when @option{-Winit-self} has been specified:
3170 @smallexample
3171 @group
3172 int f()
3173 @{
3174   int i = i;
3175   return i;
3176 @}
3177 @end group
3178 @end smallexample
3179
3180 @item -Wimplicit-int @r{(C and Objective-C only)}
3181 @opindex Wimplicit-int
3182 @opindex Wno-implicit-int
3183 Warn when a declaration does not specify a type.
3184 This warning is enabled by @option{-Wall}.
3185
3186 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3187 @opindex Wimplicit-function-declaration
3188 @opindex Wno-implicit-function-declaration
3189 Give a warning whenever a function is used before being declared. In
3190 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3191 enabled by default and it is made into an error by
3192 @option{-pedantic-errors}. This warning is also enabled by
3193 @option{-Wall}.
3194
3195 @item -Wimplicit @r{(C and Objective-C only)}
3196 @opindex Wimplicit
3197 @opindex Wno-implicit
3198 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3199 This warning is enabled by @option{-Wall}.
3200
3201 @item -Wignored-qualifiers @r{(C and C++ only)}
3202 @opindex Wignored-qualifiers
3203 @opindex Wno-ignored-qualifiers
3204 Warn if the return type of a function has a type qualifier
3205 such as @code{const}.  For ISO C such a type qualifier has no effect,
3206 since the value returned by a function is not an lvalue.
3207 For C++, the warning is only emitted for scalar types or @code{void}.
3208 ISO C prohibits qualified @code{void} return types on function
3209 definitions, so such return types always receive a warning
3210 even without this option.
3211
3212 This warning is also enabled by @option{-Wextra}.
3213
3214 @item -Wmain
3215 @opindex Wmain
3216 @opindex Wno-main
3217 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3218 a function with external linkage, returning int, taking either zero
3219 arguments, two, or three arguments of appropriate types.  This warning
3220 is enabled by default in C++ and is enabled by either @option{-Wall}
3221 or @option{-pedantic}.
3222
3223 @item -Wmissing-braces
3224 @opindex Wmissing-braces
3225 @opindex Wno-missing-braces
3226 Warn if an aggregate or union initializer is not fully bracketed.  In
3227 the following example, the initializer for @samp{a} is not fully
3228 bracketed, but that for @samp{b} is fully bracketed.
3229
3230 @smallexample
3231 int a[2][2] = @{ 0, 1, 2, 3 @};
3232 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3233 @end smallexample
3234
3235 This warning is enabled by @option{-Wall}.
3236
3237 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3238 @opindex Wmissing-include-dirs
3239 @opindex Wno-missing-include-dirs
3240 Warn if a user-supplied include directory does not exist.
3241
3242 @item -Wparentheses
3243 @opindex Wparentheses
3244 @opindex Wno-parentheses
3245 Warn if parentheses are omitted in certain contexts, such
3246 as when there is an assignment in a context where a truth value
3247 is expected, or when operators are nested whose precedence people
3248 often get confused about.
3249
3250 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3251 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3252 interpretation from that of ordinary mathematical notation.
3253
3254 Also warn about constructions where there may be confusion to which
3255 @code{if} statement an @code{else} branch belongs.  Here is an example of
3256 such a case:
3257
3258 @smallexample
3259 @group
3260 @{
3261   if (a)
3262     if (b)
3263       foo ();
3264   else
3265     bar ();
3266 @}
3267 @end group
3268 @end smallexample
3269
3270 In C/C++, every @code{else} branch belongs to the innermost possible
3271 @code{if} statement, which in this example is @code{if (b)}.  This is
3272 often not what the programmer expected, as illustrated in the above
3273 example by indentation the programmer chose.  When there is the
3274 potential for this confusion, GCC will issue a warning when this flag
3275 is specified.  To eliminate the warning, add explicit braces around
3276 the innermost @code{if} statement so there is no way the @code{else}
3277 could belong to the enclosing @code{if}.  The resulting code would
3278 look like this:
3279
3280 @smallexample
3281 @group
3282 @{
3283   if (a)
3284     @{
3285       if (b)
3286         foo ();
3287       else
3288         bar ();
3289     @}
3290 @}
3291 @end group
3292 @end smallexample
3293
3294 Also warn for dangerous uses of the 
3295 ?: with omitted middle operand GNU extension. When the condition
3296 in the ?: operator is a boolean expression the omitted value will
3297 be always 1. Often the user expects it to be a value computed
3298 inside the conditional expression instead. 
3299
3300 This warning is enabled by @option{-Wall}.
3301
3302 @item -Wsequence-point
3303 @opindex Wsequence-point
3304 @opindex Wno-sequence-point
3305 Warn about code that may have undefined semantics because of violations
3306 of sequence point rules in the C and C++ standards.
3307
3308 The C and C++ standards defines the order in which expressions in a C/C++
3309 program are evaluated in terms of @dfn{sequence points}, which represent
3310 a partial ordering between the execution of parts of the program: those
3311 executed before the sequence point, and those executed after it.  These
3312 occur after the evaluation of a full expression (one which is not part
3313 of a larger expression), after the evaluation of the first operand of a
3314 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3315 function is called (but after the evaluation of its arguments and the
3316 expression denoting the called function), and in certain other places.
3317 Other than as expressed by the sequence point rules, the order of
3318 evaluation of subexpressions of an expression is not specified.  All
3319 these rules describe only a partial order rather than a total order,
3320 since, for example, if two functions are called within one expression
3321 with no sequence point between them, the order in which the functions
3322 are called is not specified.  However, the standards committee have
3323 ruled that function calls do not overlap.
3324
3325 It is not specified when between sequence points modifications to the
3326 values of objects take effect.  Programs whose behavior depends on this
3327 have undefined behavior; the C and C++ standards specify that ``Between
3328 the previous and next sequence point an object shall have its stored
3329 value modified at most once by the evaluation of an expression.
3330 Furthermore, the prior value shall be read only to determine the value
3331 to be stored.''.  If a program breaks these rules, the results on any
3332 particular implementation are entirely unpredictable.
3333
3334 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3335 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3336 diagnosed by this option, and it may give an occasional false positive
3337 result, but in general it has been found fairly effective at detecting
3338 this sort of problem in programs.
3339
3340 The standard is worded confusingly, therefore there is some debate
3341 over the precise meaning of the sequence point rules in subtle cases.
3342 Links to discussions of the problem, including proposed formal
3343 definitions, may be found on the GCC readings page, at
3344 @w{@uref{http://gcc.gnu.org/readings.html}}.
3345
3346 This warning is enabled by @option{-Wall} for C and C++.
3347
3348 @item -Wreturn-type
3349 @opindex Wreturn-type
3350 @opindex Wno-return-type
3351 Warn whenever a function is defined with a return-type that defaults
3352 to @code{int}.  Also warn about any @code{return} statement with no
3353 return-value in a function whose return-type is not @code{void}
3354 (falling off the end of the function body is considered returning
3355 without a value), and about a @code{return} statement with an
3356 expression in a function whose return-type is @code{void}.
3357
3358 For C++, a function without return type always produces a diagnostic
3359 message, even when @option{-Wno-return-type} is specified.  The only
3360 exceptions are @samp{main} and functions defined in system headers.
3361
3362 This warning is enabled by @option{-Wall}.
3363
3364 @item -Wswitch
3365 @opindex Wswitch
3366 @opindex Wno-switch
3367 Warn whenever a @code{switch} statement has an index of enumerated type
3368 and lacks a @code{case} for one or more of the named codes of that
3369 enumeration.  (The presence of a @code{default} label prevents this
3370 warning.)  @code{case} labels outside the enumeration range also
3371 provoke warnings when this option is used (even if there is a
3372 @code{default} label).
3373 This warning is enabled by @option{-Wall}.
3374
3375 @item -Wswitch-default
3376 @opindex Wswitch-default
3377 @opindex Wno-switch-default
3378 Warn whenever a @code{switch} statement does not have a @code{default}
3379 case.
3380
3381 @item -Wswitch-enum
3382 @opindex Wswitch-enum
3383 @opindex Wno-switch-enum
3384 Warn whenever a @code{switch} statement has an index of enumerated type
3385 and lacks a @code{case} for one or more of the named codes of that
3386 enumeration.  @code{case} labels outside the enumeration range also
3387 provoke warnings when this option is used.  The only difference
3388 between @option{-Wswitch} and this option is that this option gives a
3389 warning about an omitted enumeration code even if there is a
3390 @code{default} label.
3391
3392 @item -Wsync-nand @r{(C and C++ only)}
3393 @opindex Wsync-nand
3394 @opindex Wno-sync-nand
3395 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3396 built-in functions are used.  These functions changed semantics in GCC 4.4.
3397
3398 @item -Wtrigraphs
3399 @opindex Wtrigraphs
3400 @opindex Wno-trigraphs
3401 Warn if any trigraphs are encountered that might change the meaning of
3402 the program (trigraphs within comments are not warned about).
3403 This warning is enabled by @option{-Wall}.
3404
3405 @item -Wunused-but-set-parameter
3406 @opindex Wunused-but-set-parameter
3407 @opindex Wno-unused-but-set-parameter
3408 Warn whenever a function parameter is assigned to, but otherwise unused
3409 (aside from its declaration).
3410
3411 To suppress this warning use the @samp{unused} attribute
3412 (@pxref{Variable Attributes}).
3413
3414 This warning is also enabled by @option{-Wunused} together with
3415 @option{-Wextra}.
3416
3417 @item -Wunused-but-set-variable
3418 @opindex Wunused-but-set-variable
3419 @opindex Wno-unused-but-set-variable
3420 Warn whenever a local variable is assigned to, but otherwise unused
3421 (aside from its declaration).
3422 This warning is enabled by @option{-Wall}.
3423
3424 To suppress this warning use the @samp{unused} attribute
3425 (@pxref{Variable Attributes}).
3426
3427 This warning is also enabled by @option{-Wunused}, which is enabled
3428 by @option{-Wall}.
3429
3430 @item -Wunused-function
3431 @opindex Wunused-function
3432 @opindex Wno-unused-function
3433 Warn whenever a static function is declared but not defined or a
3434 non-inline static function is unused.
3435 This warning is enabled by @option{-Wall}.
3436
3437 @item -Wunused-label
3438 @opindex Wunused-label
3439 @opindex Wno-unused-label
3440 Warn whenever a label is declared but not used.
3441 This warning is enabled by @option{-Wall}.
3442
3443 To suppress this warning use the @samp{unused} attribute
3444 (@pxref{Variable Attributes}).
3445
3446 @item -Wunused-parameter
3447 @opindex Wunused-parameter
3448 @opindex Wno-unused-parameter
3449 Warn whenever a function parameter is unused aside from its declaration.
3450
3451 To suppress this warning use the @samp{unused} attribute
3452 (@pxref{Variable Attributes}).
3453
3454 @item -Wno-unused-result
3455 @opindex Wunused-result
3456 @opindex Wno-unused-result
3457 Do not warn if a caller of a function marked with attribute
3458 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3459 its return value. The default is @option{-Wunused-result}.
3460
3461 @item -Wunused-variable
3462 @opindex Wunused-variable
3463 @opindex Wno-unused-variable
3464 Warn whenever a local variable or non-constant static variable is unused
3465 aside from its declaration.
3466 This warning is enabled by @option{-Wall}.
3467
3468 To suppress this warning use the @samp{unused} attribute
3469 (@pxref{Variable Attributes}).
3470
3471 @item -Wunused-value
3472 @opindex Wunused-value
3473 @opindex Wno-unused-value
3474 Warn whenever a statement computes a result that is explicitly not
3475 used. To suppress this warning cast the unused expression to
3476 @samp{void}. This includes an expression-statement or the left-hand
3477 side of a comma expression that contains no side effects. For example,
3478 an expression such as @samp{x[i,j]} will cause a warning, while
3479 @samp{x[(void)i,j]} will not.
3480
3481 This warning is enabled by @option{-Wall}.
3482
3483 @item -Wunused
3484 @opindex Wunused
3485 @opindex Wno-unused
3486 All the above @option{-Wunused} options combined.
3487
3488 In order to get a warning about an unused function parameter, you must
3489 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3490 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3491
3492 @item -Wuninitialized
3493 @opindex Wuninitialized
3494 @opindex Wno-uninitialized
3495 Warn if an automatic variable is used without first being initialized
3496 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3497 warn if a non-static reference or non-static @samp{const} member
3498 appears in a class without constructors.
3499
3500 If you want to warn about code which uses the uninitialized value of the
3501 variable in its own initializer, use the @option{-Winit-self} option.
3502
3503 These warnings occur for individual uninitialized or clobbered
3504 elements of structure, union or array variables as well as for
3505 variables which are uninitialized or clobbered as a whole.  They do
3506 not occur for variables or elements declared @code{volatile}.  Because
3507 these warnings depend on optimization, the exact variables or elements
3508 for which there are warnings will depend on the precise optimization
3509 options and version of GCC used.
3510
3511 Note that there may be no warning about a variable that is used only
3512 to compute a value that itself is never used, because such
3513 computations may be deleted by data flow analysis before the warnings
3514 are printed.
3515
3516 These warnings are made optional because GCC is not smart
3517 enough to see all the reasons why the code might be correct
3518 despite appearing to have an error.  Here is one example of how
3519 this can happen:
3520
3521 @smallexample
3522 @group
3523 @{
3524   int x;
3525   switch (y)
3526     @{
3527     case 1: x = 1;
3528       break;
3529     case 2: x = 4;
3530       break;
3531     case 3: x = 5;
3532     @}
3533   foo (x);
3534 @}
3535 @end group
3536 @end smallexample
3537
3538 @noindent
3539 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3540 always initialized, but GCC doesn't know this.  Here is
3541 another common case:
3542
3543 @smallexample
3544 @{
3545   int save_y;
3546   if (change_y) save_y = y, y = new_y;
3547   @dots{}
3548   if (change_y) y = save_y;
3549 @}
3550 @end smallexample
3551
3552 @noindent
3553 This has no bug because @code{save_y} is used only if it is set.
3554
3555 @cindex @code{longjmp} warnings
3556 This option also warns when a non-volatile automatic variable might be
3557 changed by a call to @code{longjmp}.  These warnings as well are possible
3558 only in optimizing compilation.
3559
3560 The compiler sees only the calls to @code{setjmp}.  It cannot know
3561 where @code{longjmp} will be called; in fact, a signal handler could
3562 call it at any point in the code.  As a result, you may get a warning
3563 even when there is in fact no problem because @code{longjmp} cannot
3564 in fact be called at the place which would cause a problem.
3565
3566 Some spurious warnings can be avoided if you declare all the functions
3567 you use that never return as @code{noreturn}.  @xref{Function
3568 Attributes}.
3569
3570 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3571
3572 @item -Wunknown-pragmas
3573 @opindex Wunknown-pragmas
3574 @opindex Wno-unknown-pragmas
3575 @cindex warning for unknown pragmas
3576 @cindex unknown pragmas, warning
3577 @cindex pragmas, warning of unknown
3578 Warn when a #pragma directive is encountered which is not understood by
3579 GCC@.  If this command line option is used, warnings will even be issued
3580 for unknown pragmas in system header files.  This is not the case if
3581 the warnings were only enabled by the @option{-Wall} command line option.
3582
3583 @item -Wno-pragmas
3584 @opindex Wno-pragmas
3585 @opindex Wpragmas
3586 Do not warn about misuses of pragmas, such as incorrect parameters,
3587 invalid syntax, or conflicts between pragmas.  See also
3588 @samp{-Wunknown-pragmas}.
3589
3590 @item -Wstrict-aliasing
3591 @opindex Wstrict-aliasing
3592 @opindex Wno-strict-aliasing
3593 This option is only active when @option{-fstrict-aliasing} is active.
3594 It warns about code which might break the strict aliasing rules that the
3595 compiler is using for optimization.  The warning does not catch all
3596 cases, but does attempt to catch the more common pitfalls.  It is
3597 included in @option{-Wall}.
3598 It is equivalent to @option{-Wstrict-aliasing=3}
3599
3600 @item -Wstrict-aliasing=n
3601 @opindex Wstrict-aliasing=n
3602 @opindex Wno-strict-aliasing=n
3603 This option is only active when @option{-fstrict-aliasing} is active.
3604 It warns about code which might break the strict aliasing rules that the
3605 compiler is using for optimization.
3606 Higher levels correspond to higher accuracy (fewer false positives).
3607 Higher levels also correspond to more effort, similar to the way -O works.
3608 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3609 with n=3.
3610
3611 Level 1: Most aggressive, quick, least accurate.
3612 Possibly useful when higher levels
3613 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3614 false negatives.  However, it has many false positives.
3615 Warns for all pointer conversions between possibly incompatible types,
3616 even if never dereferenced.  Runs in the frontend only.
3617
3618 Level 2: Aggressive, quick, not too precise.
3619 May still have many false positives (not as many as level 1 though),
3620 and few false negatives (but possibly more than level 1).
3621 Unlike level 1, it only warns when an address is taken.  Warns about
3622 incomplete types.  Runs in the frontend only.
3623
3624 Level 3 (default for @option{-Wstrict-aliasing}):
3625 Should have very few false positives and few false
3626 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3627 Takes care of the common pun+dereference pattern in the frontend:
3628 @code{*(int*)&some_float}.
3629 If optimization is enabled, it also runs in the backend, where it deals
3630 with multiple statement cases using flow-sensitive points-to information.
3631 Only warns when the converted pointer is dereferenced.
3632 Does not warn about incomplete types.
3633
3634 @item -Wstrict-overflow
3635 @itemx -Wstrict-overflow=@var{n}
3636 @opindex Wstrict-overflow
3637 @opindex Wno-strict-overflow
3638 This option is only active when @option{-fstrict-overflow} is active.
3639 It warns about cases where the compiler optimizes based on the
3640 assumption that signed overflow does not occur.  Note that it does not
3641 warn about all cases where the code might overflow: it only warns
3642 about cases where the compiler implements some optimization.  Thus
3643 this warning depends on the optimization level.
3644
3645 An optimization which assumes that signed overflow does not occur is
3646 perfectly safe if the values of the variables involved are such that
3647 overflow never does, in fact, occur.  Therefore this warning can
3648 easily give a false positive: a warning about code which is not
3649 actually a problem.  To help focus on important issues, several
3650 warning levels are defined.  No warnings are issued for the use of
3651 undefined signed overflow when estimating how many iterations a loop
3652 will require, in particular when determining whether a loop will be
3653 executed at all.
3654
3655 @table @gcctabopt
3656 @item -Wstrict-overflow=1
3657 Warn about cases which are both questionable and easy to avoid.  For
3658 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3659 compiler will simplify this to @code{1}.  This level of
3660 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3661 are not, and must be explicitly requested.
3662
3663 @item -Wstrict-overflow=2
3664 Also warn about other cases where a comparison is simplified to a
3665 constant.  For example: @code{abs (x) >= 0}.  This can only be
3666 simplified when @option{-fstrict-overflow} is in effect, because
3667 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3668 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3669 @option{-Wstrict-overflow=2}.
3670
3671 @item -Wstrict-overflow=3
3672 Also warn about other cases where a comparison is simplified.  For
3673 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3674
3675 @item -Wstrict-overflow=4
3676 Also warn about other simplifications not covered by the above cases.
3677 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3678
3679 @item -Wstrict-overflow=5
3680 Also warn about cases where the compiler reduces the magnitude of a
3681 constant involved in a comparison.  For example: @code{x + 2 > y} will
3682 be simplified to @code{x + 1 >= y}.  This is reported only at the
3683 highest warning level because this simplification applies to many
3684 comparisons, so this warning level will give a very large number of
3685 false positives.
3686 @end table
3687
3688 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3689 @opindex Wsuggest-attribute=
3690 @opindex Wno-suggest-attribute=
3691 Warn for cases where adding an attribute may be beneficial. The
3692 attributes currently supported are listed below.
3693
3694 @table @gcctabopt
3695 @item -Wsuggest-attribute=pure
3696 @itemx -Wsuggest-attribute=const
3697 @itemx -Wsuggest-attribute=noreturn
3698 @opindex Wsuggest-attribute=pure
3699 @opindex Wno-suggest-attribute=pure
3700 @opindex Wsuggest-attribute=const
3701 @opindex Wno-suggest-attribute=const
3702 @opindex Wsuggest-attribute=noreturn
3703 @opindex Wno-suggest-attribute=noreturn
3704
3705 Warn about functions which might be candidates for attributes
3706 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3707 functions visible in other compilation units or (in the case of @code{pure} and
3708 @code{const}) if it cannot prove that the function returns normally. A function
3709 returns normally if it doesn't contain an infinite loop nor returns abnormally
3710 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3711 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3712 higher.  Higher optimization levels improve the accuracy of the analysis.
3713 @end table
3714
3715 @item -Warray-bounds
3716 @opindex Wno-array-bounds
3717 @opindex Warray-bounds
3718 This option is only active when @option{-ftree-vrp} is active
3719 (default for @option{-O2} and above). It warns about subscripts to arrays
3720 that are always out of bounds. This warning is enabled by @option{-Wall}.
3721
3722 @item -Wno-div-by-zero
3723 @opindex Wno-div-by-zero
3724 @opindex Wdiv-by-zero
3725 Do not warn about compile-time integer division by zero.  Floating point
3726 division by zero is not warned about, as it can be a legitimate way of
3727 obtaining infinities and NaNs.
3728
3729 @item -Wsystem-headers
3730 @opindex Wsystem-headers
3731 @opindex Wno-system-headers
3732 @cindex warnings from system headers
3733 @cindex system headers, warnings from
3734 Print warning messages for constructs found in system header files.
3735 Warnings from system headers are normally suppressed, on the assumption
3736 that they usually do not indicate real problems and would only make the
3737 compiler output harder to read.  Using this command line option tells
3738 GCC to emit warnings from system headers as if they occurred in user
3739 code.  However, note that using @option{-Wall} in conjunction with this
3740 option will @emph{not} warn about unknown pragmas in system
3741 headers---for that, @option{-Wunknown-pragmas} must also be used.
3742
3743 @item -Wtrampolines
3744 @opindex Wtrampolines
3745 @opindex Wno-trampolines
3746  Warn about trampolines generated for pointers to nested functions.
3747  
3748  A trampoline is a small piece of data or code that is created at run
3749  time on the stack when the address of a nested function is taken, and
3750  is used to call the nested function indirectly.  For some targets, it
3751  is made up of data only and thus requires no special treatment.  But,
3752  for most targets, it is made up of code and thus requires the stack
3753  to be made executable in order for the program to work properly.
3754
3755 @item -Wfloat-equal
3756 @opindex Wfloat-equal
3757 @opindex Wno-float-equal
3758 Warn if floating point values are used in equality comparisons.
3759
3760 The idea behind this is that sometimes it is convenient (for the
3761 programmer) to consider floating-point values as approximations to
3762 infinitely precise real numbers.  If you are doing this, then you need
3763 to compute (by analyzing the code, or in some other way) the maximum or
3764 likely maximum error that the computation introduces, and allow for it
3765 when performing comparisons (and when producing output, but that's a
3766 different problem).  In particular, instead of testing for equality, you
3767 would check to see whether the two values have ranges that overlap; and
3768 this is done with the relational operators, so equality comparisons are
3769 probably mistaken.
3770
3771 @item -Wtraditional @r{(C and Objective-C only)}
3772 @opindex Wtraditional
3773 @opindex Wno-traditional
3774 Warn about certain constructs that behave differently in traditional and
3775 ISO C@.  Also warn about ISO C constructs that have no traditional C
3776 equivalent, and/or problematic constructs which should be avoided.
3777
3778 @itemize @bullet
3779 @item
3780 Macro parameters that appear within string literals in the macro body.
3781 In traditional C macro replacement takes place within string literals,
3782 but does not in ISO C@.
3783
3784 @item
3785 In traditional C, some preprocessor directives did not exist.
3786 Traditional preprocessors would only consider a line to be a directive
3787 if the @samp{#} appeared in column 1 on the line.  Therefore
3788 @option{-Wtraditional} warns about directives that traditional C
3789 understands but would ignore because the @samp{#} does not appear as the
3790 first character on the line.  It also suggests you hide directives like
3791 @samp{#pragma} not understood by traditional C by indenting them.  Some
3792 traditional implementations would not recognize @samp{#elif}, so it
3793 suggests avoiding it altogether.
3794
3795 @item
3796 A function-like macro that appears without arguments.
3797
3798 @item
3799 The unary plus operator.
3800
3801 @item
3802 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3803 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3804 constants.)  Note, these suffixes appear in macros defined in the system
3805 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3806 Use of these macros in user code might normally lead to spurious
3807 warnings, however GCC's integrated preprocessor has enough context to
3808 avoid warning in these cases.
3809
3810 @item
3811 A function declared external in one block and then used after the end of
3812 the block.
3813
3814 @item
3815 A @code{switch} statement has an operand of type @code{long}.
3816
3817 @item
3818 A non-@code{static} function declaration follows a @code{static} one.
3819 This construct is not accepted by some traditional C compilers.
3820
3821 @item
3822 The ISO type of an integer constant has a different width or
3823 signedness from its traditional type.  This warning is only issued if
3824 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3825 typically represent bit patterns, are not warned about.
3826
3827 @item
3828 Usage of ISO string concatenation is detected.
3829
3830 @item
3831 Initialization of automatic aggregates.
3832
3833 @item
3834 Identifier conflicts with labels.  Traditional C lacks a separate
3835 namespace for labels.
3836
3837 @item
3838 Initialization of unions.  If the initializer is zero, the warning is
3839 omitted.  This is done under the assumption that the zero initializer in
3840 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3841 initializer warnings and relies on default initialization to zero in the
3842 traditional C case.
3843
3844 @item
3845 Conversions by prototypes between fixed/floating point values and vice
3846 versa.  The absence of these prototypes when compiling with traditional
3847 C would cause serious problems.  This is a subset of the possible
3848 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3849
3850 @item
3851 Use of ISO C style function definitions.  This warning intentionally is
3852 @emph{not} issued for prototype declarations or variadic functions
3853 because these ISO C features will appear in your code when using
3854 libiberty's traditional C compatibility macros, @code{PARAMS} and
3855 @code{VPARAMS}.  This warning is also bypassed for nested functions
3856 because that feature is already a GCC extension and thus not relevant to
3857 traditional C compatibility.
3858 @end itemize
3859
3860 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3861 @opindex Wtraditional-conversion
3862 @opindex Wno-traditional-conversion
3863 Warn if a prototype causes a type conversion that is different from what
3864 would happen to the same argument in the absence of a prototype.  This
3865 includes conversions of fixed point to floating and vice versa, and
3866 conversions changing the width or signedness of a fixed point argument
3867 except when the same as the default promotion.
3868
3869 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3870 @opindex Wdeclaration-after-statement
3871 @opindex Wno-declaration-after-statement
3872 Warn when a declaration is found after a statement in a block.  This
3873 construct, known from C++, was introduced with ISO C99 and is by default
3874 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3875 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3876
3877 @item -Wundef
3878 @opindex Wundef
3879 @opindex Wno-undef
3880 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3881
3882 @item -Wno-endif-labels
3883 @opindex Wno-endif-labels
3884 @opindex Wendif-labels
3885 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3886
3887 @item -Wshadow
3888 @opindex Wshadow
3889 @opindex Wno-shadow
3890 Warn whenever a local variable or type declaration shadows another variable,
3891 parameter, type, or class member (in C++), or whenever a built-in function
3892 is shadowed. Note that in C++, the compiler will not warn if a local variable
3893 shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
3894
3895 @item -Wlarger-than=@var{len}
3896 @opindex Wlarger-than=@var{len}
3897 @opindex Wlarger-than-@var{len}
3898 Warn whenever an object of larger than @var{len} bytes is defined.
3899
3900 @item -Wframe-larger-than=@var{len}
3901 @opindex Wframe-larger-than
3902 Warn if the size of a function frame is larger than @var{len} bytes.
3903 The computation done to determine the stack frame size is approximate
3904 and not conservative.
3905 The actual requirements may be somewhat greater than @var{len}
3906 even if you do not get a warning.  In addition, any space allocated
3907 via @code{alloca}, variable-length arrays, or related constructs
3908 is not included by the compiler when determining
3909 whether or not to issue a warning.
3910
3911 @item -Wunsafe-loop-optimizations
3912 @opindex Wunsafe-loop-optimizations
3913 @opindex Wno-unsafe-loop-optimizations
3914 Warn if the loop cannot be optimized because the compiler could not
3915 assume anything on the bounds of the loop indices.  With
3916 @option{-funsafe-loop-optimizations} warn if the compiler made
3917 such assumptions.
3918
3919 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3920 @opindex Wno-pedantic-ms-format
3921 @opindex Wpedantic-ms-format
3922 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3923 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3924 depending on the MS runtime, when you are using the options @option{-Wformat}
3925 and @option{-pedantic} without gnu-extensions.
3926
3927 @item -Wpointer-arith
3928 @opindex Wpointer-arith
3929 @opindex Wno-pointer-arith
3930 Warn about anything that depends on the ``size of'' a function type or
3931 of @code{void}.  GNU C assigns these types a size of 1, for
3932 convenience in calculations with @code{void *} pointers and pointers
3933 to functions.  In C++, warn also when an arithmetic operation involves
3934 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3935
3936 @item -Wtype-limits
3937 @opindex Wtype-limits
3938 @opindex Wno-type-limits
3939 Warn if a comparison is always true or always false due to the limited
3940 range of the data type, but do not warn for constant expressions.  For
3941 example, warn if an unsigned variable is compared against zero with
3942 @samp{<} or @samp{>=}.  This warning is also enabled by
3943 @option{-Wextra}.
3944
3945 @item -Wbad-function-cast @r{(C and Objective-C only)}
3946 @opindex Wbad-function-cast
3947 @opindex Wno-bad-function-cast
3948 Warn whenever a function call is cast to a non-matching type.
3949 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3950
3951 @item -Wc++-compat @r{(C and Objective-C only)}
3952 Warn about ISO C constructs that are outside of the common subset of
3953 ISO C and ISO C++, e.g.@: request for implicit conversion from
3954 @code{void *} to a pointer to non-@code{void} type.
3955
3956 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3957 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3958 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3959 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3960
3961 @item -Wcast-qual
3962 @opindex Wcast-qual
3963 @opindex Wno-cast-qual
3964 Warn whenever a pointer is cast so as to remove a type qualifier from
3965 the target type.  For example, warn if a @code{const char *} is cast
3966 to an ordinary @code{char *}.
3967
3968 Also warn when making a cast which introduces a type qualifier in an
3969 unsafe way.  For example, casting @code{char **} to @code{const char **}
3970 is unsafe, as in this example:
3971
3972 @smallexample
3973   /* p is char ** value.  */
3974   const char **q = (const char **) p;
3975   /* Assignment of readonly string to const char * is OK.  */
3976   *q = "string";
3977   /* Now char** pointer points to read-only memory.  */
3978   **p = 'b';
3979 @end smallexample
3980
3981 @item -Wcast-align
3982 @opindex Wcast-align
3983 @opindex Wno-cast-align
3984 Warn whenever a pointer is cast such that the required alignment of the
3985 target is increased.  For example, warn if a @code{char *} is cast to
3986 an @code{int *} on machines where integers can only be accessed at
3987 two- or four-byte boundaries.
3988
3989 @item -Wwrite-strings
3990 @opindex Wwrite-strings
3991 @opindex Wno-write-strings
3992 When compiling C, give string constants the type @code{const
3993 char[@var{length}]} so that copying the address of one into a
3994 non-@code{const} @code{char *} pointer will get a warning.  These
3995 warnings will help you find at compile time code that can try to write
3996 into a string constant, but only if you have been very careful about
3997 using @code{const} in declarations and prototypes.  Otherwise, it will
3998 just be a nuisance. This is why we did not make @option{-Wall} request
3999 these warnings.
4000
4001 When compiling C++, warn about the deprecated conversion from string
4002 literals to @code{char *}.  This warning is enabled by default for C++
4003 programs.
4004
4005 @item -Wclobbered
4006 @opindex Wclobbered
4007 @opindex Wno-clobbered
4008 Warn for variables that might be changed by @samp{longjmp} or
4009 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4010
4011 @item -Wconversion
4012 @opindex Wconversion
4013 @opindex Wno-conversion
4014 Warn for implicit conversions that may alter a value. This includes
4015 conversions between real and integer, like @code{abs (x)} when
4016 @code{x} is @code{double}; conversions between signed and unsigned,
4017 like @code{unsigned ui = -1}; and conversions to smaller types, like
4018 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4019 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4020 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4021 conversions between signed and unsigned integers can be disabled by
4022 using @option{-Wno-sign-conversion}.
4023
4024 For C++, also warn for confusing overload resolution for user-defined
4025 conversions; and conversions that will never use a type conversion
4026 operator: conversions to @code{void}, the same type, a base class or a
4027 reference to them. Warnings about conversions between signed and
4028 unsigned integers are disabled by default in C++ unless
4029 @option{-Wsign-conversion} is explicitly enabled.
4030
4031 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4032 @opindex Wconversion-null
4033 @opindex Wno-conversion-null
4034 Do not warn for conversions between @code{NULL} and non-pointer
4035 types. @option{-Wconversion-null} is enabled by default.
4036
4037 @item -Wempty-body
4038 @opindex Wempty-body
4039 @opindex Wno-empty-body
4040 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4041 while} statement.  This warning is also enabled by @option{-Wextra}.
4042
4043 @item -Wenum-compare
4044 @opindex Wenum-compare
4045 @opindex Wno-enum-compare
4046 Warn about a comparison between values of different enum types. In C++
4047 this warning is enabled by default.  In C this warning is enabled by
4048 @option{-Wall}.
4049
4050 @item -Wjump-misses-init @r{(C, Objective-C only)}
4051 @opindex Wjump-misses-init
4052 @opindex Wno-jump-misses-init
4053 Warn if a @code{goto} statement or a @code{switch} statement jumps
4054 forward across the initialization of a variable, or jumps backward to a
4055 label after the variable has been initialized.  This only warns about
4056 variables which are initialized when they are declared.  This warning is
4057 only supported for C and Objective C; in C++ this sort of branch is an
4058 error in any case.
4059
4060 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4061 can be disabled with the @option{-Wno-jump-misses-init} option.
4062
4063 @item -Wsign-compare
4064 @opindex Wsign-compare
4065 @opindex Wno-sign-compare
4066 @cindex warning for comparison of signed and unsigned values
4067 @cindex comparison of signed and unsigned values, warning
4068 @cindex signed and unsigned values, comparison warning
4069 Warn when a comparison between signed and unsigned values could produce
4070 an incorrect result when the signed value is converted to unsigned.
4071 This warning is also enabled by @option{-Wextra}; to get the other warnings
4072 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
4073
4074 @item -Wsign-conversion
4075 @opindex Wsign-conversion
4076 @opindex Wno-sign-conversion
4077 Warn for implicit conversions that may change the sign of an integer
4078 value, like assigning a signed integer expression to an unsigned
4079 integer variable. An explicit cast silences the warning. In C, this
4080 option is enabled also by @option{-Wconversion}.
4081
4082 @item -Waddress
4083 @opindex Waddress
4084 @opindex Wno-address
4085 Warn about suspicious uses of memory addresses. These include using
4086 the address of a function in a conditional expression, such as
4087 @code{void func(void); if (func)}, and comparisons against the memory
4088 address of a string literal, such as @code{if (x == "abc")}.  Such
4089 uses typically indicate a programmer error: the address of a function
4090 always evaluates to true, so their use in a conditional usually
4091 indicate that the programmer forgot the parentheses in a function
4092 call; and comparisons against string literals result in unspecified
4093 behavior and are not portable in C, so they usually indicate that the
4094 programmer intended to use @code{strcmp}.  This warning is enabled by
4095 @option{-Wall}.
4096
4097 @item -Wlogical-op
4098 @opindex Wlogical-op
4099 @opindex Wno-logical-op
4100 Warn about suspicious uses of logical operators in expressions.
4101 This includes using logical operators in contexts where a
4102 bit-wise operator is likely to be expected.
4103
4104 @item -Waggregate-return
4105 @opindex Waggregate-return
4106 @opindex Wno-aggregate-return
4107 Warn if any functions that return structures or unions are defined or
4108 called.  (In languages where you can return an array, this also elicits
4109 a warning.)
4110
4111 @item -Wno-attributes
4112 @opindex Wno-attributes
4113 @opindex Wattributes
4114 Do not warn if an unexpected @code{__attribute__} is used, such as
4115 unrecognized attributes, function attributes applied to variables,
4116 etc.  This will not stop errors for incorrect use of supported
4117 attributes.
4118
4119 @item -Wno-builtin-macro-redefined
4120 @opindex Wno-builtin-macro-redefined
4121 @opindex Wbuiltin-macro-redefined
4122 Do not warn if certain built-in macros are redefined.  This suppresses
4123 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4124 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4125
4126 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4127 @opindex Wstrict-prototypes
4128 @opindex Wno-strict-prototypes
4129 Warn if a function is declared or defined without specifying the
4130 argument types.  (An old-style function definition is permitted without
4131 a warning if preceded by a declaration which specifies the argument
4132 types.)
4133
4134 @item -Wold-style-declaration @r{(C and Objective-C only)}
4135 @opindex Wold-style-declaration
4136 @opindex Wno-old-style-declaration
4137 Warn for obsolescent usages, according to the C Standard, in a
4138 declaration. For example, warn if storage-class specifiers like
4139 @code{static} are not the first things in a declaration.  This warning
4140 is also enabled by @option{-Wextra}.
4141
4142 @item -Wold-style-definition @r{(C and Objective-C only)}
4143 @opindex Wold-style-definition
4144 @opindex Wno-old-style-definition
4145 Warn if an old-style function definition is used.  A warning is given
4146 even if there is a previous prototype.
4147
4148 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4149 @opindex Wmissing-parameter-type
4150 @opindex Wno-missing-parameter-type
4151 A function parameter is declared without a type specifier in K&R-style
4152 functions:
4153
4154 @smallexample
4155 void foo(bar) @{ @}
4156 @end smallexample
4157
4158 This warning is also enabled by @option{-Wextra}.
4159
4160 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4161 @opindex Wmissing-prototypes
4162 @opindex Wno-missing-prototypes
4163 Warn if a global function is defined without a previous prototype
4164 declaration.  This warning is issued even if the definition itself
4165 provides a prototype.  The aim is to detect global functions that fail
4166 to be declared in header files.
4167
4168 @item -Wmissing-declarations
4169 @opindex Wmissing-declarations
4170 @opindex Wno-missing-declarations
4171 Warn if a global function is defined without a previous declaration.
4172 Do so even if the definition itself provides a prototype.
4173 Use this option to detect global functions that are not declared in
4174 header files.  In C++, no warnings are issued for function templates,
4175 or for inline functions, or for functions in anonymous namespaces.
4176
4177 @item -Wmissing-field-initializers
4178 @opindex Wmissing-field-initializers
4179 @opindex Wno-missing-field-initializers
4180 @opindex W
4181 @opindex Wextra
4182 @opindex Wno-extra
4183 Warn if a structure's initializer has some fields missing.  For
4184 example, the following code would cause such a warning, because
4185 @code{x.h} is implicitly zero:
4186
4187 @smallexample
4188 struct s @{ int f, g, h; @};
4189 struct s x = @{ 3, 4 @};
4190 @end smallexample
4191
4192 This option does not warn about designated initializers, so the following
4193 modification would not trigger a warning:
4194
4195 @smallexample
4196 struct s @{ int f, g, h; @};
4197 struct s x = @{ .f = 3, .g = 4 @};
4198 @end smallexample
4199
4200 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4201 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
4202
4203 @item -Wmissing-format-attribute
4204 @opindex Wmissing-format-attribute
4205 @opindex Wno-missing-format-attribute
4206 @opindex Wformat
4207 @opindex Wno-format
4208 Warn about function pointers which might be candidates for @code{format}
4209 attributes.  Note these are only possible candidates, not absolute ones.
4210 GCC will guess that function pointers with @code{format} attributes that
4211 are used in assignment, initialization, parameter passing or return
4212 statements should have a corresponding @code{format} attribute in the
4213 resulting type.  I.e.@: the left-hand side of the assignment or
4214 initialization, the type of the parameter variable, or the return type
4215 of the containing function respectively should also have a @code{format}
4216 attribute to avoid the warning.
4217
4218 GCC will also warn about function definitions which might be
4219 candidates for @code{format} attributes.  Again, these are only
4220 possible candidates.  GCC will guess that @code{format} attributes
4221 might be appropriate for any function that calls a function like
4222 @code{vprintf} or @code{vscanf}, but this might not always be the
4223 case, and some functions for which @code{format} attributes are
4224 appropriate may not be detected.
4225
4226 @item -Wno-multichar
4227 @opindex Wno-multichar
4228 @opindex Wmultichar
4229 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4230 Usually they indicate a typo in the user's code, as they have
4231 implementation-defined values, and should not be used in portable code.
4232
4233 @item -Wnormalized=<none|id|nfc|nfkc>
4234 @opindex Wnormalized=
4235 @cindex NFC
4236 @cindex NFKC
4237 @cindex character set, input normalization
4238 In ISO C and ISO C++, two identifiers are different if they are
4239 different sequences of characters.  However, sometimes when characters
4240 outside the basic ASCII character set are used, you can have two
4241 different character sequences that look the same.  To avoid confusion,
4242 the ISO 10646 standard sets out some @dfn{normalization rules} which
4243 when applied ensure that two sequences that look the same are turned into
4244 the same sequence.  GCC can warn you if you are using identifiers which
4245 have not been normalized; this option controls that warning.
4246
4247 There are four levels of warning that GCC supports.  The default is
4248 @option{-Wnormalized=nfc}, which warns about any identifier which is
4249 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4250 recommended form for most uses.
4251
4252 Unfortunately, there are some characters which ISO C and ISO C++ allow
4253 in identifiers that when turned into NFC aren't allowable as
4254 identifiers.  That is, there's no way to use these symbols in portable
4255 ISO C or C++ and have all your identifiers in NFC@.
4256 @option{-Wnormalized=id} suppresses the warning for these characters.
4257 It is hoped that future versions of the standards involved will correct
4258 this, which is why this option is not the default.
4259
4260 You can switch the warning off for all characters by writing
4261 @option{-Wnormalized=none}.  You would only want to do this if you
4262 were using some other normalization scheme (like ``D''), because
4263 otherwise you can easily create bugs that are literally impossible to see.
4264
4265 Some characters in ISO 10646 have distinct meanings but look identical
4266 in some fonts or display methodologies, especially once formatting has
4267 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4268 LETTER N'', will display just like a regular @code{n} which has been
4269 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4270 normalization scheme to convert all these into a standard form as
4271 well, and GCC will warn if your code is not in NFKC if you use
4272 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4273 about every identifier that contains the letter O because it might be
4274 confused with the digit 0, and so is not the default, but may be
4275 useful as a local coding convention if the programming environment is
4276 unable to be fixed to display these characters distinctly.
4277
4278 @item -Wno-deprecated
4279 @opindex Wno-deprecated
4280 @opindex Wdeprecated
4281 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4282
4283 @item -Wno-deprecated-declarations
4284 @opindex Wno-deprecated-declarations
4285 @opindex Wdeprecated-declarations
4286 Do not warn about uses of functions (@pxref{Function Attributes}),
4287 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4288 Attributes}) marked as deprecated by using the @code{deprecated}
4289 attribute.
4290
4291 @item -Wno-overflow
4292 @opindex Wno-overflow
4293 @opindex Woverflow
4294 Do not warn about compile-time overflow in constant expressions.
4295
4296 @item -Woverride-init @r{(C and Objective-C only)}
4297 @opindex Woverride-init
4298 @opindex Wno-override-init
4299 @opindex W
4300 @opindex Wextra
4301 @opindex Wno-extra
4302 Warn if an initialized field without side effects is overridden when
4303 using designated initializers (@pxref{Designated Inits, , Designated
4304 Initializers}).
4305
4306 This warning is included in @option{-Wextra}.  To get other
4307 @option{-Wextra} warnings without this one, use @samp{-Wextra
4308 -Wno-override-init}.
4309
4310 @item -Wpacked
4311 @opindex Wpacked
4312 @opindex Wno-packed
4313 Warn if a structure is given the packed attribute, but the packed
4314 attribute has no effect on the layout or size of the structure.
4315 Such structures may be mis-aligned for little benefit.  For
4316 instance, in this code, the variable @code{f.x} in @code{struct bar}
4317 will be misaligned even though @code{struct bar} does not itself
4318 have the packed attribute:
4319
4320 @smallexample
4321 @group
4322 struct foo @{
4323   int x;
4324   char a, b, c, d;
4325 @} __attribute__((packed));
4326 struct bar @{
4327   char z;
4328   struct foo f;
4329 @};
4330 @end group
4331 @end smallexample
4332
4333 @item -Wpacked-bitfield-compat
4334 @opindex Wpacked-bitfield-compat
4335 @opindex Wno-packed-bitfield-compat
4336 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4337 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4338 the change can lead to differences in the structure layout.  GCC
4339 informs you when the offset of such a field has changed in GCC 4.4.
4340 For example there is no longer a 4-bit padding between field @code{a}
4341 and @code{b} in this structure:
4342
4343 @smallexample
4344 struct foo
4345 @{
4346   char a:4;
4347   char b:8;
4348 @} __attribute__ ((packed));
4349 @end smallexample
4350
4351 This warning is enabled by default.  Use
4352 @option{-Wno-packed-bitfield-compat} to disable this warning.
4353
4354 @item -Wpadded
4355 @opindex Wpadded
4356 @opindex Wno-padded
4357 Warn if padding is included in a structure, either to align an element
4358 of the structure or to align the whole structure.  Sometimes when this
4359 happens it is possible to rearrange the fields of the structure to
4360 reduce the padding and so make the structure smaller.
4361
4362 @item -Wredundant-decls
4363 @opindex Wredundant-decls
4364 @opindex Wno-redundant-decls
4365 Warn if anything is declared more than once in the same scope, even in
4366 cases where multiple declaration is valid and changes nothing.
4367
4368 @item -Wnested-externs @r{(C and Objective-C only)}
4369 @opindex Wnested-externs
4370 @opindex Wno-nested-externs
4371 Warn if an @code{extern} declaration is encountered within a function.
4372
4373 @item -Winline
4374 @opindex Winline
4375 @opindex Wno-inline
4376 Warn if a function can not be inlined and it was declared as inline.
4377 Even with this option, the compiler will not warn about failures to
4378 inline functions declared in system headers.
4379
4380 The compiler uses a variety of heuristics to determine whether or not
4381 to inline a function.  For example, the compiler takes into account
4382 the size of the function being inlined and the amount of inlining
4383 that has already been done in the current function.  Therefore,
4384 seemingly insignificant changes in the source program can cause the
4385 warnings produced by @option{-Winline} to appear or disappear.
4386
4387 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4388 @opindex Wno-invalid-offsetof
4389 @opindex Winvalid-offsetof
4390 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4391 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4392 to a non-POD type is undefined.  In existing C++ implementations,
4393 however, @samp{offsetof} typically gives meaningful results even when
4394 applied to certain kinds of non-POD types. (Such as a simple
4395 @samp{struct} that fails to be a POD type only by virtue of having a
4396 constructor.)  This flag is for users who are aware that they are
4397 writing nonportable code and who have deliberately chosen to ignore the
4398 warning about it.
4399
4400 The restrictions on @samp{offsetof} may be relaxed in a future version
4401 of the C++ standard.
4402
4403 @item -Wno-int-to-pointer-cast
4404 @opindex Wno-int-to-pointer-cast
4405 @opindex Wint-to-pointer-cast
4406 Suppress warnings from casts to pointer type of an integer of a
4407 different size. In C++, casting to a pointer type of smaller size is
4408 an error. @option{Wint-to-pointer-cast} is enabled by default.
4409
4410
4411 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4412 @opindex Wno-pointer-to-int-cast
4413 @opindex Wpointer-to-int-cast
4414 Suppress warnings from casts from a pointer to an integer type of a
4415 different size.
4416
4417 @item -Winvalid-pch
4418 @opindex Winvalid-pch
4419 @opindex Wno-invalid-pch
4420 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4421 the search path but can't be used.
4422
4423 @item -Wlong-long
4424 @opindex Wlong-long
4425 @opindex Wno-long-long
4426 Warn if @samp{long long} type is used.  This is enabled by either
4427 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4428 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4429
4430 @item -Wvariadic-macros
4431 @opindex Wvariadic-macros
4432 @opindex Wno-variadic-macros
4433 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4434 alternate syntax when in pedantic ISO C99 mode.  This is default.
4435 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4436
4437 @item -Wvla
4438 @opindex Wvla
4439 @opindex Wno-vla
4440 Warn if variable length array is used in the code.
4441 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4442 the variable length array.
4443
4444 @item -Wvolatile-register-var
4445 @opindex Wvolatile-register-var
4446 @opindex Wno-volatile-register-var
4447 Warn if a register variable is declared volatile.  The volatile
4448 modifier does not inhibit all optimizations that may eliminate reads
4449 and/or writes to register variables.  This warning is enabled by
4450 @option{-Wall}.
4451
4452 @item -Wdisabled-optimization
4453 @opindex Wdisabled-optimization
4454 @opindex Wno-disabled-optimization
4455 Warn if a requested optimization pass is disabled.  This warning does
4456 not generally indicate that there is anything wrong with your code; it
4457 merely indicates that GCC's optimizers were unable to handle the code
4458 effectively.  Often, the problem is that your code is too big or too
4459 complex; GCC will refuse to optimize programs when the optimization
4460 itself is likely to take inordinate amounts of time.
4461
4462 @item -Wpointer-sign @r{(C and Objective-C only)}
4463 @opindex Wpointer-sign
4464 @opindex Wno-pointer-sign
4465 Warn for pointer argument passing or assignment with different signedness.
4466 This option is only supported for C and Objective-C@.  It is implied by
4467 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4468 @option{-Wno-pointer-sign}.
4469
4470 @item -Wstack-protector
4471 @opindex Wstack-protector
4472 @opindex Wno-stack-protector
4473 This option is only active when @option{-fstack-protector} is active.  It
4474 warns about functions that will not be protected against stack smashing.
4475
4476 @item -Wno-mudflap
4477 @opindex Wno-mudflap
4478 Suppress warnings about constructs that cannot be instrumented by
4479 @option{-fmudflap}.
4480
4481 @item -Woverlength-strings
4482 @opindex Woverlength-strings
4483 @opindex Wno-overlength-strings
4484 Warn about string constants which are longer than the ``minimum
4485 maximum'' length specified in the C standard.  Modern compilers
4486 generally allow string constants which are much longer than the
4487 standard's minimum limit, but very portable programs should avoid
4488 using longer strings.
4489
4490 The limit applies @emph{after} string constant concatenation, and does
4491 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4492 C99, it was raised to 4095.  C++98 does not specify a normative
4493 minimum maximum, so we do not diagnose overlength strings in C++@.
4494
4495 This option is implied by @option{-pedantic}, and can be disabled with
4496 @option{-Wno-overlength-strings}.
4497
4498 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4499 @opindex Wunsuffixed-float-constants
4500
4501 GCC will issue a warning for any floating constant that does not have
4502 a suffix.  When used together with @option{-Wsystem-headers} it will
4503 warn about such constants in system header files.  This can be useful
4504 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4505 from the decimal floating-point extension to C99.
4506 @end table
4507
4508 @node Debugging Options
4509 @section Options for Debugging Your Program or GCC
4510 @cindex options, debugging
4511 @cindex debugging information options
4512
4513 GCC has various special options that are used for debugging
4514 either your program or GCC:
4515
4516 @table @gcctabopt
4517 @item -g
4518 @opindex g
4519 Produce debugging information in the operating system's native format
4520 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4521 information.
4522
4523 On most systems that use stabs format, @option{-g} enables use of extra
4524 debugging information that only GDB can use; this extra information
4525 makes debugging work better in GDB but will probably make other debuggers
4526 crash or
4527 refuse to read the program.  If you want to control for certain whether
4528 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4529 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4530
4531 GCC allows you to use @option{-g} with
4532 @option{-O}.  The shortcuts taken by optimized code may occasionally
4533 produce surprising results: some variables you declared may not exist
4534 at all; flow of control may briefly move where you did not expect it;
4535 some statements may not be executed because they compute constant
4536 results or their values were already at hand; some statements may
4537 execute in different places because they were moved out of loops.
4538
4539 Nevertheless it proves possible to debug optimized output.  This makes
4540 it reasonable to use the optimizer for programs that might have bugs.
4541
4542 The following options are useful when GCC is generated with the
4543 capability for more than one debugging format.
4544
4545 @item -ggdb
4546 @opindex ggdb
4547 Produce debugging information for use by GDB@.  This means to use the
4548 most expressive format available (DWARF 2, stabs, or the native format
4549 if neither of those are supported), including GDB extensions if at all
4550 possible.
4551
4552 @item -gstabs
4553 @opindex gstabs
4554 Produce debugging information in stabs format (if that is supported),
4555 without GDB extensions.  This is the format used by DBX on most BSD
4556 systems.  On MIPS, Alpha and System V Release 4 systems this option
4557 produces stabs debugging output which is not understood by DBX or SDB@.
4558 On System V Release 4 systems this option requires the GNU assembler.
4559
4560 @item -feliminate-unused-debug-symbols
4561 @opindex feliminate-unused-debug-symbols
4562 Produce debugging information in stabs format (if that is supported),
4563 for only symbols that are actually used.
4564
4565 @item -femit-class-debug-always
4566 Instead of emitting debugging information for a C++ class in only one
4567 object file, emit it in all object files using the class.  This option
4568 should be used only with debuggers that are unable to handle the way GCC
4569 normally emits debugging information for classes because using this
4570 option will increase the size of debugging information by as much as a
4571 factor of two.
4572
4573 @item -gstabs+
4574 @opindex gstabs+
4575 Produce debugging information in stabs format (if that is supported),
4576 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4577 use of these extensions is likely to make other debuggers crash or
4578 refuse to read the program.
4579
4580 @item -gcoff
4581 @opindex gcoff
4582 Produce debugging information in COFF format (if that is supported).
4583 This is the format used by SDB on most System V systems prior to
4584 System V Release 4.
4585
4586 @item -gxcoff
4587 @opindex gxcoff
4588 Produce debugging information in XCOFF format (if that is supported).
4589 This is the format used by the DBX debugger on IBM RS/6000 systems.
4590
4591 @item -gxcoff+
4592 @opindex gxcoff+
4593 Produce debugging information in XCOFF format (if that is supported),
4594 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4595 use of these extensions is likely to make other debuggers crash or
4596 refuse to read the program, and may cause assemblers other than the GNU
4597 assembler (GAS) to fail with an error.
4598
4599 @item -gdwarf-@var{version}
4600 @opindex gdwarf-@var{version}
4601 Produce debugging information in DWARF format (if that is
4602 supported).  This is the format used by DBX on IRIX 6.  The value
4603 of @var{version} may be either 2, 3 or 4; the default version is 2.
4604
4605 Note that with DWARF version 2 some ports require, and will always
4606 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4607
4608 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4609 for maximum benefit.
4610
4611 @item -gstrict-dwarf
4612 @opindex gstrict-dwarf
4613 Disallow using extensions of later DWARF standard version than selected
4614 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4615 DWARF extensions from later standard versions is allowed.
4616
4617 @item -gno-strict-dwarf
4618 @opindex gno-strict-dwarf
4619 Allow using extensions of later DWARF standard version than selected with
4620 @option{-gdwarf-@var{version}}.
4621
4622 @item -gvms
4623 @opindex gvms
4624 Produce debugging information in VMS debug format (if that is
4625 supported).  This is the format used by DEBUG on VMS systems.
4626
4627 @item -g@var{level}
4628 @itemx -ggdb@var{level}
4629 @itemx -gstabs@var{level}
4630 @itemx -gcoff@var{level}
4631 @itemx -gxcoff@var{level}
4632 @itemx -gvms@var{level}
4633 Request debugging information and also use @var{level} to specify how
4634 much information.  The default level is 2.
4635
4636 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4637 @option{-g}.
4638
4639 Level 1 produces minimal information, enough for making backtraces in
4640 parts of the program that you don't plan to debug.  This includes
4641 descriptions of functions and external variables, but no information
4642 about local variables and no line numbers.
4643
4644 Level 3 includes extra information, such as all the macro definitions
4645 present in the program.  Some debuggers support macro expansion when
4646 you use @option{-g3}.
4647
4648 @option{-gdwarf-2} does not accept a concatenated debug level, because
4649 GCC used to support an option @option{-gdwarf} that meant to generate
4650 debug information in version 1 of the DWARF format (which is very
4651 different from version 2), and it would have been too confusing.  That
4652 debug format is long obsolete, but the option cannot be changed now.
4653 Instead use an additional @option{-g@var{level}} option to change the
4654 debug level for DWARF.
4655
4656 @item -gtoggle
4657 @opindex gtoggle
4658 Turn off generation of debug info, if leaving out this option would have
4659 generated it, or turn it on at level 2 otherwise.  The position of this
4660 argument in the command line does not matter, it takes effect after all
4661 other options are processed, and it does so only once, no matter how
4662 many times it is given.  This is mainly intended to be used with
4663 @option{-fcompare-debug}.
4664
4665 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4666 @opindex fdump-final-insns
4667 Dump the final internal representation (RTL) to @var{file}.  If the
4668 optional argument is omitted (or if @var{file} is @code{.}), the name
4669 of the dump file will be determined by appending @code{.gkd} to the
4670 compilation output file name.
4671
4672 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4673 @opindex fcompare-debug
4674 @opindex fno-compare-debug
4675 If no error occurs during compilation, run the compiler a second time,
4676 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4677 passed to the second compilation.  Dump the final internal
4678 representation in both compilations, and print an error if they differ.
4679
4680 If the equal sign is omitted, the default @option{-gtoggle} is used.
4681
4682 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4683 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4684 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4685 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4686 is used.
4687
4688 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4689 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4690 of the final representation and the second compilation, preventing even
4691 @env{GCC_COMPARE_DEBUG} from taking effect.
4692
4693 To verify full coverage during @option{-fcompare-debug} testing, set
4694 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4695 which GCC will reject as an invalid option in any actual compilation
4696 (rather than preprocessing, assembly or linking).  To get just a
4697 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4698 not overridden} will do.
4699
4700 @item -fcompare-debug-second
4701 @opindex fcompare-debug-second
4702 This option is implicitly passed to the compiler for the second
4703 compilation requested by @option{-fcompare-debug}, along with options to
4704 silence warnings, and omitting other options that would cause
4705 side-effect compiler outputs to files or to the standard output.  Dump
4706 files and preserved temporary files are renamed so as to contain the
4707 @code{.gk} additional extension during the second compilation, to avoid
4708 overwriting those generated by the first.
4709
4710 When this option is passed to the compiler driver, it causes the
4711 @emph{first} compilation to be skipped, which makes it useful for little
4712 other than debugging the compiler proper.
4713
4714 @item -feliminate-dwarf2-dups
4715 @opindex feliminate-dwarf2-dups
4716 Compress DWARF2 debugging information by eliminating duplicated
4717 information about each symbol.  This option only makes sense when
4718 generating DWARF2 debugging information with @option{-gdwarf-2}.
4719
4720 @item -femit-struct-debug-baseonly
4721 Emit debug information for struct-like types
4722 only when the base name of the compilation source file
4723 matches the base name of file in which the struct was defined.
4724
4725 This option substantially reduces the size of debugging information,
4726 but at significant potential loss in type information to the debugger.
4727 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4728 See @option{-femit-struct-debug-detailed} for more detailed control.
4729
4730 This option works only with DWARF 2.
4731
4732 @item -femit-struct-debug-reduced
4733 Emit debug information for struct-like types
4734 only when the base name of the compilation source file
4735 matches the base name of file in which the type was defined,
4736 unless the struct is a template or defined in a system header.
4737
4738 This option significantly reduces the size of debugging information,
4739 with some potential loss in type information to the debugger.
4740 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4741 See @option{-femit-struct-debug-detailed} for more detailed control.
4742
4743 This option works only with DWARF 2.
4744
4745 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4746 Specify the struct-like types
4747 for which the compiler will generate debug information.
4748 The intent is to reduce duplicate struct debug information
4749 between different object files within the same program.
4750
4751 This option is a detailed version of
4752 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4753 which will serve for most needs.
4754
4755 A specification has the syntax
4756 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4757
4758 The optional first word limits the specification to
4759 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4760 A struct type is used directly when it is the type of a variable, member.
4761 Indirect uses arise through pointers to structs.
4762 That is, when use of an incomplete struct would be legal, the use is indirect.
4763 An example is
4764 @samp{struct one direct; struct two * indirect;}.
4765
4766 The optional second word limits the specification to
4767 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4768 Generic structs are a bit complicated to explain.
4769 For C++, these are non-explicit specializations of template classes,
4770 or non-template classes within the above.
4771 Other programming languages have generics,
4772 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4773
4774 The third word specifies the source files for those
4775 structs for which the compiler will emit debug information.
4776 The values @samp{none} and @samp{any} have the normal meaning.
4777 The value @samp{base} means that
4778 the base of name of the file in which the type declaration appears
4779 must match the base of the name of the main compilation file.
4780 In practice, this means that
4781 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4782 but types declared in other header will not.
4783 The value @samp{sys} means those types satisfying @samp{base}
4784 or declared in system or compiler headers.
4785
4786 You may need to experiment to determine the best settings for your application.
4787
4788 The default is @samp{-femit-struct-debug-detailed=all}.
4789
4790 This option works only with DWARF 2.
4791
4792 @item -fenable-icf-debug
4793 @opindex fenable-icf-debug
4794 Generate additional debug information to support identical code folding (ICF).
4795 This option only works with DWARF version 2 or higher.
4796
4797 @item -fno-merge-debug-strings
4798 @opindex fmerge-debug-strings
4799 @opindex fno-merge-debug-strings
4800 Direct the linker to not merge together strings in the debugging
4801 information which are identical in different object files.  Merging is
4802 not supported by all assemblers or linkers.  Merging decreases the size
4803 of the debug information in the output file at the cost of increasing
4804 link processing time.  Merging is enabled by default.
4805
4806 @item -fdebug-prefix-map=@var{old}=@var{new}
4807 @opindex fdebug-prefix-map
4808 When compiling files in directory @file{@var{old}}, record debugging
4809 information describing them as in @file{@var{new}} instead.
4810
4811 @item -fno-dwarf2-cfi-asm
4812 @opindex fdwarf2-cfi-asm
4813 @opindex fno-dwarf2-cfi-asm
4814 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4815 instead of using GAS @code{.cfi_*} directives.
4816
4817 @cindex @command{prof}
4818 @item -p
4819 @opindex p
4820 Generate extra code to write profile information suitable for the
4821 analysis program @command{prof}.  You must use this option when compiling
4822 the source files you want data about, and you must also use it when
4823 linking.
4824
4825 @cindex @command{gprof}
4826 @item -pg
4827 @opindex pg
4828 Generate extra code to write profile information suitable for the
4829 analysis program @command{gprof}.  You must use this option when compiling
4830 the source files you want data about, and you must also use it when
4831 linking.
4832
4833 @item -Q
4834 @opindex Q
4835 Makes the compiler print out each function name as it is compiled, and
4836 print some statistics about each pass when it finishes.
4837
4838 @item -ftime-report
4839 @opindex ftime-report
4840 Makes the compiler print some statistics about the time consumed by each
4841 pass when it finishes.
4842
4843 @item -fmem-report
4844 @opindex fmem-report
4845 Makes the compiler print some statistics about permanent memory
4846 allocation when it finishes.
4847
4848 @item -fpre-ipa-mem-report
4849 @opindex fpre-ipa-mem-report
4850 @item -fpost-ipa-mem-report
4851 @opindex fpost-ipa-mem-report
4852 Makes the compiler print some statistics about permanent memory
4853 allocation before or after interprocedural optimization.
4854
4855 @item -fstack-usage
4856 @opindex fstack-usage
4857 Makes the compiler output stack usage information for the program, on a
4858 per-function basis.  The filename for the dump is made by appending
4859 @file{.su} to the AUXNAME.  AUXNAME is generated from the name of
4860 the output file, if explicitly specified and it is not an executable,
4861 otherwise it is the basename of the source file.  An entry is made up
4862 of three fields:
4863
4864 @itemize
4865 @item
4866 The name of the function.
4867 @item
4868 A number of bytes.
4869 @item
4870 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
4871 @end itemize
4872
4873 The qualifier @code{static} means that the function manipulates the stack
4874 statically: a fixed number of bytes are allocated for the frame on function
4875 entry and released on function exit; no stack adjustments are otherwise made
4876 in the function.  The second field is this fixed number of bytes.
4877
4878 The qualifier @code{dynamic} means that the function manipulates the stack
4879 dynamically: in addition to the static allocation described above, stack
4880 adjustments are made in the body of the function, for example to push/pop
4881 arguments around function calls.  If the qualifier @code{bounded} is also
4882 present, the amount of these adjustments is bounded at compile-time and
4883 the second field is an upper bound of the total amount of stack used by
4884 the function.  If it is not present, the amount of these adjustments is
4885 not bounded at compile-time and the second field only represents the
4886 bounded part.
4887
4888 @item -fprofile-arcs
4889 @opindex fprofile-arcs
4890 Add code so that program flow @dfn{arcs} are instrumented.  During
4891 execution the program records how many times each branch and call is
4892 executed and how many times it is taken or returns.  When the compiled
4893 program exits it saves this data to a file called
4894 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4895 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4896 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4897 @var{auxname} is generated from the name of the output file, if
4898 explicitly specified and it is not the final executable, otherwise it is
4899 the basename of the source file.  In both cases any suffix is removed
4900 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4901 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4902 @xref{Cross-profiling}.
4903
4904 @cindex @command{gcov}
4905 @item --coverage
4906 @opindex coverage
4907
4908 This option is used to compile and link code instrumented for coverage
4909 analysis.  The option is a synonym for @option{-fprofile-arcs}
4910 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4911 linking).  See the documentation for those options for more details.
4912
4913 @itemize
4914
4915 @item
4916 Compile the source files with @option{-fprofile-arcs} plus optimization
4917 and code generation options.  For test coverage analysis, use the
4918 additional @option{-ftest-coverage} option.  You do not need to profile
4919 every source file in a program.
4920
4921 @item
4922 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4923 (the latter implies the former).
4924
4925 @item
4926 Run the program on a representative workload to generate the arc profile
4927 information.  This may be repeated any number of times.  You can run
4928 concurrent instances of your program, and provided that the file system
4929 supports locking, the data files will be correctly updated.  Also
4930 @code{fork} calls are detected and correctly handled (double counting
4931 will not happen).
4932
4933 @item
4934 For profile-directed optimizations, compile the source files again with
4935 the same optimization and code generation options plus
4936 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4937 Control Optimization}).
4938
4939 @item
4940 For test coverage analysis, use @command{gcov} to produce human readable
4941 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4942 @command{gcov} documentation for further information.
4943
4944 @end itemize
4945
4946 With @option{-fprofile-arcs}, for each function of your program GCC
4947 creates a program flow graph, then finds a spanning tree for the graph.
4948 Only arcs that are not on the spanning tree have to be instrumented: the
4949 compiler adds code to count the number of times that these arcs are
4950 executed.  When an arc is the only exit or only entrance to a block, the
4951 instrumentation code can be added to the block; otherwise, a new basic
4952 block must be created to hold the instrumentation code.
4953
4954 @need 2000
4955 @item -ftest-coverage
4956 @opindex ftest-coverage
4957 Produce a notes file that the @command{gcov} code-coverage utility
4958 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4959 show program coverage.  Each source file's note file is called
4960 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4961 above for a description of @var{auxname} and instructions on how to
4962 generate test coverage data.  Coverage data will match the source files
4963 more closely, if you do not optimize.
4964
4965 @item -fdbg-cnt-list
4966 @opindex fdbg-cnt-list
4967 Print the name and the counter upperbound for all debug counters.
4968
4969 @item -fdbg-cnt=@var{counter-value-list}
4970 @opindex fdbg-cnt
4971 Set the internal debug counter upperbound. @var{counter-value-list}
4972 is a comma-separated list of @var{name}:@var{value} pairs
4973 which sets the upperbound of each debug counter @var{name} to @var{value}.
4974 All debug counters have the initial upperbound of @var{UINT_MAX},
4975 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4976 e.g. With -fdbg-cnt=dce:10,tail_call:0
4977 dbg_cnt(dce) will return true only for first 10 invocations
4978 and dbg_cnt(tail_call) will return false always.
4979
4980 @item -d@var{letters}
4981 @itemx -fdump-rtl-@var{pass}
4982 @opindex d
4983 Says to make debugging dumps during compilation at times specified by
4984 @var{letters}.  This is used for debugging the RTL-based passes of the
4985 compiler.  The file names for most of the dumps are made by appending
4986 a pass number and a word to the @var{dumpname}, and the files are
4987 created in the directory of the output file.  @var{dumpname} is
4988 generated from the name of the output file, if explicitly specified
4989 and it is not an executable, otherwise it is the basename of the
4990 source file. These switches may have different effects when
4991 @option{-E} is used for preprocessing.
4992
4993 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
4994 @option{-d} option @var{letters}.  Here are the possible
4995 letters for use in @var{pass} and @var{letters}, and their meanings:
4996
4997 @table @gcctabopt
4998
4999 @item -fdump-rtl-alignments
5000 @opindex fdump-rtl-alignments
5001 Dump after branch alignments have been computed.
5002
5003 @item -fdump-rtl-asmcons
5004 @opindex fdump-rtl-asmcons
5005 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5006
5007 @item -fdump-rtl-auto_inc_dec
5008 @opindex fdump-rtl-auto_inc_dec
5009 Dump after auto-inc-dec discovery.  This pass is only run on
5010 architectures that have auto inc or auto dec instructions.
5011
5012 @item -fdump-rtl-barriers
5013 @opindex fdump-rtl-barriers
5014 Dump after cleaning up the barrier instructions.
5015
5016 @item -fdump-rtl-bbpart
5017 @opindex fdump-rtl-bbpart
5018 Dump after partitioning hot and cold basic blocks.
5019
5020 @item -fdump-rtl-bbro
5021 @opindex fdump-rtl-bbro
5022 Dump after block reordering.
5023
5024 @item -fdump-rtl-btl1
5025 @itemx -fdump-rtl-btl2
5026 @opindex fdump-rtl-btl2
5027 @opindex fdump-rtl-btl2
5028 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5029 after the two branch
5030 target load optimization passes.
5031
5032 @item -fdump-rtl-bypass
5033 @opindex fdump-rtl-bypass
5034 Dump after jump bypassing and control flow optimizations.
5035
5036 @item -fdump-rtl-combine
5037 @opindex fdump-rtl-combine
5038 Dump after the RTL instruction combination pass.
5039
5040 @item -fdump-rtl-compgotos
5041 @opindex fdump-rtl-compgotos
5042 Dump after duplicating the computed gotos.
5043
5044 @item -fdump-rtl-ce1
5045 @itemx -fdump-rtl-ce2
5046 @itemx -fdump-rtl-ce3
5047 @opindex fdump-rtl-ce1
5048 @opindex fdump-rtl-ce2
5049 @opindex fdump-rtl-ce3
5050 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5051 @option{-fdump-rtl-ce3} enable dumping after the three
5052 if conversion passes.
5053
5054 @itemx -fdump-rtl-cprop_hardreg
5055 @opindex fdump-rtl-cprop_hardreg
5056 Dump after hard register copy propagation.
5057
5058 @itemx -fdump-rtl-csa
5059 @opindex fdump-rtl-csa
5060 Dump after combining stack adjustments.
5061
5062 @item -fdump-rtl-cse1
5063 @itemx -fdump-rtl-cse2
5064 @opindex fdump-rtl-cse1
5065 @opindex fdump-rtl-cse2
5066 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5067 the two common sub-expression elimination passes.
5068
5069 @itemx -fdump-rtl-dce
5070 @opindex fdump-rtl-dce
5071 Dump after the standalone dead code elimination passes.
5072
5073 @itemx -fdump-rtl-dbr
5074 @opindex fdump-rtl-dbr
5075 Dump after delayed branch scheduling.
5076
5077 @item -fdump-rtl-dce1
5078 @itemx -fdump-rtl-dce2
5079 @opindex fdump-rtl-dce1
5080 @opindex fdump-rtl-dce2
5081 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5082 the two dead store elimination passes.
5083
5084 @item -fdump-rtl-eh
5085 @opindex fdump-rtl-eh
5086 Dump after finalization of EH handling code.
5087
5088 @item -fdump-rtl-eh_ranges
5089 @opindex fdump-rtl-eh_ranges
5090 Dump after conversion of EH handling range regions.
5091
5092 @item -fdump-rtl-expand
5093 @opindex fdump-rtl-expand
5094 Dump after RTL generation.
5095
5096 @item -fdump-rtl-fwprop1
5097 @itemx -fdump-rtl-fwprop2
5098 @opindex fdump-rtl-fwprop1
5099 @opindex fdump-rtl-fwprop2
5100 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5101 dumping after the two forward propagation passes.
5102
5103 @item -fdump-rtl-gcse1
5104 @itemx -fdump-rtl-gcse2
5105 @opindex fdump-rtl-gcse1
5106 @opindex fdump-rtl-gcse2
5107 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5108 after global common subexpression elimination.
5109
5110 @item -fdump-rtl-init-regs
5111 @opindex fdump-rtl-init-regs
5112 Dump after the initialization of the registers.
5113
5114 @item -fdump-rtl-initvals
5115 @opindex fdump-rtl-initvals
5116 Dump after the computation of the initial value sets.
5117
5118 @itemx -fdump-rtl-into_cfglayout
5119 @opindex fdump-rtl-into_cfglayout
5120 Dump after converting to cfglayout mode.
5121
5122 @item -fdump-rtl-ira
5123 @opindex fdump-rtl-ira
5124 Dump after iterated register allocation.
5125
5126 @item -fdump-rtl-jump
5127 @opindex fdump-rtl-jump
5128 Dump after the second jump optimization.
5129
5130 @item -fdump-rtl-loop2
5131 @opindex fdump-rtl-loop2
5132 @option{-fdump-rtl-loop2} enables dumping after the rtl
5133 loop optimization passes.
5134
5135 @item -fdump-rtl-mach
5136 @opindex fdump-rtl-mach
5137 Dump after performing the machine dependent reorganization pass, if that
5138 pass exists.
5139
5140 @item -fdump-rtl-mode_sw
5141 @opindex fdump-rtl-mode_sw
5142 Dump after removing redundant mode switches.
5143
5144 @item -fdump-rtl-rnreg
5145 @opindex fdump-rtl-rnreg
5146 Dump after register renumbering.
5147
5148 @itemx -fdump-rtl-outof_cfglayout
5149 @opindex fdump-rtl-outof_cfglayout
5150 Dump after converting from cfglayout mode.
5151
5152 @item -fdump-rtl-peephole2
5153 @opindex fdump-rtl-peephole2
5154 Dump after the peephole pass.
5155
5156 @item -fdump-rtl-postreload
5157 @opindex fdump-rtl-postreload
5158 Dump after post-reload optimizations.
5159
5160 @itemx -fdump-rtl-pro_and_epilogue
5161 @opindex fdump-rtl-pro_and_epilogue
5162 Dump after generating the function pro and epilogues.
5163
5164 @item -fdump-rtl-regmove
5165 @opindex fdump-rtl-regmove
5166 Dump after the register move pass.
5167
5168 @item -fdump-rtl-sched1
5169 @itemx -fdump-rtl-sched2
5170 @opindex fdump-rtl-sched1
5171 @opindex fdump-rtl-sched2
5172 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5173 after the basic block scheduling passes.
5174
5175 @item -fdump-rtl-see
5176 @opindex fdump-rtl-see
5177 Dump after sign extension elimination.
5178
5179 @item -fdump-rtl-seqabstr
5180 @opindex fdump-rtl-seqabstr
5181 Dump after common sequence discovery.
5182
5183 @item -fdump-rtl-shorten
5184 @opindex fdump-rtl-shorten
5185 Dump after shortening branches.
5186
5187 @item -fdump-rtl-sibling
5188 @opindex fdump-rtl-sibling
5189 Dump after sibling call optimizations.
5190
5191 @item -fdump-rtl-split1
5192 @itemx -fdump-rtl-split2
5193 @itemx -fdump-rtl-split3
5194 @itemx -fdump-rtl-split4
5195 @itemx -fdump-rtl-split5
5196 @opindex fdump-rtl-split1
5197 @opindex fdump-rtl-split2
5198 @opindex fdump-rtl-split3
5199 @opindex fdump-rtl-split4
5200 @opindex fdump-rtl-split5
5201 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5202 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5203 @option{-fdump-rtl-split5} enable dumping after five rounds of
5204 instruction splitting.
5205
5206 @item -fdump-rtl-sms
5207 @opindex fdump-rtl-sms
5208 Dump after modulo scheduling.  This pass is only run on some
5209 architectures.
5210
5211 @item -fdump-rtl-stack
5212 @opindex fdump-rtl-stack
5213 Dump after conversion from GCC's "flat register file" registers to the
5214 x87's stack-like registers.  This pass is only run on x86 variants.
5215
5216 @item -fdump-rtl-subreg1
5217 @itemx -fdump-rtl-subreg2
5218 @opindex fdump-rtl-subreg1
5219 @opindex fdump-rtl-subreg2
5220 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5221 the two subreg expansion passes.
5222
5223 @item -fdump-rtl-unshare
5224 @opindex fdump-rtl-unshare
5225 Dump after all rtl has been unshared.
5226
5227 @item -fdump-rtl-vartrack
5228 @opindex fdump-rtl-vartrack
5229 Dump after variable tracking.
5230
5231 @item -fdump-rtl-vregs
5232 @opindex fdump-rtl-vregs
5233 Dump after converting virtual registers to hard registers.
5234
5235 @item -fdump-rtl-web
5236 @opindex fdump-rtl-web
5237 Dump after live range splitting.
5238
5239 @item -fdump-rtl-regclass
5240 @itemx -fdump-rtl-subregs_of_mode_init
5241 @itemx -fdump-rtl-subregs_of_mode_finish
5242 @itemx -fdump-rtl-dfinit
5243 @itemx -fdump-rtl-dfinish
5244 @opindex fdump-rtl-regclass
5245 @opindex fdump-rtl-subregs_of_mode_init
5246 @opindex fdump-rtl-subregs_of_mode_finish
5247 @opindex fdump-rtl-dfinit
5248 @opindex fdump-rtl-dfinish
5249 These dumps are defined but always produce empty files.
5250
5251 @item -fdump-rtl-all
5252 @opindex fdump-rtl-all
5253 Produce all the dumps listed above.
5254
5255 @item -dA
5256 @opindex dA
5257 Annotate the assembler output with miscellaneous debugging information.
5258
5259 @item -dD
5260 @opindex dD
5261 Dump all macro definitions, at the end of preprocessing, in addition to
5262 normal output.
5263
5264 @item -dH
5265 @opindex dH
5266 Produce a core dump whenever an error occurs.
5267
5268 @item -dm
5269 @opindex dm
5270 Print statistics on memory usage, at the end of the run, to
5271 standard error.
5272
5273 @item -dp
5274 @opindex dp
5275 Annotate the assembler output with a comment indicating which
5276 pattern and alternative was used.  The length of each instruction is
5277 also printed.
5278
5279 @item -dP
5280 @opindex dP
5281 Dump the RTL in the assembler output as a comment before each instruction.
5282 Also turns on @option{-dp} annotation.
5283
5284 @item -dv
5285 @opindex dv
5286 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5287 dump a representation of the control flow graph suitable for viewing with VCG
5288 to @file{@var{file}.@var{pass}.vcg}.
5289
5290 @item -dx
5291 @opindex dx
5292 Just generate RTL for a function instead of compiling it.  Usually used
5293 with @option{-fdump-rtl-expand}.
5294
5295 @item -dy
5296 @opindex dy
5297 Dump debugging information during parsing, to standard error.
5298 @end table
5299
5300 @item -fdump-noaddr
5301 @opindex fdump-noaddr
5302 When doing debugging dumps, suppress address output.  This makes it more
5303 feasible to use diff on debugging dumps for compiler invocations with
5304 different compiler binaries and/or different
5305 text / bss / data / heap / stack / dso start locations.
5306
5307 @item -fdump-unnumbered
5308 @opindex fdump-unnumbered
5309 When doing debugging dumps, suppress instruction numbers and address output.
5310 This makes it more feasible to use diff on debugging dumps for compiler
5311 invocations with different options, in particular with and without
5312 @option{-g}.
5313
5314 @item -fdump-unnumbered-links
5315 @opindex fdump-unnumbered-links
5316 When doing debugging dumps (see @option{-d} option above), suppress
5317 instruction numbers for the links to the previous and next instructions
5318 in a sequence.
5319
5320 @item -fdump-translation-unit @r{(C++ only)}
5321 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5322 @opindex fdump-translation-unit
5323 Dump a representation of the tree structure for the entire translation
5324 unit to a file.  The file name is made by appending @file{.tu} to the
5325 source file name, and the file is created in the same directory as the
5326 output file.  If the @samp{-@var{options}} form is used, @var{options}
5327 controls the details of the dump as described for the
5328 @option{-fdump-tree} options.
5329
5330 @item -fdump-class-hierarchy @r{(C++ only)}
5331 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5332 @opindex fdump-class-hierarchy
5333 Dump a representation of each class's hierarchy and virtual function
5334 table layout to a file.  The file name is made by appending
5335 @file{.class} to the source file name, and the file is created in the
5336 same directory as the output file.  If the @samp{-@var{options}} form
5337 is used, @var{options} controls the details of the dump as described
5338 for the @option{-fdump-tree} options.
5339
5340 @item -fdump-ipa-@var{switch}
5341 @opindex fdump-ipa
5342 Control the dumping at various stages of inter-procedural analysis
5343 language tree to a file.  The file name is generated by appending a
5344 switch specific suffix to the source file name, and the file is created
5345 in the same directory as the output file.  The following dumps are
5346 possible:
5347
5348 @table @samp
5349 @item all
5350 Enables all inter-procedural analysis dumps.
5351
5352 @item cgraph
5353 Dumps information about call-graph optimization, unused function removal,
5354 and inlining decisions.
5355
5356 @item inline
5357 Dump after function inlining.
5358
5359 @end table
5360
5361 @item -fdump-statistics-@var{option}
5362 @opindex fdump-statistics
5363 Enable and control dumping of pass statistics in a separate file.  The
5364 file name is generated by appending a suffix ending in
5365 @samp{.statistics} to the source file name, and the file is created in
5366 the same directory as the output file.  If the @samp{-@var{option}}
5367 form is used, @samp{-stats} will cause counters to be summed over the
5368 whole compilation unit while @samp{-details} will dump every event as
5369 the passes generate them.  The default with no option is to sum
5370 counters for each function compiled.
5371
5372 @item -fdump-tree-@var{switch}
5373 @itemx -fdump-tree-@var{switch}-@var{options}
5374 @opindex fdump-tree
5375 Control the dumping at various stages of processing the intermediate
5376 language tree to a file.  The file name is generated by appending a
5377 switch specific suffix to the source file name, and the file is
5378 created in the same directory as the output file.  If the
5379 @samp{-@var{options}} form is used, @var{options} is a list of
5380 @samp{-} separated options that control the details of the dump.  Not
5381 all options are applicable to all dumps, those which are not
5382 meaningful will be ignored.  The following options are available
5383
5384 @table @samp
5385 @item address
5386 Print the address of each node.  Usually this is not meaningful as it
5387 changes according to the environment and source file.  Its primary use
5388 is for tying up a dump file with a debug environment.
5389 @item asmname
5390 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5391 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5392 use working backward from mangled names in the assembly file.
5393 @item slim
5394 Inhibit dumping of members of a scope or body of a function merely
5395 because that scope has been reached.  Only dump such items when they
5396 are directly reachable by some other path.  When dumping pretty-printed
5397 trees, this option inhibits dumping the bodies of control structures.
5398 @item raw
5399 Print a raw representation of the tree.  By default, trees are
5400 pretty-printed into a C-like representation.
5401 @item details
5402 Enable more detailed dumps (not honored by every dump option).
5403 @item stats
5404 Enable dumping various statistics about the pass (not honored by every dump
5405 option).
5406 @item blocks
5407 Enable showing basic block boundaries (disabled in raw dumps).
5408 @item vops
5409 Enable showing virtual operands for every statement.
5410 @item lineno
5411 Enable showing line numbers for statements.
5412 @item uid
5413 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5414 @item verbose
5415 Enable showing the tree dump for each statement.
5416 @item eh
5417 Enable showing the EH region number holding each statement.
5418 @item all
5419 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5420 and @option{lineno}.
5421 @end table
5422
5423 The following tree dumps are possible:
5424 @table @samp
5425
5426 @item original
5427 @opindex fdump-tree-original
5428 Dump before any tree based optimization, to @file{@var{file}.original}.
5429
5430 @item optimized
5431 @opindex fdump-tree-optimized
5432 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5433
5434 @item gimple
5435 @opindex fdump-tree-gimple
5436 Dump each function before and after the gimplification pass to a file.  The
5437 file name is made by appending @file{.gimple} to the source file name.
5438
5439 @item cfg
5440 @opindex fdump-tree-cfg
5441 Dump the control flow graph of each function to a file.  The file name is
5442 made by appending @file{.cfg} to the source file name.
5443
5444 @item vcg
5445 @opindex fdump-tree-vcg
5446 Dump the control flow graph of each function to a file in VCG format.  The
5447 file name is made by appending @file{.vcg} to the source file name.  Note
5448 that if the file contains more than one function, the generated file cannot
5449 be used directly by VCG@.  You will need to cut and paste each function's
5450 graph into its own separate file first.
5451
5452 @item ch
5453 @opindex fdump-tree-ch
5454 Dump each function after copying loop headers.  The file name is made by
5455 appending @file{.ch} to the source file name.
5456
5457 @item ssa
5458 @opindex fdump-tree-ssa
5459 Dump SSA related information to a file.  The file name is made by appending
5460 @file{.ssa} to the source file name.
5461
5462 @item alias
5463 @opindex fdump-tree-alias
5464 Dump aliasing information for each function.  The file name is made by
5465 appending @file{.alias} to the source file name.
5466
5467 @item ccp
5468 @opindex fdump-tree-ccp
5469 Dump each function after CCP@.  The file name is made by appending
5470 @file{.ccp} to the source file name.
5471
5472 @item storeccp
5473 @opindex fdump-tree-storeccp
5474 Dump each function after STORE-CCP@.  The file name is made by appending
5475 @file{.storeccp} to the source file name.
5476
5477 @item pre
5478 @opindex fdump-tree-pre
5479 Dump trees after partial redundancy elimination.  The file name is made
5480 by appending @file{.pre} to the source file name.
5481
5482 @item fre
5483 @opindex fdump-tree-fre
5484 Dump trees after full redundancy elimination.  The file name is made
5485 by appending @file{.fre} to the source file name.
5486
5487 @item copyprop
5488 @opindex fdump-tree-copyprop
5489 Dump trees after copy propagation.  The file name is made
5490 by appending @file{.copyprop} to the source file name.
5491
5492 @item store_copyprop
5493 @opindex fdump-tree-store_copyprop
5494 Dump trees after store copy-propagation.  The file name is made
5495 by appending @file{.store_copyprop} to the source file name.
5496
5497 @item dce
5498 @opindex fdump-tree-dce
5499 Dump each function after dead code elimination.  The file name is made by
5500 appending @file{.dce} to the source file name.
5501
5502 @item mudflap
5503 @opindex fdump-tree-mudflap
5504 Dump each function after adding mudflap instrumentation.  The file name is
5505 made by appending @file{.mudflap} to the source file name.
5506
5507 @item sra
5508 @opindex fdump-tree-sra
5509 Dump each function after performing scalar replacement of aggregates.  The
5510 file name is made by appending @file{.sra} to the source file name.
5511
5512 @item sink
5513 @opindex fdump-tree-sink
5514 Dump each function after performing code sinking.  The file name is made
5515 by appending @file{.sink} to the source file name.
5516
5517 @item dom
5518 @opindex fdump-tree-dom
5519 Dump each function after applying dominator tree optimizations.  The file
5520 name is made by appending @file{.dom} to the source file name.
5521
5522 @item dse
5523 @opindex fdump-tree-dse
5524 Dump each function after applying dead store elimination.  The file
5525 name is made by appending @file{.dse} to the source file name.
5526
5527 @item phiopt
5528 @opindex fdump-tree-phiopt
5529 Dump each function after optimizing PHI nodes into straightline code.  The file
5530 name is made by appending @file{.phiopt} to the source file name.
5531
5532 @item forwprop
5533 @opindex fdump-tree-forwprop
5534 Dump each function after forward propagating single use variables.  The file
5535 name is made by appending @file{.forwprop} to the source file name.
5536
5537 @item copyrename
5538 @opindex fdump-tree-copyrename
5539 Dump each function after applying the copy rename optimization.  The file
5540 name is made by appending @file{.copyrename} to the source file name.
5541
5542 @item nrv
5543 @opindex fdump-tree-nrv
5544 Dump each function after applying the named return value optimization on
5545 generic trees.  The file name is made by appending @file{.nrv} to the source
5546 file name.
5547
5548 @item vect
5549 @opindex fdump-tree-vect
5550 Dump each function after applying vectorization of loops.  The file name is
5551 made by appending @file{.vect} to the source file name.
5552
5553 @item slp
5554 @opindex fdump-tree-slp
5555 Dump each function after applying vectorization of basic blocks.  The file name
5556 is made by appending @file{.slp} to the source file name.
5557
5558 @item vrp
5559 @opindex fdump-tree-vrp
5560 Dump each function after Value Range Propagation (VRP).  The file name
5561 is made by appending @file{.vrp} to the source file name.
5562
5563 @item all
5564 @opindex fdump-tree-all
5565 Enable all the available tree dumps with the flags provided in this option.
5566 @end table
5567
5568 @item -ftree-vectorizer-verbose=@var{n}
5569 @opindex ftree-vectorizer-verbose
5570 This option controls the amount of debugging output the vectorizer prints.
5571 This information is written to standard error, unless
5572 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5573 in which case it is output to the usual dump listing file, @file{.vect}.
5574 For @var{n}=0 no diagnostic information is reported.
5575 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5576 and the total number of loops that got vectorized.
5577 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5578 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5579 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5580 level that @option{-fdump-tree-vect-stats} uses.
5581 Higher verbosity levels mean either more information dumped for each
5582 reported loop, or same amount of information reported for more loops:
5583 if @var{n}=3, vectorizer cost model information is reported.
5584 If @var{n}=4, alignment related information is added to the reports.
5585 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5586 memory access-patterns) is added to the reports.
5587 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5588 that did not pass the first analysis phase (i.e., may not be countable, or
5589 may have complicated control-flow).
5590 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5591 If @var{n}=8, SLP related information is added to the reports.
5592 For @var{n}=9, all the information the vectorizer generates during its
5593 analysis and transformation is reported.  This is the same verbosity level
5594 that @option{-fdump-tree-vect-details} uses.
5595
5596 @item -frandom-seed=@var{string}
5597 @opindex frandom-seed
5598 This option provides a seed that GCC uses when it would otherwise use
5599 random numbers.  It is used to generate certain symbol names
5600 that have to be different in every compiled file.  It is also used to
5601 place unique stamps in coverage data files and the object files that
5602 produce them.  You can use the @option{-frandom-seed} option to produce
5603 reproducibly identical object files.
5604
5605 The @var{string} should be different for every file you compile.
5606
5607 @item -fsched-verbose=@var{n}
5608 @opindex fsched-verbose
5609 On targets that use instruction scheduling, this option controls the
5610 amount of debugging output the scheduler prints.  This information is
5611 written to standard error, unless @option{-fdump-rtl-sched1} or
5612 @option{-fdump-rtl-sched2} is specified, in which case it is output
5613 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5614 respectively.  However for @var{n} greater than nine, the output is
5615 always printed to standard error.
5616
5617 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5618 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5619 For @var{n} greater than one, it also output basic block probabilities,
5620 detailed ready list information and unit/insn info.  For @var{n} greater
5621 than two, it includes RTL at abort point, control-flow and regions info.
5622 And for @var{n} over four, @option{-fsched-verbose} also includes
5623 dependence info.
5624
5625 @item -save-temps
5626 @itemx -save-temps=cwd
5627 @opindex save-temps
5628 Store the usual ``temporary'' intermediate files permanently; place them
5629 in the current directory and name them based on the source file.  Thus,
5630 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5631 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5632 preprocessed @file{foo.i} output file even though the compiler now
5633 normally uses an integrated preprocessor.
5634
5635 When used in combination with the @option{-x} command line option,
5636 @option{-save-temps} is sensible enough to avoid over writing an
5637 input source file with the same extension as an intermediate file.
5638 The corresponding intermediate file may be obtained by renaming the
5639 source file before using @option{-save-temps}.
5640
5641 If you invoke GCC in parallel, compiling several different source
5642 files that share a common base name in different subdirectories or the
5643 same source file compiled for multiple output destinations, it is
5644 likely that the different parallel compilers will interfere with each
5645 other, and overwrite the temporary files.  For instance:
5646
5647 @smallexample
5648 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5649 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5650 @end smallexample
5651
5652 may result in @file{foo.i} and @file{foo.o} being written to
5653 simultaneously by both compilers.
5654
5655 @item -save-temps=obj
5656 @opindex save-temps=obj
5657 Store the usual ``temporary'' intermediate files permanently.  If the
5658 @option{-o} option is used, the temporary files are based on the
5659 object file.  If the @option{-o} option is not used, the
5660 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5661
5662 For example:
5663
5664 @smallexample
5665 gcc -save-temps=obj -c foo.c
5666 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5667 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5668 @end smallexample
5669
5670 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5671 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5672 @file{dir2/yfoobar.o}.
5673
5674 @item -time@r{[}=@var{file}@r{]}
5675 @opindex time
5676 Report the CPU time taken by each subprocess in the compilation
5677 sequence.  For C source files, this is the compiler proper and assembler
5678 (plus the linker if linking is done).
5679
5680 Without the specification of an output file, the output looks like this:
5681
5682 @smallexample
5683 # cc1 0.12 0.01
5684 # as 0.00 0.01
5685 @end smallexample
5686
5687 The first number on each line is the ``user time'', that is time spent
5688 executing the program itself.  The second number is ``system time'',
5689 time spent executing operating system routines on behalf of the program.
5690 Both numbers are in seconds.
5691
5692 With the specification of an output file, the output is appended to the
5693 named file, and it looks like this:
5694
5695 @smallexample
5696 0.12 0.01 cc1 @var{options}
5697 0.00 0.01 as @var{options}
5698 @end smallexample
5699
5700 The ``user time'' and the ``system time'' are moved before the program
5701 name, and the options passed to the program are displayed, so that one
5702 can later tell what file was being compiled, and with which options.
5703
5704 @item -fvar-tracking
5705 @opindex fvar-tracking
5706 Run variable tracking pass.  It computes where variables are stored at each
5707 position in code.  Better debugging information is then generated
5708 (if the debugging information format supports this information).
5709
5710 It is enabled by default when compiling with optimization (@option{-Os},
5711 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5712 the debug info format supports it.
5713
5714 @item -fvar-tracking-assignments
5715 @opindex fvar-tracking-assignments
5716 @opindex fno-var-tracking-assignments
5717 Annotate assignments to user variables early in the compilation and
5718 attempt to carry the annotations over throughout the compilation all the
5719 way to the end, in an attempt to improve debug information while
5720 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
5721
5722 It can be enabled even if var-tracking is disabled, in which case
5723 annotations will be created and maintained, but discarded at the end.
5724
5725 @item -fvar-tracking-assignments-toggle
5726 @opindex fvar-tracking-assignments-toggle
5727 @opindex fno-var-tracking-assignments-toggle
5728 Toggle @option{-fvar-tracking-assignments}, in the same way that
5729 @option{-gtoggle} toggles @option{-g}.
5730
5731 @item -print-file-name=@var{library}
5732 @opindex print-file-name
5733 Print the full absolute name of the library file @var{library} that
5734 would be used when linking---and don't do anything else.  With this
5735 option, GCC does not compile or link anything; it just prints the
5736 file name.
5737
5738 @item -print-multi-directory
5739 @opindex print-multi-directory
5740 Print the directory name corresponding to the multilib selected by any
5741 other switches present in the command line.  This directory is supposed
5742 to exist in @env{GCC_EXEC_PREFIX}.
5743
5744 @item -print-multi-lib
5745 @opindex print-multi-lib
5746 Print the mapping from multilib directory names to compiler switches
5747 that enable them.  The directory name is separated from the switches by
5748 @samp{;}, and each switch starts with an @samp{@@} instead of the
5749 @samp{-}, without spaces between multiple switches.  This is supposed to
5750 ease shell-processing.
5751
5752 @item -print-multi-os-directory
5753 @opindex print-multi-os-directory
5754 Print the path to OS libraries for the selected
5755 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
5756 present in the @file{lib} subdirectory and no multilibs are used, this is
5757 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
5758 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
5759 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
5760 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
5761
5762 @item -print-prog-name=@var{program}
5763 @opindex print-prog-name
5764 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5765
5766 @item -print-libgcc-file-name
5767 @opindex print-libgcc-file-name
5768 Same as @option{-print-file-name=libgcc.a}.
5769
5770 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5771 but you do want to link with @file{libgcc.a}.  You can do
5772
5773 @smallexample
5774 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5775 @end smallexample
5776
5777 @item -print-search-dirs
5778 @opindex print-search-dirs
5779 Print the name of the configured installation directory and a list of
5780 program and library directories @command{gcc} will search---and don't do anything else.
5781
5782 This is useful when @command{gcc} prints the error message
5783 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5784 To resolve this you either need to put @file{cpp0} and the other compiler
5785 components where @command{gcc} expects to find them, or you can set the environment
5786 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5787 Don't forget the trailing @samp{/}.
5788 @xref{Environment Variables}.
5789
5790 @item -print-sysroot
5791 @opindex print-sysroot
5792 Print the target sysroot directory that will be used during
5793 compilation.  This is the target sysroot specified either at configure
5794 time or using the @option{--sysroot} option, possibly with an extra
5795 suffix that depends on compilation options.  If no target sysroot is
5796 specified, the option prints nothing.
5797
5798 @item -print-sysroot-headers-suffix
5799 @opindex print-sysroot-headers-suffix
5800 Print the suffix added to the target sysroot when searching for
5801 headers, or give an error if the compiler is not configured with such
5802 a suffix---and don't do anything else.
5803
5804 @item -dumpmachine
5805 @opindex dumpmachine
5806 Print the compiler's target machine (for example,
5807 @samp{i686-pc-linux-gnu})---and don't do anything else.
5808
5809 @item -dumpversion
5810 @opindex dumpversion
5811 Print the compiler version (for example, @samp{3.0})---and don't do
5812 anything else.
5813
5814 @item -dumpspecs
5815 @opindex dumpspecs
5816 Print the compiler's built-in specs---and don't do anything else.  (This
5817 is used when GCC itself is being built.)  @xref{Spec Files}.
5818
5819 @item -feliminate-unused-debug-types
5820 @opindex feliminate-unused-debug-types
5821 Normally, when producing DWARF2 output, GCC will emit debugging
5822 information for all types declared in a compilation
5823 unit, regardless of whether or not they are actually used
5824 in that compilation unit.  Sometimes this is useful, such as
5825 if, in the debugger, you want to cast a value to a type that is
5826 not actually used in your program (but is declared).  More often,
5827 however, this results in a significant amount of wasted space.
5828 With this option, GCC will avoid producing debug symbol output
5829 for types that are nowhere used in the source file being compiled.
5830 @end table
5831
5832 @node Optimize Options
5833 @section Options That Control Optimization
5834 @cindex optimize options
5835 @cindex options, optimization
5836
5837 These options control various sorts of optimizations.
5838
5839 Without any optimization option, the compiler's goal is to reduce the
5840 cost of compilation and to make debugging produce the expected
5841 results.  Statements are independent: if you stop the program with a
5842 breakpoint between statements, you can then assign a new value to any
5843 variable or change the program counter to any other statement in the
5844 function and get exactly the results you would expect from the source
5845 code.
5846
5847 Turning on optimization flags makes the compiler attempt to improve
5848 the performance and/or code size at the expense of compilation time
5849 and possibly the ability to debug the program.
5850
5851 The compiler performs optimization based on the knowledge it has of the
5852 program.  Compiling multiple files at once to a single output file mode allows
5853 the compiler to use information gained from all of the files when compiling
5854 each of them.
5855
5856 Not all optimizations are controlled directly by a flag.  Only
5857 optimizations that have a flag are listed in this section.
5858
5859 Most optimizations are only enabled if an @option{-O} level is set on
5860 the command line.  Otherwise they are disabled, even if individual             
5861 optimization flags are specified.
5862
5863 Depending on the target and how GCC was configured, a slightly different
5864 set of optimizations may be enabled at each @option{-O} level than
5865 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
5866 to find out the exact set of optimizations that are enabled at each level.
5867 @xref{Overall Options}, for examples.
5868
5869 @table @gcctabopt
5870 @item -O
5871 @itemx -O1
5872 @opindex O
5873 @opindex O1
5874 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5875 more memory for a large function.
5876
5877 With @option{-O}, the compiler tries to reduce code size and execution
5878 time, without performing any optimizations that take a great deal of
5879 compilation time.
5880
5881 @option{-O} turns on the following optimization flags:
5882 @gccoptlist{
5883 -fauto-inc-dec @gol
5884 -fcprop-registers @gol
5885 -fdce @gol
5886 -fdefer-pop @gol
5887 -fdelayed-branch @gol
5888 -fdse @gol
5889 -fguess-branch-probability @gol
5890 -fif-conversion2 @gol
5891 -fif-conversion @gol
5892 -fipa-pure-const @gol
5893 -fipa-profile @gol
5894 -fipa-reference @gol
5895 -fmerge-constants
5896 -fsplit-wide-types @gol
5897 -ftree-bit-ccp @gol
5898 -ftree-builtin-call-dce @gol
5899 -ftree-ccp @gol
5900 -ftree-ch @gol
5901 -ftree-copyrename @gol
5902 -ftree-dce @gol
5903 -ftree-dominator-opts @gol
5904 -ftree-dse @gol
5905 -ftree-forwprop @gol
5906 -ftree-fre @gol
5907 -ftree-phiprop @gol
5908 -ftree-sra @gol
5909 -ftree-pta @gol
5910 -ftree-ter @gol
5911 -funit-at-a-time}
5912
5913 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5914 where doing so does not interfere with debugging.
5915
5916 @item -O2
5917 @opindex O2
5918 Optimize even more.  GCC performs nearly all supported optimizations
5919 that do not involve a space-speed tradeoff.
5920 As compared to @option{-O}, this option increases both compilation time
5921 and the performance of the generated code.
5922
5923 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5924 also turns on the following optimization flags:
5925 @gccoptlist{-fthread-jumps @gol
5926 -falign-functions  -falign-jumps @gol
5927 -falign-loops  -falign-labels @gol
5928 -fcaller-saves @gol
5929 -fcrossjumping @gol
5930 -fcse-follow-jumps  -fcse-skip-blocks @gol
5931 -fdelete-null-pointer-checks @gol
5932 -fexpensive-optimizations @gol
5933 -fgcse  -fgcse-lm  @gol
5934 -finline-small-functions @gol
5935 -findirect-inlining @gol
5936 -fipa-sra @gol
5937 -foptimize-sibling-calls @gol
5938 -fpartial-inlining @gol
5939 -fpeephole2 @gol
5940 -fregmove @gol
5941 -freorder-blocks  -freorder-functions @gol
5942 -frerun-cse-after-loop  @gol
5943 -fsched-interblock  -fsched-spec @gol
5944 -fschedule-insns  -fschedule-insns2 @gol
5945 -fstrict-aliasing -fstrict-overflow @gol
5946 -ftree-switch-conversion @gol
5947 -ftree-pre @gol
5948 -ftree-vrp}
5949
5950 Please note the warning under @option{-fgcse} about
5951 invoking @option{-O2} on programs that use computed gotos.
5952
5953 @item -O3
5954 @opindex O3
5955 Optimize yet more.  @option{-O3} turns on all optimizations specified
5956 by @option{-O2} and also turns on the @option{-finline-functions},
5957 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5958 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5959
5960 @item -O0
5961 @opindex O0
5962 Reduce compilation time and make debugging produce the expected
5963 results.  This is the default.
5964
5965 @item -Os
5966 @opindex Os
5967 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5968 do not typically increase code size.  It also performs further
5969 optimizations designed to reduce code size.
5970
5971 @option{-Os} disables the following optimization flags:
5972 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5973 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5974 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5975
5976 @item -Ofast
5977 @opindex Ofast
5978 Disregard strict standards compliance.  @option{-Ofast} enables all
5979 @option{-O3} optimizations.  It also enables optimizations that are not
5980 valid for all standard compliant programs.
5981 It turns on @option{-ffast-math}.
5982
5983 If you use multiple @option{-O} options, with or without level numbers,
5984 the last such option is the one that is effective.
5985 @end table
5986
5987 Options of the form @option{-f@var{flag}} specify machine-independent
5988 flags.  Most flags have both positive and negative forms; the negative
5989 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5990 below, only one of the forms is listed---the one you typically will
5991 use.  You can figure out the other form by either removing @samp{no-}
5992 or adding it.
5993
5994 The following options control specific optimizations.  They are either
5995 activated by @option{-O} options or are related to ones that are.  You
5996 can use the following flags in the rare cases when ``fine-tuning'' of
5997 optimizations to be performed is desired.
5998
5999 @table @gcctabopt
6000 @item -fno-default-inline
6001 @opindex fno-default-inline
6002 Do not make member functions inline by default merely because they are
6003 defined inside the class scope (C++ only).  Otherwise, when you specify
6004 @w{@option{-O}}, member functions defined inside class scope are compiled
6005 inline by default; i.e., you don't need to add @samp{inline} in front of
6006 the member function name.
6007
6008 @item -fno-defer-pop
6009 @opindex fno-defer-pop
6010 Always pop the arguments to each function call as soon as that function
6011 returns.  For machines which must pop arguments after a function call,
6012 the compiler normally lets arguments accumulate on the stack for several
6013 function calls and pops them all at once.
6014
6015 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6016
6017 @item -fforward-propagate
6018 @opindex fforward-propagate
6019 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6020 instructions and checks if the result can be simplified.  If loop unrolling
6021 is active, two passes are performed and the second is scheduled after
6022 loop unrolling.
6023
6024 This option is enabled by default at optimization levels @option{-O},
6025 @option{-O2}, @option{-O3}, @option{-Os}.
6026
6027 @item -fomit-frame-pointer
6028 @opindex fomit-frame-pointer
6029 Don't keep the frame pointer in a register for functions that
6030 don't need one.  This avoids the instructions to save, set up and
6031 restore frame pointers; it also makes an extra register available
6032 in many functions.  @strong{It also makes debugging impossible on
6033 some machines.}
6034
6035 On some machines, such as the VAX, this flag has no effect, because
6036 the standard calling sequence automatically handles the frame pointer
6037 and nothing is saved by pretending it doesn't exist.  The
6038 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6039 whether a target machine supports this flag.  @xref{Registers,,Register
6040 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6041
6042 Starting with GCC version 4.6, the default setting (when not optimizing for
6043 size) for 32-bit Linux x86 and 32-bit Darwin x86 targets has been changed to
6044 @option{-fomit-frame-pointer}.  The default can be reverted to
6045 @option{-fno-omit-frame-pointer} by configuring GCC with the
6046 @option{--enable-frame-pointer} configure option.
6047
6048 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6049
6050 @item -foptimize-sibling-calls
6051 @opindex foptimize-sibling-calls
6052 Optimize sibling and tail recursive calls.
6053
6054 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6055
6056 @item -fno-inline
6057 @opindex fno-inline
6058 Don't pay attention to the @code{inline} keyword.  Normally this option
6059 is used to keep the compiler from expanding any functions inline.
6060 Note that if you are not optimizing, no functions can be expanded inline.
6061
6062 @item -finline-small-functions
6063 @opindex finline-small-functions
6064 Integrate functions into their callers when their body is smaller than expected
6065 function call code (so overall size of program gets smaller).  The compiler
6066 heuristically decides which functions are simple enough to be worth integrating
6067 in this way.
6068
6069 Enabled at level @option{-O2}.
6070
6071 @item -findirect-inlining
6072 @opindex findirect-inlining
6073 Inline also indirect calls that are discovered to be known at compile
6074 time thanks to previous inlining.  This option has any effect only
6075 when inlining itself is turned on by the @option{-finline-functions}
6076 or @option{-finline-small-functions} options.
6077
6078 Enabled at level @option{-O2}.
6079
6080 @item -finline-functions
6081 @opindex finline-functions
6082 Integrate all simple functions into their callers.  The compiler
6083 heuristically decides which functions are simple enough to be worth
6084 integrating in this way.
6085
6086 If all calls to a given function are integrated, and the function is
6087 declared @code{static}, then the function is normally not output as
6088 assembler code in its own right.
6089
6090 Enabled at level @option{-O3}.
6091
6092 @item -finline-functions-called-once
6093 @opindex finline-functions-called-once
6094 Consider all @code{static} functions called once for inlining into their
6095 caller even if they are not marked @code{inline}.  If a call to a given
6096 function is integrated, then the function is not output as assembler code
6097 in its own right.
6098
6099 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6100
6101 @item -fearly-inlining
6102 @opindex fearly-inlining
6103 Inline functions marked by @code{always_inline} and functions whose body seems
6104 smaller than the function call overhead early before doing
6105 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6106 makes profiling significantly cheaper and usually inlining faster on programs
6107 having large chains of nested wrapper functions.
6108
6109 Enabled by default.
6110
6111 @item -fipa-sra
6112 @opindex fipa-sra
6113 Perform interprocedural scalar replacement of aggregates, removal of
6114 unused parameters and replacement of parameters passed by reference
6115 by parameters passed by value.
6116
6117 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6118
6119 @item -finline-limit=@var{n}
6120 @opindex finline-limit
6121 By default, GCC limits the size of functions that can be inlined.  This flag
6122 allows coarse control of this limit.  @var{n} is the size of functions that
6123 can be inlined in number of pseudo instructions.
6124
6125 Inlining is actually controlled by a number of parameters, which may be
6126 specified individually by using @option{--param @var{name}=@var{value}}.
6127 The @option{-finline-limit=@var{n}} option sets some of these parameters
6128 as follows:
6129
6130 @table @gcctabopt
6131 @item max-inline-insns-single
6132 is set to @var{n}/2.
6133 @item max-inline-insns-auto
6134 is set to @var{n}/2.
6135 @end table
6136
6137 See below for a documentation of the individual
6138 parameters controlling inlining and for the defaults of these parameters.
6139
6140 @emph{Note:} there may be no value to @option{-finline-limit} that results
6141 in default behavior.
6142
6143 @emph{Note:} pseudo instruction represents, in this particular context, an
6144 abstract measurement of function's size.  In no way does it represent a count
6145 of assembly instructions and as such its exact meaning might change from one
6146 release to an another.
6147
6148 @item -fkeep-inline-functions
6149 @opindex fkeep-inline-functions
6150 In C, emit @code{static} functions that are declared @code{inline}
6151 into the object file, even if the function has been inlined into all
6152 of its callers.  This switch does not affect functions using the
6153 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6154 inline functions into the object file.
6155
6156 @item -fkeep-static-consts
6157 @opindex fkeep-static-consts
6158 Emit variables declared @code{static const} when optimization isn't turned
6159 on, even if the variables aren't referenced.
6160
6161 GCC enables this option by default.  If you want to force the compiler to
6162 check if the variable was referenced, regardless of whether or not
6163 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6164
6165 @item -fmerge-constants
6166 @opindex fmerge-constants
6167 Attempt to merge identical constants (string constants and floating point
6168 constants) across compilation units.
6169
6170 This option is the default for optimized compilation if the assembler and
6171 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6172 behavior.
6173
6174 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6175
6176 @item -fmerge-all-constants
6177 @opindex fmerge-all-constants
6178 Attempt to merge identical constants and identical variables.
6179
6180 This option implies @option{-fmerge-constants}.  In addition to
6181 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6182 arrays or initialized constant variables with integral or floating point
6183 types.  Languages like C or C++ require each variable, including multiple
6184 instances of the same variable in recursive calls, to have distinct locations,
6185 so using this option will result in non-conforming
6186 behavior.
6187
6188 @item -fmodulo-sched
6189 @opindex fmodulo-sched
6190 Perform swing modulo scheduling immediately before the first scheduling
6191 pass.  This pass looks at innermost loops and reorders their
6192 instructions by overlapping different iterations.
6193
6194 @item -fmodulo-sched-allow-regmoves
6195 @opindex fmodulo-sched-allow-regmoves
6196 Perform more aggressive SMS based modulo scheduling with register moves
6197 allowed.  By setting this flag certain anti-dependences edges will be
6198 deleted which will trigger the generation of reg-moves based on the
6199 life-range analysis.  This option is effective only with
6200 @option{-fmodulo-sched} enabled.
6201
6202 @item -fno-branch-count-reg
6203 @opindex fno-branch-count-reg
6204 Do not use ``decrement and branch'' instructions on a count register,
6205 but instead generate a sequence of instructions that decrement a
6206 register, compare it against zero, then branch based upon the result.
6207 This option is only meaningful on architectures that support such
6208 instructions, which include x86, PowerPC, IA-64 and S/390.
6209
6210 The default is @option{-fbranch-count-reg}.
6211
6212 @item -fno-function-cse
6213 @opindex fno-function-cse
6214 Do not put function addresses in registers; make each instruction that
6215 calls a constant function contain the function's address explicitly.
6216
6217 This option results in less efficient code, but some strange hacks
6218 that alter the assembler output may be confused by the optimizations
6219 performed when this option is not used.
6220
6221 The default is @option{-ffunction-cse}
6222
6223 @item -fno-zero-initialized-in-bss
6224 @opindex fno-zero-initialized-in-bss
6225 If the target supports a BSS section, GCC by default puts variables that
6226 are initialized to zero into BSS@.  This can save space in the resulting
6227 code.
6228
6229 This option turns off this behavior because some programs explicitly
6230 rely on variables going to the data section.  E.g., so that the
6231 resulting executable can find the beginning of that section and/or make
6232 assumptions based on that.
6233
6234 The default is @option{-fzero-initialized-in-bss}.
6235
6236 @item -fmudflap -fmudflapth -fmudflapir
6237 @opindex fmudflap
6238 @opindex fmudflapth
6239 @opindex fmudflapir
6240 @cindex bounds checking
6241 @cindex mudflap
6242 For front-ends that support it (C and C++), instrument all risky
6243 pointer/array dereferencing operations, some standard library
6244 string/heap functions, and some other associated constructs with
6245 range/validity tests.  Modules so instrumented should be immune to
6246 buffer overflows, invalid heap use, and some other classes of C/C++
6247 programming errors.  The instrumentation relies on a separate runtime
6248 library (@file{libmudflap}), which will be linked into a program if
6249 @option{-fmudflap} is given at link time.  Run-time behavior of the
6250 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6251 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6252 for its options.
6253
6254 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6255 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6256 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6257 instrumentation should ignore pointer reads.  This produces less
6258 instrumentation (and therefore faster execution) and still provides
6259 some protection against outright memory corrupting writes, but allows
6260 erroneously read data to propagate within a program.
6261
6262 @item -fthread-jumps
6263 @opindex fthread-jumps
6264 Perform optimizations where we check to see if a jump branches to a
6265 location where another comparison subsumed by the first is found.  If
6266 so, the first branch is redirected to either the destination of the
6267 second branch or a point immediately following it, depending on whether
6268 the condition is known to be true or false.
6269
6270 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6271
6272 @item -fsplit-wide-types
6273 @opindex fsplit-wide-types
6274 When using a type that occupies multiple registers, such as @code{long
6275 long} on a 32-bit system, split the registers apart and allocate them
6276 independently.  This normally generates better code for those types,
6277 but may make debugging more difficult.
6278
6279 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6280 @option{-Os}.
6281
6282 @item -fcse-follow-jumps
6283 @opindex fcse-follow-jumps
6284 In common subexpression elimination (CSE), scan through jump instructions
6285 when the target of the jump is not reached by any other path.  For
6286 example, when CSE encounters an @code{if} statement with an
6287 @code{else} clause, CSE will follow the jump when the condition
6288 tested is false.
6289
6290 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6291
6292 @item -fcse-skip-blocks
6293 @opindex fcse-skip-blocks
6294 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6295 follow jumps which conditionally skip over blocks.  When CSE
6296 encounters a simple @code{if} statement with no else clause,
6297 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6298 body of the @code{if}.
6299
6300 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6301
6302 @item -frerun-cse-after-loop
6303 @opindex frerun-cse-after-loop
6304 Re-run common subexpression elimination after loop optimizations has been
6305 performed.
6306
6307 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6308
6309 @item -fgcse
6310 @opindex fgcse
6311 Perform a global common subexpression elimination pass.
6312 This pass also performs global constant and copy propagation.
6313
6314 @emph{Note:} When compiling a program using computed gotos, a GCC
6315 extension, you may get better runtime performance if you disable
6316 the global common subexpression elimination pass by adding
6317 @option{-fno-gcse} to the command line.
6318
6319 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6320
6321 @item -fgcse-lm
6322 @opindex fgcse-lm
6323 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
6324 attempt to move loads which are only killed by stores into themselves.  This
6325 allows a loop containing a load/store sequence to be changed to a load outside
6326 the loop, and a copy/store within the loop.
6327
6328 Enabled by default when gcse is enabled.
6329
6330 @item -fgcse-sm
6331 @opindex fgcse-sm
6332 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6333 global common subexpression elimination.  This pass will attempt to move
6334 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6335 loops containing a load/store sequence can be changed to a load before
6336 the loop and a store after the loop.
6337
6338 Not enabled at any optimization level.
6339
6340 @item -fgcse-las
6341 @opindex fgcse-las
6342 When @option{-fgcse-las} is enabled, the global common subexpression
6343 elimination pass eliminates redundant loads that come after stores to the
6344 same memory location (both partial and full redundancies).
6345
6346 Not enabled at any optimization level.
6347
6348 @item -fgcse-after-reload
6349 @opindex fgcse-after-reload
6350 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6351 pass is performed after reload.  The purpose of this pass is to cleanup
6352 redundant spilling.
6353
6354 @item -funsafe-loop-optimizations
6355 @opindex funsafe-loop-optimizations
6356 If given, the loop optimizer will assume that loop indices do not
6357 overflow, and that the loops with nontrivial exit condition are not
6358 infinite.  This enables a wider range of loop optimizations even if
6359 the loop optimizer itself cannot prove that these assumptions are valid.
6360 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6361 if it finds this kind of loop.
6362
6363 @item -fcrossjumping
6364 @opindex fcrossjumping
6365 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6366 resulting code may or may not perform better than without cross-jumping.
6367
6368 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6369
6370 @item -fauto-inc-dec
6371 @opindex fauto-inc-dec
6372 Combine increments or decrements of addresses with memory accesses.
6373 This pass is always skipped on architectures that do not have
6374 instructions to support this.  Enabled by default at @option{-O} and
6375 higher on architectures that support this.
6376
6377 @item -fdce
6378 @opindex fdce
6379 Perform dead code elimination (DCE) on RTL@.
6380 Enabled by default at @option{-O} and higher.
6381
6382 @item -fdse
6383 @opindex fdse
6384 Perform dead store elimination (DSE) on RTL@.
6385 Enabled by default at @option{-O} and higher.
6386
6387 @item -fif-conversion
6388 @opindex fif-conversion
6389 Attempt to transform conditional jumps into branch-less equivalents.  This
6390 include use of conditional moves, min, max, set flags and abs instructions, and
6391 some tricks doable by standard arithmetics.  The use of conditional execution
6392 on chips where it is available is controlled by @code{if-conversion2}.
6393
6394 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6395
6396 @item -fif-conversion2
6397 @opindex fif-conversion2
6398 Use conditional execution (where available) to transform conditional jumps into
6399 branch-less equivalents.
6400
6401 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6402
6403 @item -fdelete-null-pointer-checks
6404 @opindex fdelete-null-pointer-checks
6405 Assume that programs cannot safely dereference null pointers, and that
6406 no code or data element resides there.  This enables simple constant
6407 folding optimizations at all optimization levels.  In addition, other
6408 optimization passes in GCC use this flag to control global dataflow
6409 analyses that eliminate useless checks for null pointers; these assume
6410 that if a pointer is checked after it has already been dereferenced,
6411 it cannot be null.
6412
6413 Note however that in some environments this assumption is not true.
6414 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6415 for programs which depend on that behavior.
6416
6417 Some targets, especially embedded ones, disable this option at all levels.
6418 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6419 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6420 are enabled independently at different optimization levels.
6421
6422 @item -fexpensive-optimizations
6423 @opindex fexpensive-optimizations
6424 Perform a number of minor optimizations that are relatively expensive.
6425
6426 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6427
6428 @item -foptimize-register-move
6429 @itemx -fregmove
6430 @opindex foptimize-register-move
6431 @opindex fregmove
6432 Attempt to reassign register numbers in move instructions and as
6433 operands of other simple instructions in order to maximize the amount of
6434 register tying.  This is especially helpful on machines with two-operand
6435 instructions.
6436
6437 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6438 optimization.
6439
6440 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6441
6442 @item -fira-algorithm=@var{algorithm}
6443 Use specified coloring algorithm for the integrated register
6444 allocator.  The @var{algorithm} argument should be @code{priority} or
6445 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6446 the second one specifies Chaitin-Briggs coloring.  The second
6447 algorithm can be unimplemented for some architectures.  If it is
6448 implemented, it is the default because Chaitin-Briggs coloring as a
6449 rule generates a better code.
6450
6451 @item -fira-region=@var{region}
6452 Use specified regions for the integrated register allocator.  The
6453 @var{region} argument should be one of @code{all}, @code{mixed}, or
6454 @code{one}.  The first value means using all loops as register
6455 allocation regions, the second value which is the default means using
6456 all loops except for loops with small register pressure as the
6457 regions, and third one means using all function as a single region.
6458 The first value can give best result for machines with small size and
6459 irregular register set, the third one results in faster and generates
6460 decent code and the smallest size code, and the default value usually
6461 give the best results in most cases and for most architectures.
6462
6463 @item -fira-coalesce
6464 @opindex fira-coalesce
6465 Do optimistic register coalescing.  This option might be profitable for
6466 architectures with big regular register files.
6467
6468 @item -fira-loop-pressure
6469 @opindex fira-loop-pressure
6470 Use IRA to evaluate register pressure in loops for decision to move
6471 loop invariants.  Usage of this option usually results in generation
6472 of faster and smaller code on machines with big register files (>= 32
6473 registers) but it can slow compiler down.
6474
6475 This option is enabled at level @option{-O3} for some targets.
6476
6477 @item -fno-ira-share-save-slots
6478 @opindex fno-ira-share-save-slots
6479 Switch off sharing stack slots used for saving call used hard
6480 registers living through a call.  Each hard register will get a
6481 separate stack slot and as a result function stack frame will be
6482 bigger.
6483
6484 @item -fno-ira-share-spill-slots
6485 @opindex fno-ira-share-spill-slots
6486 Switch off sharing stack slots allocated for pseudo-registers.  Each
6487 pseudo-register which did not get a hard register will get a separate
6488 stack slot and as a result function stack frame will be bigger.
6489
6490 @item -fira-verbose=@var{n}
6491 @opindex fira-verbose
6492 Set up how verbose dump file for the integrated register allocator
6493 will be.  Default value is 5.  If the value is greater or equal to 10,
6494 the dump file will be stderr as if the value were @var{n} minus 10.
6495
6496 @item -fdelayed-branch
6497 @opindex fdelayed-branch
6498 If supported for the target machine, attempt to reorder instructions
6499 to exploit instruction slots available after delayed branch
6500 instructions.
6501
6502 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6503
6504 @item -fschedule-insns
6505 @opindex fschedule-insns
6506 If supported for the target machine, attempt to reorder instructions to
6507 eliminate execution stalls due to required data being unavailable.  This
6508 helps machines that have slow floating point or memory load instructions
6509 by allowing other instructions to be issued until the result of the load
6510 or floating point instruction is required.
6511
6512 Enabled at levels @option{-O2}, @option{-O3}.
6513
6514 @item -fschedule-insns2
6515 @opindex fschedule-insns2
6516 Similar to @option{-fschedule-insns}, but requests an additional pass of
6517 instruction scheduling after register allocation has been done.  This is
6518 especially useful on machines with a relatively small number of
6519 registers and where memory load instructions take more than one cycle.
6520
6521 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6522
6523 @item -fno-sched-interblock
6524 @opindex fno-sched-interblock
6525 Don't schedule instructions across basic blocks.  This is normally
6526 enabled by default when scheduling before register allocation, i.e.@:
6527 with @option{-fschedule-insns} or at @option{-O2} or higher.
6528
6529 @item -fno-sched-spec
6530 @opindex fno-sched-spec
6531 Don't allow speculative motion of non-load instructions.  This is normally
6532 enabled by default when scheduling before register allocation, i.e.@:
6533 with @option{-fschedule-insns} or at @option{-O2} or higher.
6534
6535 @item -fsched-pressure
6536 @opindex fsched-pressure
6537 Enable register pressure sensitive insn scheduling before the register
6538 allocation.  This only makes sense when scheduling before register
6539 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6540 @option{-O2} or higher.  Usage of this option can improve the
6541 generated code and decrease its size by preventing register pressure
6542 increase above the number of available hard registers and as a
6543 consequence register spills in the register allocation.
6544
6545 @item -fsched-spec-load
6546 @opindex fsched-spec-load
6547 Allow speculative motion of some load instructions.  This only makes
6548 sense when scheduling before register allocation, i.e.@: with
6549 @option{-fschedule-insns} or at @option{-O2} or higher.
6550
6551 @item -fsched-spec-load-dangerous
6552 @opindex fsched-spec-load-dangerous
6553 Allow speculative motion of more load instructions.  This only makes
6554 sense when scheduling before register allocation, i.e.@: with
6555 @option{-fschedule-insns} or at @option{-O2} or higher.
6556
6557 @item -fsched-stalled-insns
6558 @itemx -fsched-stalled-insns=@var{n}
6559 @opindex fsched-stalled-insns
6560 Define how many insns (if any) can be moved prematurely from the queue
6561 of stalled insns into the ready list, during the second scheduling pass.
6562 @option{-fno-sched-stalled-insns} means that no insns will be moved
6563 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6564 on how many queued insns can be moved prematurely.
6565 @option{-fsched-stalled-insns} without a value is equivalent to
6566 @option{-fsched-stalled-insns=1}.
6567
6568 @item -fsched-stalled-insns-dep
6569 @itemx -fsched-stalled-insns-dep=@var{n}
6570 @opindex fsched-stalled-insns-dep
6571 Define how many insn groups (cycles) will be examined for a dependency
6572 on a stalled insn that is candidate for premature removal from the queue
6573 of stalled insns.  This has an effect only during the second scheduling pass,
6574 and only if @option{-fsched-stalled-insns} is used.
6575 @option{-fno-sched-stalled-insns-dep} is equivalent to
6576 @option{-fsched-stalled-insns-dep=0}.
6577 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6578 @option{-fsched-stalled-insns-dep=1}.
6579
6580 @item -fsched2-use-superblocks
6581 @opindex fsched2-use-superblocks
6582 When scheduling after register allocation, do use superblock scheduling
6583 algorithm.  Superblock scheduling allows motion across basic block boundaries
6584 resulting on faster schedules.  This option is experimental, as not all machine
6585 descriptions used by GCC model the CPU closely enough to avoid unreliable
6586 results from the algorithm.
6587
6588 This only makes sense when scheduling after register allocation, i.e.@: with
6589 @option{-fschedule-insns2} or at @option{-O2} or higher.
6590
6591 @item -fsched-group-heuristic
6592 @opindex fsched-group-heuristic
6593 Enable the group heuristic in the scheduler.  This heuristic favors 
6594 the instruction that belongs to a schedule group.  This is enabled 
6595 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6596 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6597
6598 @item -fsched-critical-path-heuristic
6599 @opindex fsched-critical-path-heuristic
6600 Enable the critical-path heuristic in the scheduler.  This heuristic favors 
6601 instructions on the critical path.  This is enabled by default when 
6602 scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6603 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6604
6605 @item -fsched-spec-insn-heuristic
6606 @opindex fsched-spec-insn-heuristic
6607 Enable the speculative instruction heuristic in the scheduler.  This 
6608 heuristic favors speculative instructions with greater dependency weakness.  
6609 This is enabled by default when scheduling is enabled, i.e.@: 
6610 with @option{-fschedule-insns} or @option{-fschedule-insns2} 
6611 or at @option{-O2} or higher.
6612
6613 @item -fsched-rank-heuristic
6614 @opindex fsched-rank-heuristic
6615 Enable the rank heuristic in the scheduler.  This heuristic favors 
6616 the instruction belonging to a basic block with greater size or frequency.  
6617 This is enabled by default when scheduling is enabled, i.e.@: 
6618 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6619 at @option{-O2} or higher.
6620
6621 @item -fsched-last-insn-heuristic
6622 @opindex fsched-last-insn-heuristic
6623 Enable the last-instruction heuristic in the scheduler.  This heuristic 
6624 favors the instruction that is less dependent on the last instruction
6625 scheduled.  This is enabled by default when scheduling is enabled, 
6626 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6627 at @option{-O2} or higher.
6628
6629 @item -fsched-dep-count-heuristic
6630 @opindex fsched-dep-count-heuristic
6631 Enable the dependent-count heuristic in the scheduler.  This heuristic 
6632 favors the instruction that has more instructions depending on it.  
6633 This is enabled by default when scheduling is enabled, i.e.@: 
6634 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6635 at @option{-O2} or higher.
6636
6637 @item -freschedule-modulo-scheduled-loops
6638 @opindex freschedule-modulo-scheduled-loops
6639 The modulo scheduling comes before the traditional scheduling, if a loop
6640 was modulo scheduled we may want to prevent the later scheduling passes
6641 from changing its schedule, we use this option to control that.
6642
6643 @item -fselective-scheduling
6644 @opindex fselective-scheduling
6645 Schedule instructions using selective scheduling algorithm.  Selective
6646 scheduling runs instead of the first scheduler pass.
6647
6648 @item -fselective-scheduling2
6649 @opindex fselective-scheduling2
6650 Schedule instructions using selective scheduling algorithm.  Selective
6651 scheduling runs instead of the second scheduler pass.
6652
6653 @item -fsel-sched-pipelining
6654 @opindex fsel-sched-pipelining
6655 Enable software pipelining of innermost loops during selective scheduling.
6656 This option has no effect until one of @option{-fselective-scheduling} or
6657 @option{-fselective-scheduling2} is turned on.
6658
6659 @item -fsel-sched-pipelining-outer-loops
6660 @opindex fsel-sched-pipelining-outer-loops
6661 When pipelining loops during selective scheduling, also pipeline outer loops.
6662 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6663
6664 @item -fcaller-saves
6665 @opindex fcaller-saves
6666 Enable values to be allocated in registers that will be clobbered by
6667 function calls, by emitting extra instructions to save and restore the
6668 registers around such calls.  Such allocation is done only when it
6669 seems to result in better code than would otherwise be produced.
6670
6671 This option is always enabled by default on certain machines, usually
6672 those which have no call-preserved registers to use instead.
6673
6674 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6675
6676 @item -fconserve-stack
6677 @opindex fconserve-stack
6678 Attempt to minimize stack usage.  The compiler will attempt to use less
6679 stack space, even if that makes the program slower.  This option
6680 implies setting the @option{large-stack-frame} parameter to 100
6681 and the @option{large-stack-frame-growth} parameter to 400.
6682
6683 @item -ftree-reassoc
6684 @opindex ftree-reassoc
6685 Perform reassociation on trees.  This flag is enabled by default
6686 at @option{-O} and higher.
6687
6688 @item -ftree-pre
6689 @opindex ftree-pre
6690 Perform partial redundancy elimination (PRE) on trees.  This flag is
6691 enabled by default at @option{-O2} and @option{-O3}.
6692
6693 @item -ftree-forwprop
6694 @opindex ftree-forwprop
6695 Perform forward propagation on trees.  This flag is enabled by default
6696 at @option{-O} and higher.
6697
6698 @item -ftree-fre
6699 @opindex ftree-fre
6700 Perform full redundancy elimination (FRE) on trees.  The difference
6701 between FRE and PRE is that FRE only considers expressions
6702 that are computed on all paths leading to the redundant computation.
6703 This analysis is faster than PRE, though it exposes fewer redundancies.
6704 This flag is enabled by default at @option{-O} and higher.
6705
6706 @item -ftree-phiprop
6707 @opindex ftree-phiprop
6708 Perform hoisting of loads from conditional pointers on trees.  This
6709 pass is enabled by default at @option{-O} and higher.
6710
6711 @item -ftree-copy-prop
6712 @opindex ftree-copy-prop
6713 Perform copy propagation on trees.  This pass eliminates unnecessary
6714 copy operations.  This flag is enabled by default at @option{-O} and
6715 higher.
6716
6717 @item -fipa-pure-const
6718 @opindex fipa-pure-const
6719 Discover which functions are pure or constant.
6720 Enabled by default at @option{-O} and higher.
6721
6722 @item -fipa-reference
6723 @opindex fipa-reference
6724 Discover which static variables do not escape cannot escape the
6725 compilation unit.
6726 Enabled by default at @option{-O} and higher.
6727
6728 @item -fipa-struct-reorg
6729 @opindex fipa-struct-reorg
6730 Perform structure reorganization optimization, that change C-like structures
6731 layout in order to better utilize spatial locality.  This transformation is
6732 affective for programs containing arrays of structures.  Available in two
6733 compilation modes: profile-based (enabled with @option{-fprofile-generate})
6734 or static (which uses built-in heuristics).  It works only in whole program
6735 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
6736 enabled.  Structures considered @samp{cold} by this transformation are not
6737 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
6738
6739 With this flag, the program debug info reflects a new structure layout.
6740
6741 @item -fipa-pta
6742 @opindex fipa-pta
6743 Perform interprocedural pointer analysis and interprocedural modification
6744 and reference analysis.  This option can cause excessive memory and
6745 compile-time usage on large compilation units.  It is not enabled by
6746 default at any optimization level.
6747
6748 @item -fipa-profile
6749 @opindex fipa-profile
6750 Perform interprocedural profile propagation.  The functions called only from
6751 cold functions are marked as cold. Also functions executed once (such as
6752 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
6753 functions and loop less parts of functions executed once are then optimized for
6754 size.
6755 Enabled by default at @option{-O} and higher.
6756
6757 @item -fipa-cp
6758 @opindex fipa-cp
6759 Perform interprocedural constant propagation.
6760 This optimization analyzes the program to determine when values passed
6761 to functions are constants and then optimizes accordingly.
6762 This optimization can substantially increase performance
6763 if the application has constants passed to functions.
6764 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6765
6766 @item -fipa-cp-clone
6767 @opindex fipa-cp-clone
6768 Perform function cloning to make interprocedural constant propagation stronger.
6769 When enabled, interprocedural constant propagation will perform function cloning
6770 when externally visible function can be called with constant arguments.
6771 Because this optimization can create multiple copies of functions,
6772 it may significantly increase code size
6773 (see @option{--param ipcp-unit-growth=@var{value}}).
6774 This flag is enabled by default at @option{-O3}.
6775
6776 @item -fipa-matrix-reorg
6777 @opindex fipa-matrix-reorg
6778 Perform matrix flattening and transposing.
6779 Matrix flattening tries to replace an @math{m}-dimensional matrix
6780 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
6781 This reduces the level of indirection needed for accessing the elements
6782 of the matrix. The second optimization is matrix transposing that
6783 attempts to change the order of the matrix's dimensions in order to
6784 improve cache locality.
6785 Both optimizations need the @option{-fwhole-program} flag.
6786 Transposing is enabled only if profiling information is available.
6787
6788 @item -ftree-sink
6789 @opindex ftree-sink
6790 Perform forward store motion  on trees.  This flag is
6791 enabled by default at @option{-O} and higher.
6792
6793 @item -ftree-bit-ccp
6794 @opindex ftree-bit-ccp
6795 Perform sparse conditional bit constant propagation on trees and propagate
6796 pointer alignment information.
6797 This pass only operates on local scalar variables and is enabled by default
6798 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
6799
6800 @item -ftree-ccp
6801 @opindex ftree-ccp
6802 Perform sparse conditional constant propagation (CCP) on trees.  This
6803 pass only operates on local scalar variables and is enabled by default
6804 at @option{-O} and higher.
6805
6806 @item -ftree-switch-conversion
6807 Perform conversion of simple initializations in a switch to
6808 initializations from a scalar array.  This flag is enabled by default
6809 at @option{-O2} and higher.
6810
6811 @item -ftree-dce
6812 @opindex ftree-dce
6813 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6814 default at @option{-O} and higher.
6815
6816 @item -ftree-builtin-call-dce
6817 @opindex ftree-builtin-call-dce
6818 Perform conditional dead code elimination (DCE) for calls to builtin functions
6819 that may set @code{errno} but are otherwise side-effect free.  This flag is
6820 enabled by default at @option{-O2} and higher if @option{-Os} is not also
6821 specified.
6822
6823 @item -ftree-dominator-opts
6824 @opindex ftree-dominator-opts
6825 Perform a variety of simple scalar cleanups (constant/copy
6826 propagation, redundancy elimination, range propagation and expression
6827 simplification) based on a dominator tree traversal.  This also
6828 performs jump threading (to reduce jumps to jumps). This flag is
6829 enabled by default at @option{-O} and higher.
6830
6831 @item -ftree-dse
6832 @opindex ftree-dse
6833 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6834 a memory location which will later be overwritten by another store without
6835 any intervening loads.  In this case the earlier store can be deleted.  This
6836 flag is enabled by default at @option{-O} and higher.
6837
6838 @item -ftree-ch
6839 @opindex ftree-ch
6840 Perform loop header copying on trees.  This is beneficial since it increases
6841 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6842 is enabled by default at @option{-O} and higher.  It is not enabled
6843 for @option{-Os}, since it usually increases code size.
6844
6845 @item -ftree-loop-optimize
6846 @opindex ftree-loop-optimize
6847 Perform loop optimizations on trees.  This flag is enabled by default
6848 at @option{-O} and higher.
6849
6850 @item -ftree-loop-linear
6851 @opindex ftree-loop-linear
6852 Perform linear loop transformations on tree.  This flag can improve cache
6853 performance and allow further loop optimizations to take place.
6854
6855 @item -floop-interchange
6856 Perform loop interchange transformations on loops.  Interchanging two
6857 nested loops switches the inner and outer loops.  For example, given a
6858 loop like:
6859 @smallexample
6860 DO J = 1, M
6861   DO I = 1, N
6862     A(J, I) = A(J, I) * C
6863   ENDDO
6864 ENDDO
6865 @end smallexample
6866 loop interchange will transform the loop as if the user had written:
6867 @smallexample
6868 DO I = 1, N
6869   DO J = 1, M
6870     A(J, I) = A(J, I) * C
6871   ENDDO
6872 ENDDO
6873 @end smallexample
6874 which can be beneficial when @code{N} is larger than the caches,
6875 because in Fortran, the elements of an array are stored in memory
6876 contiguously by column, and the original loop iterates over rows,
6877 potentially creating at each access a cache miss.  This optimization
6878 applies to all the languages supported by GCC and is not limited to
6879 Fortran.  To use this code transformation, GCC has to be configured
6880 with @option{--with-ppl} and @option{--with-cloog} to enable the
6881 Graphite loop transformation infrastructure.
6882
6883 @item -floop-strip-mine
6884 Perform loop strip mining transformations on loops.  Strip mining
6885 splits a loop into two nested loops.  The outer loop has strides
6886 equal to the strip size and the inner loop has strides of the
6887 original loop within a strip.  The strip length can be changed
6888 using the @option{loop-block-tile-size} parameter.  For example,
6889 given a loop like:
6890 @smallexample
6891 DO I = 1, N
6892   A(I) = A(I) + C
6893 ENDDO
6894 @end smallexample
6895 loop strip mining will transform the loop as if the user had written:
6896 @smallexample
6897 DO II = 1, N, 51
6898   DO I = II, min (II + 50, N)
6899     A(I) = A(I) + C
6900   ENDDO
6901 ENDDO
6902 @end smallexample
6903 This optimization applies to all the languages supported by GCC and is
6904 not limited to Fortran.  To use this code transformation, GCC has to
6905 be configured with @option{--with-ppl} and @option{--with-cloog} to
6906 enable the Graphite loop transformation infrastructure.
6907
6908 @item -floop-block
6909 Perform loop blocking transformations on loops.  Blocking strip mines
6910 each loop in the loop nest such that the memory accesses of the
6911 element loops fit inside caches.  The strip length can be changed
6912 using the @option{loop-block-tile-size} parameter.  For example, given
6913 a loop like:
6914 @smallexample
6915 DO I = 1, N
6916   DO J = 1, M
6917     A(J, I) = B(I) + C(J)
6918   ENDDO
6919 ENDDO
6920 @end smallexample
6921 loop blocking will transform the loop as if the user had written:
6922 @smallexample
6923 DO II = 1, N, 51
6924   DO JJ = 1, M, 51
6925     DO I = II, min (II + 50, N)
6926       DO J = JJ, min (JJ + 50, M)
6927         A(J, I) = B(I) + C(J)
6928       ENDDO
6929     ENDDO
6930   ENDDO
6931 ENDDO
6932 @end smallexample
6933 which can be beneficial when @code{M} is larger than the caches,
6934 because the innermost loop will iterate over a smaller amount of data
6935 that can be kept in the caches.  This optimization applies to all the
6936 languages supported by GCC and is not limited to Fortran.  To use this
6937 code transformation, GCC has to be configured with @option{--with-ppl}
6938 and @option{--with-cloog} to enable the Graphite loop transformation
6939 infrastructure.
6940
6941 @item -fgraphite-identity
6942 @opindex fgraphite-identity
6943 Enable the identity transformation for graphite.  For every SCoP we generate
6944 the polyhedral representation and transform it back to gimple.  Using
6945 @option{-fgraphite-identity} we can check the costs or benefits of the
6946 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
6947 are also performed by the code generator CLooG, like index splitting and
6948 dead code elimination in loops.
6949
6950 @item -floop-parallelize-all
6951 Use the Graphite data dependence analysis to identify loops that can
6952 be parallelized.  Parallelize all the loops that can be analyzed to
6953 not contain loop carried dependences without checking that it is
6954 profitable to parallelize the loops.
6955
6956 @item -fcheck-data-deps
6957 @opindex fcheck-data-deps
6958 Compare the results of several data dependence analyzers.  This option
6959 is used for debugging the data dependence analyzers.
6960
6961 @item -ftree-loop-if-convert
6962 Attempt to transform conditional jumps in the innermost loops to
6963 branch-less equivalents.  The intent is to remove control-flow from
6964 the innermost loops in order to improve the ability of the
6965 vectorization pass to handle these loops.  This is enabled by default
6966 if vectorization is enabled.
6967
6968 @item -ftree-loop-if-convert-stores
6969 Attempt to also if-convert conditional jumps containing memory writes.
6970 This transformation can be unsafe for multi-threaded programs as it
6971 transforms conditional memory writes into unconditional memory writes.
6972 For example,
6973 @smallexample
6974 for (i = 0; i < N; i++)
6975   if (cond)
6976     A[i] = expr;
6977 @end smallexample
6978 would be transformed to
6979 @smallexample
6980 for (i = 0; i < N; i++)
6981   A[i] = cond ? expr : A[i];
6982 @end smallexample
6983 potentially producing data races.
6984
6985 @item -ftree-loop-distribution
6986 Perform loop distribution.  This flag can improve cache performance on
6987 big loop bodies and allow further loop optimizations, like
6988 parallelization or vectorization, to take place.  For example, the loop
6989 @smallexample
6990 DO I = 1, N
6991   A(I) = B(I) + C
6992   D(I) = E(I) * F
6993 ENDDO
6994 @end smallexample
6995 is transformed to
6996 @smallexample
6997 DO I = 1, N
6998    A(I) = B(I) + C
6999 ENDDO
7000 DO I = 1, N
7001    D(I) = E(I) * F
7002 ENDDO
7003 @end smallexample
7004
7005 @item -ftree-loop-distribute-patterns
7006 Perform loop distribution of patterns that can be code generated with
7007 calls to a library.  This flag is enabled by default at @option{-O3}.
7008
7009 This pass distributes the initialization loops and generates a call to
7010 memset zero.  For example, the loop
7011 @smallexample
7012 DO I = 1, N
7013   A(I) = 0
7014   B(I) = A(I) + I
7015 ENDDO
7016 @end smallexample
7017 is transformed to
7018 @smallexample
7019 DO I = 1, N
7020    A(I) = 0
7021 ENDDO
7022 DO I = 1, N
7023    B(I) = A(I) + I
7024 ENDDO
7025 @end smallexample
7026 and the initialization loop is transformed into a call to memset zero.
7027
7028 @item -ftree-loop-im
7029 @opindex ftree-loop-im
7030 Perform loop invariant motion on trees.  This pass moves only invariants that
7031 would be hard to handle at RTL level (function calls, operations that expand to
7032 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7033 operands of conditions that are invariant out of the loop, so that we can use
7034 just trivial invariantness analysis in loop unswitching.  The pass also includes
7035 store motion.
7036
7037 @item -ftree-loop-ivcanon
7038 @opindex ftree-loop-ivcanon
7039 Create a canonical counter for number of iterations in the loop for that
7040 determining number of iterations requires complicated analysis.  Later
7041 optimizations then may determine the number easily.  Useful especially
7042 in connection with unrolling.
7043
7044 @item -fivopts
7045 @opindex fivopts
7046 Perform induction variable optimizations (strength reduction, induction
7047 variable merging and induction variable elimination) on trees.
7048
7049 @item -ftree-parallelize-loops=n
7050 @opindex ftree-parallelize-loops
7051 Parallelize loops, i.e., split their iteration space to run in n threads.
7052 This is only possible for loops whose iterations are independent
7053 and can be arbitrarily reordered.  The optimization is only
7054 profitable on multiprocessor machines, for loops that are CPU-intensive,
7055 rather than constrained e.g.@: by memory bandwidth.  This option
7056 implies @option{-pthread}, and thus is only supported on targets
7057 that have support for @option{-pthread}.
7058
7059 @item -ftree-pta
7060 @opindex ftree-pta
7061 Perform function-local points-to analysis on trees.  This flag is
7062 enabled by default at @option{-O} and higher.
7063
7064 @item -ftree-sra
7065 @opindex ftree-sra
7066 Perform scalar replacement of aggregates.  This pass replaces structure
7067 references with scalars to prevent committing structures to memory too
7068 early.  This flag is enabled by default at @option{-O} and higher.
7069
7070 @item -ftree-copyrename
7071 @opindex ftree-copyrename
7072 Perform copy renaming on trees.  This pass attempts to rename compiler
7073 temporaries to other variables at copy locations, usually resulting in
7074 variable names which more closely resemble the original variables.  This flag
7075 is enabled by default at @option{-O} and higher.
7076
7077 @item -ftree-ter
7078 @opindex ftree-ter
7079 Perform temporary expression replacement during the SSA->normal phase.  Single
7080 use/single def temporaries are replaced at their use location with their
7081 defining expression.  This results in non-GIMPLE code, but gives the expanders
7082 much more complex trees to work on resulting in better RTL generation.  This is
7083 enabled by default at @option{-O} and higher.
7084
7085 @item -ftree-vectorize
7086 @opindex ftree-vectorize
7087 Perform loop vectorization on trees. This flag is enabled by default at
7088 @option{-O3}.
7089
7090 @item -ftree-slp-vectorize
7091 @opindex ftree-slp-vectorize
7092 Perform basic block vectorization on trees. This flag is enabled by default at
7093 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7094
7095 @item -ftree-vect-loop-version
7096 @opindex ftree-vect-loop-version
7097 Perform loop versioning when doing loop vectorization on trees.  When a loop
7098 appears to be vectorizable except that data alignment or data dependence cannot
7099 be determined at compile time then vectorized and non-vectorized versions of
7100 the loop are generated along with runtime checks for alignment or dependence
7101 to control which version is executed.  This option is enabled by default
7102 except at level @option{-Os} where it is disabled.
7103
7104 @item -fvect-cost-model
7105 @opindex fvect-cost-model
7106 Enable cost model for vectorization.
7107
7108 @item -ftree-vrp
7109 @opindex ftree-vrp
7110 Perform Value Range Propagation on trees.  This is similar to the
7111 constant propagation pass, but instead of values, ranges of values are
7112 propagated.  This allows the optimizers to remove unnecessary range
7113 checks like array bound checks and null pointer checks.  This is
7114 enabled by default at @option{-O2} and higher.  Null pointer check
7115 elimination is only done if @option{-fdelete-null-pointer-checks} is
7116 enabled.
7117
7118 @item -ftracer
7119 @opindex ftracer
7120 Perform tail duplication to enlarge superblock size.  This transformation
7121 simplifies the control flow of the function allowing other optimizations to do
7122 better job.
7123
7124 @item -funroll-loops
7125 @opindex funroll-loops
7126 Unroll loops whose number of iterations can be determined at compile
7127 time or upon entry to the loop.  @option{-funroll-loops} implies
7128 @option{-frerun-cse-after-loop}.  This option makes code larger,
7129 and may or may not make it run faster.
7130
7131 @item -funroll-all-loops
7132 @opindex funroll-all-loops
7133 Unroll all loops, even if their number of iterations is uncertain when
7134 the loop is entered.  This usually makes programs run more slowly.
7135 @option{-funroll-all-loops} implies the same options as
7136 @option{-funroll-loops},
7137
7138 @item -fsplit-ivs-in-unroller
7139 @opindex fsplit-ivs-in-unroller
7140 Enables expressing of values of induction variables in later iterations
7141 of the unrolled loop using the value in the first iteration.  This breaks
7142 long dependency chains, thus improving efficiency of the scheduling passes.
7143
7144 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7145 same effect.  However in cases the loop body is more complicated than
7146 a single basic block, this is not reliable.  It also does not work at all
7147 on some of the architectures due to restrictions in the CSE pass.
7148
7149 This optimization is enabled by default.
7150
7151 @item -fvariable-expansion-in-unroller
7152 @opindex fvariable-expansion-in-unroller
7153 With this option, the compiler will create multiple copies of some
7154 local variables when unrolling a loop which can result in superior code.
7155
7156 @item -fpartial-inlining
7157 @opindex fpartial-inlining
7158 Inline parts of functions.  This option has any effect only
7159 when inlining itself is turned on by the @option{-finline-functions}
7160 or @option{-finline-small-functions} options.
7161
7162 Enabled at level @option{-O2}.
7163
7164 @item -fpredictive-commoning
7165 @opindex fpredictive-commoning
7166 Perform predictive commoning optimization, i.e., reusing computations
7167 (especially memory loads and stores) performed in previous
7168 iterations of loops.
7169
7170 This option is enabled at level @option{-O3}.
7171
7172 @item -fprefetch-loop-arrays
7173 @opindex fprefetch-loop-arrays
7174 If supported by the target machine, generate instructions to prefetch
7175 memory to improve the performance of loops that access large arrays.
7176
7177 This option may generate better or worse code; results are highly
7178 dependent on the structure of loops within the source code.
7179
7180 Disabled at level @option{-Os}.
7181
7182 @item -fno-peephole
7183 @itemx -fno-peephole2
7184 @opindex fno-peephole
7185 @opindex fno-peephole2
7186 Disable any machine-specific peephole optimizations.  The difference
7187 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7188 are implemented in the compiler; some targets use one, some use the
7189 other, a few use both.
7190
7191 @option{-fpeephole} is enabled by default.
7192 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7193
7194 @item -fno-guess-branch-probability
7195 @opindex fno-guess-branch-probability
7196 Do not guess branch probabilities using heuristics.
7197
7198 GCC will use heuristics to guess branch probabilities if they are
7199 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7200 heuristics are based on the control flow graph.  If some branch probabilities
7201 are specified by @samp{__builtin_expect}, then the heuristics will be
7202 used to guess branch probabilities for the rest of the control flow graph,
7203 taking the @samp{__builtin_expect} info into account.  The interactions
7204 between the heuristics and @samp{__builtin_expect} can be complex, and in
7205 some cases, it may be useful to disable the heuristics so that the effects
7206 of @samp{__builtin_expect} are easier to understand.
7207
7208 The default is @option{-fguess-branch-probability} at levels
7209 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7210
7211 @item -freorder-blocks
7212 @opindex freorder-blocks
7213 Reorder basic blocks in the compiled function in order to reduce number of
7214 taken branches and improve code locality.
7215
7216 Enabled at levels @option{-O2}, @option{-O3}.
7217
7218 @item -freorder-blocks-and-partition
7219 @opindex freorder-blocks-and-partition
7220 In addition to reordering basic blocks in the compiled function, in order
7221 to reduce number of taken branches, partitions hot and cold basic blocks
7222 into separate sections of the assembly and .o files, to improve
7223 paging and cache locality performance.
7224
7225 This optimization is automatically turned off in the presence of
7226 exception handling, for linkonce sections, for functions with a user-defined
7227 section attribute and on any architecture that does not support named
7228 sections.
7229
7230 @item -freorder-functions
7231 @opindex freorder-functions
7232 Reorder functions in the object file in order to
7233 improve code locality.  This is implemented by using special
7234 subsections @code{.text.hot} for most frequently executed functions and
7235 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7236 the linker so object file format must support named sections and linker must
7237 place them in a reasonable way.
7238
7239 Also profile feedback must be available in to make this option effective.  See
7240 @option{-fprofile-arcs} for details.
7241
7242 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7243
7244 @item -fstrict-aliasing
7245 @opindex fstrict-aliasing
7246 Allow the compiler to assume the strictest aliasing rules applicable to
7247 the language being compiled.  For C (and C++), this activates
7248 optimizations based on the type of expressions.  In particular, an
7249 object of one type is assumed never to reside at the same address as an
7250 object of a different type, unless the types are almost the same.  For
7251 example, an @code{unsigned int} can alias an @code{int}, but not a
7252 @code{void*} or a @code{double}.  A character type may alias any other
7253 type.
7254
7255 @anchor{Type-punning}Pay special attention to code like this:
7256 @smallexample
7257 union a_union @{
7258   int i;
7259   double d;
7260 @};
7261
7262 int f() @{
7263   union a_union t;
7264   t.d = 3.0;
7265   return t.i;
7266 @}
7267 @end smallexample
7268 The practice of reading from a different union member than the one most
7269 recently written to (called ``type-punning'') is common.  Even with
7270 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7271 is accessed through the union type.  So, the code above will work as
7272 expected.  @xref{Structures unions enumerations and bit-fields
7273 implementation}.  However, this code might not:
7274 @smallexample
7275 int f() @{
7276   union a_union t;
7277   int* ip;
7278   t.d = 3.0;
7279   ip = &t.i;
7280   return *ip;
7281 @}
7282 @end smallexample
7283
7284 Similarly, access by taking the address, casting the resulting pointer
7285 and dereferencing the result has undefined behavior, even if the cast
7286 uses a union type, e.g.:
7287 @smallexample
7288 int f() @{
7289   double d = 3.0;
7290   return ((union a_union *) &d)->i;
7291 @}
7292 @end smallexample
7293
7294 The @option{-fstrict-aliasing} option is enabled at levels
7295 @option{-O2}, @option{-O3}, @option{-Os}.
7296
7297 @item -fstrict-overflow
7298 @opindex fstrict-overflow
7299 Allow the compiler to assume strict signed overflow rules, depending
7300 on the language being compiled.  For C (and C++) this means that
7301 overflow when doing arithmetic with signed numbers is undefined, which
7302 means that the compiler may assume that it will not happen.  This
7303 permits various optimizations.  For example, the compiler will assume
7304 that an expression like @code{i + 10 > i} will always be true for
7305 signed @code{i}.  This assumption is only valid if signed overflow is
7306 undefined, as the expression is false if @code{i + 10} overflows when
7307 using twos complement arithmetic.  When this option is in effect any
7308 attempt to determine whether an operation on signed numbers will
7309 overflow must be written carefully to not actually involve overflow.
7310
7311 This option also allows the compiler to assume strict pointer
7312 semantics: given a pointer to an object, if adding an offset to that
7313 pointer does not produce a pointer to the same object, the addition is
7314 undefined.  This permits the compiler to conclude that @code{p + u >
7315 p} is always true for a pointer @code{p} and unsigned integer
7316 @code{u}.  This assumption is only valid because pointer wraparound is
7317 undefined, as the expression is false if @code{p + u} overflows using
7318 twos complement arithmetic.
7319
7320 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7321 that integer signed overflow is fully defined: it wraps.  When
7322 @option{-fwrapv} is used, there is no difference between
7323 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7324 integers.  With @option{-fwrapv} certain types of overflow are
7325 permitted.  For example, if the compiler gets an overflow when doing
7326 arithmetic on constants, the overflowed value can still be used with
7327 @option{-fwrapv}, but not otherwise.
7328
7329 The @option{-fstrict-overflow} option is enabled at levels
7330 @option{-O2}, @option{-O3}, @option{-Os}.
7331
7332 @item -falign-functions
7333 @itemx -falign-functions=@var{n}
7334 @opindex falign-functions
7335 Align the start of functions to the next power-of-two greater than
7336 @var{n}, skipping up to @var{n} bytes.  For instance,
7337 @option{-falign-functions=32} aligns functions to the next 32-byte
7338 boundary, but @option{-falign-functions=24} would align to the next
7339 32-byte boundary only if this can be done by skipping 23 bytes or less.
7340
7341 @option{-fno-align-functions} and @option{-falign-functions=1} are
7342 equivalent and mean that functions will not be aligned.
7343
7344 Some assemblers only support this flag when @var{n} is a power of two;
7345 in that case, it is rounded up.
7346
7347 If @var{n} is not specified or is zero, use a machine-dependent default.
7348
7349 Enabled at levels @option{-O2}, @option{-O3}.
7350
7351 @item -falign-labels
7352 @itemx -falign-labels=@var{n}
7353 @opindex falign-labels
7354 Align all branch targets to a power-of-two boundary, skipping up to
7355 @var{n} bytes like @option{-falign-functions}.  This option can easily
7356 make code slower, because it must insert dummy operations for when the
7357 branch target is reached in the usual flow of the code.
7358
7359 @option{-fno-align-labels} and @option{-falign-labels=1} are
7360 equivalent and mean that labels will not be aligned.
7361
7362 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7363 are greater than this value, then their values are used instead.
7364
7365 If @var{n} is not specified or is zero, use a machine-dependent default
7366 which is very likely to be @samp{1}, meaning no alignment.
7367
7368 Enabled at levels @option{-O2}, @option{-O3}.
7369
7370 @item -falign-loops
7371 @itemx -falign-loops=@var{n}
7372 @opindex falign-loops
7373 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7374 like @option{-falign-functions}.  The hope is that the loop will be
7375 executed many times, which will make up for any execution of the dummy
7376 operations.
7377
7378 @option{-fno-align-loops} and @option{-falign-loops=1} are
7379 equivalent and mean that loops will not be aligned.
7380
7381 If @var{n} is not specified or is zero, use a machine-dependent default.
7382
7383 Enabled at levels @option{-O2}, @option{-O3}.
7384
7385 @item -falign-jumps
7386 @itemx -falign-jumps=@var{n}
7387 @opindex falign-jumps
7388 Align branch targets to a power-of-two boundary, for branch targets
7389 where the targets can only be reached by jumping, skipping up to @var{n}
7390 bytes like @option{-falign-functions}.  In this case, no dummy operations
7391 need be executed.
7392
7393 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7394 equivalent and mean that loops will not be aligned.
7395
7396 If @var{n} is not specified or is zero, use a machine-dependent default.
7397
7398 Enabled at levels @option{-O2}, @option{-O3}.
7399
7400 @item -funit-at-a-time
7401 @opindex funit-at-a-time
7402 This option is left for compatibility reasons. @option{-funit-at-a-time}
7403 has no effect, while @option{-fno-unit-at-a-time} implies
7404 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7405
7406 Enabled by default.
7407
7408 @item -fno-toplevel-reorder
7409 @opindex fno-toplevel-reorder
7410 Do not reorder top-level functions, variables, and @code{asm}
7411 statements.  Output them in the same order that they appear in the
7412 input file.  When this option is used, unreferenced static variables
7413 will not be removed.  This option is intended to support existing code
7414 which relies on a particular ordering.  For new code, it is better to
7415 use attributes.
7416
7417 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
7418 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
7419 targets.
7420
7421 @item -fweb
7422 @opindex fweb
7423 Constructs webs as commonly used for register allocation purposes and assign
7424 each web individual pseudo register.  This allows the register allocation pass
7425 to operate on pseudos directly, but also strengthens several other optimization
7426 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7427 however, make debugging impossible, since variables will no longer stay in a
7428 ``home register''.
7429
7430 Enabled by default with @option{-funroll-loops}.
7431
7432 @item -fwhole-program
7433 @opindex fwhole-program
7434 Assume that the current compilation unit represents the whole program being
7435 compiled.  All public functions and variables with the exception of @code{main}
7436 and those merged by attribute @code{externally_visible} become static functions
7437 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.
7438 While this option is equivalent to proper use of the @code{static} keyword for
7439 programs consisting of a single file, in combination with option
7440 @option{-combine}, @option{-flto} or @option{-fwhopr} this flag can be used to
7441 compile many smaller scale programs since the functions and variables become
7442 local for the whole combined compilation unit, not for the single source file
7443 itself.
7444
7445 This option implies @option{-fwhole-file} for Fortran programs.
7446
7447 @item -flto
7448 @opindex flto
7449 This option runs the standard link-time optimizer.  When invoked
7450 with source code, it generates GIMPLE (one of GCC's internal
7451 representations) and writes it to special ELF sections in the object
7452 file.  When the object files are linked together, all the function
7453 bodies are read from these ELF sections and instantiated as if they
7454 had been part of the same translation unit.
7455
7456 To use the link-timer optimizer, @option{-flto} needs to be specified at
7457 compile time and during the final link.  For example,
7458
7459 @smallexample
7460 gcc -c -O2 -flto foo.c
7461 gcc -c -O2 -flto bar.c
7462 gcc -o myprog -flto -O2 foo.o bar.o
7463 @end smallexample
7464
7465 The first two invocations to GCC will save a bytecode representation
7466 of GIMPLE into special ELF sections inside @file{foo.o} and
7467 @file{bar.o}.  The final invocation will read the GIMPLE bytecode from
7468 @file{foo.o} and @file{bar.o}, merge the two files into a single
7469 internal image, and compile the result as usual.  Since both
7470 @file{foo.o} and @file{bar.o} are merged into a single image, this
7471 causes all the inter-procedural analyses and optimizations in GCC to
7472 work across the two files as if they were a single one.  This means,
7473 for example, that the inliner will be able to inline functions in
7474 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7475
7476 Another (simpler) way to enable link-time optimization is,
7477
7478 @smallexample
7479 gcc -o myprog -flto -O2 foo.c bar.c
7480 @end smallexample
7481
7482 The above will generate bytecode for @file{foo.c} and @file{bar.c},
7483 merge them together into a single GIMPLE representation and optimize
7484 them as usual to produce @file{myprog}.
7485
7486 The only important thing to keep in mind is that to enable link-time
7487 optimizations the @option{-flto} flag needs to be passed to both the
7488 compile and the link commands.
7489
7490 Note that when a file is compiled with @option{-flto}, the generated
7491 object file will be larger than a regular object file because it will
7492 contain GIMPLE bytecodes and the usual final code.  This means that
7493 object files with LTO information can be linked as a normal object
7494 file.  So, in the previous example, if the final link is done with
7495
7496 @smallexample
7497 gcc -o myprog foo.o bar.o
7498 @end smallexample
7499
7500 The only difference will be that no inter-procedural optimizations
7501 will be applied to produce @file{myprog}.  The two object files
7502 @file{foo.o} and @file{bar.o} will be simply sent to the regular
7503 linker.
7504
7505 Additionally, the optimization flags used to compile individual files
7506 are not necessarily related to those used at link-time.  For instance,
7507
7508 @smallexample
7509 gcc -c -O0 -flto foo.c
7510 gcc -c -O0 -flto bar.c
7511 gcc -o myprog -flto -O3 foo.o bar.o
7512 @end smallexample
7513
7514 This will produce individual object files with unoptimized assembler
7515 code, but the resulting binary @file{myprog} will be optimized at
7516 @option{-O3}.  Now, if the final binary is generated without
7517 @option{-flto}, then @file{myprog} will not be optimized.
7518
7519 When producing the final binary with @option{-flto}, GCC will only
7520 apply link-time optimizations to those files that contain bytecode.
7521 Therefore, you can mix and match object files and libraries with
7522 GIMPLE bytecodes and final object code.  GCC will automatically select
7523 which files to optimize in LTO mode and which files to link without
7524 further processing.
7525
7526 There are some code generation flags that GCC will preserve when
7527 generating bytecodes, as they need to be used during the final link
7528 stage.  Currently, the following options are saved into the GIMPLE
7529 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7530 @option{-m} target flags.
7531
7532 At link time, these options are read-in and reapplied.  Note that the
7533 current implementation makes no attempt at recognizing conflicting
7534 values for these options.  If two or more files have a conflicting
7535 value (e.g., one file is compiled with @option{-fPIC} and another
7536 isn't), the compiler will simply use the last value read from the
7537 bytecode files.  It is recommended, then, that all the files
7538 participating in the same link be compiled with the same options.
7539
7540 Another feature of LTO is that it is possible to apply interprocedural
7541 optimizations on files written in different languages.  This requires
7542 some support in the language front end.  Currently, the C, C++ and
7543 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7544 something like this should work
7545
7546 @smallexample
7547 gcc -c -flto foo.c
7548 g++ -c -flto bar.cc
7549 gfortran -c -flto baz.f90
7550 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7551 @end smallexample
7552
7553 Notice that the final link is done with @command{g++} to get the C++
7554 runtime libraries and @option{-lgfortran} is added to get the Fortran
7555 runtime libraries.  In general, when mixing languages in LTO mode, you
7556 should use the same link command used when mixing languages in a
7557 regular (non-LTO) compilation.  This means that if your build process
7558 was mixing languages before, all you need to add is @option{-flto} to
7559 all the compile and link commands.
7560
7561 If LTO encounters objects with C linkage declared with incompatible
7562 types in separate translation units to be linked together (undefined
7563 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7564 issued.  The behavior is still undefined at runtime.
7565
7566 If object files containing GIMPLE bytecode are stored in a library
7567 archive, say @file{libfoo.a}, it is possible to extract and use them
7568 in an LTO link if you are using @command{gold} as the linker (which,
7569 in turn requires GCC to be configured with @option{--enable-gold}).
7570 To enable this feature, use the flag @option{-fuse-linker-plugin} at
7571 link-time:
7572
7573 @smallexample
7574 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7575 @end smallexample
7576
7577 With the linker plugin enabled, @command{gold} will extract the needed
7578 GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
7579 to make them part of the aggregated GIMPLE image to be optimized.
7580
7581 If you are not using @command{gold} and/or do not specify
7582 @option{-fuse-linker-plugin} then the objects inside @file{libfoo.a}
7583 will be extracted and linked as usual, but they will not participate
7584 in the LTO optimization process.
7585
7586 Link time optimizations do not require the presence of the whole
7587 program to operate.  If the program does not require any symbols to
7588 be exported, it is possible to combine @option{-flto} and
7589 @option{-fwhopr} with @option{-fwhole-program} to allow the
7590 interprocedural optimizers to use more aggressive assumptions which
7591 may lead to improved optimization opportunities.
7592
7593 Regarding portability: the current implementation of LTO makes no
7594 attempt at generating bytecode that can be ported between different
7595 types of hosts.  The bytecode files are versioned and there is a
7596 strict version check, so bytecode files generated in one version of
7597 GCC will not work with an older/newer version of GCC.
7598
7599 Link time optimization does not play well with generating debugging
7600 information.  Combining @option{-flto} or @option{-fwhopr} with
7601 @option{-g} is experimental.
7602
7603 This option is disabled by default.
7604
7605 @item -fwhopr[=@var{n}]
7606 @opindex fwhopr
7607 This option is identical in functionality to @option{-flto} but it
7608 differs in how the final link stage is executed.  Instead of loading
7609 all the function bodies in memory, the callgraph is analyzed and
7610 optimization decisions are made (whole program analysis or WPA). Once
7611 optimization decisions are made, the callgraph is partitioned and the
7612 different sections are compiled separately (local transformations or
7613 LTRANS)@.  This process allows optimizations on very large programs
7614 that otherwise would not fit in memory.  This option enables
7615 @option{-fwpa} and @option{-fltrans} automatically.
7616
7617 If you specify the optional @var{n} the link stage is executed in
7618 parallel using @var{n} parallel jobs by utilizing an installed
7619 @command{make} program.  The environment variable @env{MAKE} may be
7620 used to override the program used.
7621
7622 You can also specify @option{-fwhopr=jobserver} to use GNU make's 
7623 job server mode to determine the number of parallel jobs. This 
7624 is useful when the Makefile calling GCC is already parallel.
7625 The parent Makefile will need a @samp{+} prepended to the command recipe
7626 for this to work. This will likely only work if @env{MAKE} is 
7627 GNU make.
7628
7629 Disabled by default.
7630
7631 @item -fwpa
7632 @opindex fwpa
7633 This is an internal option used by GCC when compiling with
7634 @option{-fwhopr}.  You should never need to use it.
7635
7636 This option runs the link-time optimizer in the whole-program-analysis
7637 (WPA) mode, which reads in summary information from all inputs and
7638 performs a whole-program analysis based on summary information only.
7639 It generates object files for subsequent runs of the link-time
7640 optimizer where individual object files are optimized using both
7641 summary information from the WPA mode and the actual function bodies.
7642 It then drives the LTRANS phase.
7643
7644 Disabled by default.
7645
7646 @item -fltrans
7647 @opindex fltrans
7648 This is an internal option used by GCC when compiling with
7649 @option{-fwhopr}.  You should never need to use it.
7650
7651 This option runs the link-time optimizer in the local-transformation (LTRANS)
7652 mode, which reads in output from a previous run of the LTO in WPA mode.
7653 In the LTRANS mode, LTO optimizes an object and produces the final assembly.
7654
7655 Disabled by default.
7656
7657 @item -fltrans-output-list=@var{file}
7658 @opindex fltrans-output-list
7659 This is an internal option used by GCC when compiling with
7660 @option{-fwhopr}.  You should never need to use it.
7661
7662 This option specifies a file to which the names of LTRANS output files are
7663 written.  This option is only meaningful in conjunction with @option{-fwpa}.
7664
7665 Disabled by default.
7666
7667 @item -flto-compression-level=@var{n}
7668 This option specifies the level of compression used for intermediate
7669 language written to LTO object files, and is only meaningful in
7670 conjunction with LTO mode (@option{-fwhopr}, @option{-flto}).  Valid
7671 values are 0 (no compression) to 9 (maximum compression).  Values
7672 outside this range are clamped to either 0 or 9.  If the option is not
7673 given, a default balanced compression setting is used.
7674
7675 @item -flto-report
7676 Prints a report with internal details on the workings of the link-time
7677 optimizer.  The contents of this report vary from version to version,
7678 it is meant to be useful to GCC developers when processing object
7679 files in LTO mode (via @option{-fwhopr} or @option{-flto}).
7680
7681 Disabled by default.
7682
7683 @item -fuse-linker-plugin
7684 Enables the extraction of objects with GIMPLE bytecode information
7685 from library archives.  This option relies on features available only
7686 in @command{gold}, so to use this you must configure GCC with
7687 @option{--enable-gold}.  See @option{-flto} for a description on the
7688 effect of this flag and how to use it.
7689
7690 Disabled by default.
7691
7692 @item -fcprop-registers
7693 @opindex fcprop-registers
7694 After register allocation and post-register allocation instruction splitting,
7695 we perform a copy-propagation pass to try to reduce scheduling dependencies
7696 and occasionally eliminate the copy.
7697
7698 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7699
7700 @item -fprofile-correction
7701 @opindex fprofile-correction
7702 Profiles collected using an instrumented binary for multi-threaded programs may
7703 be inconsistent due to missed counter updates. When this option is specified,
7704 GCC will use heuristics to correct or smooth out such inconsistencies. By
7705 default, GCC will emit an error message when an inconsistent profile is detected.
7706
7707 @item -fprofile-dir=@var{path}
7708 @opindex fprofile-dir
7709
7710 Set the directory to search the profile data files in to @var{path}.
7711 This option affects only the profile data generated by
7712 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
7713 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
7714 and its related options.
7715 By default, GCC will use the current directory as @var{path}
7716 thus the profile data file will appear in the same directory as the object file.
7717
7718 @item -fprofile-generate
7719 @itemx -fprofile-generate=@var{path}
7720 @opindex fprofile-generate
7721
7722 Enable options usually used for instrumenting application to produce
7723 profile useful for later recompilation with profile feedback based
7724 optimization.  You must use @option{-fprofile-generate} both when
7725 compiling and when linking your program.
7726
7727 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
7728
7729 If @var{path} is specified, GCC will look at the @var{path} to find
7730 the profile feedback data files. See @option{-fprofile-dir}.
7731
7732 @item -fprofile-use
7733 @itemx -fprofile-use=@var{path}
7734 @opindex fprofile-use
7735 Enable profile feedback directed optimizations, and optimizations
7736 generally profitable only with profile feedback available.
7737
7738 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
7739 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
7740
7741 By default, GCC emits an error message if the feedback profiles do not
7742 match the source code.  This error can be turned into a warning by using
7743 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
7744 code.
7745
7746 If @var{path} is specified, GCC will look at the @var{path} to find
7747 the profile feedback data files. See @option{-fprofile-dir}.
7748 @end table
7749
7750 The following options control compiler behavior regarding floating
7751 point arithmetic.  These options trade off between speed and
7752 correctness.  All must be specifically enabled.
7753
7754 @table @gcctabopt
7755 @item -ffloat-store
7756 @opindex ffloat-store
7757 Do not store floating point variables in registers, and inhibit other
7758 options that might change whether a floating point value is taken from a
7759 register or memory.
7760
7761 @cindex floating point precision
7762 This option prevents undesirable excess precision on machines such as
7763 the 68000 where the floating registers (of the 68881) keep more
7764 precision than a @code{double} is supposed to have.  Similarly for the
7765 x86 architecture.  For most programs, the excess precision does only
7766 good, but a few programs rely on the precise definition of IEEE floating
7767 point.  Use @option{-ffloat-store} for such programs, after modifying
7768 them to store all pertinent intermediate computations into variables.
7769
7770 @item -fexcess-precision=@var{style}
7771 @opindex fexcess-precision
7772 This option allows further control over excess precision on machines
7773 where floating-point registers have more precision than the IEEE
7774 @code{float} and @code{double} types and the processor does not
7775 support operations rounding to those types.  By default,
7776 @option{-fexcess-precision=fast} is in effect; this means that
7777 operations are carried out in the precision of the registers and that
7778 it is unpredictable when rounding to the types specified in the source
7779 code takes place.  When compiling C, if
7780 @option{-fexcess-precision=standard} is specified then excess
7781 precision will follow the rules specified in ISO C99; in particular,
7782 both casts and assignments cause values to be rounded to their
7783 semantic types (whereas @option{-ffloat-store} only affects
7784 assignments).  This option is enabled by default for C if a strict
7785 conformance option such as @option{-std=c99} is used.
7786
7787 @opindex mfpmath
7788 @option{-fexcess-precision=standard} is not implemented for languages
7789 other than C, and has no effect if
7790 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
7791 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
7792 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
7793 semantics apply without excess precision, and in the latter, rounding
7794 is unpredictable.
7795
7796 @item -ffast-math
7797 @opindex ffast-math
7798 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
7799 @option{-ffinite-math-only}, @option{-fno-rounding-math},
7800 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
7801
7802 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
7803
7804 This option is not turned on by any @option{-O} option since
7805 it can result in incorrect output for programs which depend on
7806 an exact implementation of IEEE or ISO rules/specifications for
7807 math functions. It may, however, yield faster code for programs
7808 that do not require the guarantees of these specifications.
7809
7810 @item -fno-math-errno
7811 @opindex fno-math-errno
7812 Do not set ERRNO after calling math functions that are executed
7813 with a single instruction, e.g., sqrt.  A program that relies on
7814 IEEE exceptions for math error handling may want to use this flag
7815 for speed while maintaining IEEE arithmetic compatibility.
7816
7817 This option is not turned on by any @option{-O} option since
7818 it can result in incorrect output for programs which depend on
7819 an exact implementation of IEEE or ISO rules/specifications for
7820 math functions. It may, however, yield faster code for programs
7821 that do not require the guarantees of these specifications.
7822
7823 The default is @option{-fmath-errno}.
7824
7825 On Darwin systems, the math library never sets @code{errno}.  There is
7826 therefore no reason for the compiler to consider the possibility that
7827 it might, and @option{-fno-math-errno} is the default.
7828
7829 @item -funsafe-math-optimizations
7830 @opindex funsafe-math-optimizations
7831
7832 Allow optimizations for floating-point arithmetic that (a) assume
7833 that arguments and results are valid and (b) may violate IEEE or
7834 ANSI standards.  When used at link-time, it may include libraries
7835 or startup files that change the default FPU control word or other
7836 similar optimizations.
7837
7838 This option is not turned on by any @option{-O} option since
7839 it can result in incorrect output for programs which depend on
7840 an exact implementation of IEEE or ISO rules/specifications for
7841 math functions. It may, however, yield faster code for programs
7842 that do not require the guarantees of these specifications.
7843 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
7844 @option{-fassociative-math} and @option{-freciprocal-math}.
7845
7846 The default is @option{-fno-unsafe-math-optimizations}.
7847
7848 @item -fassociative-math
7849 @opindex fassociative-math
7850
7851 Allow re-association of operands in series of floating-point operations.
7852 This violates the ISO C and C++ language standard by possibly changing
7853 computation result.  NOTE: re-ordering may change the sign of zero as
7854 well as ignore NaNs and inhibit or create underflow or overflow (and
7855 thus cannot be used on a code which relies on rounding behavior like
7856 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
7857 and thus may not be used when ordered comparisons are required.
7858 This option requires that both @option{-fno-signed-zeros} and
7859 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
7860 much sense with @option{-frounding-math}. For Fortran the option
7861 is automatically enabled when both @option{-fno-signed-zeros} and
7862 @option{-fno-trapping-math} are in effect.
7863
7864 The default is @option{-fno-associative-math}.
7865
7866 @item -freciprocal-math
7867 @opindex freciprocal-math
7868
7869 Allow the reciprocal of a value to be used instead of dividing by
7870 the value if this enables optimizations.  For example @code{x / y}
7871 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
7872 is subject to common subexpression elimination.  Note that this loses
7873 precision and increases the number of flops operating on the value.
7874
7875 The default is @option{-fno-reciprocal-math}.
7876
7877 @item -ffinite-math-only
7878 @opindex ffinite-math-only
7879 Allow optimizations for floating-point arithmetic that assume
7880 that arguments and results are not NaNs or +-Infs.
7881
7882 This option is not turned on by any @option{-O} option since
7883 it can result in incorrect output for programs which depend on
7884 an exact implementation of IEEE or ISO rules/specifications for
7885 math functions. It may, however, yield faster code for programs
7886 that do not require the guarantees of these specifications.
7887
7888 The default is @option{-fno-finite-math-only}.
7889
7890 @item -fno-signed-zeros
7891 @opindex fno-signed-zeros
7892 Allow optimizations for floating point arithmetic that ignore the
7893 signedness of zero.  IEEE arithmetic specifies the behavior of
7894 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
7895 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
7896 This option implies that the sign of a zero result isn't significant.
7897
7898 The default is @option{-fsigned-zeros}.
7899
7900 @item -fno-trapping-math
7901 @opindex fno-trapping-math
7902 Compile code assuming that floating-point operations cannot generate
7903 user-visible traps.  These traps include division by zero, overflow,
7904 underflow, inexact result and invalid operation.  This option requires
7905 that @option{-fno-signaling-nans} be in effect.  Setting this option may
7906 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
7907
7908 This option should never be turned on by any @option{-O} option since
7909 it can result in incorrect output for programs which depend on
7910 an exact implementation of IEEE or ISO rules/specifications for
7911 math functions.
7912
7913 The default is @option{-ftrapping-math}.
7914
7915 @item -frounding-math
7916 @opindex frounding-math
7917 Disable transformations and optimizations that assume default floating
7918 point rounding behavior.  This is round-to-zero for all floating point
7919 to integer conversions, and round-to-nearest for all other arithmetic
7920 truncations.  This option should be specified for programs that change
7921 the FP rounding mode dynamically, or that may be executed with a
7922 non-default rounding mode.  This option disables constant folding of
7923 floating point expressions at compile-time (which may be affected by
7924 rounding mode) and arithmetic transformations that are unsafe in the
7925 presence of sign-dependent rounding modes.
7926
7927 The default is @option{-fno-rounding-math}.
7928
7929 This option is experimental and does not currently guarantee to
7930 disable all GCC optimizations that are affected by rounding mode.
7931 Future versions of GCC may provide finer control of this setting
7932 using C99's @code{FENV_ACCESS} pragma.  This command line option
7933 will be used to specify the default state for @code{FENV_ACCESS}.
7934
7935 @item -fsignaling-nans
7936 @opindex fsignaling-nans
7937 Compile code assuming that IEEE signaling NaNs may generate user-visible
7938 traps during floating-point operations.  Setting this option disables
7939 optimizations that may change the number of exceptions visible with
7940 signaling NaNs.  This option implies @option{-ftrapping-math}.
7941
7942 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
7943 be defined.
7944
7945 The default is @option{-fno-signaling-nans}.
7946
7947 This option is experimental and does not currently guarantee to
7948 disable all GCC optimizations that affect signaling NaN behavior.
7949
7950 @item -fsingle-precision-constant
7951 @opindex fsingle-precision-constant
7952 Treat floating point constant as single precision constant instead of
7953 implicitly converting it to double precision constant.
7954
7955 @item -fcx-limited-range
7956 @opindex fcx-limited-range
7957 When enabled, this option states that a range reduction step is not
7958 needed when performing complex division.  Also, there is no checking
7959 whether the result of a complex multiplication or division is @code{NaN
7960 + I*NaN}, with an attempt to rescue the situation in that case.  The
7961 default is @option{-fno-cx-limited-range}, but is enabled by
7962 @option{-ffast-math}.
7963
7964 This option controls the default setting of the ISO C99
7965 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
7966 all languages.
7967
7968 @item -fcx-fortran-rules
7969 @opindex fcx-fortran-rules
7970 Complex multiplication and division follow Fortran rules.  Range
7971 reduction is done as part of complex division, but there is no checking
7972 whether the result of a complex multiplication or division is @code{NaN
7973 + I*NaN}, with an attempt to rescue the situation in that case.
7974
7975 The default is @option{-fno-cx-fortran-rules}.
7976
7977 @end table
7978
7979 The following options control optimizations that may improve
7980 performance, but are not enabled by any @option{-O} options.  This
7981 section includes experimental options that may produce broken code.
7982
7983 @table @gcctabopt
7984 @item -fbranch-probabilities
7985 @opindex fbranch-probabilities
7986 After running a program compiled with @option{-fprofile-arcs}
7987 (@pxref{Debugging Options,, Options for Debugging Your Program or
7988 @command{gcc}}), you can compile it a second time using
7989 @option{-fbranch-probabilities}, to improve optimizations based on
7990 the number of times each branch was taken.  When the program
7991 compiled with @option{-fprofile-arcs} exits it saves arc execution
7992 counts to a file called @file{@var{sourcename}.gcda} for each source
7993 file.  The information in this data file is very dependent on the
7994 structure of the generated code, so you must use the same source code
7995 and the same optimization options for both compilations.
7996
7997 With @option{-fbranch-probabilities}, GCC puts a
7998 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
7999 These can be used to improve optimization.  Currently, they are only
8000 used in one place: in @file{reorg.c}, instead of guessing which path a
8001 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
8002 exactly determine which path is taken more often.
8003
8004 @item -fprofile-values
8005 @opindex fprofile-values
8006 If combined with @option{-fprofile-arcs}, it adds code so that some
8007 data about values of expressions in the program is gathered.
8008
8009 With @option{-fbranch-probabilities}, it reads back the data gathered
8010 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
8011 notes to instructions for their later usage in optimizations.
8012
8013 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8014
8015 @item -fvpt
8016 @opindex fvpt
8017 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
8018 a code to gather information about values of expressions.
8019
8020 With @option{-fbranch-probabilities}, it reads back the data gathered
8021 and actually performs the optimizations based on them.
8022 Currently the optimizations include specialization of division operation
8023 using the knowledge about the value of the denominator.
8024
8025 @item -frename-registers
8026 @opindex frename-registers
8027 Attempt to avoid false dependencies in scheduled code by making use
8028 of registers left over after register allocation.  This optimization
8029 will most benefit processors with lots of registers.  Depending on the
8030 debug information format adopted by the target, however, it can
8031 make debugging impossible, since variables will no longer stay in
8032 a ``home register''.
8033
8034 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8035
8036 @item -ftracer
8037 @opindex ftracer
8038 Perform tail duplication to enlarge superblock size.  This transformation
8039 simplifies the control flow of the function allowing other optimizations to do
8040 better job.
8041
8042 Enabled with @option{-fprofile-use}.
8043
8044 @item -funroll-loops
8045 @opindex funroll-loops
8046 Unroll loops whose number of iterations can be determined at compile time or
8047 upon entry to the loop.  @option{-funroll-loops} implies
8048 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8049 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8050 small constant number of iterations).  This option makes code larger, and may
8051 or may not make it run faster.
8052
8053 Enabled with @option{-fprofile-use}.
8054
8055 @item -funroll-all-loops
8056 @opindex funroll-all-loops
8057 Unroll all loops, even if their number of iterations is uncertain when
8058 the loop is entered.  This usually makes programs run more slowly.
8059 @option{-funroll-all-loops} implies the same options as
8060 @option{-funroll-loops}.
8061
8062 @item -fpeel-loops
8063 @opindex fpeel-loops
8064 Peels the loops for that there is enough information that they do not
8065 roll much (from profile feedback).  It also turns on complete loop peeling
8066 (i.e.@: complete removal of loops with small constant number of iterations).
8067
8068 Enabled with @option{-fprofile-use}.
8069
8070 @item -fmove-loop-invariants
8071 @opindex fmove-loop-invariants
8072 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8073 at level @option{-O1}
8074
8075 @item -funswitch-loops
8076 @opindex funswitch-loops
8077 Move branches with loop invariant conditions out of the loop, with duplicates
8078 of the loop on both branches (modified according to result of the condition).
8079
8080 @item -ffunction-sections
8081 @itemx -fdata-sections
8082 @opindex ffunction-sections
8083 @opindex fdata-sections
8084 Place each function or data item into its own section in the output
8085 file if the target supports arbitrary sections.  The name of the
8086 function or the name of the data item determines the section's name
8087 in the output file.
8088
8089 Use these options on systems where the linker can perform optimizations
8090 to improve locality of reference in the instruction space.  Most systems
8091 using the ELF object format and SPARC processors running Solaris 2 have
8092 linkers with such optimizations.  AIX may have these optimizations in
8093 the future.
8094
8095 Only use these options when there are significant benefits from doing
8096 so.  When you specify these options, the assembler and linker will
8097 create larger object and executable files and will also be slower.
8098 You will not be able to use @code{gprof} on all systems if you
8099 specify this option and you may have problems with debugging if
8100 you specify both this option and @option{-g}.
8101
8102 @item -fbranch-target-load-optimize
8103 @opindex fbranch-target-load-optimize
8104 Perform branch target register load optimization before prologue / epilogue
8105 threading.
8106 The use of target registers can typically be exposed only during reload,
8107 thus hoisting loads out of loops and doing inter-block scheduling needs
8108 a separate optimization pass.
8109
8110 @item -fbranch-target-load-optimize2
8111 @opindex fbranch-target-load-optimize2
8112 Perform branch target register load optimization after prologue / epilogue
8113 threading.
8114
8115 @item -fbtr-bb-exclusive
8116 @opindex fbtr-bb-exclusive
8117 When performing branch target register load optimization, don't reuse
8118 branch target registers in within any basic block.
8119
8120 @item -fstack-protector
8121 @opindex fstack-protector
8122 Emit extra code to check for buffer overflows, such as stack smashing
8123 attacks.  This is done by adding a guard variable to functions with
8124 vulnerable objects.  This includes functions that call alloca, and
8125 functions with buffers larger than 8 bytes.  The guards are initialized
8126 when a function is entered and then checked when the function exits.
8127 If a guard check fails, an error message is printed and the program exits.
8128
8129 @item -fstack-protector-all
8130 @opindex fstack-protector-all
8131 Like @option{-fstack-protector} except that all functions are protected.
8132
8133 @item -fsection-anchors
8134 @opindex fsection-anchors
8135 Try to reduce the number of symbolic address calculations by using
8136 shared ``anchor'' symbols to address nearby objects.  This transformation
8137 can help to reduce the number of GOT entries and GOT accesses on some
8138 targets.
8139
8140 For example, the implementation of the following function @code{foo}:
8141
8142 @smallexample
8143 static int a, b, c;
8144 int foo (void) @{ return a + b + c; @}
8145 @end smallexample
8146
8147 would usually calculate the addresses of all three variables, but if you
8148 compile it with @option{-fsection-anchors}, it will access the variables
8149 from a common anchor point instead.  The effect is similar to the
8150 following pseudocode (which isn't valid C):
8151
8152 @smallexample
8153 int foo (void)
8154 @{
8155   register int *xr = &x;
8156   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8157 @}
8158 @end smallexample
8159
8160 Not all targets support this option.
8161
8162 @item --param @var{name}=@var{value}
8163 @opindex param
8164 In some places, GCC uses various constants to control the amount of
8165 optimization that is done.  For example, GCC will not inline functions
8166 that contain more that a certain number of instructions.  You can
8167 control some of these constants on the command-line using the
8168 @option{--param} option.
8169
8170 The names of specific parameters, and the meaning of the values, are
8171 tied to the internals of the compiler, and are subject to change
8172 without notice in future releases.
8173
8174 In each case, the @var{value} is an integer.  The allowable choices for
8175 @var{name} are given in the following table:
8176
8177 @table @gcctabopt
8178 @item struct-reorg-cold-struct-ratio
8179 The threshold ratio (as a percentage) between a structure frequency
8180 and the frequency of the hottest structure in the program.  This parameter
8181 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
8182 We say that if the ratio of a structure frequency, calculated by profiling,
8183 to the hottest structure frequency in the program is less than this
8184 parameter, then structure reorganization is not applied to this structure.
8185 The default is 10.
8186
8187 @item predictable-branch-outcome
8188 When branch is predicted to be taken with probability lower than this threshold
8189 (in percent), then it is considered well predictable. The default is 10.
8190
8191 @item max-crossjump-edges
8192 The maximum number of incoming edges to consider for crossjumping.
8193 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8194 the number of edges incoming to each block.  Increasing values mean
8195 more aggressive optimization, making the compile time increase with
8196 probably small improvement in executable size.
8197
8198 @item min-crossjump-insns
8199 The minimum number of instructions which must be matched at the end
8200 of two blocks before crossjumping will be performed on them.  This
8201 value is ignored in the case where all instructions in the block being
8202 crossjumped from are matched.  The default value is 5.
8203
8204 @item max-grow-copy-bb-insns
8205 The maximum code size expansion factor when copying basic blocks
8206 instead of jumping.  The expansion is relative to a jump instruction.
8207 The default value is 8.
8208
8209 @item max-goto-duplication-insns
8210 The maximum number of instructions to duplicate to a block that jumps
8211 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8212 passes, GCC factors computed gotos early in the compilation process,
8213 and unfactors them as late as possible.  Only computed jumps at the
8214 end of a basic blocks with no more than max-goto-duplication-insns are
8215 unfactored.  The default value is 8.
8216
8217 @item max-delay-slot-insn-search
8218 The maximum number of instructions to consider when looking for an
8219 instruction to fill a delay slot.  If more than this arbitrary number of
8220 instructions is searched, the time savings from filling the delay slot
8221 will be minimal so stop searching.  Increasing values mean more
8222 aggressive optimization, making the compile time increase with probably
8223 small improvement in executable run time.
8224
8225 @item max-delay-slot-live-search
8226 When trying to fill delay slots, the maximum number of instructions to
8227 consider when searching for a block with valid live register
8228 information.  Increasing this arbitrarily chosen value means more
8229 aggressive optimization, increasing the compile time.  This parameter
8230 should be removed when the delay slot code is rewritten to maintain the
8231 control-flow graph.
8232
8233 @item max-gcse-memory
8234 The approximate maximum amount of memory that will be allocated in
8235 order to perform the global common subexpression elimination
8236 optimization.  If more memory than specified is required, the
8237 optimization will not be done.
8238
8239 @item max-pending-list-length
8240 The maximum number of pending dependencies scheduling will allow
8241 before flushing the current state and starting over.  Large functions
8242 with few branches or calls can create excessively large lists which
8243 needlessly consume memory and resources.
8244
8245 @item max-inline-insns-single
8246 Several parameters control the tree inliner used in gcc.
8247 This number sets the maximum number of instructions (counted in GCC's
8248 internal representation) in a single function that the tree inliner
8249 will consider for inlining.  This only affects functions declared
8250 inline and methods implemented in a class declaration (C++).
8251 The default value is 300.
8252
8253 @item max-inline-insns-auto
8254 When you use @option{-finline-functions} (included in @option{-O3}),
8255 a lot of functions that would otherwise not be considered for inlining
8256 by the compiler will be investigated.  To those functions, a different
8257 (more restrictive) limit compared to functions declared inline can
8258 be applied.
8259 The default value is 40.
8260
8261 @item large-function-insns
8262 The limit specifying really large functions.  For functions larger than this
8263 limit after inlining, inlining is constrained by
8264 @option{--param large-function-growth}.  This parameter is useful primarily
8265 to avoid extreme compilation time caused by non-linear algorithms used by the
8266 backend.
8267 The default value is 2700.
8268
8269 @item large-function-growth
8270 Specifies maximal growth of large function caused by inlining in percents.
8271 The default value is 100 which limits large function growth to 2.0 times
8272 the original size.
8273
8274 @item large-unit-insns
8275 The limit specifying large translation unit.  Growth caused by inlining of
8276 units larger than this limit is limited by @option{--param inline-unit-growth}.
8277 For small units this might be too tight (consider unit consisting of function A
8278 that is inline and B that just calls A three time.  If B is small relative to
8279 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8280 large units consisting of small inlineable functions however the overall unit
8281 growth limit is needed to avoid exponential explosion of code size.  Thus for
8282 smaller units, the size is increased to @option{--param large-unit-insns}
8283 before applying @option{--param inline-unit-growth}.  The default is 10000
8284
8285 @item inline-unit-growth
8286 Specifies maximal overall growth of the compilation unit caused by inlining.
8287 The default value is 30 which limits unit growth to 1.3 times the original
8288 size.
8289
8290 @item ipcp-unit-growth
8291 Specifies maximal overall growth of the compilation unit caused by
8292 interprocedural constant propagation.  The default value is 10 which limits
8293 unit growth to 1.1 times the original size.
8294
8295 @item large-stack-frame
8296 The limit specifying large stack frames.  While inlining the algorithm is trying
8297 to not grow past this limit too much.  Default value is 256 bytes.
8298
8299 @item large-stack-frame-growth
8300 Specifies maximal growth of large stack frames caused by inlining in percents.
8301 The default value is 1000 which limits large stack frame growth to 11 times
8302 the original size.
8303
8304 @item max-inline-insns-recursive
8305 @itemx max-inline-insns-recursive-auto
8306 Specifies maximum number of instructions out-of-line copy of self recursive inline
8307 function can grow into by performing recursive inlining.
8308
8309 For functions declared inline @option{--param max-inline-insns-recursive} is
8310 taken into account.  For function not declared inline, recursive inlining
8311 happens only when @option{-finline-functions} (included in @option{-O3}) is
8312 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8313 default value is 450.
8314
8315 @item max-inline-recursive-depth
8316 @itemx max-inline-recursive-depth-auto
8317 Specifies maximum recursion depth used by the recursive inlining.
8318
8319 For functions declared inline @option{--param max-inline-recursive-depth} is
8320 taken into account.  For function not declared inline, recursive inlining
8321 happens only when @option{-finline-functions} (included in @option{-O3}) is
8322 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8323 default value is 8.
8324
8325 @item min-inline-recursive-probability
8326 Recursive inlining is profitable only for function having deep recursion
8327 in average and can hurt for function having little recursion depth by
8328 increasing the prologue size or complexity of function body to other
8329 optimizers.
8330
8331 When profile feedback is available (see @option{-fprofile-generate}) the actual
8332 recursion depth can be guessed from probability that function will recurse via
8333 given call expression.  This parameter limits inlining only to call expression
8334 whose probability exceeds given threshold (in percents).  The default value is
8335 10.
8336
8337 @item early-inlining-insns
8338 Specify growth that early inliner can make.  In effect it increases amount of
8339 inlining for code having large abstraction penalty.  The default value is 8.
8340
8341 @item max-early-inliner-iterations
8342 @itemx max-early-inliner-iterations
8343 Limit of iterations of early inliner.  This basically bounds number of nested
8344 indirect calls early inliner can resolve.  Deeper chains are still handled by
8345 late inlining.
8346
8347 @item min-vect-loop-bound
8348 The minimum number of iterations under which a loop will not get vectorized
8349 when @option{-ftree-vectorize} is used.  The number of iterations after
8350 vectorization needs to be greater than the value specified by this option
8351 to allow vectorization.  The default value is 0.
8352
8353 @item gcse-cost-distance-ratio
8354 Scaling factor in calculation of maximum distance an expression
8355 can be moved by GCSE optimizations.  This is currently supported only in
8356 code hoisting pass.  The bigger the ratio, the more agressive code hoisting
8357 will be with simple expressions, i.e., the expressions which have cost
8358 less than @option{gcse-unrestricted-cost}.  Specifying 0 will disable
8359 hoisting of simple expressions.  The default value is 10.
8360
8361 @item gcse-unrestricted-cost
8362 Cost, roughly measured as the cost of a single typical machine
8363 instruction, at which GCSE optimizations will not constrain
8364 the distance an expression can travel.  This is currently
8365 supported only in code hoisting pass.  The lesser the cost,
8366 the more aggressive code hoisting will be.  Specifying 0 will
8367 allow all expressions to travel unrestricted distances.
8368 The default value is 3.
8369
8370 @item max-hoist-depth
8371 The depth of search in the dominator tree for expressions to hoist.
8372 This is used to avoid quadratic behavior in hoisting algorithm.
8373 The value of 0 will avoid limiting the search, but may slow down compilation
8374 of huge functions.  The default value is 30.
8375
8376 @item max-unrolled-insns
8377 The maximum number of instructions that a loop should have if that loop
8378 is unrolled, and if the loop is unrolled, it determines how many times
8379 the loop code is unrolled.
8380
8381 @item max-average-unrolled-insns
8382 The maximum number of instructions biased by probabilities of their execution
8383 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8384 it determines how many times the loop code is unrolled.
8385
8386 @item max-unroll-times
8387 The maximum number of unrollings of a single loop.
8388
8389 @item max-peeled-insns
8390 The maximum number of instructions that a loop should have if that loop
8391 is peeled, and if the loop is peeled, it determines how many times
8392 the loop code is peeled.
8393
8394 @item max-peel-times
8395 The maximum number of peelings of a single loop.
8396
8397 @item max-completely-peeled-insns
8398 The maximum number of insns of a completely peeled loop.
8399
8400 @item max-completely-peel-times
8401 The maximum number of iterations of a loop to be suitable for complete peeling.
8402
8403 @item max-completely-peel-loop-nest-depth
8404 The maximum depth of a loop nest suitable for complete peeling.
8405
8406 @item max-unswitch-insns
8407 The maximum number of insns of an unswitched loop.
8408
8409 @item max-unswitch-level
8410 The maximum number of branches unswitched in a single loop.
8411
8412 @item lim-expensive
8413 The minimum cost of an expensive expression in the loop invariant motion.
8414
8415 @item iv-consider-all-candidates-bound
8416 Bound on number of candidates for induction variables below that
8417 all candidates are considered for each use in induction variable
8418 optimizations.  Only the most relevant candidates are considered
8419 if there are more candidates, to avoid quadratic time complexity.
8420
8421 @item iv-max-considered-uses
8422 The induction variable optimizations give up on loops that contain more
8423 induction variable uses.
8424
8425 @item iv-always-prune-cand-set-bound
8426 If number of candidates in the set is smaller than this value,
8427 we always try to remove unnecessary ivs from the set during its
8428 optimization when a new iv is added to the set.
8429
8430 @item scev-max-expr-size
8431 Bound on size of expressions used in the scalar evolutions analyzer.
8432 Large expressions slow the analyzer.
8433
8434 @item omega-max-vars
8435 The maximum number of variables in an Omega constraint system.
8436 The default value is 128.
8437
8438 @item omega-max-geqs
8439 The maximum number of inequalities in an Omega constraint system.
8440 The default value is 256.
8441
8442 @item omega-max-eqs
8443 The maximum number of equalities in an Omega constraint system.
8444 The default value is 128.
8445
8446 @item omega-max-wild-cards
8447 The maximum number of wildcard variables that the Omega solver will
8448 be able to insert.  The default value is 18.
8449
8450 @item omega-hash-table-size
8451 The size of the hash table in the Omega solver.  The default value is
8452 550.
8453
8454 @item omega-max-keys
8455 The maximal number of keys used by the Omega solver.  The default
8456 value is 500.
8457
8458 @item omega-eliminate-redundant-constraints
8459 When set to 1, use expensive methods to eliminate all redundant
8460 constraints.  The default value is 0.
8461
8462 @item vect-max-version-for-alignment-checks
8463 The maximum number of runtime checks that can be performed when
8464 doing loop versioning for alignment in the vectorizer.  See option
8465 ftree-vect-loop-version for more information.
8466
8467 @item vect-max-version-for-alias-checks
8468 The maximum number of runtime checks that can be performed when
8469 doing loop versioning for alias in the vectorizer.  See option
8470 ftree-vect-loop-version for more information.
8471
8472 @item max-iterations-to-track
8473
8474 The maximum number of iterations of a loop the brute force algorithm
8475 for analysis of # of iterations of the loop tries to evaluate.
8476
8477 @item hot-bb-count-fraction
8478 Select fraction of the maximal count of repetitions of basic block in program
8479 given basic block needs to have to be considered hot.
8480
8481 @item hot-bb-frequency-fraction
8482 Select fraction of the maximal frequency of executions of basic block in
8483 function given basic block needs to have to be considered hot
8484
8485 @item max-predicted-iterations
8486 The maximum number of loop iterations we predict statically.  This is useful
8487 in cases where function contain single loop with known bound and other loop
8488 with unknown.  We predict the known number of iterations correctly, while
8489 the unknown number of iterations average to roughly 10.  This means that the
8490 loop without bounds would appear artificially cold relative to the other one.
8491
8492 @item align-threshold
8493
8494 Select fraction of the maximal frequency of executions of basic block in
8495 function given basic block will get aligned.
8496
8497 @item align-loop-iterations
8498
8499 A loop expected to iterate at lest the selected number of iterations will get
8500 aligned.
8501
8502 @item tracer-dynamic-coverage
8503 @itemx tracer-dynamic-coverage-feedback
8504
8505 This value is used to limit superblock formation once the given percentage of
8506 executed instructions is covered.  This limits unnecessary code size
8507 expansion.
8508
8509 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8510 feedback is available.  The real profiles (as opposed to statically estimated
8511 ones) are much less balanced allowing the threshold to be larger value.
8512
8513 @item tracer-max-code-growth
8514 Stop tail duplication once code growth has reached given percentage.  This is
8515 rather hokey argument, as most of the duplicates will be eliminated later in
8516 cross jumping, so it may be set to much higher values than is the desired code
8517 growth.
8518
8519 @item tracer-min-branch-ratio
8520
8521 Stop reverse growth when the reverse probability of best edge is less than this
8522 threshold (in percent).
8523
8524 @item tracer-min-branch-ratio
8525 @itemx tracer-min-branch-ratio-feedback
8526
8527 Stop forward growth if the best edge do have probability lower than this
8528 threshold.
8529
8530 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8531 compilation for profile feedback and one for compilation without.  The value
8532 for compilation with profile feedback needs to be more conservative (higher) in
8533 order to make tracer effective.
8534
8535 @item max-cse-path-length
8536
8537 Maximum number of basic blocks on path that cse considers.  The default is 10.
8538
8539 @item max-cse-insns
8540 The maximum instructions CSE process before flushing. The default is 1000.
8541
8542 @item ggc-min-expand
8543
8544 GCC uses a garbage collector to manage its own memory allocation.  This
8545 parameter specifies the minimum percentage by which the garbage
8546 collector's heap should be allowed to expand between collections.
8547 Tuning this may improve compilation speed; it has no effect on code
8548 generation.
8549
8550 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8551 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
8552 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8553 GCC is not able to calculate RAM on a particular platform, the lower
8554 bound of 30% is used.  Setting this parameter and
8555 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8556 every opportunity.  This is extremely slow, but can be useful for
8557 debugging.
8558
8559 @item ggc-min-heapsize
8560
8561 Minimum size of the garbage collector's heap before it begins bothering
8562 to collect garbage.  The first collection occurs after the heap expands
8563 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8564 tuning this may improve compilation speed, and has no effect on code
8565 generation.
8566
8567 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
8568 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8569 with a lower bound of 4096 (four megabytes) and an upper bound of
8570 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8571 particular platform, the lower bound is used.  Setting this parameter
8572 very large effectively disables garbage collection.  Setting this
8573 parameter and @option{ggc-min-expand} to zero causes a full collection
8574 to occur at every opportunity.
8575
8576 @item max-reload-search-insns
8577 The maximum number of instruction reload should look backward for equivalent
8578 register.  Increasing values mean more aggressive optimization, making the
8579 compile time increase with probably slightly better performance.  The default
8580 value is 100.
8581
8582 @item max-cselib-memory-locations
8583 The maximum number of memory locations cselib should take into account.
8584 Increasing values mean more aggressive optimization, making the compile time
8585 increase with probably slightly better performance.  The default value is 500.
8586
8587 @item reorder-blocks-duplicate
8588 @itemx reorder-blocks-duplicate-feedback
8589
8590 Used by basic block reordering pass to decide whether to use unconditional
8591 branch or duplicate the code on its destination.  Code is duplicated when its
8592 estimated size is smaller than this value multiplied by the estimated size of
8593 unconditional jump in the hot spots of the program.
8594
8595 The @option{reorder-block-duplicate-feedback} is used only when profile
8596 feedback is available and may be set to higher values than
8597 @option{reorder-block-duplicate} since information about the hot spots is more
8598 accurate.
8599
8600 @item max-sched-ready-insns
8601 The maximum number of instructions ready to be issued the scheduler should
8602 consider at any given time during the first scheduling pass.  Increasing
8603 values mean more thorough searches, making the compilation time increase
8604 with probably little benefit.  The default value is 100.
8605
8606 @item max-sched-region-blocks
8607 The maximum number of blocks in a region to be considered for
8608 interblock scheduling.  The default value is 10.
8609
8610 @item max-pipeline-region-blocks
8611 The maximum number of blocks in a region to be considered for
8612 pipelining in the selective scheduler.  The default value is 15.
8613
8614 @item max-sched-region-insns
8615 The maximum number of insns in a region to be considered for
8616 interblock scheduling.  The default value is 100.
8617
8618 @item max-pipeline-region-insns
8619 The maximum number of insns in a region to be considered for
8620 pipelining in the selective scheduler.  The default value is 200.
8621
8622 @item min-spec-prob
8623 The minimum probability (in percents) of reaching a source block
8624 for interblock speculative scheduling.  The default value is 40.
8625
8626 @item max-sched-extend-regions-iters
8627 The maximum number of iterations through CFG to extend regions.
8628 0 - disable region extension,
8629 N - do at most N iterations.
8630 The default value is 0.
8631
8632 @item max-sched-insn-conflict-delay
8633 The maximum conflict delay for an insn to be considered for speculative motion.
8634 The default value is 3.
8635
8636 @item sched-spec-prob-cutoff
8637 The minimal probability of speculation success (in percents), so that
8638 speculative insn will be scheduled.
8639 The default value is 40.
8640
8641 @item sched-mem-true-dep-cost
8642 Minimal distance (in CPU cycles) between store and load targeting same
8643 memory locations.  The default value is 1.
8644
8645 @item selsched-max-lookahead
8646 The maximum size of the lookahead window of selective scheduling.  It is a
8647 depth of search for available instructions.
8648 The default value is 50.
8649
8650 @item selsched-max-sched-times
8651 The maximum number of times that an instruction will be scheduled during
8652 selective scheduling.  This is the limit on the number of iterations
8653 through which the instruction may be pipelined.  The default value is 2.
8654
8655 @item selsched-max-insns-to-rename
8656 The maximum number of best instructions in the ready list that are considered
8657 for renaming in the selective scheduler.  The default value is 2.
8658
8659 @item max-last-value-rtl
8660 The maximum size measured as number of RTLs that can be recorded in an expression
8661 in combiner for a pseudo register as last known value of that register.  The default
8662 is 10000.
8663
8664 @item integer-share-limit
8665 Small integer constants can use a shared data structure, reducing the
8666 compiler's memory usage and increasing its speed.  This sets the maximum
8667 value of a shared integer constant.  The default value is 256.
8668
8669 @item min-virtual-mappings
8670 Specifies the minimum number of virtual mappings in the incremental
8671 SSA updater that should be registered to trigger the virtual mappings
8672 heuristic defined by virtual-mappings-ratio.  The default value is
8673 100.
8674
8675 @item virtual-mappings-ratio
8676 If the number of virtual mappings is virtual-mappings-ratio bigger
8677 than the number of virtual symbols to be updated, then the incremental
8678 SSA updater switches to a full update for those symbols.  The default
8679 ratio is 3.
8680
8681 @item ssp-buffer-size
8682 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
8683 protection when @option{-fstack-protection} is used.
8684
8685 @item max-jump-thread-duplication-stmts
8686 Maximum number of statements allowed in a block that needs to be
8687 duplicated when threading jumps.
8688
8689 @item max-fields-for-field-sensitive
8690 Maximum number of fields in a structure we will treat in
8691 a field sensitive manner during pointer analysis.  The default is zero
8692 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
8693
8694 @item prefetch-latency
8695 Estimate on average number of instructions that are executed before
8696 prefetch finishes.  The distance we prefetch ahead is proportional
8697 to this constant.  Increasing this number may also lead to less
8698 streams being prefetched (see @option{simultaneous-prefetches}).
8699
8700 @item simultaneous-prefetches
8701 Maximum number of prefetches that can run at the same time.
8702
8703 @item l1-cache-line-size
8704 The size of cache line in L1 cache, in bytes.
8705
8706 @item l1-cache-size
8707 The size of L1 cache, in kilobytes.
8708
8709 @item l2-cache-size
8710 The size of L2 cache, in kilobytes.
8711
8712 @item min-insn-to-prefetch-ratio
8713 The minimum ratio between the number of instructions and the
8714 number of prefetches to enable prefetching in a loop.
8715
8716 @item prefetch-min-insn-to-mem-ratio
8717 The minimum ratio between the number of instructions and the
8718 number of memory references to enable prefetching in a loop.
8719
8720 @item use-canonical-types
8721 Whether the compiler should use the ``canonical'' type system.  By
8722 default, this should always be 1, which uses a more efficient internal
8723 mechanism for comparing types in C++ and Objective-C++.  However, if
8724 bugs in the canonical type system are causing compilation failures,
8725 set this value to 0 to disable canonical types.
8726
8727 @item switch-conversion-max-branch-ratio
8728 Switch initialization conversion will refuse to create arrays that are
8729 bigger than @option{switch-conversion-max-branch-ratio} times the number of
8730 branches in the switch.
8731
8732 @item max-partial-antic-length
8733 Maximum length of the partial antic set computed during the tree
8734 partial redundancy elimination optimization (@option{-ftree-pre}) when
8735 optimizing at @option{-O3} and above.  For some sorts of source code
8736 the enhanced partial redundancy elimination optimization can run away,
8737 consuming all of the memory available on the host machine.  This
8738 parameter sets a limit on the length of the sets that are computed,
8739 which prevents the runaway behavior.  Setting a value of 0 for
8740 this parameter will allow an unlimited set length.
8741
8742 @item sccvn-max-scc-size
8743 Maximum size of a strongly connected component (SCC) during SCCVN
8744 processing.  If this limit is hit, SCCVN processing for the whole
8745 function will not be done and optimizations depending on it will
8746 be disabled.  The default maximum SCC size is 10000.
8747
8748 @item ira-max-loops-num
8749 IRA uses a regional register allocation by default.  If a function
8750 contains loops more than number given by the parameter, only at most
8751 given number of the most frequently executed loops will form regions
8752 for the regional register allocation.  The default value of the
8753 parameter is 100.
8754
8755 @item ira-max-conflict-table-size
8756 Although IRA uses a sophisticated algorithm of compression conflict
8757 table, the table can be still big for huge functions.  If the conflict
8758 table for a function could be more than size in MB given by the
8759 parameter, the conflict table is not built and faster, simpler, and
8760 lower quality register allocation algorithm will be used.  The
8761 algorithm do not use pseudo-register conflicts.  The default value of
8762 the parameter is 2000.
8763
8764 @item ira-loop-reserved-regs
8765 IRA can be used to evaluate more accurate register pressure in loops
8766 for decision to move loop invariants (see @option{-O3}).  The number
8767 of available registers reserved for some other purposes is described
8768 by this parameter.  The default value of the parameter is 2 which is
8769 minimal number of registers needed for execution of typical
8770 instruction.  This value is the best found from numerous experiments.
8771
8772 @item loop-invariant-max-bbs-in-loop
8773 Loop invariant motion can be very expensive, both in compile time and
8774 in amount of needed compile time memory, with very large loops.  Loops
8775 with more basic blocks than this parameter won't have loop invariant
8776 motion optimization performed on them.  The default value of the
8777 parameter is 1000 for -O1 and 10000 for -O2 and above.
8778
8779 @item max-vartrack-size
8780 Sets a maximum number of hash table slots to use during variable
8781 tracking dataflow analysis of any function.  If this limit is exceeded
8782 with variable tracking at assignments enabled, analysis for that
8783 function is retried without it, after removing all debug insns from
8784 the function.  If the limit is exceeded even without debug insns, var
8785 tracking analysis is completely disabled for the function.  Setting
8786 the parameter to zero makes it unlimited.
8787
8788 @item min-nondebug-insn-uid
8789 Use uids starting at this parameter for nondebug insns.  The range below
8790 the parameter is reserved exclusively for debug insns created by
8791 @option{-fvar-tracking-assignments}, but debug insns may get
8792 (non-overlapping) uids above it if the reserved range is exhausted.
8793
8794 @item ipa-sra-ptr-growth-factor
8795 IPA-SRA will replace a pointer to an aggregate with one or more new
8796 parameters only when their cumulative size is less or equal to
8797 @option{ipa-sra-ptr-growth-factor} times the size of the original
8798 pointer parameter.
8799
8800 @item graphite-max-nb-scop-params
8801 To avoid exponential effects in the Graphite loop transforms, the
8802 number of parameters in a Static Control Part (SCoP) is bounded.  The
8803 default value is 10 parameters.  A variable whose value is unknown at
8804 compile time and defined outside a SCoP is a parameter of the SCoP.
8805
8806 @item graphite-max-bbs-per-function
8807 To avoid exponential effects in the detection of SCoPs, the size of
8808 the functions analyzed by Graphite is bounded.  The default value is
8809 100 basic blocks.
8810
8811 @item loop-block-tile-size
8812 Loop blocking or strip mining transforms, enabled with
8813 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
8814 loop in the loop nest by a given number of iterations.  The strip
8815 length can be changed using the @option{loop-block-tile-size}
8816 parameter.  The default value is 51 iterations.
8817
8818 @item devirt-type-list-size
8819 IPA-CP attempts to track all possible types passed to a function's
8820 parameter in order to perform devirtualization.
8821 @option{devirt-type-list-size} is the maximum number of types it
8822 stores per a single formal parameter of a function.
8823
8824 @end table
8825 @end table
8826
8827 @node Preprocessor Options
8828 @section Options Controlling the Preprocessor
8829 @cindex preprocessor options
8830 @cindex options, preprocessor
8831
8832 These options control the C preprocessor, which is run on each C source
8833 file before actual compilation.
8834
8835 If you use the @option{-E} option, nothing is done except preprocessing.
8836 Some of these options make sense only together with @option{-E} because
8837 they cause the preprocessor output to be unsuitable for actual
8838 compilation.
8839
8840 @table @gcctabopt
8841 @item -Wp,@var{option}
8842 @opindex Wp
8843 You can use @option{-Wp,@var{option}} to bypass the compiler driver
8844 and pass @var{option} directly through to the preprocessor.  If
8845 @var{option} contains commas, it is split into multiple options at the
8846 commas.  However, many options are modified, translated or interpreted
8847 by the compiler driver before being passed to the preprocessor, and
8848 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
8849 interface is undocumented and subject to change, so whenever possible
8850 you should avoid using @option{-Wp} and let the driver handle the
8851 options instead.
8852
8853 @item -Xpreprocessor @var{option}
8854 @opindex Xpreprocessor
8855 Pass @var{option} as an option to the preprocessor.  You can use this to
8856 supply system-specific preprocessor options which GCC does not know how to
8857 recognize.
8858
8859 If you want to pass an option that takes an argument, you must use
8860 @option{-Xpreprocessor} twice, once for the option and once for the argument.
8861 @end table
8862
8863 @include cppopts.texi
8864
8865 @node Assembler Options
8866 @section Passing Options to the Assembler
8867
8868 @c prevent bad page break with this line
8869 You can pass options to the assembler.
8870
8871 @table @gcctabopt
8872 @item -Wa,@var{option}
8873 @opindex Wa
8874 Pass @var{option} as an option to the assembler.  If @var{option}
8875 contains commas, it is split into multiple options at the commas.
8876
8877 @item -Xassembler @var{option}
8878 @opindex Xassembler
8879 Pass @var{option} as an option to the assembler.  You can use this to
8880 supply system-specific assembler options which GCC does not know how to
8881 recognize.
8882
8883 If you want to pass an option that takes an argument, you must use
8884 @option{-Xassembler} twice, once for the option and once for the argument.
8885
8886 @end table
8887
8888 @node Link Options
8889 @section Options for Linking
8890 @cindex link options
8891 @cindex options, linking
8892
8893 These options come into play when the compiler links object files into
8894 an executable output file.  They are meaningless if the compiler is
8895 not doing a link step.
8896
8897 @table @gcctabopt
8898 @cindex file names
8899 @item @var{object-file-name}
8900 A file name that does not end in a special recognized suffix is
8901 considered to name an object file or library.  (Object files are
8902 distinguished from libraries by the linker according to the file
8903 contents.)  If linking is done, these object files are used as input
8904 to the linker.
8905
8906 @item -c
8907 @itemx -S
8908 @itemx -E
8909 @opindex c
8910 @opindex S
8911 @opindex E
8912 If any of these options is used, then the linker is not run, and
8913 object file names should not be used as arguments.  @xref{Overall
8914 Options}.
8915
8916 @cindex Libraries
8917 @item -l@var{library}
8918 @itemx -l @var{library}
8919 @opindex l
8920 Search the library named @var{library} when linking.  (The second
8921 alternative with the library as a separate argument is only for
8922 POSIX compliance and is not recommended.)
8923
8924 It makes a difference where in the command you write this option; the
8925 linker searches and processes libraries and object files in the order they
8926 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
8927 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
8928 to functions in @samp{z}, those functions may not be loaded.
8929
8930 The linker searches a standard list of directories for the library,
8931 which is actually a file named @file{lib@var{library}.a}.  The linker
8932 then uses this file as if it had been specified precisely by name.
8933
8934 The directories searched include several standard system directories
8935 plus any that you specify with @option{-L}.
8936
8937 Normally the files found this way are library files---archive files
8938 whose members are object files.  The linker handles an archive file by
8939 scanning through it for members which define symbols that have so far
8940 been referenced but not defined.  But if the file that is found is an
8941 ordinary object file, it is linked in the usual fashion.  The only
8942 difference between using an @option{-l} option and specifying a file name
8943 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
8944 and searches several directories.
8945
8946 @item -lobjc
8947 @opindex lobjc
8948 You need this special case of the @option{-l} option in order to
8949 link an Objective-C or Objective-C++ program.
8950
8951 @item -nostartfiles
8952 @opindex nostartfiles
8953 Do not use the standard system startup files when linking.
8954 The standard system libraries are used normally, unless @option{-nostdlib}
8955 or @option{-nodefaultlibs} is used.
8956
8957 @item -nodefaultlibs
8958 @opindex nodefaultlibs
8959 Do not use the standard system libraries when linking.
8960 Only the libraries you specify will be passed to the linker, options
8961 specifying linkage of the system libraries, such as @code{-static-libgcc}
8962 or @code{-shared-libgcc}, will be ignored.
8963 The standard startup files are used normally, unless @option{-nostartfiles}
8964 is used.  The compiler may generate calls to @code{memcmp},
8965 @code{memset}, @code{memcpy} and @code{memmove}.
8966 These entries are usually resolved by entries in
8967 libc.  These entry points should be supplied through some other
8968 mechanism when this option is specified.
8969
8970 @item -nostdlib
8971 @opindex nostdlib
8972 Do not use the standard system startup files or libraries when linking.
8973 No startup files and only the libraries you specify will be passed to
8974 the linker, options specifying linkage of the system libraries, such as
8975 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
8976 The compiler may generate calls to @code{memcmp}, @code{memset},
8977 @code{memcpy} and @code{memmove}.
8978 These entries are usually resolved by entries in
8979 libc.  These entry points should be supplied through some other
8980 mechanism when this option is specified.
8981
8982 @cindex @option{-lgcc}, use with @option{-nostdlib}
8983 @cindex @option{-nostdlib} and unresolved references
8984 @cindex unresolved references and @option{-nostdlib}
8985 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
8986 @cindex @option{-nodefaultlibs} and unresolved references
8987 @cindex unresolved references and @option{-nodefaultlibs}
8988 One of the standard libraries bypassed by @option{-nostdlib} and
8989 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
8990 that GCC uses to overcome shortcomings of particular machines, or special
8991 needs for some languages.
8992 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
8993 Collection (GCC) Internals},
8994 for more discussion of @file{libgcc.a}.)
8995 In most cases, you need @file{libgcc.a} even when you want to avoid
8996 other standard libraries.  In other words, when you specify @option{-nostdlib}
8997 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
8998 This ensures that you have no unresolved references to internal GCC
8999 library subroutines.  (For example, @samp{__main}, used to ensure C++
9000 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
9001 GNU Compiler Collection (GCC) Internals}.)
9002
9003 @item -pie
9004 @opindex pie
9005 Produce a position independent executable on targets which support it.
9006 For predictable results, you must also specify the same set of options
9007 that were used to generate code (@option{-fpie}, @option{-fPIE},
9008 or model suboptions) when you specify this option.
9009
9010 @item -rdynamic
9011 @opindex rdynamic
9012 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9013 that support it. This instructs the linker to add all symbols, not
9014 only used ones, to the dynamic symbol table. This option is needed
9015 for some uses of @code{dlopen} or to allow obtaining backtraces
9016 from within a program.
9017
9018 @item -s
9019 @opindex s
9020 Remove all symbol table and relocation information from the executable.
9021
9022 @item -static
9023 @opindex static
9024 On systems that support dynamic linking, this prevents linking with the shared
9025 libraries.  On other systems, this option has no effect.
9026
9027 @item -shared
9028 @opindex shared
9029 Produce a shared object which can then be linked with other objects to
9030 form an executable.  Not all systems support this option.  For predictable
9031 results, you must also specify the same set of options that were used to
9032 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
9033 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
9034 needs to build supplementary stub code for constructors to work.  On
9035 multi-libbed systems, @samp{gcc -shared} must select the correct support
9036 libraries to link against.  Failing to supply the correct flags may lead
9037 to subtle defects.  Supplying them in cases where they are not necessary
9038 is innocuous.}
9039
9040 @item -shared-libgcc
9041 @itemx -static-libgcc
9042 @opindex shared-libgcc
9043 @opindex static-libgcc
9044 On systems that provide @file{libgcc} as a shared library, these options
9045 force the use of either the shared or static version respectively.
9046 If no shared version of @file{libgcc} was built when the compiler was
9047 configured, these options have no effect.
9048
9049 There are several situations in which an application should use the
9050 shared @file{libgcc} instead of the static version.  The most common
9051 of these is when the application wishes to throw and catch exceptions
9052 across different shared libraries.  In that case, each of the libraries
9053 as well as the application itself should use the shared @file{libgcc}.
9054
9055 Therefore, the G++ and GCJ drivers automatically add
9056 @option{-shared-libgcc} whenever you build a shared library or a main
9057 executable, because C++ and Java programs typically use exceptions, so
9058 this is the right thing to do.
9059
9060 If, instead, you use the GCC driver to create shared libraries, you may
9061 find that they will not always be linked with the shared @file{libgcc}.
9062 If GCC finds, at its configuration time, that you have a non-GNU linker
9063 or a GNU linker that does not support option @option{--eh-frame-hdr},
9064 it will link the shared version of @file{libgcc} into shared libraries
9065 by default.  Otherwise, it will take advantage of the linker and optimize
9066 away the linking with the shared version of @file{libgcc}, linking with
9067 the static version of libgcc by default.  This allows exceptions to
9068 propagate through such shared libraries, without incurring relocation
9069 costs at library load time.
9070
9071 However, if a library or main executable is supposed to throw or catch
9072 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9073 for the languages used in the program, or using the option
9074 @option{-shared-libgcc}, such that it is linked with the shared
9075 @file{libgcc}.
9076
9077 @item -static-libstdc++
9078 When the @command{g++} program is used to link a C++ program, it will
9079 normally automatically link against @option{libstdc++}.  If
9080 @file{libstdc++} is available as a shared library, and the
9081 @option{-static} option is not used, then this will link against the
9082 shared version of @file{libstdc++}.  That is normally fine.  However, it
9083 is sometimes useful to freeze the version of @file{libstdc++} used by
9084 the program without going all the way to a fully static link.  The
9085 @option{-static-libstdc++} option directs the @command{g++} driver to
9086 link @file{libstdc++} statically, without necessarily linking other
9087 libraries statically.
9088
9089 @item -symbolic
9090 @opindex symbolic
9091 Bind references to global symbols when building a shared object.  Warn
9092 about any unresolved references (unless overridden by the link editor
9093 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
9094 this option.
9095
9096 @item -T @var{script}
9097 @opindex T
9098 @cindex linker script
9099 Use @var{script} as the linker script.  This option is supported by most
9100 systems using the GNU linker.  On some targets, such as bare-board
9101 targets without an operating system, the @option{-T} option may be required
9102 when linking to avoid references to undefined symbols.
9103
9104 @item -Xlinker @var{option}
9105 @opindex Xlinker
9106 Pass @var{option} as an option to the linker.  You can use this to
9107 supply system-specific linker options which GCC does not know how to
9108 recognize.
9109
9110 If you want to pass an option that takes a separate argument, you must use
9111 @option{-Xlinker} twice, once for the option and once for the argument.
9112 For example, to pass @option{-assert definitions}, you must write
9113 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9114 @option{-Xlinker "-assert definitions"}, because this passes the entire
9115 string as a single argument, which is not what the linker expects.
9116
9117 When using the GNU linker, it is usually more convenient to pass
9118 arguments to linker options using the @option{@var{option}=@var{value}}
9119 syntax than as separate arguments.  For example, you can specify
9120 @samp{-Xlinker -Map=output.map} rather than
9121 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9122 this syntax for command-line options.
9123
9124 @item -Wl,@var{option}
9125 @opindex Wl
9126 Pass @var{option} as an option to the linker.  If @var{option} contains
9127 commas, it is split into multiple options at the commas.  You can use this
9128 syntax to pass an argument to the option.
9129 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
9130 linker.  When using the GNU linker, you can also get the same effect with
9131 @samp{-Wl,-Map=output.map}.
9132
9133 @item -u @var{symbol}
9134 @opindex u
9135 Pretend the symbol @var{symbol} is undefined, to force linking of
9136 library modules to define it.  You can use @option{-u} multiple times with
9137 different symbols to force loading of additional library modules.
9138 @end table
9139
9140 @node Directory Options
9141 @section Options for Directory Search
9142 @cindex directory options
9143 @cindex options, directory search
9144 @cindex search path
9145
9146 These options specify directories to search for header files, for
9147 libraries and for parts of the compiler:
9148
9149 @table @gcctabopt
9150 @item -I@var{dir}
9151 @opindex I
9152 Add the directory @var{dir} to the head of the list of directories to be
9153 searched for header files.  This can be used to override a system header
9154 file, substituting your own version, since these directories are
9155 searched before the system header file directories.  However, you should
9156 not use this option to add directories that contain vendor-supplied
9157 system header files (use @option{-isystem} for that).  If you use more than
9158 one @option{-I} option, the directories are scanned in left-to-right
9159 order; the standard system directories come after.
9160
9161 If a standard system include directory, or a directory specified with
9162 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9163 option will be ignored.  The directory will still be searched but as a
9164 system directory at its normal position in the system include chain.
9165 This is to ensure that GCC's procedure to fix buggy system headers and
9166 the ordering for the include_next directive are not inadvertently changed.
9167 If you really need to change the search order for system directories,
9168 use the @option{-nostdinc} and/or @option{-isystem} options.
9169
9170 @item -iplugindir=@var{dir}
9171 Set the directory to search for plugins which are passed
9172 by @option{-fplugin=@var{name}} instead of
9173 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9174 to be used by the user, but only passed by the driver.
9175
9176 @item -iquote@var{dir}
9177 @opindex iquote
9178 Add the directory @var{dir} to the head of the list of directories to
9179 be searched for header files only for the case of @samp{#include
9180 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9181 otherwise just like @option{-I}.
9182
9183 @item -L@var{dir}
9184 @opindex L
9185 Add directory @var{dir} to the list of directories to be searched
9186 for @option{-l}.
9187
9188 @item -B@var{prefix}
9189 @opindex B
9190 This option specifies where to find the executables, libraries,
9191 include files, and data files of the compiler itself.
9192
9193 The compiler driver program runs one or more of the subprograms
9194 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
9195 @var{prefix} as a prefix for each program it tries to run, both with and
9196 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9197
9198 For each subprogram to be run, the compiler driver first tries the
9199 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9200 was not specified, the driver tries two standard prefixes, which are
9201 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9202 those results in a file name that is found, the unmodified program
9203 name is searched for using the directories specified in your
9204 @env{PATH} environment variable.
9205
9206 The compiler will check to see if the path provided by the @option{-B}
9207 refers to a directory, and if necessary it will add a directory
9208 separator character at the end of the path.
9209
9210 @option{-B} prefixes that effectively specify directory names also apply
9211 to libraries in the linker, because the compiler translates these
9212 options into @option{-L} options for the linker.  They also apply to
9213 includes files in the preprocessor, because the compiler translates these
9214 options into @option{-isystem} options for the preprocessor.  In this case,
9215 the compiler appends @samp{include} to the prefix.
9216
9217 The run-time support file @file{libgcc.a} can also be searched for using
9218 the @option{-B} prefix, if needed.  If it is not found there, the two
9219 standard prefixes above are tried, and that is all.  The file is left
9220 out of the link if it is not found by those means.
9221
9222 Another way to specify a prefix much like the @option{-B} prefix is to use
9223 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9224 Variables}.
9225
9226 As a special kludge, if the path provided by @option{-B} is
9227 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9228 9, then it will be replaced by @file{[dir/]include}.  This is to help
9229 with boot-strapping the compiler.
9230
9231 @item -specs=@var{file}
9232 @opindex specs
9233 Process @var{file} after the compiler reads in the standard @file{specs}
9234 file, in order to override the defaults that the @file{gcc} driver
9235 program uses when determining what switches to pass to @file{cc1},
9236 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
9237 @option{-specs=@var{file}} can be specified on the command line, and they
9238 are processed in order, from left to right.
9239
9240 @item --sysroot=@var{dir}
9241 @opindex sysroot
9242 Use @var{dir} as the logical root directory for headers and libraries.
9243 For example, if the compiler would normally search for headers in
9244 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
9245 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9246
9247 If you use both this option and the @option{-isysroot} option, then
9248 the @option{--sysroot} option will apply to libraries, but the
9249 @option{-isysroot} option will apply to header files.
9250
9251 The GNU linker (beginning with version 2.16) has the necessary support
9252 for this option.  If your linker does not support this option, the
9253 header file aspect of @option{--sysroot} will still work, but the
9254 library aspect will not.
9255
9256 @item -I-
9257 @opindex I-
9258 This option has been deprecated.  Please use @option{-iquote} instead for
9259 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9260 Any directories you specify with @option{-I} options before the @option{-I-}
9261 option are searched only for the case of @samp{#include "@var{file}"};
9262 they are not searched for @samp{#include <@var{file}>}.
9263
9264 If additional directories are specified with @option{-I} options after
9265 the @option{-I-}, these directories are searched for all @samp{#include}
9266 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9267 this way.)
9268
9269 In addition, the @option{-I-} option inhibits the use of the current
9270 directory (where the current input file came from) as the first search
9271 directory for @samp{#include "@var{file}"}.  There is no way to
9272 override this effect of @option{-I-}.  With @option{-I.} you can specify
9273 searching the directory which was current when the compiler was
9274 invoked.  That is not exactly the same as what the preprocessor does
9275 by default, but it is often satisfactory.
9276
9277 @option{-I-} does not inhibit the use of the standard system directories
9278 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9279 independent.
9280 @end table
9281
9282 @c man end
9283
9284 @node Spec Files
9285 @section Specifying subprocesses and the switches to pass to them
9286 @cindex Spec Files
9287
9288 @command{gcc} is a driver program.  It performs its job by invoking a
9289 sequence of other programs to do the work of compiling, assembling and
9290 linking.  GCC interprets its command-line parameters and uses these to
9291 deduce which programs it should invoke, and which command-line options
9292 it ought to place on their command lines.  This behavior is controlled
9293 by @dfn{spec strings}.  In most cases there is one spec string for each
9294 program that GCC can invoke, but a few programs have multiple spec
9295 strings to control their behavior.  The spec strings built into GCC can
9296 be overridden by using the @option{-specs=} command-line switch to specify
9297 a spec file.
9298
9299 @dfn{Spec files} are plaintext files that are used to construct spec
9300 strings.  They consist of a sequence of directives separated by blank
9301 lines.  The type of directive is determined by the first non-whitespace
9302 character on the line and it can be one of the following:
9303
9304 @table @code
9305 @item %@var{command}
9306 Issues a @var{command} to the spec file processor.  The commands that can
9307 appear here are:
9308
9309 @table @code
9310 @item %include <@var{file}>
9311 @cindex %include
9312 Search for @var{file} and insert its text at the current point in the
9313 specs file.
9314
9315 @item %include_noerr <@var{file}>
9316 @cindex %include_noerr
9317 Just like @samp{%include}, but do not generate an error message if the include
9318 file cannot be found.
9319
9320 @item %rename @var{old_name} @var{new_name}
9321 @cindex %rename
9322 Rename the spec string @var{old_name} to @var{new_name}.
9323
9324 @end table
9325
9326 @item *[@var{spec_name}]:
9327 This tells the compiler to create, override or delete the named spec
9328 string.  All lines after this directive up to the next directive or
9329 blank line are considered to be the text for the spec string.  If this
9330 results in an empty string then the spec will be deleted.  (Or, if the
9331 spec did not exist, then nothing will happened.)  Otherwise, if the spec
9332 does not currently exist a new spec will be created.  If the spec does
9333 exist then its contents will be overridden by the text of this
9334 directive, unless the first character of that text is the @samp{+}
9335 character, in which case the text will be appended to the spec.
9336
9337 @item [@var{suffix}]:
9338 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9339 and up to the next directive or blank line are considered to make up the
9340 spec string for the indicated suffix.  When the compiler encounters an
9341 input file with the named suffix, it will processes the spec string in
9342 order to work out how to compile that file.  For example:
9343
9344 @smallexample
9345 .ZZ:
9346 z-compile -input %i
9347 @end smallexample
9348
9349 This says that any input file whose name ends in @samp{.ZZ} should be
9350 passed to the program @samp{z-compile}, which should be invoked with the
9351 command-line switch @option{-input} and with the result of performing the
9352 @samp{%i} substitution.  (See below.)
9353
9354 As an alternative to providing a spec string, the text that follows a
9355 suffix directive can be one of the following:
9356
9357 @table @code
9358 @item @@@var{language}
9359 This says that the suffix is an alias for a known @var{language}.  This is
9360 similar to using the @option{-x} command-line switch to GCC to specify a
9361 language explicitly.  For example:
9362
9363 @smallexample
9364 .ZZ:
9365 @@c++
9366 @end smallexample
9367
9368 Says that .ZZ files are, in fact, C++ source files.
9369
9370 @item #@var{name}
9371 This causes an error messages saying:
9372
9373 @smallexample
9374 @var{name} compiler not installed on this system.
9375 @end smallexample
9376 @end table
9377
9378 GCC already has an extensive list of suffixes built into it.
9379 This directive will add an entry to the end of the list of suffixes, but
9380 since the list is searched from the end backwards, it is effectively
9381 possible to override earlier entries using this technique.
9382
9383 @end table
9384
9385 GCC has the following spec strings built into it.  Spec files can
9386 override these strings or create their own.  Note that individual
9387 targets can also add their own spec strings to this list.
9388
9389 @smallexample
9390 asm          Options to pass to the assembler
9391 asm_final    Options to pass to the assembler post-processor
9392 cpp          Options to pass to the C preprocessor
9393 cc1          Options to pass to the C compiler
9394 cc1plus      Options to pass to the C++ compiler
9395 endfile      Object files to include at the end of the link
9396 link         Options to pass to the linker
9397 lib          Libraries to include on the command line to the linker
9398 libgcc       Decides which GCC support library to pass to the linker
9399 linker       Sets the name of the linker
9400 predefines   Defines to be passed to the C preprocessor
9401 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9402              by default
9403 startfile    Object files to include at the start of the link
9404 @end smallexample
9405
9406 Here is a small example of a spec file:
9407
9408 @smallexample
9409 %rename lib                 old_lib
9410
9411 *lib:
9412 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9413 @end smallexample
9414
9415 This example renames the spec called @samp{lib} to @samp{old_lib} and
9416 then overrides the previous definition of @samp{lib} with a new one.
9417 The new definition adds in some extra command-line options before
9418 including the text of the old definition.
9419
9420 @dfn{Spec strings} are a list of command-line options to be passed to their
9421 corresponding program.  In addition, the spec strings can contain
9422 @samp{%}-prefixed sequences to substitute variable text or to
9423 conditionally insert text into the command line.  Using these constructs
9424 it is possible to generate quite complex command lines.
9425
9426 Here is a table of all defined @samp{%}-sequences for spec
9427 strings.  Note that spaces are not generated automatically around the
9428 results of expanding these sequences.  Therefore you can concatenate them
9429 together or combine them with constant text in a single argument.
9430
9431 @table @code
9432 @item %%
9433 Substitute one @samp{%} into the program name or argument.
9434
9435 @item %i
9436 Substitute the name of the input file being processed.
9437
9438 @item %b
9439 Substitute the basename of the input file being processed.
9440 This is the substring up to (and not including) the last period
9441 and not including the directory.
9442
9443 @item %B
9444 This is the same as @samp{%b}, but include the file suffix (text after
9445 the last period).
9446
9447 @item %d
9448 Marks the argument containing or following the @samp{%d} as a
9449 temporary file name, so that that file will be deleted if GCC exits
9450 successfully.  Unlike @samp{%g}, this contributes no text to the
9451 argument.
9452
9453 @item %g@var{suffix}
9454 Substitute a file name that has suffix @var{suffix} and is chosen
9455 once per compilation, and mark the argument in the same way as
9456 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9457 name is now chosen in a way that is hard to predict even when previously
9458 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9459 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9460 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9461 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9462 was simply substituted with a file name chosen once per compilation,
9463 without regard to any appended suffix (which was therefore treated
9464 just like ordinary text), making such attacks more likely to succeed.
9465
9466 @item %u@var{suffix}
9467 Like @samp{%g}, but generates a new temporary file name even if
9468 @samp{%u@var{suffix}} was already seen.
9469
9470 @item %U@var{suffix}
9471 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9472 new one if there is no such last file name.  In the absence of any
9473 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9474 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9475 would involve the generation of two distinct file names, one
9476 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9477 simply substituted with a file name chosen for the previous @samp{%u},
9478 without regard to any appended suffix.
9479
9480 @item %j@var{suffix}
9481 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9482 writable, and if save-temps is off; otherwise, substitute the name
9483 of a temporary file, just like @samp{%u}.  This temporary file is not
9484 meant for communication between processes, but rather as a junk
9485 disposal mechanism.
9486
9487 @item %|@var{suffix}
9488 @itemx %m@var{suffix}
9489 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9490 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9491 all.  These are the two most common ways to instruct a program that it
9492 should read from standard input or write to standard output.  If you
9493 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9494 construct: see for example @file{f/lang-specs.h}.
9495
9496 @item %.@var{SUFFIX}
9497 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9498 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9499 terminated by the next space or %.
9500
9501 @item %w
9502 Marks the argument containing or following the @samp{%w} as the
9503 designated output file of this compilation.  This puts the argument
9504 into the sequence of arguments that @samp{%o} will substitute later.
9505
9506 @item %o
9507 Substitutes the names of all the output files, with spaces
9508 automatically placed around them.  You should write spaces
9509 around the @samp{%o} as well or the results are undefined.
9510 @samp{%o} is for use in the specs for running the linker.
9511 Input files whose names have no recognized suffix are not compiled
9512 at all, but they are included among the output files, so they will
9513 be linked.
9514
9515 @item %O
9516 Substitutes the suffix for object files.  Note that this is
9517 handled specially when it immediately follows @samp{%g, %u, or %U},
9518 because of the need for those to form complete file names.  The
9519 handling is such that @samp{%O} is treated exactly as if it had already
9520 been substituted, except that @samp{%g, %u, and %U} do not currently
9521 support additional @var{suffix} characters following @samp{%O} as they would
9522 following, for example, @samp{.o}.
9523
9524 @item %p
9525 Substitutes the standard macro predefinitions for the
9526 current target machine.  Use this when running @code{cpp}.
9527
9528 @item %P
9529 Like @samp{%p}, but puts @samp{__} before and after the name of each
9530 predefined macro, except for macros that start with @samp{__} or with
9531 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
9532 C@.
9533
9534 @item %I
9535 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
9536 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
9537 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
9538 and @option{-imultilib} as necessary.
9539
9540 @item %s
9541 Current argument is the name of a library or startup file of some sort.
9542 Search for that file in a standard list of directories and substitute
9543 the full name found.  The current working directory is included in the
9544 list of directories scanned.
9545
9546 @item %T
9547 Current argument is the name of a linker script.  Search for that file
9548 in the current list of directories to scan for libraries. If the file
9549 is located insert a @option{--script} option into the command line
9550 followed by the full path name found.  If the file is not found then
9551 generate an error message.  Note: the current working directory is not
9552 searched.
9553
9554 @item %e@var{str}
9555 Print @var{str} as an error message.  @var{str} is terminated by a newline.
9556 Use this when inconsistent options are detected.
9557
9558 @item %(@var{name})
9559 Substitute the contents of spec string @var{name} at this point.
9560
9561 @item %[@var{name}]
9562 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
9563
9564 @item %x@{@var{option}@}
9565 Accumulate an option for @samp{%X}.
9566
9567 @item %X
9568 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
9569 spec string.
9570
9571 @item %Y
9572 Output the accumulated assembler options specified by @option{-Wa}.
9573
9574 @item %Z
9575 Output the accumulated preprocessor options specified by @option{-Wp}.
9576
9577 @item %a
9578 Process the @code{asm} spec.  This is used to compute the
9579 switches to be passed to the assembler.
9580
9581 @item %A
9582 Process the @code{asm_final} spec.  This is a spec string for
9583 passing switches to an assembler post-processor, if such a program is
9584 needed.
9585
9586 @item %l
9587 Process the @code{link} spec.  This is the spec for computing the
9588 command line passed to the linker.  Typically it will make use of the
9589 @samp{%L %G %S %D and %E} sequences.
9590
9591 @item %D
9592 Dump out a @option{-L} option for each directory that GCC believes might
9593 contain startup files.  If the target supports multilibs then the
9594 current multilib directory will be prepended to each of these paths.
9595
9596 @item %L
9597 Process the @code{lib} spec.  This is a spec string for deciding which
9598 libraries should be included on the command line to the linker.
9599
9600 @item %G
9601 Process the @code{libgcc} spec.  This is a spec string for deciding
9602 which GCC support library should be included on the command line to the linker.
9603
9604 @item %S
9605 Process the @code{startfile} spec.  This is a spec for deciding which
9606 object files should be the first ones passed to the linker.  Typically
9607 this might be a file named @file{crt0.o}.
9608
9609 @item %E
9610 Process the @code{endfile} spec.  This is a spec string that specifies
9611 the last object files that will be passed to the linker.
9612
9613 @item %C
9614 Process the @code{cpp} spec.  This is used to construct the arguments
9615 to be passed to the C preprocessor.
9616
9617 @item %1
9618 Process the @code{cc1} spec.  This is used to construct the options to be
9619 passed to the actual C compiler (@samp{cc1}).
9620
9621 @item %2
9622 Process the @code{cc1plus} spec.  This is used to construct the options to be
9623 passed to the actual C++ compiler (@samp{cc1plus}).
9624
9625 @item %*
9626 Substitute the variable part of a matched option.  See below.
9627 Note that each comma in the substituted string is replaced by
9628 a single space.
9629
9630 @item %<@code{S}
9631 Remove all occurrences of @code{-S} from the command line.  Note---this
9632 command is position dependent.  @samp{%} commands in the spec string
9633 before this one will see @code{-S}, @samp{%} commands in the spec string
9634 after this one will not.
9635
9636 @item %:@var{function}(@var{args})
9637 Call the named function @var{function}, passing it @var{args}.
9638 @var{args} is first processed as a nested spec string, then split
9639 into an argument vector in the usual fashion.  The function returns
9640 a string which is processed as if it had appeared literally as part
9641 of the current spec.
9642
9643 The following built-in spec functions are provided:
9644
9645 @table @code
9646 @item @code{getenv}
9647 The @code{getenv} spec function takes two arguments: an environment
9648 variable name and a string.  If the environment variable is not
9649 defined, a fatal error is issued.  Otherwise, the return value is the
9650 value of the environment variable concatenated with the string.  For
9651 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
9652
9653 @smallexample
9654 %:getenv(TOPDIR /include)
9655 @end smallexample
9656
9657 expands to @file{/path/to/top/include}.
9658
9659 @item @code{if-exists}
9660 The @code{if-exists} spec function takes one argument, an absolute
9661 pathname to a file.  If the file exists, @code{if-exists} returns the
9662 pathname.  Here is a small example of its usage:
9663
9664 @smallexample
9665 *startfile:
9666 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
9667 @end smallexample
9668
9669 @item @code{if-exists-else}
9670 The @code{if-exists-else} spec function is similar to the @code{if-exists}
9671 spec function, except that it takes two arguments.  The first argument is
9672 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
9673 returns the pathname.  If it does not exist, it returns the second argument.
9674 This way, @code{if-exists-else} can be used to select one file or another,
9675 based on the existence of the first.  Here is a small example of its usage:
9676
9677 @smallexample
9678 *startfile:
9679 crt0%O%s %:if-exists(crti%O%s) \
9680 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
9681 @end smallexample
9682
9683 @item @code{replace-outfile}
9684 The @code{replace-outfile} spec function takes two arguments.  It looks for the
9685 first argument in the outfiles array and replaces it with the second argument.  Here
9686 is a small example of its usage:
9687
9688 @smallexample
9689 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
9690 @end smallexample
9691
9692 @item @code{remove-outfile}
9693 The @code{remove-outfile} spec function takes one argument.  It looks for the
9694 first argument in the outfiles array and removes it.  Here is a small example
9695 its usage:
9696
9697 @smallexample
9698 %:remove-outfile(-lm)
9699 @end smallexample
9700
9701 @item @code{print-asm-header}
9702 The @code{print-asm-header} function takes no arguments and simply
9703 prints a banner like:
9704
9705 @smallexample
9706 Assembler options
9707 =================
9708
9709 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
9710 @end smallexample
9711
9712 It is used to separate compiler options from assembler options
9713 in the @option{--target-help} output.
9714 @end table
9715
9716 @item %@{@code{S}@}
9717 Substitutes the @code{-S} switch, if that switch was given to GCC@.
9718 If that switch was not specified, this substitutes nothing.  Note that
9719 the leading dash is omitted when specifying this option, and it is
9720 automatically inserted if the substitution is performed.  Thus the spec
9721 string @samp{%@{foo@}} would match the command-line option @option{-foo}
9722 and would output the command line option @option{-foo}.
9723
9724 @item %W@{@code{S}@}
9725 Like %@{@code{S}@} but mark last argument supplied within as a file to be
9726 deleted on failure.
9727
9728 @item %@{@code{S}*@}
9729 Substitutes all the switches specified to GCC whose names start
9730 with @code{-S}, but which also take an argument.  This is used for
9731 switches like @option{-o}, @option{-D}, @option{-I}, etc.
9732 GCC considers @option{-o foo} as being
9733 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
9734 text, including the space.  Thus two arguments would be generated.
9735
9736 @item %@{@code{S}*&@code{T}*@}
9737 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
9738 (the order of @code{S} and @code{T} in the spec is not significant).
9739 There can be any number of ampersand-separated variables; for each the
9740 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
9741
9742 @item %@{@code{S}:@code{X}@}
9743 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
9744
9745 @item %@{!@code{S}:@code{X}@}
9746 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
9747
9748 @item %@{@code{S}*:@code{X}@}
9749 Substitutes @code{X} if one or more switches whose names start with
9750 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
9751 once, no matter how many such switches appeared.  However, if @code{%*}
9752 appears somewhere in @code{X}, then @code{X} will be substituted once
9753 for each matching switch, with the @code{%*} replaced by the part of
9754 that switch that matched the @code{*}.
9755
9756 @item %@{.@code{S}:@code{X}@}
9757 Substitutes @code{X}, if processing a file with suffix @code{S}.
9758
9759 @item %@{!.@code{S}:@code{X}@}
9760 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
9761
9762 @item %@{,@code{S}:@code{X}@}
9763 Substitutes @code{X}, if processing a file for language @code{S}.
9764
9765 @item %@{!,@code{S}:@code{X}@}
9766 Substitutes @code{X}, if not processing a file for language @code{S}.
9767
9768 @item %@{@code{S}|@code{P}:@code{X}@}
9769 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
9770 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
9771 @code{*} sequences as well, although they have a stronger binding than
9772 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
9773 alternatives must be starred, and only the first matching alternative
9774 is substituted.
9775
9776 For example, a spec string like this:
9777
9778 @smallexample
9779 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
9780 @end smallexample
9781
9782 will output the following command-line options from the following input
9783 command-line options:
9784
9785 @smallexample
9786 fred.c        -foo -baz
9787 jim.d         -bar -boggle
9788 -d fred.c     -foo -baz -boggle
9789 -d jim.d      -bar -baz -boggle
9790 @end smallexample
9791
9792 @item %@{S:X; T:Y; :D@}
9793
9794 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
9795 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
9796 be as many clauses as you need.  This may be combined with @code{.},
9797 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
9798
9799
9800 @end table
9801
9802 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
9803 construct may contain other nested @samp{%} constructs or spaces, or
9804 even newlines.  They are processed as usual, as described above.
9805 Trailing white space in @code{X} is ignored.  White space may also
9806 appear anywhere on the left side of the colon in these constructs,
9807 except between @code{.} or @code{*} and the corresponding word.
9808
9809 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
9810 handled specifically in these constructs.  If another value of
9811 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
9812 @option{-W} switch is found later in the command line, the earlier
9813 switch value is ignored, except with @{@code{S}*@} where @code{S} is
9814 just one letter, which passes all matching options.
9815
9816 The character @samp{|} at the beginning of the predicate text is used to
9817 indicate that a command should be piped to the following command, but
9818 only if @option{-pipe} is specified.
9819
9820 It is built into GCC which switches take arguments and which do not.
9821 (You might think it would be useful to generalize this to allow each
9822 compiler's spec to say which switches take arguments.  But this cannot
9823 be done in a consistent fashion.  GCC cannot even decide which input
9824 files have been specified without knowing which switches take arguments,
9825 and it must know which input files to compile in order to tell which
9826 compilers to run).
9827
9828 GCC also knows implicitly that arguments starting in @option{-l} are to be
9829 treated as compiler output files, and passed to the linker in their
9830 proper position among the other output files.
9831
9832 @c man begin OPTIONS
9833
9834 @node Target Options
9835 @section Specifying Target Machine and Compiler Version
9836 @cindex target options
9837 @cindex cross compiling
9838 @cindex specifying machine version
9839 @cindex specifying compiler version and target machine
9840 @cindex compiler version, specifying
9841 @cindex target machine, specifying
9842
9843 The usual way to run GCC is to run the executable called @file{gcc}, or
9844 @file{<machine>-gcc} when cross-compiling, or
9845 @file{<machine>-gcc-<version>} to run a version other than the one that
9846 was installed last.
9847
9848 @node Submodel Options
9849 @section Hardware Models and Configurations
9850 @cindex submodel options
9851 @cindex specifying hardware config
9852 @cindex hardware models and configurations, specifying
9853 @cindex machine dependent options
9854
9855 Each target machine types can have its own
9856 special options, starting with @samp{-m}, to choose among various
9857 hardware models or configurations---for example, 68010 vs 68020,
9858 floating coprocessor or none.  A single installed version of the
9859 compiler can compile for any model or configuration, according to the
9860 options specified.
9861
9862 Some configurations of the compiler also support additional special
9863 options, usually for compatibility with other compilers on the same
9864 platform.
9865
9866 @c This list is ordered alphanumerically by subsection name.
9867 @c It should be the same order and spelling as these options are listed
9868 @c in Machine Dependent Options
9869
9870 @menu
9871 * ARC Options::
9872 * ARM Options::
9873 * AVR Options::
9874 * Blackfin Options::
9875 * CRIS Options::
9876 * CRX Options::
9877 * Darwin Options::
9878 * DEC Alpha Options::
9879 * DEC Alpha/VMS Options::
9880 * FR30 Options::
9881 * FRV Options::
9882 * GNU/Linux Options::
9883 * H8/300 Options::
9884 * HPPA Options::
9885 * i386 and x86-64 Options::
9886 * i386 and x86-64 Windows Options::
9887 * IA-64 Options::
9888 * IA-64/VMS Options::
9889 * LM32 Options::
9890 * M32C Options::
9891 * M32R/D Options::
9892 * M680x0 Options::
9893 * M68hc1x Options::
9894 * MCore Options::
9895 * MeP Options::
9896 * MIPS Options::
9897 * MMIX Options::
9898 * MN10300 Options::
9899 * PDP-11 Options::
9900 * picoChip Options::
9901 * PowerPC Options::
9902 * RS/6000 and PowerPC Options::
9903 * RX Options::
9904 * S/390 and zSeries Options::
9905 * Score Options::
9906 * SH Options::
9907 * SPARC Options::
9908 * SPU Options::
9909 * System V Options::
9910 * V850 Options::
9911 * VAX Options::
9912 * VxWorks Options::
9913 * x86-64 Options::
9914 * Xstormy16 Options::
9915 * Xtensa Options::
9916 * zSeries Options::
9917 @end menu
9918
9919 @node ARC Options
9920 @subsection ARC Options
9921 @cindex ARC Options
9922
9923 These options are defined for ARC implementations:
9924
9925 @table @gcctabopt
9926 @item -EL
9927 @opindex EL
9928 Compile code for little endian mode.  This is the default.
9929
9930 @item -EB
9931 @opindex EB
9932 Compile code for big endian mode.
9933
9934 @item -mmangle-cpu
9935 @opindex mmangle-cpu
9936 Prepend the name of the cpu to all public symbol names.
9937 In multiple-processor systems, there are many ARC variants with different
9938 instruction and register set characteristics.  This flag prevents code
9939 compiled for one cpu to be linked with code compiled for another.
9940 No facility exists for handling variants that are ``almost identical''.
9941 This is an all or nothing option.
9942
9943 @item -mcpu=@var{cpu}
9944 @opindex mcpu
9945 Compile code for ARC variant @var{cpu}.
9946 Which variants are supported depend on the configuration.
9947 All variants support @option{-mcpu=base}, this is the default.
9948
9949 @item -mtext=@var{text-section}
9950 @itemx -mdata=@var{data-section}
9951 @itemx -mrodata=@var{readonly-data-section}
9952 @opindex mtext
9953 @opindex mdata
9954 @opindex mrodata
9955 Put functions, data, and readonly data in @var{text-section},
9956 @var{data-section}, and @var{readonly-data-section} respectively
9957 by default.  This can be overridden with the @code{section} attribute.
9958 @xref{Variable Attributes}.
9959
9960 @end table
9961
9962 @node ARM Options
9963 @subsection ARM Options
9964 @cindex ARM options
9965
9966 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
9967 architectures:
9968
9969 @table @gcctabopt
9970 @item -mabi=@var{name}
9971 @opindex mabi
9972 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
9973 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
9974
9975 @item -mapcs-frame
9976 @opindex mapcs-frame
9977 Generate a stack frame that is compliant with the ARM Procedure Call
9978 Standard for all functions, even if this is not strictly necessary for
9979 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
9980 with this option will cause the stack frames not to be generated for
9981 leaf functions.  The default is @option{-mno-apcs-frame}.
9982
9983 @item -mapcs
9984 @opindex mapcs
9985 This is a synonym for @option{-mapcs-frame}.
9986
9987 @ignore
9988 @c not currently implemented
9989 @item -mapcs-stack-check
9990 @opindex mapcs-stack-check
9991 Generate code to check the amount of stack space available upon entry to
9992 every function (that actually uses some stack space).  If there is
9993 insufficient space available then either the function
9994 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
9995 called, depending upon the amount of stack space required.  The run time
9996 system is required to provide these functions.  The default is
9997 @option{-mno-apcs-stack-check}, since this produces smaller code.
9998
9999 @c not currently implemented
10000 @item -mapcs-float
10001 @opindex mapcs-float
10002 Pass floating point arguments using the float point registers.  This is
10003 one of the variants of the APCS@.  This option is recommended if the
10004 target hardware has a floating point unit or if a lot of floating point
10005 arithmetic is going to be performed by the code.  The default is
10006 @option{-mno-apcs-float}, since integer only code is slightly increased in
10007 size if @option{-mapcs-float} is used.
10008
10009 @c not currently implemented
10010 @item -mapcs-reentrant
10011 @opindex mapcs-reentrant
10012 Generate reentrant, position independent code.  The default is
10013 @option{-mno-apcs-reentrant}.
10014 @end ignore
10015
10016 @item -mthumb-interwork
10017 @opindex mthumb-interwork
10018 Generate code which supports calling between the ARM and Thumb
10019 instruction sets.  Without this option the two instruction sets cannot
10020 be reliably used inside one program.  The default is
10021 @option{-mno-thumb-interwork}, since slightly larger code is generated
10022 when @option{-mthumb-interwork} is specified.
10023
10024 @item -mno-sched-prolog
10025 @opindex mno-sched-prolog
10026 Prevent the reordering of instructions in the function prolog, or the
10027 merging of those instruction with the instructions in the function's
10028 body.  This means that all functions will start with a recognizable set
10029 of instructions (or in fact one of a choice from a small set of
10030 different function prologues), and this information can be used to
10031 locate the start if functions inside an executable piece of code.  The
10032 default is @option{-msched-prolog}.
10033
10034 @item -mfloat-abi=@var{name}
10035 @opindex mfloat-abi
10036 Specifies which floating-point ABI to use.  Permissible values
10037 are: @samp{soft}, @samp{softfp} and @samp{hard}.
10038
10039 Specifying @samp{soft} causes GCC to generate output containing
10040 library calls for floating-point operations.
10041 @samp{softfp} allows the generation of code using hardware floating-point
10042 instructions, but still uses the soft-float calling conventions.
10043 @samp{hard} allows generation of floating-point instructions
10044 and uses FPU-specific calling conventions.
10045
10046 The default depends on the specific target configuration.  Note that
10047 the hard-float and soft-float ABIs are not link-compatible; you must
10048 compile your entire program with the same ABI, and link with a
10049 compatible set of libraries.
10050
10051 @item -mhard-float
10052 @opindex mhard-float
10053 Equivalent to @option{-mfloat-abi=hard}.
10054
10055 @item -msoft-float
10056 @opindex msoft-float
10057 Equivalent to @option{-mfloat-abi=soft}.
10058
10059 @item -mlittle-endian
10060 @opindex mlittle-endian
10061 Generate code for a processor running in little-endian mode.  This is
10062 the default for all standard configurations.
10063
10064 @item -mbig-endian
10065 @opindex mbig-endian
10066 Generate code for a processor running in big-endian mode; the default is
10067 to compile code for a little-endian processor.
10068
10069 @item -mwords-little-endian
10070 @opindex mwords-little-endian
10071 This option only applies when generating code for big-endian processors.
10072 Generate code for a little-endian word order but a big-endian byte
10073 order.  That is, a byte order of the form @samp{32107654}.  Note: this
10074 option should only be used if you require compatibility with code for
10075 big-endian ARM processors generated by versions of the compiler prior to
10076 2.8.
10077
10078 @item -mcpu=@var{name}
10079 @opindex mcpu
10080 This specifies the name of the target ARM processor.  GCC uses this name
10081 to determine what kind of instructions it can emit when generating
10082 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
10083 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
10084 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
10085 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
10086 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
10087 @samp{arm720},
10088 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
10089 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
10090 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
10091 @samp{strongarm1110},
10092 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
10093 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
10094 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
10095 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
10096 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
10097 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
10098 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
10099 @samp{cortex-a5}, @samp{cortex-a8}, @samp{cortex-a9},
10100 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m4}, @samp{cortex-m3},
10101 @samp{cortex-m1},
10102 @samp{cortex-m0},
10103 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10104
10105 @item -mtune=@var{name}
10106 @opindex mtune
10107 This option is very similar to the @option{-mcpu=} option, except that
10108 instead of specifying the actual target processor type, and hence
10109 restricting which instructions can be used, it specifies that GCC should
10110 tune the performance of the code as if the target were of the type
10111 specified in this option, but still choosing the instructions that it
10112 will generate based on the cpu specified by a @option{-mcpu=} option.
10113 For some ARM implementations better performance can be obtained by using
10114 this option.
10115
10116 @item -march=@var{name}
10117 @opindex march
10118 This specifies the name of the target ARM architecture.  GCC uses this
10119 name to determine what kind of instructions it can emit when generating
10120 assembly code.  This option can be used in conjunction with or instead
10121 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
10122 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
10123 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
10124 @samp{armv6}, @samp{armv6j},
10125 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
10126 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
10127 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10128
10129 @item -mfpu=@var{name}
10130 @itemx -mfpe=@var{number}
10131 @itemx -mfp=@var{number}
10132 @opindex mfpu
10133 @opindex mfpe
10134 @opindex mfp
10135 This specifies what floating point hardware (or hardware emulation) is
10136 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
10137 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
10138 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
10139 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
10140 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
10141 @option{-mfp} and @option{-mfpe} are synonyms for
10142 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
10143 of GCC@.
10144
10145 If @option{-msoft-float} is specified this specifies the format of
10146 floating point values.
10147
10148 If the selected floating-point hardware includes the NEON extension
10149 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
10150 operations will not be used by GCC's auto-vectorization pass unless
10151 @option{-funsafe-math-optimizations} is also specified.  This is
10152 because NEON hardware does not fully implement the IEEE 754 standard for
10153 floating-point arithmetic (in particular denormal values are treated as
10154 zero), so the use of NEON instructions may lead to a loss of precision.
10155
10156 @item -mfp16-format=@var{name}
10157 @opindex mfp16-format
10158 Specify the format of the @code{__fp16} half-precision floating-point type.
10159 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
10160 the default is @samp{none}, in which case the @code{__fp16} type is not
10161 defined.  @xref{Half-Precision}, for more information.
10162
10163 @item -mstructure-size-boundary=@var{n}
10164 @opindex mstructure-size-boundary
10165 The size of all structures and unions will be rounded up to a multiple
10166 of the number of bits set by this option.  Permissible values are 8, 32
10167 and 64.  The default value varies for different toolchains.  For the COFF
10168 targeted toolchain the default value is 8.  A value of 64 is only allowed
10169 if the underlying ABI supports it.
10170
10171 Specifying the larger number can produce faster, more efficient code, but
10172 can also increase the size of the program.  Different values are potentially
10173 incompatible.  Code compiled with one value cannot necessarily expect to
10174 work with code or libraries compiled with another value, if they exchange
10175 information using structures or unions.
10176
10177 @item -mabort-on-noreturn
10178 @opindex mabort-on-noreturn
10179 Generate a call to the function @code{abort} at the end of a
10180 @code{noreturn} function.  It will be executed if the function tries to
10181 return.
10182
10183 @item -mlong-calls
10184 @itemx -mno-long-calls
10185 @opindex mlong-calls
10186 @opindex mno-long-calls
10187 Tells the compiler to perform function calls by first loading the
10188 address of the function into a register and then performing a subroutine
10189 call on this register.  This switch is needed if the target function
10190 will lie outside of the 64 megabyte addressing range of the offset based
10191 version of subroutine call instruction.
10192
10193 Even if this switch is enabled, not all function calls will be turned
10194 into long calls.  The heuristic is that static functions, functions
10195 which have the @samp{short-call} attribute, functions that are inside
10196 the scope of a @samp{#pragma no_long_calls} directive and functions whose
10197 definitions have already been compiled within the current compilation
10198 unit, will not be turned into long calls.  The exception to this rule is
10199 that weak function definitions, functions with the @samp{long-call}
10200 attribute or the @samp{section} attribute, and functions that are within
10201 the scope of a @samp{#pragma long_calls} directive, will always be
10202 turned into long calls.
10203
10204 This feature is not enabled by default.  Specifying
10205 @option{-mno-long-calls} will restore the default behavior, as will
10206 placing the function calls within the scope of a @samp{#pragma
10207 long_calls_off} directive.  Note these switches have no effect on how
10208 the compiler generates code to handle function calls via function
10209 pointers.
10210
10211 @item -msingle-pic-base
10212 @opindex msingle-pic-base
10213 Treat the register used for PIC addressing as read-only, rather than
10214 loading it in the prologue for each function.  The run-time system is
10215 responsible for initializing this register with an appropriate value
10216 before execution begins.
10217
10218 @item -mpic-register=@var{reg}
10219 @opindex mpic-register
10220 Specify the register to be used for PIC addressing.  The default is R10
10221 unless stack-checking is enabled, when R9 is used.
10222
10223 @item -mcirrus-fix-invalid-insns
10224 @opindex mcirrus-fix-invalid-insns
10225 @opindex mno-cirrus-fix-invalid-insns
10226 Insert NOPs into the instruction stream to in order to work around
10227 problems with invalid Maverick instruction combinations.  This option
10228 is only valid if the @option{-mcpu=ep9312} option has been used to
10229 enable generation of instructions for the Cirrus Maverick floating
10230 point co-processor.  This option is not enabled by default, since the
10231 problem is only present in older Maverick implementations.  The default
10232 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10233 switch.
10234
10235 @item -mpoke-function-name
10236 @opindex mpoke-function-name
10237 Write the name of each function into the text section, directly
10238 preceding the function prologue.  The generated code is similar to this:
10239
10240 @smallexample
10241      t0
10242          .ascii "arm_poke_function_name", 0
10243          .align
10244      t1
10245          .word 0xff000000 + (t1 - t0)
10246      arm_poke_function_name
10247          mov     ip, sp
10248          stmfd   sp!, @{fp, ip, lr, pc@}
10249          sub     fp, ip, #4
10250 @end smallexample
10251
10252 When performing a stack backtrace, code can inspect the value of
10253 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10254 location @code{pc - 12} and the top 8 bits are set, then we know that
10255 there is a function name embedded immediately preceding this location
10256 and has length @code{((pc[-3]) & 0xff000000)}.
10257
10258 @item -mthumb
10259 @opindex mthumb
10260 Generate code for the Thumb instruction set.  The default is to
10261 use the 32-bit ARM instruction set.
10262 This option automatically enables either 16-bit Thumb-1 or
10263 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
10264 and @option{-march=@var{name}} options.  This option is not passed to the
10265 assembler. If you want to force assembler files to be interpreted as Thumb code,
10266 either add a @samp{.thumb} directive to the source or pass the @option{-mthumb}
10267 option directly to the assembler by prefixing it with @option{-Wa}.
10268
10269 @item -mtpcs-frame
10270 @opindex mtpcs-frame
10271 Generate a stack frame that is compliant with the Thumb Procedure Call
10272 Standard for all non-leaf functions.  (A leaf function is one that does
10273 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10274
10275 @item -mtpcs-leaf-frame
10276 @opindex mtpcs-leaf-frame
10277 Generate a stack frame that is compliant with the Thumb Procedure Call
10278 Standard for all leaf functions.  (A leaf function is one that does
10279 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10280
10281 @item -mcallee-super-interworking
10282 @opindex mcallee-super-interworking
10283 Gives all externally visible functions in the file being compiled an ARM
10284 instruction set header which switches to Thumb mode before executing the
10285 rest of the function.  This allows these functions to be called from
10286 non-interworking code.  This option is not valid in AAPCS configurations
10287 because interworking is enabled by default.
10288
10289 @item -mcaller-super-interworking
10290 @opindex mcaller-super-interworking
10291 Allows calls via function pointers (including virtual functions) to
10292 execute correctly regardless of whether the target code has been
10293 compiled for interworking or not.  There is a small overhead in the cost
10294 of executing a function pointer if this option is enabled.  This option
10295 is not valid in AAPCS configurations because interworking is enabled
10296 by default.
10297
10298 @item -mtp=@var{name}
10299 @opindex mtp
10300 Specify the access model for the thread local storage pointer.  The valid
10301 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10302 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10303 (supported in the arm6k architecture), and @option{auto}, which uses the
10304 best available method for the selected processor.  The default setting is
10305 @option{auto}.
10306
10307 @item -mword-relocations
10308 @opindex mword-relocations
10309 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
10310 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10311 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10312 is specified.
10313
10314 @item -mfix-cortex-m3-ldrd
10315 @opindex mfix-cortex-m3-ldrd
10316 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10317 with overlapping destination and base registers are used.  This option avoids
10318 generating these instructions.  This option is enabled by default when
10319 @option{-mcpu=cortex-m3} is specified.
10320
10321 @end table
10322
10323 @node AVR Options
10324 @subsection AVR Options
10325 @cindex AVR Options
10326
10327 These options are defined for AVR implementations:
10328
10329 @table @gcctabopt
10330 @item -mmcu=@var{mcu}
10331 @opindex mmcu
10332 Specify ATMEL AVR instruction set or MCU type.
10333
10334 Instruction set avr1 is for the minimal AVR core, not supported by the C
10335 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
10336 attiny11, attiny12, attiny15, attiny28).
10337
10338 Instruction set avr2 (default) is for the classic AVR core with up to
10339 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
10340 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
10341 at90c8534, at90s8535).
10342
10343 Instruction set avr3 is for the classic AVR core with up to 128K program
10344 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
10345
10346 Instruction set avr4 is for the enhanced AVR core with up to 8K program
10347 memory space (MCU types: atmega8, atmega83, atmega85).
10348
10349 Instruction set avr5 is for the enhanced AVR core with up to 128K program
10350 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
10351 atmega64, atmega128, at43usb355, at94k).
10352
10353 @item -mno-interrupts
10354 @opindex mno-interrupts
10355 Generated code is not compatible with hardware interrupts.
10356 Code size will be smaller.
10357
10358 @item -mcall-prologues
10359 @opindex mcall-prologues
10360 Functions prologues/epilogues expanded as call to appropriate
10361 subroutines.  Code size will be smaller.
10362
10363 @item -mtiny-stack
10364 @opindex mtiny-stack
10365 Change only the low 8 bits of the stack pointer.
10366
10367 @item -mint8
10368 @opindex mint8
10369 Assume int to be 8 bit integer.  This affects the sizes of all types: A
10370 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
10371 and long long will be 4 bytes.  Please note that this option does not
10372 comply to the C standards, but it will provide you with smaller code
10373 size.
10374 @end table
10375
10376 @node Blackfin Options
10377 @subsection Blackfin Options
10378 @cindex Blackfin Options
10379
10380 @table @gcctabopt
10381 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
10382 @opindex mcpu=
10383 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
10384 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
10385 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
10386 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
10387 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
10388 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
10389 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
10390 @samp{bf561}.
10391 The optional @var{sirevision} specifies the silicon revision of the target
10392 Blackfin processor.  Any workarounds available for the targeted silicon revision
10393 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
10394 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
10395 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
10396 hexadecimal digits representing the major and minor numbers in the silicon
10397 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
10398 is not defined.  If @var{sirevision} is @samp{any}, the
10399 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
10400 If this optional @var{sirevision} is not used, GCC assumes the latest known
10401 silicon revision of the targeted Blackfin processor.
10402
10403 Support for @samp{bf561} is incomplete.  For @samp{bf561},
10404 Only the processor macro is defined.
10405 Without this option, @samp{bf532} is used as the processor by default.
10406 The corresponding predefined processor macros for @var{cpu} is to
10407 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
10408 provided by libgloss to be linked in if @option{-msim} is not given.
10409
10410 @item -msim
10411 @opindex msim
10412 Specifies that the program will be run on the simulator.  This causes
10413 the simulator BSP provided by libgloss to be linked in.  This option
10414 has effect only for @samp{bfin-elf} toolchain.
10415 Certain other options, such as @option{-mid-shared-library} and
10416 @option{-mfdpic}, imply @option{-msim}.
10417
10418 @item -momit-leaf-frame-pointer
10419 @opindex momit-leaf-frame-pointer
10420 Don't keep the frame pointer in a register for leaf functions.  This
10421 avoids the instructions to save, set up and restore frame pointers and
10422 makes an extra register available in leaf functions.  The option
10423 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10424 which might make debugging harder.
10425
10426 @item -mspecld-anomaly
10427 @opindex mspecld-anomaly
10428 When enabled, the compiler will ensure that the generated code does not
10429 contain speculative loads after jump instructions. If this option is used,
10430 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
10431
10432 @item -mno-specld-anomaly
10433 @opindex mno-specld-anomaly
10434 Don't generate extra code to prevent speculative loads from occurring.
10435
10436 @item -mcsync-anomaly
10437 @opindex mcsync-anomaly
10438 When enabled, the compiler will ensure that the generated code does not
10439 contain CSYNC or SSYNC instructions too soon after conditional branches.
10440 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
10441
10442 @item -mno-csync-anomaly
10443 @opindex mno-csync-anomaly
10444 Don't generate extra code to prevent CSYNC or SSYNC instructions from
10445 occurring too soon after a conditional branch.
10446
10447 @item -mlow-64k
10448 @opindex mlow-64k
10449 When enabled, the compiler is free to take advantage of the knowledge that
10450 the entire program fits into the low 64k of memory.
10451
10452 @item -mno-low-64k
10453 @opindex mno-low-64k
10454 Assume that the program is arbitrarily large.  This is the default.
10455
10456 @item -mstack-check-l1
10457 @opindex mstack-check-l1
10458 Do stack checking using information placed into L1 scratchpad memory by the
10459 uClinux kernel.
10460
10461 @item -mid-shared-library
10462 @opindex mid-shared-library
10463 Generate code that supports shared libraries via the library ID method.
10464 This allows for execute in place and shared libraries in an environment
10465 without virtual memory management.  This option implies @option{-fPIC}.
10466 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10467
10468 @item -mno-id-shared-library
10469 @opindex mno-id-shared-library
10470 Generate code that doesn't assume ID based shared libraries are being used.
10471 This is the default.
10472
10473 @item -mleaf-id-shared-library
10474 @opindex mleaf-id-shared-library
10475 Generate code that supports shared libraries via the library ID method,
10476 but assumes that this library or executable won't link against any other
10477 ID shared libraries.  That allows the compiler to use faster code for jumps
10478 and calls.
10479
10480 @item -mno-leaf-id-shared-library
10481 @opindex mno-leaf-id-shared-library
10482 Do not assume that the code being compiled won't link against any ID shared
10483 libraries.  Slower code will be generated for jump and call insns.
10484
10485 @item -mshared-library-id=n
10486 @opindex mshared-library-id
10487 Specified the identification number of the ID based shared library being
10488 compiled.  Specifying a value of 0 will generate more compact code, specifying
10489 other values will force the allocation of that number to the current
10490 library but is no more space or time efficient than omitting this option.
10491
10492 @item -msep-data
10493 @opindex msep-data
10494 Generate code that allows the data segment to be located in a different
10495 area of memory from the text segment.  This allows for execute in place in
10496 an environment without virtual memory management by eliminating relocations
10497 against the text section.
10498
10499 @item -mno-sep-data
10500 @opindex mno-sep-data
10501 Generate code that assumes that the data segment follows the text segment.
10502 This is the default.
10503
10504 @item -mlong-calls
10505 @itemx -mno-long-calls
10506 @opindex mlong-calls
10507 @opindex mno-long-calls
10508 Tells the compiler to perform function calls by first loading the
10509 address of the function into a register and then performing a subroutine
10510 call on this register.  This switch is needed if the target function
10511 will lie outside of the 24 bit addressing range of the offset based
10512 version of subroutine call instruction.
10513
10514 This feature is not enabled by default.  Specifying
10515 @option{-mno-long-calls} will restore the default behavior.  Note these
10516 switches have no effect on how the compiler generates code to handle
10517 function calls via function pointers.
10518
10519 @item -mfast-fp
10520 @opindex mfast-fp
10521 Link with the fast floating-point library. This library relaxes some of
10522 the IEEE floating-point standard's rules for checking inputs against
10523 Not-a-Number (NAN), in the interest of performance.
10524
10525 @item -minline-plt
10526 @opindex minline-plt
10527 Enable inlining of PLT entries in function calls to functions that are
10528 not known to bind locally.  It has no effect without @option{-mfdpic}.
10529
10530 @item -mmulticore
10531 @opindex mmulticore
10532 Build standalone application for multicore Blackfin processor. Proper
10533 start files and link scripts will be used to support multicore.
10534 This option defines @code{__BFIN_MULTICORE}. It can only be used with
10535 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
10536 @option{-mcorea} or @option{-mcoreb}. If it's used without
10537 @option{-mcorea} or @option{-mcoreb}, single application/dual core
10538 programming model is used. In this model, the main function of Core B
10539 should be named as coreb_main. If it's used with @option{-mcorea} or
10540 @option{-mcoreb}, one application per core programming model is used.
10541 If this option is not used, single core application programming
10542 model is used.
10543
10544 @item -mcorea
10545 @opindex mcorea
10546 Build standalone application for Core A of BF561 when using
10547 one application per core programming model. Proper start files
10548 and link scripts will be used to support Core A. This option
10549 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
10550
10551 @item -mcoreb
10552 @opindex mcoreb
10553 Build standalone application for Core B of BF561 when using
10554 one application per core programming model. Proper start files
10555 and link scripts will be used to support Core B. This option
10556 defines @code{__BFIN_COREB}. When this option is used, coreb_main
10557 should be used instead of main. It must be used with
10558 @option{-mmulticore}.
10559
10560 @item -msdram
10561 @opindex msdram
10562 Build standalone application for SDRAM. Proper start files and
10563 link scripts will be used to put the application into SDRAM.
10564 Loader should initialize SDRAM before loading the application
10565 into SDRAM. This option defines @code{__BFIN_SDRAM}.
10566
10567 @item -micplb
10568 @opindex micplb
10569 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
10570 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
10571 are enabled; for standalone applications the default is off.
10572 @end table
10573
10574 @node CRIS Options
10575 @subsection CRIS Options
10576 @cindex CRIS Options
10577
10578 These options are defined specifically for the CRIS ports.
10579
10580 @table @gcctabopt
10581 @item -march=@var{architecture-type}
10582 @itemx -mcpu=@var{architecture-type}
10583 @opindex march
10584 @opindex mcpu
10585 Generate code for the specified architecture.  The choices for
10586 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
10587 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
10588 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
10589 @samp{v10}.
10590
10591 @item -mtune=@var{architecture-type}
10592 @opindex mtune
10593 Tune to @var{architecture-type} everything applicable about the generated
10594 code, except for the ABI and the set of available instructions.  The
10595 choices for @var{architecture-type} are the same as for
10596 @option{-march=@var{architecture-type}}.
10597
10598 @item -mmax-stack-frame=@var{n}
10599 @opindex mmax-stack-frame
10600 Warn when the stack frame of a function exceeds @var{n} bytes.
10601
10602 @item -metrax4
10603 @itemx -metrax100
10604 @opindex metrax4
10605 @opindex metrax100
10606 The options @option{-metrax4} and @option{-metrax100} are synonyms for
10607 @option{-march=v3} and @option{-march=v8} respectively.
10608
10609 @item -mmul-bug-workaround
10610 @itemx -mno-mul-bug-workaround
10611 @opindex mmul-bug-workaround
10612 @opindex mno-mul-bug-workaround
10613 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
10614 models where it applies.  This option is active by default.
10615
10616 @item -mpdebug
10617 @opindex mpdebug
10618 Enable CRIS-specific verbose debug-related information in the assembly
10619 code.  This option also has the effect to turn off the @samp{#NO_APP}
10620 formatted-code indicator to the assembler at the beginning of the
10621 assembly file.
10622
10623 @item -mcc-init
10624 @opindex mcc-init
10625 Do not use condition-code results from previous instruction; always emit
10626 compare and test instructions before use of condition codes.
10627
10628 @item -mno-side-effects
10629 @opindex mno-side-effects
10630 Do not emit instructions with side-effects in addressing modes other than
10631 post-increment.
10632
10633 @item -mstack-align
10634 @itemx -mno-stack-align
10635 @itemx -mdata-align
10636 @itemx -mno-data-align
10637 @itemx -mconst-align
10638 @itemx -mno-const-align
10639 @opindex mstack-align
10640 @opindex mno-stack-align
10641 @opindex mdata-align
10642 @opindex mno-data-align
10643 @opindex mconst-align
10644 @opindex mno-const-align
10645 These options (no-options) arranges (eliminate arrangements) for the
10646 stack-frame, individual data and constants to be aligned for the maximum
10647 single data access size for the chosen CPU model.  The default is to
10648 arrange for 32-bit alignment.  ABI details such as structure layout are
10649 not affected by these options.
10650
10651 @item -m32-bit
10652 @itemx -m16-bit
10653 @itemx -m8-bit
10654 @opindex m32-bit
10655 @opindex m16-bit
10656 @opindex m8-bit
10657 Similar to the stack- data- and const-align options above, these options
10658 arrange for stack-frame, writable data and constants to all be 32-bit,
10659 16-bit or 8-bit aligned.  The default is 32-bit alignment.
10660
10661 @item -mno-prologue-epilogue
10662 @itemx -mprologue-epilogue
10663 @opindex mno-prologue-epilogue
10664 @opindex mprologue-epilogue
10665 With @option{-mno-prologue-epilogue}, the normal function prologue and
10666 epilogue that sets up the stack-frame are omitted and no return
10667 instructions or return sequences are generated in the code.  Use this
10668 option only together with visual inspection of the compiled code: no
10669 warnings or errors are generated when call-saved registers must be saved,
10670 or storage for local variable needs to be allocated.
10671
10672 @item -mno-gotplt
10673 @itemx -mgotplt
10674 @opindex mno-gotplt
10675 @opindex mgotplt
10676 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
10677 instruction sequences that load addresses for functions from the PLT part
10678 of the GOT rather than (traditional on other architectures) calls to the
10679 PLT@.  The default is @option{-mgotplt}.
10680
10681 @item -melf
10682 @opindex melf
10683 Legacy no-op option only recognized with the cris-axis-elf and
10684 cris-axis-linux-gnu targets.
10685
10686 @item -mlinux
10687 @opindex mlinux
10688 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
10689
10690 @item -sim
10691 @opindex sim
10692 This option, recognized for the cris-axis-elf arranges
10693 to link with input-output functions from a simulator library.  Code,
10694 initialized data and zero-initialized data are allocated consecutively.
10695
10696 @item -sim2
10697 @opindex sim2
10698 Like @option{-sim}, but pass linker options to locate initialized data at
10699 0x40000000 and zero-initialized data at 0x80000000.
10700 @end table
10701
10702 @node CRX Options
10703 @subsection CRX Options
10704 @cindex CRX Options
10705
10706 These options are defined specifically for the CRX ports.
10707
10708 @table @gcctabopt
10709
10710 @item -mmac
10711 @opindex mmac
10712 Enable the use of multiply-accumulate instructions. Disabled by default.
10713
10714 @item -mpush-args
10715 @opindex mpush-args
10716 Push instructions will be used to pass outgoing arguments when functions
10717 are called. Enabled by default.
10718 @end table
10719
10720 @node Darwin Options
10721 @subsection Darwin Options
10722 @cindex Darwin options
10723
10724 These options are defined for all architectures running the Darwin operating
10725 system.
10726
10727 FSF GCC on Darwin does not create ``fat'' object files; it will create
10728 an object file for the single architecture that it was built to
10729 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
10730 @option{-arch} options are used; it does so by running the compiler or
10731 linker multiple times and joining the results together with
10732 @file{lipo}.
10733
10734 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
10735 @samp{i686}) is determined by the flags that specify the ISA
10736 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
10737 @option{-force_cpusubtype_ALL} option can be used to override this.
10738
10739 The Darwin tools vary in their behavior when presented with an ISA
10740 mismatch.  The assembler, @file{as}, will only permit instructions to
10741 be used that are valid for the subtype of the file it is generating,
10742 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
10743 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
10744 and print an error if asked to create a shared library with a less
10745 restrictive subtype than its input files (for instance, trying to put
10746 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
10747 for executables, @file{ld}, will quietly give the executable the most
10748 restrictive subtype of any of its input files.
10749
10750 @table @gcctabopt
10751 @item -F@var{dir}
10752 @opindex F
10753 Add the framework directory @var{dir} to the head of the list of
10754 directories to be searched for header files.  These directories are
10755 interleaved with those specified by @option{-I} options and are
10756 scanned in a left-to-right order.
10757
10758 A framework directory is a directory with frameworks in it.  A
10759 framework is a directory with a @samp{"Headers"} and/or
10760 @samp{"PrivateHeaders"} directory contained directly in it that ends
10761 in @samp{".framework"}.  The name of a framework is the name of this
10762 directory excluding the @samp{".framework"}.  Headers associated with
10763 the framework are found in one of those two directories, with
10764 @samp{"Headers"} being searched first.  A subframework is a framework
10765 directory that is in a framework's @samp{"Frameworks"} directory.
10766 Includes of subframework headers can only appear in a header of a
10767 framework that contains the subframework, or in a sibling subframework
10768 header.  Two subframeworks are siblings if they occur in the same
10769 framework.  A subframework should not have the same name as a
10770 framework, a warning will be issued if this is violated.  Currently a
10771 subframework cannot have subframeworks, in the future, the mechanism
10772 may be extended to support this.  The standard frameworks can be found
10773 in @samp{"/System/Library/Frameworks"} and
10774 @samp{"/Library/Frameworks"}.  An example include looks like
10775 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
10776 the name of the framework and header.h is found in the
10777 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
10778
10779 @item -iframework@var{dir}
10780 @opindex iframework
10781 Like @option{-F} except the directory is a treated as a system
10782 directory.  The main difference between this @option{-iframework} and
10783 @option{-F} is that with @option{-iframework} the compiler does not
10784 warn about constructs contained within header files found via
10785 @var{dir}.  This option is valid only for the C family of languages.
10786
10787 @item -gused
10788 @opindex gused
10789 Emit debugging information for symbols that are used.  For STABS
10790 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
10791 This is by default ON@.
10792
10793 @item -gfull
10794 @opindex gfull
10795 Emit debugging information for all symbols and types.
10796
10797 @item -mmacosx-version-min=@var{version}
10798 The earliest version of MacOS X that this executable will run on
10799 is @var{version}.  Typical values of @var{version} include @code{10.1},
10800 @code{10.2}, and @code{10.3.9}.
10801
10802 If the compiler was built to use the system's headers by default,
10803 then the default for this option is the system version on which the
10804 compiler is running, otherwise the default is to make choices which
10805 are compatible with as many systems and code bases as possible.
10806
10807 @item -mkernel
10808 @opindex mkernel
10809 Enable kernel development mode.  The @option{-mkernel} option sets
10810 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
10811 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
10812 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
10813 applicable.  This mode also sets @option{-mno-altivec},
10814 @option{-msoft-float}, @option{-fno-builtin} and
10815 @option{-mlong-branch} for PowerPC targets.
10816
10817 @item -mone-byte-bool
10818 @opindex mone-byte-bool
10819 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
10820 By default @samp{sizeof(bool)} is @samp{4} when compiling for
10821 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
10822 option has no effect on x86.
10823
10824 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
10825 to generate code that is not binary compatible with code generated
10826 without that switch.  Using this switch may require recompiling all
10827 other modules in a program, including system libraries.  Use this
10828 switch to conform to a non-default data model.
10829
10830 @item -mfix-and-continue
10831 @itemx -ffix-and-continue
10832 @itemx -findirect-data
10833 @opindex mfix-and-continue
10834 @opindex ffix-and-continue
10835 @opindex findirect-data
10836 Generate code suitable for fast turn around development.  Needed to
10837 enable gdb to dynamically load @code{.o} files into already running
10838 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
10839 are provided for backwards compatibility.
10840
10841 @item -all_load
10842 @opindex all_load
10843 Loads all members of static archive libraries.
10844 See man ld(1) for more information.
10845
10846 @item -arch_errors_fatal
10847 @opindex arch_errors_fatal
10848 Cause the errors having to do with files that have the wrong architecture
10849 to be fatal.
10850
10851 @item -bind_at_load
10852 @opindex bind_at_load
10853 Causes the output file to be marked such that the dynamic linker will
10854 bind all undefined references when the file is loaded or launched.
10855
10856 @item -bundle
10857 @opindex bundle
10858 Produce a Mach-o bundle format file.
10859 See man ld(1) for more information.
10860
10861 @item -bundle_loader @var{executable}
10862 @opindex bundle_loader
10863 This option specifies the @var{executable} that will be loading the build
10864 output file being linked.  See man ld(1) for more information.
10865
10866 @item -dynamiclib
10867 @opindex dynamiclib
10868 When passed this option, GCC will produce a dynamic library instead of
10869 an executable when linking, using the Darwin @file{libtool} command.
10870
10871 @item -force_cpusubtype_ALL
10872 @opindex force_cpusubtype_ALL
10873 This causes GCC's output file to have the @var{ALL} subtype, instead of
10874 one controlled by the @option{-mcpu} or @option{-march} option.
10875
10876 @item -allowable_client  @var{client_name}
10877 @itemx -client_name
10878 @itemx -compatibility_version
10879 @itemx -current_version
10880 @itemx -dead_strip
10881 @itemx -dependency-file
10882 @itemx -dylib_file
10883 @itemx -dylinker_install_name
10884 @itemx -dynamic
10885 @itemx -exported_symbols_list
10886 @itemx -filelist
10887 @itemx -flat_namespace
10888 @itemx -force_flat_namespace
10889 @itemx -headerpad_max_install_names
10890 @itemx -image_base
10891 @itemx -init
10892 @itemx -install_name
10893 @itemx -keep_private_externs
10894 @itemx -multi_module
10895 @itemx -multiply_defined
10896 @itemx -multiply_defined_unused
10897 @itemx -noall_load
10898 @itemx -no_dead_strip_inits_and_terms
10899 @itemx -nofixprebinding
10900 @itemx -nomultidefs
10901 @itemx -noprebind
10902 @itemx -noseglinkedit
10903 @itemx -pagezero_size
10904 @itemx -prebind
10905 @itemx -prebind_all_twolevel_modules
10906 @itemx -private_bundle
10907 @itemx -read_only_relocs
10908 @itemx -sectalign
10909 @itemx -sectobjectsymbols
10910 @itemx -whyload
10911 @itemx -seg1addr
10912 @itemx -sectcreate
10913 @itemx -sectobjectsymbols
10914 @itemx -sectorder
10915 @itemx -segaddr
10916 @itemx -segs_read_only_addr
10917 @itemx -segs_read_write_addr
10918 @itemx -seg_addr_table
10919 @itemx -seg_addr_table_filename
10920 @itemx -seglinkedit
10921 @itemx -segprot
10922 @itemx -segs_read_only_addr
10923 @itemx -segs_read_write_addr
10924 @itemx -single_module
10925 @itemx -static
10926 @itemx -sub_library
10927 @itemx -sub_umbrella
10928 @itemx -twolevel_namespace
10929 @itemx -umbrella
10930 @itemx -undefined
10931 @itemx -unexported_symbols_list
10932 @itemx -weak_reference_mismatches
10933 @itemx -whatsloaded
10934 @opindex allowable_client
10935 @opindex client_name
10936 @opindex compatibility_version
10937 @opindex current_version
10938 @opindex dead_strip
10939 @opindex dependency-file
10940 @opindex dylib_file
10941 @opindex dylinker_install_name
10942 @opindex dynamic
10943 @opindex exported_symbols_list
10944 @opindex filelist
10945 @opindex flat_namespace
10946 @opindex force_flat_namespace
10947 @opindex headerpad_max_install_names
10948 @opindex image_base
10949 @opindex init
10950 @opindex install_name
10951 @opindex keep_private_externs
10952 @opindex multi_module
10953 @opindex multiply_defined
10954 @opindex multiply_defined_unused
10955 @opindex noall_load
10956 @opindex no_dead_strip_inits_and_terms
10957 @opindex nofixprebinding
10958 @opindex nomultidefs
10959 @opindex noprebind
10960 @opindex noseglinkedit
10961 @opindex pagezero_size
10962 @opindex prebind
10963 @opindex prebind_all_twolevel_modules
10964 @opindex private_bundle
10965 @opindex read_only_relocs
10966 @opindex sectalign
10967 @opindex sectobjectsymbols
10968 @opindex whyload
10969 @opindex seg1addr
10970 @opindex sectcreate
10971 @opindex sectobjectsymbols
10972 @opindex sectorder
10973 @opindex segaddr
10974 @opindex segs_read_only_addr
10975 @opindex segs_read_write_addr
10976 @opindex seg_addr_table
10977 @opindex seg_addr_table_filename
10978 @opindex seglinkedit
10979 @opindex segprot
10980 @opindex segs_read_only_addr
10981 @opindex segs_read_write_addr
10982 @opindex single_module
10983 @opindex static
10984 @opindex sub_library
10985 @opindex sub_umbrella
10986 @opindex twolevel_namespace
10987 @opindex umbrella
10988 @opindex undefined
10989 @opindex unexported_symbols_list
10990 @opindex weak_reference_mismatches
10991 @opindex whatsloaded
10992 These options are passed to the Darwin linker.  The Darwin linker man page
10993 describes them in detail.
10994 @end table
10995
10996 @node DEC Alpha Options
10997 @subsection DEC Alpha Options
10998
10999 These @samp{-m} options are defined for the DEC Alpha implementations:
11000
11001 @table @gcctabopt
11002 @item -mno-soft-float
11003 @itemx -msoft-float
11004 @opindex mno-soft-float
11005 @opindex msoft-float
11006 Use (do not use) the hardware floating-point instructions for
11007 floating-point operations.  When @option{-msoft-float} is specified,
11008 functions in @file{libgcc.a} will be used to perform floating-point
11009 operations.  Unless they are replaced by routines that emulate the
11010 floating-point operations, or compiled in such a way as to call such
11011 emulations routines, these routines will issue floating-point
11012 operations.   If you are compiling for an Alpha without floating-point
11013 operations, you must ensure that the library is built so as not to call
11014 them.
11015
11016 Note that Alpha implementations without floating-point operations are
11017 required to have floating-point registers.
11018
11019 @item -mfp-reg
11020 @itemx -mno-fp-regs
11021 @opindex mfp-reg
11022 @opindex mno-fp-regs
11023 Generate code that uses (does not use) the floating-point register set.
11024 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
11025 register set is not used, floating point operands are passed in integer
11026 registers as if they were integers and floating-point results are passed
11027 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
11028 so any function with a floating-point argument or return value called by code
11029 compiled with @option{-mno-fp-regs} must also be compiled with that
11030 option.
11031
11032 A typical use of this option is building a kernel that does not use,
11033 and hence need not save and restore, any floating-point registers.
11034
11035 @item -mieee
11036 @opindex mieee
11037 The Alpha architecture implements floating-point hardware optimized for
11038 maximum performance.  It is mostly compliant with the IEEE floating
11039 point standard.  However, for full compliance, software assistance is
11040 required.  This option generates code fully IEEE compliant code
11041 @emph{except} that the @var{inexact-flag} is not maintained (see below).
11042 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
11043 defined during compilation.  The resulting code is less efficient but is
11044 able to correctly support denormalized numbers and exceptional IEEE
11045 values such as not-a-number and plus/minus infinity.  Other Alpha
11046 compilers call this option @option{-ieee_with_no_inexact}.
11047
11048 @item -mieee-with-inexact
11049 @opindex mieee-with-inexact
11050 This is like @option{-mieee} except the generated code also maintains
11051 the IEEE @var{inexact-flag}.  Turning on this option causes the
11052 generated code to implement fully-compliant IEEE math.  In addition to
11053 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
11054 macro.  On some Alpha implementations the resulting code may execute
11055 significantly slower than the code generated by default.  Since there is
11056 very little code that depends on the @var{inexact-flag}, you should
11057 normally not specify this option.  Other Alpha compilers call this
11058 option @option{-ieee_with_inexact}.
11059
11060 @item -mfp-trap-mode=@var{trap-mode}
11061 @opindex mfp-trap-mode
11062 This option controls what floating-point related traps are enabled.
11063 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
11064 The trap mode can be set to one of four values:
11065
11066 @table @samp
11067 @item n
11068 This is the default (normal) setting.  The only traps that are enabled
11069 are the ones that cannot be disabled in software (e.g., division by zero
11070 trap).
11071
11072 @item u
11073 In addition to the traps enabled by @samp{n}, underflow traps are enabled
11074 as well.
11075
11076 @item su
11077 Like @samp{u}, but the instructions are marked to be safe for software
11078 completion (see Alpha architecture manual for details).
11079
11080 @item sui
11081 Like @samp{su}, but inexact traps are enabled as well.
11082 @end table
11083
11084 @item -mfp-rounding-mode=@var{rounding-mode}
11085 @opindex mfp-rounding-mode
11086 Selects the IEEE rounding mode.  Other Alpha compilers call this option
11087 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
11088 of:
11089
11090 @table @samp
11091 @item n
11092 Normal IEEE rounding mode.  Floating point numbers are rounded towards
11093 the nearest machine number or towards the even machine number in case
11094 of a tie.
11095
11096 @item m
11097 Round towards minus infinity.
11098
11099 @item c
11100 Chopped rounding mode.  Floating point numbers are rounded towards zero.
11101
11102 @item d
11103 Dynamic rounding mode.  A field in the floating point control register
11104 (@var{fpcr}, see Alpha architecture reference manual) controls the
11105 rounding mode in effect.  The C library initializes this register for
11106 rounding towards plus infinity.  Thus, unless your program modifies the
11107 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
11108 @end table
11109
11110 @item -mtrap-precision=@var{trap-precision}
11111 @opindex mtrap-precision
11112 In the Alpha architecture, floating point traps are imprecise.  This
11113 means without software assistance it is impossible to recover from a
11114 floating trap and program execution normally needs to be terminated.
11115 GCC can generate code that can assist operating system trap handlers
11116 in determining the exact location that caused a floating point trap.
11117 Depending on the requirements of an application, different levels of
11118 precisions can be selected:
11119
11120 @table @samp
11121 @item p
11122 Program precision.  This option is the default and means a trap handler
11123 can only identify which program caused a floating point exception.
11124
11125 @item f
11126 Function precision.  The trap handler can determine the function that
11127 caused a floating point exception.
11128
11129 @item i
11130 Instruction precision.  The trap handler can determine the exact
11131 instruction that caused a floating point exception.
11132 @end table
11133
11134 Other Alpha compilers provide the equivalent options called
11135 @option{-scope_safe} and @option{-resumption_safe}.
11136
11137 @item -mieee-conformant
11138 @opindex mieee-conformant
11139 This option marks the generated code as IEEE conformant.  You must not
11140 use this option unless you also specify @option{-mtrap-precision=i} and either
11141 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
11142 is to emit the line @samp{.eflag 48} in the function prologue of the
11143 generated assembly file.  Under DEC Unix, this has the effect that
11144 IEEE-conformant math library routines will be linked in.
11145
11146 @item -mbuild-constants
11147 @opindex mbuild-constants
11148 Normally GCC examines a 32- or 64-bit integer constant to
11149 see if it can construct it from smaller constants in two or three
11150 instructions.  If it cannot, it will output the constant as a literal and
11151 generate code to load it from the data segment at runtime.
11152
11153 Use this option to require GCC to construct @emph{all} integer constants
11154 using code, even if it takes more instructions (the maximum is six).
11155
11156 You would typically use this option to build a shared library dynamic
11157 loader.  Itself a shared library, it must relocate itself in memory
11158 before it can find the variables and constants in its own data segment.
11159
11160 @item -malpha-as
11161 @itemx -mgas
11162 @opindex malpha-as
11163 @opindex mgas
11164 Select whether to generate code to be assembled by the vendor-supplied
11165 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
11166
11167 @item -mbwx
11168 @itemx -mno-bwx
11169 @itemx -mcix
11170 @itemx -mno-cix
11171 @itemx -mfix
11172 @itemx -mno-fix
11173 @itemx -mmax
11174 @itemx -mno-max
11175 @opindex mbwx
11176 @opindex mno-bwx
11177 @opindex mcix
11178 @opindex mno-cix
11179 @opindex mfix
11180 @opindex mno-fix
11181 @opindex mmax
11182 @opindex mno-max
11183 Indicate whether GCC should generate code to use the optional BWX,
11184 CIX, FIX and MAX instruction sets.  The default is to use the instruction
11185 sets supported by the CPU type specified via @option{-mcpu=} option or that
11186 of the CPU on which GCC was built if none was specified.
11187
11188 @item -mfloat-vax
11189 @itemx -mfloat-ieee
11190 @opindex mfloat-vax
11191 @opindex mfloat-ieee
11192 Generate code that uses (does not use) VAX F and G floating point
11193 arithmetic instead of IEEE single and double precision.
11194
11195 @item -mexplicit-relocs
11196 @itemx -mno-explicit-relocs
11197 @opindex mexplicit-relocs
11198 @opindex mno-explicit-relocs
11199 Older Alpha assemblers provided no way to generate symbol relocations
11200 except via assembler macros.  Use of these macros does not allow
11201 optimal instruction scheduling.  GNU binutils as of version 2.12
11202 supports a new syntax that allows the compiler to explicitly mark
11203 which relocations should apply to which instructions.  This option
11204 is mostly useful for debugging, as GCC detects the capabilities of
11205 the assembler when it is built and sets the default accordingly.
11206
11207 @item -msmall-data
11208 @itemx -mlarge-data
11209 @opindex msmall-data
11210 @opindex mlarge-data
11211 When @option{-mexplicit-relocs} is in effect, static data is
11212 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
11213 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
11214 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
11215 16-bit relocations off of the @code{$gp} register.  This limits the
11216 size of the small data area to 64KB, but allows the variables to be
11217 directly accessed via a single instruction.
11218
11219 The default is @option{-mlarge-data}.  With this option the data area
11220 is limited to just below 2GB@.  Programs that require more than 2GB of
11221 data must use @code{malloc} or @code{mmap} to allocate the data in the
11222 heap instead of in the program's data segment.
11223
11224 When generating code for shared libraries, @option{-fpic} implies
11225 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
11226
11227 @item -msmall-text
11228 @itemx -mlarge-text
11229 @opindex msmall-text
11230 @opindex mlarge-text
11231 When @option{-msmall-text} is used, the compiler assumes that the
11232 code of the entire program (or shared library) fits in 4MB, and is
11233 thus reachable with a branch instruction.  When @option{-msmall-data}
11234 is used, the compiler can assume that all local symbols share the
11235 same @code{$gp} value, and thus reduce the number of instructions
11236 required for a function call from 4 to 1.
11237
11238 The default is @option{-mlarge-text}.
11239
11240 @item -mcpu=@var{cpu_type}
11241 @opindex mcpu
11242 Set the instruction set and instruction scheduling parameters for
11243 machine type @var{cpu_type}.  You can specify either the @samp{EV}
11244 style name or the corresponding chip number.  GCC supports scheduling
11245 parameters for the EV4, EV5 and EV6 family of processors and will
11246 choose the default values for the instruction set from the processor
11247 you specify.  If you do not specify a processor type, GCC will default
11248 to the processor on which the compiler was built.
11249
11250 Supported values for @var{cpu_type} are
11251
11252 @table @samp
11253 @item ev4
11254 @itemx ev45
11255 @itemx 21064
11256 Schedules as an EV4 and has no instruction set extensions.
11257
11258 @item ev5
11259 @itemx 21164
11260 Schedules as an EV5 and has no instruction set extensions.
11261
11262 @item ev56
11263 @itemx 21164a
11264 Schedules as an EV5 and supports the BWX extension.
11265
11266 @item pca56
11267 @itemx 21164pc
11268 @itemx 21164PC
11269 Schedules as an EV5 and supports the BWX and MAX extensions.
11270
11271 @item ev6
11272 @itemx 21264
11273 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
11274
11275 @item ev67
11276 @itemx 21264a
11277 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
11278 @end table
11279
11280 Native Linux/GNU toolchains also support the value @samp{native},
11281 which selects the best architecture option for the host processor.
11282 @option{-mcpu=native} has no effect if GCC does not recognize
11283 the processor.
11284
11285 @item -mtune=@var{cpu_type}
11286 @opindex mtune
11287 Set only the instruction scheduling parameters for machine type
11288 @var{cpu_type}.  The instruction set is not changed.
11289
11290 Native Linux/GNU toolchains also support the value @samp{native},
11291 which selects the best architecture option for the host processor.
11292 @option{-mtune=native} has no effect if GCC does not recognize
11293 the processor.
11294
11295 @item -mmemory-latency=@var{time}
11296 @opindex mmemory-latency
11297 Sets the latency the scheduler should assume for typical memory
11298 references as seen by the application.  This number is highly
11299 dependent on the memory access patterns used by the application
11300 and the size of the external cache on the machine.
11301
11302 Valid options for @var{time} are
11303
11304 @table @samp
11305 @item @var{number}
11306 A decimal number representing clock cycles.
11307
11308 @item L1
11309 @itemx L2
11310 @itemx L3
11311 @itemx main
11312 The compiler contains estimates of the number of clock cycles for
11313 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
11314 (also called Dcache, Scache, and Bcache), as well as to main memory.
11315 Note that L3 is only valid for EV5.
11316
11317 @end table
11318 @end table
11319
11320 @node DEC Alpha/VMS Options
11321 @subsection DEC Alpha/VMS Options
11322
11323 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
11324
11325 @table @gcctabopt
11326 @item -mvms-return-codes
11327 @opindex mvms-return-codes
11328 Return VMS condition codes from main.  The default is to return POSIX
11329 style condition (e.g.@: error) codes.
11330
11331 @item -mdebug-main=@var{prefix}
11332 @opindex mdebug-main=@var{prefix}
11333 Flag the first routine whose name starts with @var{prefix} as the main
11334 routine for the debugger.
11335
11336 @item -mmalloc64
11337 @opindex mmalloc64
11338 Default to 64bit memory allocation routines.
11339 @end table
11340
11341 @node FR30 Options
11342 @subsection FR30 Options
11343 @cindex FR30 Options
11344
11345 These options are defined specifically for the FR30 port.
11346
11347 @table @gcctabopt
11348
11349 @item -msmall-model
11350 @opindex msmall-model
11351 Use the small address space model.  This can produce smaller code, but
11352 it does assume that all symbolic values and addresses will fit into a
11353 20-bit range.
11354
11355 @item -mno-lsim
11356 @opindex mno-lsim
11357 Assume that run-time support has been provided and so there is no need
11358 to include the simulator library (@file{libsim.a}) on the linker
11359 command line.
11360
11361 @end table
11362
11363 @node FRV Options
11364 @subsection FRV Options
11365 @cindex FRV Options
11366
11367 @table @gcctabopt
11368 @item -mgpr-32
11369 @opindex mgpr-32
11370
11371 Only use the first 32 general purpose registers.
11372
11373 @item -mgpr-64
11374 @opindex mgpr-64
11375
11376 Use all 64 general purpose registers.
11377
11378 @item -mfpr-32
11379 @opindex mfpr-32
11380
11381 Use only the first 32 floating point registers.
11382
11383 @item -mfpr-64
11384 @opindex mfpr-64
11385
11386 Use all 64 floating point registers
11387
11388 @item -mhard-float
11389 @opindex mhard-float
11390
11391 Use hardware instructions for floating point operations.
11392
11393 @item -msoft-float
11394 @opindex msoft-float
11395
11396 Use library routines for floating point operations.
11397
11398 @item -malloc-cc
11399 @opindex malloc-cc
11400
11401 Dynamically allocate condition code registers.
11402
11403 @item -mfixed-cc
11404 @opindex mfixed-cc
11405
11406 Do not try to dynamically allocate condition code registers, only
11407 use @code{icc0} and @code{fcc0}.
11408
11409 @item -mdword
11410 @opindex mdword
11411
11412 Change ABI to use double word insns.
11413
11414 @item -mno-dword
11415 @opindex mno-dword
11416
11417 Do not use double word instructions.
11418
11419 @item -mdouble
11420 @opindex mdouble
11421
11422 Use floating point double instructions.
11423
11424 @item -mno-double
11425 @opindex mno-double
11426
11427 Do not use floating point double instructions.
11428
11429 @item -mmedia
11430 @opindex mmedia
11431
11432 Use media instructions.
11433
11434 @item -mno-media
11435 @opindex mno-media
11436
11437 Do not use media instructions.
11438
11439 @item -mmuladd
11440 @opindex mmuladd
11441
11442 Use multiply and add/subtract instructions.
11443
11444 @item -mno-muladd
11445 @opindex mno-muladd
11446
11447 Do not use multiply and add/subtract instructions.
11448
11449 @item -mfdpic
11450 @opindex mfdpic
11451
11452 Select the FDPIC ABI, that uses function descriptors to represent
11453 pointers to functions.  Without any PIC/PIE-related options, it
11454 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
11455 assumes GOT entries and small data are within a 12-bit range from the
11456 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
11457 are computed with 32 bits.
11458 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11459
11460 @item -minline-plt
11461 @opindex minline-plt
11462
11463 Enable inlining of PLT entries in function calls to functions that are
11464 not known to bind locally.  It has no effect without @option{-mfdpic}.
11465 It's enabled by default if optimizing for speed and compiling for
11466 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
11467 optimization option such as @option{-O3} or above is present in the
11468 command line.
11469
11470 @item -mTLS
11471 @opindex mTLS
11472
11473 Assume a large TLS segment when generating thread-local code.
11474
11475 @item -mtls
11476 @opindex mtls
11477
11478 Do not assume a large TLS segment when generating thread-local code.
11479
11480 @item -mgprel-ro
11481 @opindex mgprel-ro
11482
11483 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
11484 that is known to be in read-only sections.  It's enabled by default,
11485 except for @option{-fpic} or @option{-fpie}: even though it may help
11486 make the global offset table smaller, it trades 1 instruction for 4.
11487 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
11488 one of which may be shared by multiple symbols, and it avoids the need
11489 for a GOT entry for the referenced symbol, so it's more likely to be a
11490 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
11491
11492 @item -multilib-library-pic
11493 @opindex multilib-library-pic
11494
11495 Link with the (library, not FD) pic libraries.  It's implied by
11496 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
11497 @option{-fpic} without @option{-mfdpic}.  You should never have to use
11498 it explicitly.
11499
11500 @item -mlinked-fp
11501 @opindex mlinked-fp
11502
11503 Follow the EABI requirement of always creating a frame pointer whenever
11504 a stack frame is allocated.  This option is enabled by default and can
11505 be disabled with @option{-mno-linked-fp}.
11506
11507 @item -mlong-calls
11508 @opindex mlong-calls
11509
11510 Use indirect addressing to call functions outside the current
11511 compilation unit.  This allows the functions to be placed anywhere
11512 within the 32-bit address space.
11513
11514 @item -malign-labels
11515 @opindex malign-labels
11516
11517 Try to align labels to an 8-byte boundary by inserting nops into the
11518 previous packet.  This option only has an effect when VLIW packing
11519 is enabled.  It doesn't create new packets; it merely adds nops to
11520 existing ones.
11521
11522 @item -mlibrary-pic
11523 @opindex mlibrary-pic
11524
11525 Generate position-independent EABI code.
11526
11527 @item -macc-4
11528 @opindex macc-4
11529
11530 Use only the first four media accumulator registers.
11531
11532 @item -macc-8
11533 @opindex macc-8
11534
11535 Use all eight media accumulator registers.
11536
11537 @item -mpack
11538 @opindex mpack
11539
11540 Pack VLIW instructions.
11541
11542 @item -mno-pack
11543 @opindex mno-pack
11544
11545 Do not pack VLIW instructions.
11546
11547 @item -mno-eflags
11548 @opindex mno-eflags
11549
11550 Do not mark ABI switches in e_flags.
11551
11552 @item -mcond-move
11553 @opindex mcond-move
11554
11555 Enable the use of conditional-move instructions (default).
11556
11557 This switch is mainly for debugging the compiler and will likely be removed
11558 in a future version.
11559
11560 @item -mno-cond-move
11561 @opindex mno-cond-move
11562
11563 Disable the use of conditional-move instructions.
11564
11565 This switch is mainly for debugging the compiler and will likely be removed
11566 in a future version.
11567
11568 @item -mscc
11569 @opindex mscc
11570
11571 Enable the use of conditional set instructions (default).
11572
11573 This switch is mainly for debugging the compiler and will likely be removed
11574 in a future version.
11575
11576 @item -mno-scc
11577 @opindex mno-scc
11578
11579 Disable the use of conditional set instructions.
11580
11581 This switch is mainly for debugging the compiler and will likely be removed
11582 in a future version.
11583
11584 @item -mcond-exec
11585 @opindex mcond-exec
11586
11587 Enable the use of conditional execution (default).
11588
11589 This switch is mainly for debugging the compiler and will likely be removed
11590 in a future version.
11591
11592 @item -mno-cond-exec
11593 @opindex mno-cond-exec
11594
11595 Disable the use of conditional execution.
11596
11597 This switch is mainly for debugging the compiler and will likely be removed
11598 in a future version.
11599
11600 @item -mvliw-branch
11601 @opindex mvliw-branch
11602
11603 Run a pass to pack branches into VLIW instructions (default).
11604
11605 This switch is mainly for debugging the compiler and will likely be removed
11606 in a future version.
11607
11608 @item -mno-vliw-branch
11609 @opindex mno-vliw-branch
11610
11611 Do not run a pass to pack branches into VLIW instructions.
11612
11613 This switch is mainly for debugging the compiler and will likely be removed
11614 in a future version.
11615
11616 @item -mmulti-cond-exec
11617 @opindex mmulti-cond-exec
11618
11619 Enable optimization of @code{&&} and @code{||} in conditional execution
11620 (default).
11621
11622 This switch is mainly for debugging the compiler and will likely be removed
11623 in a future version.
11624
11625 @item -mno-multi-cond-exec
11626 @opindex mno-multi-cond-exec
11627
11628 Disable optimization of @code{&&} and @code{||} in conditional execution.
11629
11630 This switch is mainly for debugging the compiler and will likely be removed
11631 in a future version.
11632
11633 @item -mnested-cond-exec
11634 @opindex mnested-cond-exec
11635
11636 Enable nested conditional execution optimizations (default).
11637
11638 This switch is mainly for debugging the compiler and will likely be removed
11639 in a future version.
11640
11641 @item -mno-nested-cond-exec
11642 @opindex mno-nested-cond-exec
11643
11644 Disable nested conditional execution optimizations.
11645
11646 This switch is mainly for debugging the compiler and will likely be removed
11647 in a future version.
11648
11649 @item -moptimize-membar
11650 @opindex moptimize-membar
11651
11652 This switch removes redundant @code{membar} instructions from the
11653 compiler generated code.  It is enabled by default.
11654
11655 @item -mno-optimize-membar
11656 @opindex mno-optimize-membar
11657
11658 This switch disables the automatic removal of redundant @code{membar}
11659 instructions from the generated code.
11660
11661 @item -mtomcat-stats
11662 @opindex mtomcat-stats
11663
11664 Cause gas to print out tomcat statistics.
11665
11666 @item -mcpu=@var{cpu}
11667 @opindex mcpu
11668
11669 Select the processor type for which to generate code.  Possible values are
11670 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
11671 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
11672
11673 @end table
11674
11675 @node GNU/Linux Options
11676 @subsection GNU/Linux Options
11677
11678 These @samp{-m} options are defined for GNU/Linux targets:
11679
11680 @table @gcctabopt
11681 @item -mglibc
11682 @opindex mglibc
11683 Use the GNU C library.  This is the default except
11684 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
11685
11686 @item -muclibc
11687 @opindex muclibc
11688 Use uClibc C library.  This is the default on
11689 @samp{*-*-linux-*uclibc*} targets.
11690
11691 @item -mbionic
11692 @opindex mbionic
11693 Use Bionic C library.  This is the default on
11694 @samp{*-*-linux-*android*} targets.
11695
11696 @item -mandroid
11697 @opindex mandroid
11698 Compile code compatible with Android platform.  This is the default on
11699 @samp{*-*-linux-*android*} targets.
11700
11701 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
11702 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
11703 this option makes the GCC driver pass Android-specific options to the linker.
11704 Finally, this option causes the preprocessor macro @code{__ANDROID__}
11705 to be defined.
11706
11707 @item -tno-android-cc
11708 @opindex tno-android-cc
11709 Disable compilation effects of @option{-mandroid}, i.e., do not enable
11710 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
11711 @option{-fno-rtti} by default.
11712
11713 @item -tno-android-ld
11714 @opindex tno-android-ld
11715 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
11716 linking options to the linker.
11717
11718 @end table
11719
11720 @node H8/300 Options
11721 @subsection H8/300 Options
11722
11723 These @samp{-m} options are defined for the H8/300 implementations:
11724
11725 @table @gcctabopt
11726 @item -mrelax
11727 @opindex mrelax
11728 Shorten some address references at link time, when possible; uses the
11729 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
11730 ld, Using ld}, for a fuller description.
11731
11732 @item -mh
11733 @opindex mh
11734 Generate code for the H8/300H@.
11735
11736 @item -ms
11737 @opindex ms
11738 Generate code for the H8S@.
11739
11740 @item -mn
11741 @opindex mn
11742 Generate code for the H8S and H8/300H in the normal mode.  This switch
11743 must be used either with @option{-mh} or @option{-ms}.
11744
11745 @item -ms2600
11746 @opindex ms2600
11747 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
11748
11749 @item -mint32
11750 @opindex mint32
11751 Make @code{int} data 32 bits by default.
11752
11753 @item -malign-300
11754 @opindex malign-300
11755 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
11756 The default for the H8/300H and H8S is to align longs and floats on 4
11757 byte boundaries.
11758 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
11759 This option has no effect on the H8/300.
11760 @end table
11761
11762 @node HPPA Options
11763 @subsection HPPA Options
11764 @cindex HPPA Options
11765
11766 These @samp{-m} options are defined for the HPPA family of computers:
11767
11768 @table @gcctabopt
11769 @item -march=@var{architecture-type}
11770 @opindex march
11771 Generate code for the specified architecture.  The choices for
11772 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
11773 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
11774 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
11775 architecture option for your machine.  Code compiled for lower numbered
11776 architectures will run on higher numbered architectures, but not the
11777 other way around.
11778
11779 @item -mpa-risc-1-0
11780 @itemx -mpa-risc-1-1
11781 @itemx -mpa-risc-2-0
11782 @opindex mpa-risc-1-0
11783 @opindex mpa-risc-1-1
11784 @opindex mpa-risc-2-0
11785 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
11786
11787 @item -mbig-switch
11788 @opindex mbig-switch
11789 Generate code suitable for big switch tables.  Use this option only if
11790 the assembler/linker complain about out of range branches within a switch
11791 table.
11792
11793 @item -mjump-in-delay
11794 @opindex mjump-in-delay
11795 Fill delay slots of function calls with unconditional jump instructions
11796 by modifying the return pointer for the function call to be the target
11797 of the conditional jump.
11798
11799 @item -mdisable-fpregs
11800 @opindex mdisable-fpregs
11801 Prevent floating point registers from being used in any manner.  This is
11802 necessary for compiling kernels which perform lazy context switching of
11803 floating point registers.  If you use this option and attempt to perform
11804 floating point operations, the compiler will abort.
11805
11806 @item -mdisable-indexing
11807 @opindex mdisable-indexing
11808 Prevent the compiler from using indexing address modes.  This avoids some
11809 rather obscure problems when compiling MIG generated code under MACH@.
11810
11811 @item -mno-space-regs
11812 @opindex mno-space-regs
11813 Generate code that assumes the target has no space registers.  This allows
11814 GCC to generate faster indirect calls and use unscaled index address modes.
11815
11816 Such code is suitable for level 0 PA systems and kernels.
11817
11818 @item -mfast-indirect-calls
11819 @opindex mfast-indirect-calls
11820 Generate code that assumes calls never cross space boundaries.  This
11821 allows GCC to emit code which performs faster indirect calls.
11822
11823 This option will not work in the presence of shared libraries or nested
11824 functions.
11825
11826 @item -mfixed-range=@var{register-range}
11827 @opindex mfixed-range
11828 Generate code treating the given register range as fixed registers.
11829 A fixed register is one that the register allocator can not use.  This is
11830 useful when compiling kernel code.  A register range is specified as
11831 two registers separated by a dash.  Multiple register ranges can be
11832 specified separated by a comma.
11833
11834 @item -mlong-load-store
11835 @opindex mlong-load-store
11836 Generate 3-instruction load and store sequences as sometimes required by
11837 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
11838 the HP compilers.
11839
11840 @item -mportable-runtime
11841 @opindex mportable-runtime
11842 Use the portable calling conventions proposed by HP for ELF systems.
11843
11844 @item -mgas
11845 @opindex mgas
11846 Enable the use of assembler directives only GAS understands.
11847
11848 @item -mschedule=@var{cpu-type}
11849 @opindex mschedule
11850 Schedule code according to the constraints for the machine type
11851 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
11852 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
11853 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
11854 proper scheduling option for your machine.  The default scheduling is
11855 @samp{8000}.
11856
11857 @item -mlinker-opt
11858 @opindex mlinker-opt
11859 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
11860 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
11861 linkers in which they give bogus error messages when linking some programs.
11862
11863 @item -msoft-float
11864 @opindex msoft-float
11865 Generate output containing library calls for floating point.
11866 @strong{Warning:} the requisite libraries are not available for all HPPA
11867 targets.  Normally the facilities of the machine's usual C compiler are
11868 used, but this cannot be done directly in cross-compilation.  You must make
11869 your own arrangements to provide suitable library functions for
11870 cross-compilation.
11871
11872 @option{-msoft-float} changes the calling convention in the output file;
11873 therefore, it is only useful if you compile @emph{all} of a program with
11874 this option.  In particular, you need to compile @file{libgcc.a}, the
11875 library that comes with GCC, with @option{-msoft-float} in order for
11876 this to work.
11877
11878 @item -msio
11879 @opindex msio
11880 Generate the predefine, @code{_SIO}, for server IO@.  The default is
11881 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
11882 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
11883 options are available under HP-UX and HI-UX@.
11884
11885 @item -mgnu-ld
11886 @opindex mgnu-ld
11887 Use GNU ld specific options.  This passes @option{-shared} to ld when
11888 building a shared library.  It is the default when GCC is configured,
11889 explicitly or implicitly, with the GNU linker.  This option does not
11890 have any affect on which ld is called, it only changes what parameters
11891 are passed to that ld.  The ld that is called is determined by the
11892 @option{--with-ld} configure option, GCC's program search path, and
11893 finally by the user's @env{PATH}.  The linker used by GCC can be printed
11894 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
11895 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11896
11897 @item -mhp-ld
11898 @opindex mhp-ld
11899 Use HP ld specific options.  This passes @option{-b} to ld when building
11900 a shared library and passes @option{+Accept TypeMismatch} to ld on all
11901 links.  It is the default when GCC is configured, explicitly or
11902 implicitly, with the HP linker.  This option does not have any affect on
11903 which ld is called, it only changes what parameters are passed to that
11904 ld.  The ld that is called is determined by the @option{--with-ld}
11905 configure option, GCC's program search path, and finally by the user's
11906 @env{PATH}.  The linker used by GCC can be printed using @samp{which
11907 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
11908 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11909
11910 @item -mlong-calls
11911 @opindex mno-long-calls
11912 Generate code that uses long call sequences.  This ensures that a call
11913 is always able to reach linker generated stubs.  The default is to generate
11914 long calls only when the distance from the call site to the beginning
11915 of the function or translation unit, as the case may be, exceeds a
11916 predefined limit set by the branch type being used.  The limits for
11917 normal calls are 7,600,000 and 240,000 bytes, respectively for the
11918 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
11919 240,000 bytes.
11920
11921 Distances are measured from the beginning of functions when using the
11922 @option{-ffunction-sections} option, or when using the @option{-mgas}
11923 and @option{-mno-portable-runtime} options together under HP-UX with
11924 the SOM linker.
11925
11926 It is normally not desirable to use this option as it will degrade
11927 performance.  However, it may be useful in large applications,
11928 particularly when partial linking is used to build the application.
11929
11930 The types of long calls used depends on the capabilities of the
11931 assembler and linker, and the type of code being generated.  The
11932 impact on systems that support long absolute calls, and long pic
11933 symbol-difference or pc-relative calls should be relatively small.
11934 However, an indirect call is used on 32-bit ELF systems in pic code
11935 and it is quite long.
11936
11937 @item -munix=@var{unix-std}
11938 @opindex march
11939 Generate compiler predefines and select a startfile for the specified
11940 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
11941 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
11942 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
11943 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
11944 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
11945 and later.
11946
11947 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
11948 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
11949 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
11950 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
11951 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
11952 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
11953
11954 It is @emph{important} to note that this option changes the interfaces
11955 for various library routines.  It also affects the operational behavior
11956 of the C library.  Thus, @emph{extreme} care is needed in using this
11957 option.
11958
11959 Library code that is intended to operate with more than one UNIX
11960 standard must test, set and restore the variable @var{__xpg4_extended_mask}
11961 as appropriate.  Most GNU software doesn't provide this capability.
11962
11963 @item -nolibdld
11964 @opindex nolibdld
11965 Suppress the generation of link options to search libdld.sl when the
11966 @option{-static} option is specified on HP-UX 10 and later.
11967
11968 @item -static
11969 @opindex static
11970 The HP-UX implementation of setlocale in libc has a dependency on
11971 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
11972 when the @option{-static} option is specified, special link options
11973 are needed to resolve this dependency.
11974
11975 On HP-UX 10 and later, the GCC driver adds the necessary options to
11976 link with libdld.sl when the @option{-static} option is specified.
11977 This causes the resulting binary to be dynamic.  On the 64-bit port,
11978 the linkers generate dynamic binaries by default in any case.  The
11979 @option{-nolibdld} option can be used to prevent the GCC driver from
11980 adding these link options.
11981
11982 @item -threads
11983 @opindex threads
11984 Add support for multithreading with the @dfn{dce thread} library
11985 under HP-UX@.  This option sets flags for both the preprocessor and
11986 linker.
11987 @end table
11988
11989 @node i386 and x86-64 Options
11990 @subsection Intel 386 and AMD x86-64 Options
11991 @cindex i386 Options
11992 @cindex x86-64 Options
11993 @cindex Intel 386 Options
11994 @cindex AMD x86-64 Options
11995
11996 These @samp{-m} options are defined for the i386 and x86-64 family of
11997 computers:
11998
11999 @table @gcctabopt
12000 @item -mtune=@var{cpu-type}
12001 @opindex mtune
12002 Tune to @var{cpu-type} everything applicable about the generated code, except
12003 for the ABI and the set of available instructions.  The choices for
12004 @var{cpu-type} are:
12005 @table @emph
12006 @item generic
12007 Produce code optimized for the most common IA32/AMD64/EM64T processors.
12008 If you know the CPU on which your code will run, then you should use
12009 the corresponding @option{-mtune} option instead of
12010 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
12011 of your application will have, then you should use this option.
12012
12013 As new processors are deployed in the marketplace, the behavior of this
12014 option will change.  Therefore, if you upgrade to a newer version of
12015 GCC, the code generated option will change to reflect the processors
12016 that were most common when that version of GCC was released.
12017
12018 There is no @option{-march=generic} option because @option{-march}
12019 indicates the instruction set the compiler can use, and there is no
12020 generic instruction set applicable to all processors.  In contrast,
12021 @option{-mtune} indicates the processor (or, in this case, collection of
12022 processors) for which the code is optimized.
12023 @item native
12024 This selects the CPU to tune for at compilation time by determining
12025 the processor type of the compiling machine.  Using @option{-mtune=native}
12026 will produce code optimized for the local machine under the constraints
12027 of the selected instruction set.  Using @option{-march=native} will
12028 enable all instruction subsets supported by the local machine (hence
12029 the result might not run on different machines).
12030 @item i386
12031 Original Intel's i386 CPU@.
12032 @item i486
12033 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
12034 @item i586, pentium
12035 Intel Pentium CPU with no MMX support.
12036 @item pentium-mmx
12037 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
12038 @item pentiumpro
12039 Intel PentiumPro CPU@.
12040 @item i686
12041 Same as @code{generic}, but when used as @code{march} option, PentiumPro
12042 instruction set will be used, so the code will run on all i686 family chips.
12043 @item pentium2
12044 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
12045 @item pentium3, pentium3m
12046 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
12047 support.
12048 @item pentium-m
12049 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
12050 support.  Used by Centrino notebooks.
12051 @item pentium4, pentium4m
12052 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
12053 @item prescott
12054 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
12055 set support.
12056 @item nocona
12057 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
12058 SSE2 and SSE3 instruction set support.
12059 @item core2
12060 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12061 instruction set support.
12062 @item atom
12063 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12064 instruction set support.
12065 @item k6
12066 AMD K6 CPU with MMX instruction set support.
12067 @item k6-2, k6-3
12068 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
12069 @item athlon, athlon-tbird
12070 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
12071 support.
12072 @item athlon-4, athlon-xp, athlon-mp
12073 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
12074 instruction set support.
12075 @item k8, opteron, athlon64, athlon-fx
12076 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
12077 MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit instruction set extensions.)
12078 @item k8-sse3, opteron-sse3, athlon64-sse3
12079 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
12080 @item amdfam10, barcelona
12081 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
12082 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
12083 instruction set extensions.)
12084 @item winchip-c6
12085 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
12086 set support.
12087 @item winchip2
12088 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
12089 instruction set support.
12090 @item c3
12091 Via C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
12092 implemented for this chip.)
12093 @item c3-2
12094 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
12095 implemented for this chip.)
12096 @item geode
12097 Embedded AMD CPU with MMX and 3DNow!@: instruction set support.
12098 @end table
12099
12100 While picking a specific @var{cpu-type} will schedule things appropriately
12101 for that particular chip, the compiler will not generate any code that
12102 does not run on the i386 without the @option{-march=@var{cpu-type}} option
12103 being used.
12104
12105 @item -march=@var{cpu-type}
12106 @opindex march
12107 Generate instructions for the machine type @var{cpu-type}.  The choices
12108 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
12109 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
12110
12111 @item -mcpu=@var{cpu-type}
12112 @opindex mcpu
12113 A deprecated synonym for @option{-mtune}.
12114
12115 @item -mfpmath=@var{unit}
12116 @opindex mfpmath
12117 Generate floating point arithmetics for selected unit @var{unit}.  The choices
12118 for @var{unit} are:
12119
12120 @table @samp
12121 @item 387
12122 Use the standard 387 floating point coprocessor present majority of chips and
12123 emulated otherwise.  Code compiled with this option will run almost everywhere.
12124 The temporary results are computed in 80bit precision instead of precision
12125 specified by the type resulting in slightly different results compared to most
12126 of other chips.  See @option{-ffloat-store} for more detailed description.
12127
12128 This is the default choice for i386 compiler.
12129
12130 @item sse
12131 Use scalar floating point instructions present in the SSE instruction set.
12132 This instruction set is supported by Pentium3 and newer chips, in the AMD line
12133 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
12134 instruction set supports only single precision arithmetics, thus the double and
12135 extended precision arithmetics is still done using 387.  Later version, present
12136 only in Pentium4 and the future AMD x86-64 chips supports double precision
12137 arithmetics too.
12138
12139 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
12140 or @option{-msse2} switches to enable SSE extensions and make this option
12141 effective.  For the x86-64 compiler, these extensions are enabled by default.
12142
12143 The resulting code should be considerably faster in the majority of cases and avoid
12144 the numerical instability problems of 387 code, but may break some existing
12145 code that expects temporaries to be 80bit.
12146
12147 This is the default choice for the x86-64 compiler.
12148
12149 @item sse,387
12150 @itemx sse+387
12151 @itemx both
12152 Attempt to utilize both instruction sets at once.  This effectively double the
12153 amount of available registers and on chips with separate execution units for
12154 387 and SSE the execution resources too.  Use this option with care, as it is
12155 still experimental, because the GCC register allocator does not model separate
12156 functional units well resulting in instable performance.
12157 @end table
12158
12159 @item -masm=@var{dialect}
12160 @opindex masm=@var{dialect}
12161 Output asm instructions using selected @var{dialect}.  Supported
12162 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
12163 not support @samp{intel}.
12164
12165 @item -mieee-fp
12166 @itemx -mno-ieee-fp
12167 @opindex mieee-fp
12168 @opindex mno-ieee-fp
12169 Control whether or not the compiler uses IEEE floating point
12170 comparisons.  These handle correctly the case where the result of a
12171 comparison is unordered.
12172
12173 @item -msoft-float
12174 @opindex msoft-float
12175 Generate output containing library calls for floating point.
12176 @strong{Warning:} the requisite libraries are not part of GCC@.
12177 Normally the facilities of the machine's usual C compiler are used, but
12178 this can't be done directly in cross-compilation.  You must make your
12179 own arrangements to provide suitable library functions for
12180 cross-compilation.
12181
12182 On machines where a function returns floating point results in the 80387
12183 register stack, some floating point opcodes may be emitted even if
12184 @option{-msoft-float} is used.
12185
12186 @item -mno-fp-ret-in-387
12187 @opindex mno-fp-ret-in-387
12188 Do not use the FPU registers for return values of functions.
12189
12190 The usual calling convention has functions return values of types
12191 @code{float} and @code{double} in an FPU register, even if there
12192 is no FPU@.  The idea is that the operating system should emulate
12193 an FPU@.
12194
12195 The option @option{-mno-fp-ret-in-387} causes such values to be returned
12196 in ordinary CPU registers instead.
12197
12198 @item -mno-fancy-math-387
12199 @opindex mno-fancy-math-387
12200 Some 387 emulators do not support the @code{sin}, @code{cos} and
12201 @code{sqrt} instructions for the 387.  Specify this option to avoid
12202 generating those instructions.  This option is the default on FreeBSD,
12203 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
12204 indicates that the target cpu will always have an FPU and so the
12205 instruction will not need emulation.  As of revision 2.6.1, these
12206 instructions are not generated unless you also use the
12207 @option{-funsafe-math-optimizations} switch.
12208
12209 @item -malign-double
12210 @itemx -mno-align-double
12211 @opindex malign-double
12212 @opindex mno-align-double
12213 Control whether GCC aligns @code{double}, @code{long double}, and
12214 @code{long long} variables on a two word boundary or a one word
12215 boundary.  Aligning @code{double} variables on a two word boundary will
12216 produce code that runs somewhat faster on a @samp{Pentium} at the
12217 expense of more memory.
12218
12219 On x86-64, @option{-malign-double} is enabled by default.
12220
12221 @strong{Warning:} if you use the @option{-malign-double} switch,
12222 structures containing the above types will be aligned differently than
12223 the published application binary interface specifications for the 386
12224 and will not be binary compatible with structures in code compiled
12225 without that switch.
12226
12227 @item -m96bit-long-double
12228 @itemx -m128bit-long-double
12229 @opindex m96bit-long-double
12230 @opindex m128bit-long-double
12231 These switches control the size of @code{long double} type.  The i386
12232 application binary interface specifies the size to be 96 bits,
12233 so @option{-m96bit-long-double} is the default in 32 bit mode.
12234
12235 Modern architectures (Pentium and newer) would prefer @code{long double}
12236 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
12237 conforming to the ABI, this would not be possible.  So specifying a
12238 @option{-m128bit-long-double} will align @code{long double}
12239 to a 16 byte boundary by padding the @code{long double} with an additional
12240 32 bit zero.
12241
12242 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
12243 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
12244
12245 Notice that neither of these options enable any extra precision over the x87
12246 standard of 80 bits for a @code{long double}.
12247
12248 @strong{Warning:} if you override the default value for your target ABI, the
12249 structures and arrays containing @code{long double} variables will change
12250 their size as well as function calling convention for function taking
12251 @code{long double} will be modified.  Hence they will not be binary
12252 compatible with arrays or structures in code compiled without that switch.
12253
12254 @item -mlarge-data-threshold=@var{number}
12255 @opindex mlarge-data-threshold=@var{number}
12256 When @option{-mcmodel=medium} is specified, the data greater than
12257 @var{threshold} are placed in large data section.  This value must be the
12258 same across all object linked into the binary and defaults to 65535.
12259
12260 @item -mrtd
12261 @opindex mrtd
12262 Use a different function-calling convention, in which functions that
12263 take a fixed number of arguments return with the @code{ret} @var{num}
12264 instruction, which pops their arguments while returning.  This saves one
12265 instruction in the caller since there is no need to pop the arguments
12266 there.
12267
12268 You can specify that an individual function is called with this calling
12269 sequence with the function attribute @samp{stdcall}.  You can also
12270 override the @option{-mrtd} option by using the function attribute
12271 @samp{cdecl}.  @xref{Function Attributes}.
12272
12273 @strong{Warning:} this calling convention is incompatible with the one
12274 normally used on Unix, so you cannot use it if you need to call
12275 libraries compiled with the Unix compiler.
12276
12277 Also, you must provide function prototypes for all functions that
12278 take variable numbers of arguments (including @code{printf});
12279 otherwise incorrect code will be generated for calls to those
12280 functions.
12281
12282 In addition, seriously incorrect code will result if you call a
12283 function with too many arguments.  (Normally, extra arguments are
12284 harmlessly ignored.)
12285
12286 @item -mregparm=@var{num}
12287 @opindex mregparm
12288 Control how many registers are used to pass integer arguments.  By
12289 default, no registers are used to pass arguments, and at most 3
12290 registers can be used.  You can control this behavior for a specific
12291 function by using the function attribute @samp{regparm}.
12292 @xref{Function Attributes}.
12293
12294 @strong{Warning:} if you use this switch, and
12295 @var{num} is nonzero, then you must build all modules with the same
12296 value, including any libraries.  This includes the system libraries and
12297 startup modules.
12298
12299 @item -msseregparm
12300 @opindex msseregparm
12301 Use SSE register passing conventions for float and double arguments
12302 and return values.  You can control this behavior for a specific
12303 function by using the function attribute @samp{sseregparm}.
12304 @xref{Function Attributes}.
12305
12306 @strong{Warning:} if you use this switch then you must build all
12307 modules with the same value, including any libraries.  This includes
12308 the system libraries and startup modules.
12309
12310 @item -mpc32
12311 @itemx -mpc64
12312 @itemx -mpc80
12313 @opindex mpc32
12314 @opindex mpc64
12315 @opindex mpc80
12316
12317 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
12318 is specified, the significands of results of floating-point operations are
12319 rounded to 24 bits (single precision); @option{-mpc64} rounds the
12320 significands of results of floating-point operations to 53 bits (double
12321 precision) and @option{-mpc80} rounds the significands of results of
12322 floating-point operations to 64 bits (extended double precision), which is
12323 the default.  When this option is used, floating-point operations in higher
12324 precisions are not available to the programmer without setting the FPU
12325 control word explicitly.
12326
12327 Setting the rounding of floating-point operations to less than the default
12328 80 bits can speed some programs by 2% or more.  Note that some mathematical
12329 libraries assume that extended precision (80 bit) floating-point operations
12330 are enabled by default; routines in such libraries could suffer significant
12331 loss of accuracy, typically through so-called "catastrophic cancellation",
12332 when this option is used to set the precision to less than extended precision.
12333
12334 @item -mstackrealign
12335 @opindex mstackrealign
12336 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
12337 option will generate an alternate prologue and epilogue that realigns the
12338 runtime stack if necessary.  This supports mixing legacy codes that keep
12339 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
12340 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
12341 applicable to individual functions.
12342
12343 @item -mpreferred-stack-boundary=@var{num}
12344 @opindex mpreferred-stack-boundary
12345 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
12346 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
12347 the default is 4 (16 bytes or 128 bits).
12348
12349 @item -mincoming-stack-boundary=@var{num}
12350 @opindex mincoming-stack-boundary
12351 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
12352 boundary.  If @option{-mincoming-stack-boundary} is not specified,
12353 the one specified by @option{-mpreferred-stack-boundary} will be used.
12354
12355 On Pentium and PentiumPro, @code{double} and @code{long double} values
12356 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
12357 suffer significant run time performance penalties.  On Pentium III, the
12358 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
12359 properly if it is not 16 byte aligned.
12360
12361 To ensure proper alignment of this values on the stack, the stack boundary
12362 must be as aligned as that required by any value stored on the stack.
12363 Further, every function must be generated such that it keeps the stack
12364 aligned.  Thus calling a function compiled with a higher preferred
12365 stack boundary from a function compiled with a lower preferred stack
12366 boundary will most likely misalign the stack.  It is recommended that
12367 libraries that use callbacks always use the default setting.
12368
12369 This extra alignment does consume extra stack space, and generally
12370 increases code size.  Code that is sensitive to stack space usage, such
12371 as embedded systems and operating system kernels, may want to reduce the
12372 preferred alignment to @option{-mpreferred-stack-boundary=2}.
12373
12374 @item -mmmx
12375 @itemx -mno-mmx
12376 @itemx -msse
12377 @itemx -mno-sse
12378 @itemx -msse2
12379 @itemx -mno-sse2
12380 @itemx -msse3
12381 @itemx -mno-sse3
12382 @itemx -mssse3
12383 @itemx -mno-ssse3
12384 @itemx -msse4.1
12385 @itemx -mno-sse4.1
12386 @itemx -msse4.2
12387 @itemx -mno-sse4.2
12388 @itemx -msse4
12389 @itemx -mno-sse4
12390 @itemx -mavx
12391 @itemx -mno-avx
12392 @itemx -maes
12393 @itemx -mno-aes
12394 @itemx -mpclmul
12395 @itemx -mno-pclmul
12396 @itemx -mfsgsbase
12397 @itemx -mno-fsgsbase
12398 @itemx -mrdrnd
12399 @itemx -mno-rdrnd
12400 @itemx -mf16c
12401 @itemx -mno-f16c
12402 @itemx -msse4a
12403 @itemx -mno-sse4a
12404 @itemx -mfma4
12405 @itemx -mno-fma4
12406 @itemx -mxop
12407 @itemx -mno-xop
12408 @itemx -mlwp
12409 @itemx -mno-lwp
12410 @itemx -m3dnow
12411 @itemx -mno-3dnow
12412 @itemx -mpopcnt
12413 @itemx -mno-popcnt
12414 @itemx -mabm
12415 @itemx -mno-abm
12416 @opindex mmmx
12417 @opindex mno-mmx
12418 @opindex msse
12419 @opindex mno-sse
12420 @opindex m3dnow
12421 @opindex mno-3dnow
12422 These switches enable or disable the use of instructions in the MMX,
12423 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, FSGSBASE, RDRND,
12424 F16C, SSE4A, FMA4, XOP, LWP, ABM or 3DNow!@: extended instruction sets.
12425 These extensions are also available as built-in functions: see
12426 @ref{X86 Built-in Functions}, for details of the functions enabled and
12427 disabled by these switches.
12428
12429 To have SSE/SSE2 instructions generated automatically from floating-point
12430 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
12431
12432 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
12433 generates new AVX instructions or AVX equivalence for all SSEx instructions
12434 when needed.
12435
12436 These options will enable GCC to use these extended instructions in
12437 generated code, even without @option{-mfpmath=sse}.  Applications which
12438 perform runtime CPU detection must compile separate files for each
12439 supported architecture, using the appropriate flags.  In particular,
12440 the file containing the CPU detection code should be compiled without
12441 these options.
12442
12443 @item -mfused-madd
12444 @itemx -mno-fused-madd
12445 @opindex mfused-madd
12446 @opindex mno-fused-madd
12447 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12448 instructions.  The default is to use these instructions.
12449
12450 @item -mcld
12451 @opindex mcld
12452 This option instructs GCC to emit a @code{cld} instruction in the prologue
12453 of functions that use string instructions.  String instructions depend on
12454 the DF flag to select between autoincrement or autodecrement mode.  While the
12455 ABI specifies the DF flag to be cleared on function entry, some operating
12456 systems violate this specification by not clearing the DF flag in their
12457 exception dispatchers.  The exception handler can be invoked with the DF flag
12458 set which leads to wrong direction mode, when string instructions are used.
12459 This option can be enabled by default on 32-bit x86 targets by configuring
12460 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
12461 instructions can be suppressed with the @option{-mno-cld} compiler option
12462 in this case.
12463
12464 @item -mcx16
12465 @opindex mcx16
12466 This option will enable GCC to use CMPXCHG16B instruction in generated code.
12467 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
12468 data types.  This is useful for high resolution counters that could be updated
12469 by multiple processors (or cores).  This instruction is generated as part of
12470 atomic built-in functions: see @ref{Atomic Builtins} for details.
12471
12472 @item -msahf
12473 @opindex msahf
12474 This option will enable GCC to use SAHF instruction in generated 64-bit code.
12475 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
12476 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
12477 SAHF are load and store instructions, respectively, for certain status flags.
12478 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
12479 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
12480
12481 @item -mmovbe
12482 @opindex mmovbe
12483 This option will enable GCC to use movbe instruction to implement
12484 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
12485
12486 @item -mcrc32
12487 @opindex mcrc32
12488 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
12489 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
12490 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
12491
12492 @item -mrecip
12493 @opindex mrecip
12494 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
12495 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
12496 to increase precision instead of DIVSS and SQRTSS (and their vectorized
12497 variants) for single precision floating point arguments.  These instructions
12498 are generated only when @option{-funsafe-math-optimizations} is enabled
12499 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
12500 Note that while the throughput of the sequence is higher than the throughput
12501 of the non-reciprocal instruction, the precision of the sequence can be
12502 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
12503
12504 Note that GCC implements 1.0f/sqrtf(x) in terms of RSQRTSS (or RSQRTPS)
12505 already with @option{-ffast-math} (or the above option combination), and
12506 doesn't need @option{-mrecip}.
12507
12508 @item -mveclibabi=@var{type}
12509 @opindex mveclibabi
12510 Specifies the ABI type to use for vectorizing intrinsics using an
12511 external library.  Supported types are @code{svml} for the Intel short
12512 vector math library and @code{acml} for the AMD math core library style
12513 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
12514 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
12515 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
12516 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
12517 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
12518 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
12519 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
12520 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
12521 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
12522 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
12523 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
12524 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
12525 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
12526 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
12527 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
12528 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
12529 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
12530 compatible library will have to be specified at link time.
12531
12532 @item -mabi=@var{name}
12533 @opindex mabi
12534 Generate code for the specified calling convention.  Permissible values
12535 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
12536 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
12537 ABI when targeting Windows.  On all other systems, the default is the
12538 SYSV ABI.  You can control this behavior for a specific function by
12539 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
12540 @xref{Function Attributes}.
12541
12542 @item -mpush-args
12543 @itemx -mno-push-args
12544 @opindex mpush-args
12545 @opindex mno-push-args
12546 Use PUSH operations to store outgoing parameters.  This method is shorter
12547 and usually equally fast as method using SUB/MOV operations and is enabled
12548 by default.  In some cases disabling it may improve performance because of
12549 improved scheduling and reduced dependencies.
12550
12551 @item -maccumulate-outgoing-args
12552 @opindex maccumulate-outgoing-args
12553 If enabled, the maximum amount of space required for outgoing arguments will be
12554 computed in the function prologue.  This is faster on most modern CPUs
12555 because of reduced dependencies, improved scheduling and reduced stack usage
12556 when preferred stack boundary is not equal to 2.  The drawback is a notable
12557 increase in code size.  This switch implies @option{-mno-push-args}.
12558
12559 @item -mthreads
12560 @opindex mthreads
12561 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
12562 on thread-safe exception handling must compile and link all code with the
12563 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
12564 @option{-D_MT}; when linking, it links in a special thread helper library
12565 @option{-lmingwthrd} which cleans up per thread exception handling data.
12566
12567 @item -mno-align-stringops
12568 @opindex mno-align-stringops
12569 Do not align destination of inlined string operations.  This switch reduces
12570 code size and improves performance in case the destination is already aligned,
12571 but GCC doesn't know about it.
12572
12573 @item -minline-all-stringops
12574 @opindex minline-all-stringops
12575 By default GCC inlines string operations only when destination is known to be
12576 aligned at least to 4 byte boundary.  This enables more inlining, increase code
12577 size, but may improve performance of code that depends on fast memcpy, strlen
12578 and memset for short lengths.
12579
12580 @item -minline-stringops-dynamically
12581 @opindex minline-stringops-dynamically
12582 For string operation of unknown size, inline runtime checks so for small
12583 blocks inline code is used, while for large blocks library call is used.
12584
12585 @item -mstringop-strategy=@var{alg}
12586 @opindex mstringop-strategy=@var{alg}
12587 Overwrite internal decision heuristic about particular algorithm to inline
12588 string operation with.  The allowed values are @code{rep_byte},
12589 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
12590 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
12591 expanding inline loop, @code{libcall} for always expanding library call.
12592
12593 @item -momit-leaf-frame-pointer
12594 @opindex momit-leaf-frame-pointer
12595 Don't keep the frame pointer in a register for leaf functions.  This
12596 avoids the instructions to save, set up and restore frame pointers and
12597 makes an extra register available in leaf functions.  The option
12598 @option{-fomit-frame-pointer} removes the frame pointer for all functions
12599 which might make debugging harder.
12600
12601 @item -mtls-direct-seg-refs
12602 @itemx -mno-tls-direct-seg-refs
12603 @opindex mtls-direct-seg-refs
12604 Controls whether TLS variables may be accessed with offsets from the
12605 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
12606 or whether the thread base pointer must be added.  Whether or not this
12607 is legal depends on the operating system, and whether it maps the
12608 segment to cover the entire TLS area.
12609
12610 For systems that use GNU libc, the default is on.
12611
12612 @item -msse2avx
12613 @itemx -mno-sse2avx
12614 @opindex msse2avx
12615 Specify that the assembler should encode SSE instructions with VEX
12616 prefix.  The option @option{-mavx} turns this on by default.
12617
12618 @item -mfentry
12619 @itemx -mno-fentry
12620 @opindex mfentry
12621 If profiling is active @option{-pg} put the profiling
12622 counter call before prologue.
12623 Note: On x86 architectures the attribute @code{ms_hook_prologue}
12624 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
12625 @end table
12626
12627 These @samp{-m} switches are supported in addition to the above
12628 on AMD x86-64 processors in 64-bit environments.
12629
12630 @table @gcctabopt
12631 @item -m32
12632 @itemx -m64
12633 @opindex m32
12634 @opindex m64
12635 Generate code for a 32-bit or 64-bit environment.
12636 The 32-bit environment sets int, long and pointer to 32 bits and
12637 generates code that runs on any i386 system.
12638 The 64-bit environment sets int to 32 bits and long and pointer
12639 to 64 bits and generates code for AMD's x86-64 architecture. For
12640 darwin only the -m64 option turns off the @option{-fno-pic} and
12641 @option{-mdynamic-no-pic} options.
12642
12643 @item -mno-red-zone
12644 @opindex mno-red-zone
12645 Do not use a so called red zone for x86-64 code.  The red zone is mandated
12646 by the x86-64 ABI, it is a 128-byte area beyond the location of the
12647 stack pointer that will not be modified by signal or interrupt handlers
12648 and therefore can be used for temporary data without adjusting the stack
12649 pointer.  The flag @option{-mno-red-zone} disables this red zone.
12650
12651 @item -mcmodel=small
12652 @opindex mcmodel=small
12653 Generate code for the small code model: the program and its symbols must
12654 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
12655 Programs can be statically or dynamically linked.  This is the default
12656 code model.
12657
12658 @item -mcmodel=kernel
12659 @opindex mcmodel=kernel
12660 Generate code for the kernel code model.  The kernel runs in the
12661 negative 2 GB of the address space.
12662 This model has to be used for Linux kernel code.
12663
12664 @item -mcmodel=medium
12665 @opindex mcmodel=medium
12666 Generate code for the medium model: The program is linked in the lower 2
12667 GB of the address space.  Small symbols are also placed there.  Symbols
12668 with sizes larger than @option{-mlarge-data-threshold} are put into
12669 large data or bss sections and can be located above 2GB.  Programs can
12670 be statically or dynamically linked.
12671
12672 @item -mcmodel=large
12673 @opindex mcmodel=large
12674 Generate code for the large model: This model makes no assumptions
12675 about addresses and sizes of sections.
12676 @end table
12677
12678 @node IA-64 Options
12679 @subsection IA-64 Options
12680 @cindex IA-64 Options
12681
12682 These are the @samp{-m} options defined for the Intel IA-64 architecture.
12683
12684 @table @gcctabopt
12685 @item -mbig-endian
12686 @opindex mbig-endian
12687 Generate code for a big endian target.  This is the default for HP-UX@.
12688
12689 @item -mlittle-endian
12690 @opindex mlittle-endian
12691 Generate code for a little endian target.  This is the default for AIX5
12692 and GNU/Linux.
12693
12694 @item -mgnu-as
12695 @itemx -mno-gnu-as
12696 @opindex mgnu-as
12697 @opindex mno-gnu-as
12698 Generate (or don't) code for the GNU assembler.  This is the default.
12699 @c Also, this is the default if the configure option @option{--with-gnu-as}
12700 @c is used.
12701
12702 @item -mgnu-ld
12703 @itemx -mno-gnu-ld
12704 @opindex mgnu-ld
12705 @opindex mno-gnu-ld
12706 Generate (or don't) code for the GNU linker.  This is the default.
12707 @c Also, this is the default if the configure option @option{--with-gnu-ld}
12708 @c is used.
12709
12710 @item -mno-pic
12711 @opindex mno-pic
12712 Generate code that does not use a global pointer register.  The result
12713 is not position independent code, and violates the IA-64 ABI@.
12714
12715 @item -mvolatile-asm-stop
12716 @itemx -mno-volatile-asm-stop
12717 @opindex mvolatile-asm-stop
12718 @opindex mno-volatile-asm-stop
12719 Generate (or don't) a stop bit immediately before and after volatile asm
12720 statements.
12721
12722 @item -mregister-names
12723 @itemx -mno-register-names
12724 @opindex mregister-names
12725 @opindex mno-register-names
12726 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
12727 the stacked registers.  This may make assembler output more readable.
12728
12729 @item -mno-sdata
12730 @itemx -msdata
12731 @opindex mno-sdata
12732 @opindex msdata
12733 Disable (or enable) optimizations that use the small data section.  This may
12734 be useful for working around optimizer bugs.
12735
12736 @item -mconstant-gp
12737 @opindex mconstant-gp
12738 Generate code that uses a single constant global pointer value.  This is
12739 useful when compiling kernel code.
12740
12741 @item -mauto-pic
12742 @opindex mauto-pic
12743 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
12744 This is useful when compiling firmware code.
12745
12746 @item -minline-float-divide-min-latency
12747 @opindex minline-float-divide-min-latency
12748 Generate code for inline divides of floating point values
12749 using the minimum latency algorithm.
12750
12751 @item -minline-float-divide-max-throughput
12752 @opindex minline-float-divide-max-throughput
12753 Generate code for inline divides of floating point values
12754 using the maximum throughput algorithm.
12755
12756 @item -mno-inline-float-divide
12757 @opindex mno-inline-float-divide
12758 Do not generate inline code for divides of floating point values.
12759
12760 @item -minline-int-divide-min-latency
12761 @opindex minline-int-divide-min-latency
12762 Generate code for inline divides of integer values
12763 using the minimum latency algorithm.
12764
12765 @item -minline-int-divide-max-throughput
12766 @opindex minline-int-divide-max-throughput
12767 Generate code for inline divides of integer values
12768 using the maximum throughput algorithm.
12769
12770 @item -mno-inline-int-divide
12771 @opindex mno-inline-int-divide
12772 Do not generate inline code for divides of integer values.
12773
12774 @item -minline-sqrt-min-latency
12775 @opindex minline-sqrt-min-latency
12776 Generate code for inline square roots
12777 using the minimum latency algorithm.
12778
12779 @item -minline-sqrt-max-throughput
12780 @opindex minline-sqrt-max-throughput
12781 Generate code for inline square roots
12782 using the maximum throughput algorithm.
12783
12784 @item -mno-inline-sqrt
12785 @opindex mno-inline-sqrt
12786 Do not generate inline code for sqrt.
12787
12788 @item -mfused-madd
12789 @itemx -mno-fused-madd
12790 @opindex mfused-madd
12791 @opindex mno-fused-madd
12792 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12793 instructions.  The default is to use these instructions.
12794
12795 @item -mno-dwarf2-asm
12796 @itemx -mdwarf2-asm
12797 @opindex mno-dwarf2-asm
12798 @opindex mdwarf2-asm
12799 Don't (or do) generate assembler code for the DWARF2 line number debugging
12800 info.  This may be useful when not using the GNU assembler.
12801
12802 @item -mearly-stop-bits
12803 @itemx -mno-early-stop-bits
12804 @opindex mearly-stop-bits
12805 @opindex mno-early-stop-bits
12806 Allow stop bits to be placed earlier than immediately preceding the
12807 instruction that triggered the stop bit.  This can improve instruction
12808 scheduling, but does not always do so.
12809
12810 @item -mfixed-range=@var{register-range}
12811 @opindex mfixed-range
12812 Generate code treating the given register range as fixed registers.
12813 A fixed register is one that the register allocator can not use.  This is
12814 useful when compiling kernel code.  A register range is specified as
12815 two registers separated by a dash.  Multiple register ranges can be
12816 specified separated by a comma.
12817
12818 @item -mtls-size=@var{tls-size}
12819 @opindex mtls-size
12820 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
12821 64.
12822
12823 @item -mtune=@var{cpu-type}
12824 @opindex mtune
12825 Tune the instruction scheduling for a particular CPU, Valid values are
12826 itanium, itanium1, merced, itanium2, and mckinley.
12827
12828 @item -milp32
12829 @itemx -mlp64
12830 @opindex milp32
12831 @opindex mlp64
12832 Generate code for a 32-bit or 64-bit environment.
12833 The 32-bit environment sets int, long and pointer to 32 bits.
12834 The 64-bit environment sets int to 32 bits and long and pointer
12835 to 64 bits.  These are HP-UX specific flags.
12836
12837 @item -mno-sched-br-data-spec
12838 @itemx -msched-br-data-spec
12839 @opindex mno-sched-br-data-spec
12840 @opindex msched-br-data-spec
12841 (Dis/En)able data speculative scheduling before reload.
12842 This will result in generation of the ld.a instructions and
12843 the corresponding check instructions (ld.c / chk.a).
12844 The default is 'disable'.
12845
12846 @item -msched-ar-data-spec
12847 @itemx -mno-sched-ar-data-spec
12848 @opindex msched-ar-data-spec
12849 @opindex mno-sched-ar-data-spec
12850 (En/Dis)able data speculative scheduling after reload.
12851 This will result in generation of the ld.a instructions and
12852 the corresponding check instructions (ld.c / chk.a).
12853 The default is 'enable'.
12854
12855 @item -mno-sched-control-spec
12856 @itemx -msched-control-spec
12857 @opindex mno-sched-control-spec
12858 @opindex msched-control-spec
12859 (Dis/En)able control speculative scheduling.  This feature is
12860 available only during region scheduling (i.e.@: before reload).
12861 This will result in generation of the ld.s instructions and
12862 the corresponding check instructions chk.s .
12863 The default is 'disable'.
12864
12865 @item -msched-br-in-data-spec
12866 @itemx -mno-sched-br-in-data-spec
12867 @opindex msched-br-in-data-spec
12868 @opindex mno-sched-br-in-data-spec
12869 (En/Dis)able speculative scheduling of the instructions that
12870 are dependent on the data speculative loads before reload.
12871 This is effective only with @option{-msched-br-data-spec} enabled.
12872 The default is 'enable'.
12873
12874 @item -msched-ar-in-data-spec
12875 @itemx -mno-sched-ar-in-data-spec
12876 @opindex msched-ar-in-data-spec
12877 @opindex mno-sched-ar-in-data-spec
12878 (En/Dis)able speculative scheduling of the instructions that
12879 are dependent on the data speculative loads after reload.
12880 This is effective only with @option{-msched-ar-data-spec} enabled.
12881 The default is 'enable'.
12882
12883 @item -msched-in-control-spec
12884 @itemx -mno-sched-in-control-spec
12885 @opindex msched-in-control-spec
12886 @opindex mno-sched-in-control-spec
12887 (En/Dis)able speculative scheduling of the instructions that
12888 are dependent on the control speculative loads.
12889 This is effective only with @option{-msched-control-spec} enabled.
12890 The default is 'enable'.
12891
12892 @item -mno-sched-prefer-non-data-spec-insns
12893 @itemx -msched-prefer-non-data-spec-insns
12894 @opindex mno-sched-prefer-non-data-spec-insns
12895 @opindex msched-prefer-non-data-spec-insns
12896 If enabled, data speculative instructions will be chosen for schedule
12897 only if there are no other choices at the moment.  This will make
12898 the use of the data speculation much more conservative.
12899 The default is 'disable'.
12900
12901 @item -mno-sched-prefer-non-control-spec-insns
12902 @itemx -msched-prefer-non-control-spec-insns
12903 @opindex mno-sched-prefer-non-control-spec-insns
12904 @opindex msched-prefer-non-control-spec-insns
12905 If enabled, control speculative instructions will be chosen for schedule
12906 only if there are no other choices at the moment.  This will make
12907 the use of the control speculation much more conservative.
12908 The default is 'disable'.
12909
12910 @item -mno-sched-count-spec-in-critical-path
12911 @itemx -msched-count-spec-in-critical-path
12912 @opindex mno-sched-count-spec-in-critical-path
12913 @opindex msched-count-spec-in-critical-path
12914 If enabled, speculative dependencies will be considered during
12915 computation of the instructions priorities.  This will make the use of the
12916 speculation a bit more conservative.
12917 The default is 'disable'.
12918
12919 @item -msched-spec-ldc
12920 @opindex msched-spec-ldc
12921 Use a simple data speculation check.  This option is on by default.
12922
12923 @item -msched-control-spec-ldc
12924 @opindex msched-spec-ldc
12925 Use a simple check for control speculation.  This option is on by default.
12926
12927 @item -msched-stop-bits-after-every-cycle
12928 @opindex msched-stop-bits-after-every-cycle
12929 Place a stop bit after every cycle when scheduling.  This option is on
12930 by default.
12931
12932 @item -msched-fp-mem-deps-zero-cost
12933 @opindex msched-fp-mem-deps-zero-cost
12934 Assume that floating-point stores and loads are not likely to cause a conflict
12935 when placed into the same instruction group.  This option is disabled by
12936 default.
12937
12938 @item -msel-sched-dont-check-control-spec
12939 @opindex msel-sched-dont-check-control-spec
12940 Generate checks for control speculation in selective scheduling.
12941 This flag is disabled by default.
12942
12943 @item -msched-max-memory-insns=@var{max-insns}
12944 @opindex msched-max-memory-insns
12945 Limit on the number of memory insns per instruction group, giving lower
12946 priority to subsequent memory insns attempting to schedule in the same
12947 instruction group. Frequently useful to prevent cache bank conflicts.
12948 The default value is 1.
12949
12950 @item -msched-max-memory-insns-hard-limit
12951 @opindex msched-max-memory-insns-hard-limit
12952 Disallow more than `msched-max-memory-insns' in instruction group.
12953 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
12954 when limit is reached but may still schedule memory operations.
12955
12956 @end table
12957
12958 @node IA-64/VMS Options
12959 @subsection IA-64/VMS Options
12960
12961 These @samp{-m} options are defined for the IA-64/VMS implementations:
12962
12963 @table @gcctabopt
12964 @item -mvms-return-codes
12965 @opindex mvms-return-codes
12966 Return VMS condition codes from main. The default is to return POSIX
12967 style condition (e.g.@ error) codes.
12968
12969 @item -mdebug-main=@var{prefix}
12970 @opindex mdebug-main=@var{prefix}
12971 Flag the first routine whose name starts with @var{prefix} as the main
12972 routine for the debugger.
12973
12974 @item -mmalloc64
12975 @opindex mmalloc64
12976 Default to 64bit memory allocation routines.
12977 @end table
12978
12979 @node LM32 Options
12980 @subsection LM32 Options
12981 @cindex LM32 options
12982
12983 These @option{-m} options are defined for the Lattice Mico32 architecture:
12984
12985 @table @gcctabopt
12986 @item -mbarrel-shift-enabled
12987 @opindex mbarrel-shift-enabled
12988 Enable barrel-shift instructions.
12989
12990 @item -mdivide-enabled
12991 @opindex mdivide-enabled
12992 Enable divide and modulus instructions.
12993
12994 @item -mmultiply-enabled
12995 @opindex multiply-enabled
12996 Enable multiply instructions.
12997
12998 @item -msign-extend-enabled
12999 @opindex msign-extend-enabled
13000 Enable sign extend instructions.
13001
13002 @item -muser-enabled
13003 @opindex muser-enabled
13004 Enable user-defined instructions.
13005
13006 @end table
13007
13008 @node M32C Options
13009 @subsection M32C Options
13010 @cindex M32C options
13011
13012 @table @gcctabopt
13013 @item -mcpu=@var{name}
13014 @opindex mcpu=
13015 Select the CPU for which code is generated.  @var{name} may be one of
13016 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
13017 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
13018 the M32C/80 series.
13019
13020 @item -msim
13021 @opindex msim
13022 Specifies that the program will be run on the simulator.  This causes
13023 an alternate runtime library to be linked in which supports, for
13024 example, file I/O@.  You must not use this option when generating
13025 programs that will run on real hardware; you must provide your own
13026 runtime library for whatever I/O functions are needed.
13027
13028 @item -memregs=@var{number}
13029 @opindex memregs=
13030 Specifies the number of memory-based pseudo-registers GCC will use
13031 during code generation.  These pseudo-registers will be used like real
13032 registers, so there is a tradeoff between GCC's ability to fit the
13033 code into available registers, and the performance penalty of using
13034 memory instead of registers.  Note that all modules in a program must
13035 be compiled with the same value for this option.  Because of that, you
13036 must not use this option with the default runtime libraries gcc
13037 builds.
13038
13039 @end table
13040
13041 @node M32R/D Options
13042 @subsection M32R/D Options
13043 @cindex M32R/D options
13044
13045 These @option{-m} options are defined for Renesas M32R/D architectures:
13046
13047 @table @gcctabopt
13048 @item -m32r2
13049 @opindex m32r2
13050 Generate code for the M32R/2@.
13051
13052 @item -m32rx
13053 @opindex m32rx
13054 Generate code for the M32R/X@.
13055
13056 @item -m32r
13057 @opindex m32r
13058 Generate code for the M32R@.  This is the default.
13059
13060 @item -mmodel=small
13061 @opindex mmodel=small
13062 Assume all objects live in the lower 16MB of memory (so that their addresses
13063 can be loaded with the @code{ld24} instruction), and assume all subroutines
13064 are reachable with the @code{bl} instruction.
13065 This is the default.
13066
13067 The addressability of a particular object can be set with the
13068 @code{model} attribute.
13069
13070 @item -mmodel=medium
13071 @opindex mmodel=medium
13072 Assume objects may be anywhere in the 32-bit address space (the compiler
13073 will generate @code{seth/add3} instructions to load their addresses), and
13074 assume all subroutines are reachable with the @code{bl} instruction.
13075
13076 @item -mmodel=large
13077 @opindex mmodel=large
13078 Assume objects may be anywhere in the 32-bit address space (the compiler
13079 will generate @code{seth/add3} instructions to load their addresses), and
13080 assume subroutines may not be reachable with the @code{bl} instruction
13081 (the compiler will generate the much slower @code{seth/add3/jl}
13082 instruction sequence).
13083
13084 @item -msdata=none
13085 @opindex msdata=none
13086 Disable use of the small data area.  Variables will be put into
13087 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
13088 @code{section} attribute has been specified).
13089 This is the default.
13090
13091 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
13092 Objects may be explicitly put in the small data area with the
13093 @code{section} attribute using one of these sections.
13094
13095 @item -msdata=sdata
13096 @opindex msdata=sdata
13097 Put small global and static data in the small data area, but do not
13098 generate special code to reference them.
13099
13100 @item -msdata=use
13101 @opindex msdata=use
13102 Put small global and static data in the small data area, and generate
13103 special instructions to reference them.
13104
13105 @item -G @var{num}
13106 @opindex G
13107 @cindex smaller data references
13108 Put global and static objects less than or equal to @var{num} bytes
13109 into the small data or bss sections instead of the normal data or bss
13110 sections.  The default value of @var{num} is 8.
13111 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
13112 for this option to have any effect.
13113
13114 All modules should be compiled with the same @option{-G @var{num}} value.
13115 Compiling with different values of @var{num} may or may not work; if it
13116 doesn't the linker will give an error message---incorrect code will not be
13117 generated.
13118
13119 @item -mdebug
13120 @opindex mdebug
13121 Makes the M32R specific code in the compiler display some statistics
13122 that might help in debugging programs.
13123
13124 @item -malign-loops
13125 @opindex malign-loops
13126 Align all loops to a 32-byte boundary.
13127
13128 @item -mno-align-loops
13129 @opindex mno-align-loops
13130 Do not enforce a 32-byte alignment for loops.  This is the default.
13131
13132 @item -missue-rate=@var{number}
13133 @opindex missue-rate=@var{number}
13134 Issue @var{number} instructions per cycle.  @var{number} can only be 1
13135 or 2.
13136
13137 @item -mbranch-cost=@var{number}
13138 @opindex mbranch-cost=@var{number}
13139 @var{number} can only be 1 or 2.  If it is 1 then branches will be
13140 preferred over conditional code, if it is 2, then the opposite will
13141 apply.
13142
13143 @item -mflush-trap=@var{number}
13144 @opindex mflush-trap=@var{number}
13145 Specifies the trap number to use to flush the cache.  The default is
13146 12.  Valid numbers are between 0 and 15 inclusive.
13147
13148 @item -mno-flush-trap
13149 @opindex mno-flush-trap
13150 Specifies that the cache cannot be flushed by using a trap.
13151
13152 @item -mflush-func=@var{name}
13153 @opindex mflush-func=@var{name}
13154 Specifies the name of the operating system function to call to flush
13155 the cache.  The default is @emph{_flush_cache}, but a function call
13156 will only be used if a trap is not available.
13157
13158 @item -mno-flush-func
13159 @opindex mno-flush-func
13160 Indicates that there is no OS function for flushing the cache.
13161
13162 @end table
13163
13164 @node M680x0 Options
13165 @subsection M680x0 Options
13166 @cindex M680x0 options
13167
13168 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
13169 The default settings depend on which architecture was selected when
13170 the compiler was configured; the defaults for the most common choices
13171 are given below.
13172
13173 @table @gcctabopt
13174 @item -march=@var{arch}
13175 @opindex march
13176 Generate code for a specific M680x0 or ColdFire instruction set
13177 architecture.  Permissible values of @var{arch} for M680x0
13178 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
13179 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
13180 architectures are selected according to Freescale's ISA classification
13181 and the permissible values are: @samp{isaa}, @samp{isaaplus},
13182 @samp{isab} and @samp{isac}.
13183
13184 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
13185 code for a ColdFire target.  The @var{arch} in this macro is one of the
13186 @option{-march} arguments given above.
13187
13188 When used together, @option{-march} and @option{-mtune} select code
13189 that runs on a family of similar processors but that is optimized
13190 for a particular microarchitecture.
13191
13192 @item -mcpu=@var{cpu}
13193 @opindex mcpu
13194 Generate code for a specific M680x0 or ColdFire processor.
13195 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
13196 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
13197 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
13198 below, which also classifies the CPUs into families:
13199
13200 @multitable @columnfractions 0.20 0.80
13201 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
13202 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
13203 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
13204 @item @samp{5206e} @tab @samp{5206e}
13205 @item @samp{5208} @tab @samp{5207} @samp{5208}
13206 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
13207 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
13208 @item @samp{5216} @tab @samp{5214} @samp{5216}
13209 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
13210 @item @samp{5225} @tab @samp{5224} @samp{5225}
13211 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
13212 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
13213 @item @samp{5249} @tab @samp{5249}
13214 @item @samp{5250} @tab @samp{5250}
13215 @item @samp{5271} @tab @samp{5270} @samp{5271}
13216 @item @samp{5272} @tab @samp{5272}
13217 @item @samp{5275} @tab @samp{5274} @samp{5275}
13218 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
13219 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
13220 @item @samp{5307} @tab @samp{5307}
13221 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
13222 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
13223 @item @samp{5407} @tab @samp{5407}
13224 @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}
13225 @end multitable
13226
13227 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
13228 @var{arch} is compatible with @var{cpu}.  Other combinations of
13229 @option{-mcpu} and @option{-march} are rejected.
13230
13231 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
13232 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
13233 where the value of @var{family} is given by the table above.
13234
13235 @item -mtune=@var{tune}
13236 @opindex mtune
13237 Tune the code for a particular microarchitecture, within the
13238 constraints set by @option{-march} and @option{-mcpu}.
13239 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
13240 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
13241 and @samp{cpu32}.  The ColdFire microarchitectures
13242 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
13243
13244 You can also use @option{-mtune=68020-40} for code that needs
13245 to run relatively well on 68020, 68030 and 68040 targets.
13246 @option{-mtune=68020-60} is similar but includes 68060 targets
13247 as well.  These two options select the same tuning decisions as
13248 @option{-m68020-40} and @option{-m68020-60} respectively.
13249
13250 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
13251 when tuning for 680x0 architecture @var{arch}.  It also defines
13252 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
13253 option is used.  If gcc is tuning for a range of architectures,
13254 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
13255 it defines the macros for every architecture in the range.
13256
13257 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
13258 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
13259 of the arguments given above.
13260
13261 @item -m68000
13262 @itemx -mc68000
13263 @opindex m68000
13264 @opindex mc68000
13265 Generate output for a 68000.  This is the default
13266 when the compiler is configured for 68000-based systems.
13267 It is equivalent to @option{-march=68000}.
13268
13269 Use this option for microcontrollers with a 68000 or EC000 core,
13270 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
13271
13272 @item -m68010
13273 @opindex m68010
13274 Generate output for a 68010.  This is the default
13275 when the compiler is configured for 68010-based systems.
13276 It is equivalent to @option{-march=68010}.
13277
13278 @item -m68020
13279 @itemx -mc68020
13280 @opindex m68020
13281 @opindex mc68020
13282 Generate output for a 68020.  This is the default
13283 when the compiler is configured for 68020-based systems.
13284 It is equivalent to @option{-march=68020}.
13285
13286 @item -m68030
13287 @opindex m68030
13288 Generate output for a 68030.  This is the default when the compiler is
13289 configured for 68030-based systems.  It is equivalent to
13290 @option{-march=68030}.
13291
13292 @item -m68040
13293 @opindex m68040
13294 Generate output for a 68040.  This is the default when the compiler is
13295 configured for 68040-based systems.  It is equivalent to
13296 @option{-march=68040}.
13297
13298 This option inhibits the use of 68881/68882 instructions that have to be
13299 emulated by software on the 68040.  Use this option if your 68040 does not
13300 have code to emulate those instructions.
13301
13302 @item -m68060
13303 @opindex m68060
13304 Generate output for a 68060.  This is the default when the compiler is
13305 configured for 68060-based systems.  It is equivalent to
13306 @option{-march=68060}.
13307
13308 This option inhibits the use of 68020 and 68881/68882 instructions that
13309 have to be emulated by software on the 68060.  Use this option if your 68060
13310 does not have code to emulate those instructions.
13311
13312 @item -mcpu32
13313 @opindex mcpu32
13314 Generate output for a CPU32.  This is the default
13315 when the compiler is configured for CPU32-based systems.
13316 It is equivalent to @option{-march=cpu32}.
13317
13318 Use this option for microcontrollers with a
13319 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
13320 68336, 68340, 68341, 68349 and 68360.
13321
13322 @item -m5200
13323 @opindex m5200
13324 Generate output for a 520X ColdFire CPU@.  This is the default
13325 when the compiler is configured for 520X-based systems.
13326 It is equivalent to @option{-mcpu=5206}, and is now deprecated
13327 in favor of that option.
13328
13329 Use this option for microcontroller with a 5200 core, including
13330 the MCF5202, MCF5203, MCF5204 and MCF5206.
13331
13332 @item -m5206e
13333 @opindex m5206e
13334 Generate output for a 5206e ColdFire CPU@.  The option is now
13335 deprecated in favor of the equivalent @option{-mcpu=5206e}.
13336
13337 @item -m528x
13338 @opindex m528x
13339 Generate output for a member of the ColdFire 528X family.
13340 The option is now deprecated in favor of the equivalent
13341 @option{-mcpu=528x}.
13342
13343 @item -m5307
13344 @opindex m5307
13345 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
13346 in favor of the equivalent @option{-mcpu=5307}.
13347
13348 @item -m5407
13349 @opindex m5407
13350 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
13351 in favor of the equivalent @option{-mcpu=5407}.
13352
13353 @item -mcfv4e
13354 @opindex mcfv4e
13355 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
13356 This includes use of hardware floating point instructions.
13357 The option is equivalent to @option{-mcpu=547x}, and is now
13358 deprecated in favor of that option.
13359
13360 @item -m68020-40
13361 @opindex m68020-40
13362 Generate output for a 68040, without using any of the new instructions.
13363 This results in code which can run relatively efficiently on either a
13364 68020/68881 or a 68030 or a 68040.  The generated code does use the
13365 68881 instructions that are emulated on the 68040.
13366
13367 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
13368
13369 @item -m68020-60
13370 @opindex m68020-60
13371 Generate output for a 68060, without using any of the new instructions.
13372 This results in code which can run relatively efficiently on either a
13373 68020/68881 or a 68030 or a 68040.  The generated code does use the
13374 68881 instructions that are emulated on the 68060.
13375
13376 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
13377
13378 @item -mhard-float
13379 @itemx -m68881
13380 @opindex mhard-float
13381 @opindex m68881
13382 Generate floating-point instructions.  This is the default for 68020
13383 and above, and for ColdFire devices that have an FPU@.  It defines the
13384 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
13385 on ColdFire targets.
13386
13387 @item -msoft-float
13388 @opindex msoft-float
13389 Do not generate floating-point instructions; use library calls instead.
13390 This is the default for 68000, 68010, and 68832 targets.  It is also
13391 the default for ColdFire devices that have no FPU.
13392
13393 @item -mdiv
13394 @itemx -mno-div
13395 @opindex mdiv
13396 @opindex mno-div
13397 Generate (do not generate) ColdFire hardware divide and remainder
13398 instructions.  If @option{-march} is used without @option{-mcpu},
13399 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
13400 architectures.  Otherwise, the default is taken from the target CPU
13401 (either the default CPU, or the one specified by @option{-mcpu}).  For
13402 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
13403 @option{-mcpu=5206e}.
13404
13405 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
13406
13407 @item -mshort
13408 @opindex mshort
13409 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13410 Additionally, parameters passed on the stack are also aligned to a
13411 16-bit boundary even on targets whose API mandates promotion to 32-bit.
13412
13413 @item -mno-short
13414 @opindex mno-short
13415 Do not consider type @code{int} to be 16 bits wide.  This is the default.
13416
13417 @item -mnobitfield
13418 @itemx -mno-bitfield
13419 @opindex mnobitfield
13420 @opindex mno-bitfield
13421 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
13422 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
13423
13424 @item -mbitfield
13425 @opindex mbitfield
13426 Do use the bit-field instructions.  The @option{-m68020} option implies
13427 @option{-mbitfield}.  This is the default if you use a configuration
13428 designed for a 68020.
13429
13430 @item -mrtd
13431 @opindex mrtd
13432 Use a different function-calling convention, in which functions
13433 that take a fixed number of arguments return with the @code{rtd}
13434 instruction, which pops their arguments while returning.  This
13435 saves one instruction in the caller since there is no need to pop
13436 the arguments there.
13437
13438 This calling convention is incompatible with the one normally
13439 used on Unix, so you cannot use it if you need to call libraries
13440 compiled with the Unix compiler.
13441
13442 Also, you must provide function prototypes for all functions that
13443 take variable numbers of arguments (including @code{printf});
13444 otherwise incorrect code will be generated for calls to those
13445 functions.
13446
13447 In addition, seriously incorrect code will result if you call a
13448 function with too many arguments.  (Normally, extra arguments are
13449 harmlessly ignored.)
13450
13451 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
13452 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
13453
13454 @item -mno-rtd
13455 @opindex mno-rtd
13456 Do not use the calling conventions selected by @option{-mrtd}.
13457 This is the default.
13458
13459 @item -malign-int
13460 @itemx -mno-align-int
13461 @opindex malign-int
13462 @opindex mno-align-int
13463 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
13464 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
13465 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
13466 Aligning variables on 32-bit boundaries produces code that runs somewhat
13467 faster on processors with 32-bit busses at the expense of more memory.
13468
13469 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
13470 align structures containing the above types  differently than
13471 most published application binary interface specifications for the m68k.
13472
13473 @item -mpcrel
13474 @opindex mpcrel
13475 Use the pc-relative addressing mode of the 68000 directly, instead of
13476 using a global offset table.  At present, this option implies @option{-fpic},
13477 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
13478 not presently supported with @option{-mpcrel}, though this could be supported for
13479 68020 and higher processors.
13480
13481 @item -mno-strict-align
13482 @itemx -mstrict-align
13483 @opindex mno-strict-align
13484 @opindex mstrict-align
13485 Do not (do) assume that unaligned memory references will be handled by
13486 the system.
13487
13488 @item -msep-data
13489 Generate code that allows the data segment to be located in a different
13490 area of memory from the text segment.  This allows for execute in place in
13491 an environment without virtual memory management.  This option implies
13492 @option{-fPIC}.
13493
13494 @item -mno-sep-data
13495 Generate code that assumes that the data segment follows the text segment.
13496 This is the default.
13497
13498 @item -mid-shared-library
13499 Generate code that supports shared libraries via the library ID method.
13500 This allows for execute in place and shared libraries in an environment
13501 without virtual memory management.  This option implies @option{-fPIC}.
13502
13503 @item -mno-id-shared-library
13504 Generate code that doesn't assume ID based shared libraries are being used.
13505 This is the default.
13506
13507 @item -mshared-library-id=n
13508 Specified the identification number of the ID based shared library being
13509 compiled.  Specifying a value of 0 will generate more compact code, specifying
13510 other values will force the allocation of that number to the current
13511 library but is no more space or time efficient than omitting this option.
13512
13513 @item -mxgot
13514 @itemx -mno-xgot
13515 @opindex mxgot
13516 @opindex mno-xgot
13517 When generating position-independent code for ColdFire, generate code
13518 that works if the GOT has more than 8192 entries.  This code is
13519 larger and slower than code generated without this option.  On M680x0
13520 processors, this option is not needed; @option{-fPIC} suffices.
13521
13522 GCC normally uses a single instruction to load values from the GOT@.
13523 While this is relatively efficient, it only works if the GOT
13524 is smaller than about 64k.  Anything larger causes the linker
13525 to report an error such as:
13526
13527 @cindex relocation truncated to fit (ColdFire)
13528 @smallexample
13529 relocation truncated to fit: R_68K_GOT16O foobar
13530 @end smallexample
13531
13532 If this happens, you should recompile your code with @option{-mxgot}.
13533 It should then work with very large GOTs.  However, code generated with
13534 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
13535 the value of a global symbol.
13536
13537 Note that some linkers, including newer versions of the GNU linker,
13538 can create multiple GOTs and sort GOT entries.  If you have such a linker,
13539 you should only need to use @option{-mxgot} when compiling a single
13540 object file that accesses more than 8192 GOT entries.  Very few do.
13541
13542 These options have no effect unless GCC is generating
13543 position-independent code.
13544
13545 @end table
13546
13547 @node M68hc1x Options
13548 @subsection M68hc1x Options
13549 @cindex M68hc1x options
13550
13551 These are the @samp{-m} options defined for the 68hc11 and 68hc12
13552 microcontrollers.  The default values for these options depends on
13553 which style of microcontroller was selected when the compiler was configured;
13554 the defaults for the most common choices are given below.
13555
13556 @table @gcctabopt
13557 @item -m6811
13558 @itemx -m68hc11
13559 @opindex m6811
13560 @opindex m68hc11
13561 Generate output for a 68HC11.  This is the default
13562 when the compiler is configured for 68HC11-based systems.
13563
13564 @item -m6812
13565 @itemx -m68hc12
13566 @opindex m6812
13567 @opindex m68hc12
13568 Generate output for a 68HC12.  This is the default
13569 when the compiler is configured for 68HC12-based systems.
13570
13571 @item -m68S12
13572 @itemx -m68hcs12
13573 @opindex m68S12
13574 @opindex m68hcs12
13575 Generate output for a 68HCS12.
13576
13577 @item -mauto-incdec
13578 @opindex mauto-incdec
13579 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
13580 addressing modes.
13581
13582 @item -minmax
13583 @itemx -mnominmax
13584 @opindex minmax
13585 @opindex mnominmax
13586 Enable the use of 68HC12 min and max instructions.
13587
13588 @item -mlong-calls
13589 @itemx -mno-long-calls
13590 @opindex mlong-calls
13591 @opindex mno-long-calls
13592 Treat all calls as being far away (near).  If calls are assumed to be
13593 far away, the compiler will use the @code{call} instruction to
13594 call a function and the @code{rtc} instruction for returning.
13595
13596 @item -mshort
13597 @opindex mshort
13598 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13599
13600 @item -msoft-reg-count=@var{count}
13601 @opindex msoft-reg-count
13602 Specify the number of pseudo-soft registers which are used for the
13603 code generation.  The maximum number is 32.  Using more pseudo-soft
13604 register may or may not result in better code depending on the program.
13605 The default is 4 for 68HC11 and 2 for 68HC12.
13606
13607 @end table
13608
13609 @node MCore Options
13610 @subsection MCore Options
13611 @cindex MCore options
13612
13613 These are the @samp{-m} options defined for the Motorola M*Core
13614 processors.
13615
13616 @table @gcctabopt
13617
13618 @item -mhardlit
13619 @itemx -mno-hardlit
13620 @opindex mhardlit
13621 @opindex mno-hardlit
13622 Inline constants into the code stream if it can be done in two
13623 instructions or less.
13624
13625 @item -mdiv
13626 @itemx -mno-div
13627 @opindex mdiv
13628 @opindex mno-div
13629 Use the divide instruction.  (Enabled by default).
13630
13631 @item -mrelax-immediate
13632 @itemx -mno-relax-immediate
13633 @opindex mrelax-immediate
13634 @opindex mno-relax-immediate
13635 Allow arbitrary sized immediates in bit operations.
13636
13637 @item -mwide-bitfields
13638 @itemx -mno-wide-bitfields
13639 @opindex mwide-bitfields
13640 @opindex mno-wide-bitfields
13641 Always treat bit-fields as int-sized.
13642
13643 @item -m4byte-functions
13644 @itemx -mno-4byte-functions
13645 @opindex m4byte-functions
13646 @opindex mno-4byte-functions
13647 Force all functions to be aligned to a four byte boundary.
13648
13649 @item -mcallgraph-data
13650 @itemx -mno-callgraph-data
13651 @opindex mcallgraph-data
13652 @opindex mno-callgraph-data
13653 Emit callgraph information.
13654
13655 @item -mslow-bytes
13656 @itemx -mno-slow-bytes
13657 @opindex mslow-bytes
13658 @opindex mno-slow-bytes
13659 Prefer word access when reading byte quantities.
13660
13661 @item -mlittle-endian
13662 @itemx -mbig-endian
13663 @opindex mlittle-endian
13664 @opindex mbig-endian
13665 Generate code for a little endian target.
13666
13667 @item -m210
13668 @itemx -m340
13669 @opindex m210
13670 @opindex m340
13671 Generate code for the 210 processor.
13672
13673 @item -mno-lsim
13674 @opindex mno-lsim
13675 Assume that run-time support has been provided and so omit the
13676 simulator library (@file{libsim.a)} from the linker command line.
13677
13678 @item -mstack-increment=@var{size}
13679 @opindex mstack-increment
13680 Set the maximum amount for a single stack increment operation.  Large
13681 values can increase the speed of programs which contain functions
13682 that need a large amount of stack space, but they can also trigger a
13683 segmentation fault if the stack is extended too much.  The default
13684 value is 0x1000.
13685
13686 @end table
13687
13688 @node MeP Options
13689 @subsection MeP Options
13690 @cindex MeP options
13691
13692 @table @gcctabopt
13693
13694 @item -mabsdiff
13695 @opindex mabsdiff
13696 Enables the @code{abs} instruction, which is the absolute difference
13697 between two registers.
13698
13699 @item -mall-opts
13700 @opindex mall-opts
13701 Enables all the optional instructions - average, multiply, divide, bit
13702 operations, leading zero, absolute difference, min/max, clip, and
13703 saturation.
13704
13705
13706 @item -maverage
13707 @opindex maverage
13708 Enables the @code{ave} instruction, which computes the average of two
13709 registers.
13710
13711 @item -mbased=@var{n}
13712 @opindex mbased=
13713 Variables of size @var{n} bytes or smaller will be placed in the
13714 @code{.based} section by default.  Based variables use the @code{$tp}
13715 register as a base register, and there is a 128 byte limit to the
13716 @code{.based} section.
13717
13718 @item -mbitops
13719 @opindex mbitops
13720 Enables the bit operation instructions - bit test (@code{btstm}), set
13721 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
13722 test-and-set (@code{tas}).
13723
13724 @item -mc=@var{name}
13725 @opindex mc=
13726 Selects which section constant data will be placed in.  @var{name} may
13727 be @code{tiny}, @code{near}, or @code{far}.
13728
13729 @item -mclip
13730 @opindex mclip
13731 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
13732 useful unless you also provide @code{-mminmax}.
13733
13734 @item -mconfig=@var{name}
13735 @opindex mconfig=
13736 Selects one of the build-in core configurations.  Each MeP chip has
13737 one or more modules in it; each module has a core CPU and a variety of
13738 coprocessors, optional instructions, and peripherals.  The
13739 @code{MeP-Integrator} tool, not part of GCC, provides these
13740 configurations through this option; using this option is the same as
13741 using all the corresponding command line options.  The default
13742 configuration is @code{default}.
13743
13744 @item -mcop
13745 @opindex mcop
13746 Enables the coprocessor instructions.  By default, this is a 32-bit
13747 coprocessor.  Note that the coprocessor is normally enabled via the
13748 @code{-mconfig=} option.
13749
13750 @item -mcop32
13751 @opindex mcop32
13752 Enables the 32-bit coprocessor's instructions.
13753
13754 @item -mcop64
13755 @opindex mcop64
13756 Enables the 64-bit coprocessor's instructions.
13757
13758 @item -mivc2
13759 @opindex mivc2
13760 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
13761
13762 @item -mdc
13763 @opindex mdc
13764 Causes constant variables to be placed in the @code{.near} section.
13765
13766 @item -mdiv
13767 @opindex mdiv
13768 Enables the @code{div} and @code{divu} instructions.
13769
13770 @item -meb
13771 @opindex meb
13772 Generate big-endian code.
13773
13774 @item -mel
13775 @opindex mel
13776 Generate little-endian code.
13777
13778 @item -mio-volatile
13779 @opindex mio-volatile
13780 Tells the compiler that any variable marked with the @code{io}
13781 attribute is to be considered volatile.
13782
13783 @item -ml
13784 @opindex ml
13785 Causes variables to be assigned to the @code{.far} section by default.
13786
13787 @item -mleadz
13788 @opindex mleadz
13789 Enables the @code{leadz} (leading zero) instruction.
13790
13791 @item -mm
13792 @opindex mm
13793 Causes variables to be assigned to the @code{.near} section by default.
13794
13795 @item -mminmax
13796 @opindex mminmax
13797 Enables the @code{min} and @code{max} instructions.
13798
13799 @item -mmult
13800 @opindex mmult
13801 Enables the multiplication and multiply-accumulate instructions.
13802
13803 @item -mno-opts
13804 @opindex mno-opts
13805 Disables all the optional instructions enabled by @code{-mall-opts}.
13806
13807 @item -mrepeat
13808 @opindex mrepeat
13809 Enables the @code{repeat} and @code{erepeat} instructions, used for
13810 low-overhead looping.
13811
13812 @item -ms
13813 @opindex ms
13814 Causes all variables to default to the @code{.tiny} section.  Note
13815 that there is a 65536 byte limit to this section.  Accesses to these
13816 variables use the @code{%gp} base register.
13817
13818 @item -msatur
13819 @opindex msatur
13820 Enables the saturation instructions.  Note that the compiler does not
13821 currently generate these itself, but this option is included for
13822 compatibility with other tools, like @code{as}.
13823
13824 @item -msdram
13825 @opindex msdram
13826 Link the SDRAM-based runtime instead of the default ROM-based runtime.
13827
13828 @item -msim
13829 @opindex msim
13830 Link the simulator runtime libraries.
13831
13832 @item -msimnovec
13833 @opindex msimnovec
13834 Link the simulator runtime libraries, excluding built-in support
13835 for reset and exception vectors and tables.
13836
13837 @item -mtf
13838 @opindex mtf
13839 Causes all functions to default to the @code{.far} section.  Without
13840 this option, functions default to the @code{.near} section.
13841
13842 @item -mtiny=@var{n}
13843 @opindex mtiny=
13844 Variables that are @var{n} bytes or smaller will be allocated to the
13845 @code{.tiny} section.  These variables use the @code{$gp} base
13846 register.  The default for this option is 4, but note that there's a
13847 65536 byte limit to the @code{.tiny} section.
13848
13849 @end table
13850
13851 @node MIPS Options
13852 @subsection MIPS Options
13853 @cindex MIPS options
13854
13855 @table @gcctabopt
13856
13857 @item -EB
13858 @opindex EB
13859 Generate big-endian code.
13860
13861 @item -EL
13862 @opindex EL
13863 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
13864 configurations.
13865
13866 @item -march=@var{arch}
13867 @opindex march
13868 Generate code that will run on @var{arch}, which can be the name of a
13869 generic MIPS ISA, or the name of a particular processor.
13870 The ISA names are:
13871 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
13872 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
13873 The processor names are:
13874 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
13875 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
13876 @samp{5kc}, @samp{5kf},
13877 @samp{20kc},
13878 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
13879 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
13880 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
13881 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
13882 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
13883 @samp{loongson2e}, @samp{loongson2f},
13884 @samp{m4k},
13885 @samp{octeon},
13886 @samp{orion},
13887 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
13888 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
13889 @samp{rm7000}, @samp{rm9000},
13890 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
13891 @samp{sb1},
13892 @samp{sr71000},
13893 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
13894 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
13895 and @samp{xlr}.
13896 The special value @samp{from-abi} selects the
13897 most compatible architecture for the selected ABI (that is,
13898 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
13899
13900 Native Linux/GNU toolchains also support the value @samp{native},
13901 which selects the best architecture option for the host processor.
13902 @option{-march=native} has no effect if GCC does not recognize
13903 the processor.
13904
13905 In processor names, a final @samp{000} can be abbreviated as @samp{k}
13906 (for example, @samp{-march=r2k}).  Prefixes are optional, and
13907 @samp{vr} may be written @samp{r}.
13908
13909 Names of the form @samp{@var{n}f2_1} refer to processors with
13910 FPUs clocked at half the rate of the core, names of the form
13911 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
13912 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
13913 processors with FPUs clocked a ratio of 3:2 with respect to the core.
13914 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
13915 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
13916 accepted as synonyms for @samp{@var{n}f1_1}.
13917
13918 GCC defines two macros based on the value of this option.  The first
13919 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
13920 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
13921 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
13922 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
13923 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
13924
13925 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
13926 above.  In other words, it will have the full prefix and will not
13927 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
13928 the macro names the resolved architecture (either @samp{"mips1"} or
13929 @samp{"mips3"}).  It names the default architecture when no
13930 @option{-march} option is given.
13931
13932 @item -mtune=@var{arch}
13933 @opindex mtune
13934 Optimize for @var{arch}.  Among other things, this option controls
13935 the way instructions are scheduled, and the perceived cost of arithmetic
13936 operations.  The list of @var{arch} values is the same as for
13937 @option{-march}.
13938
13939 When this option is not used, GCC will optimize for the processor
13940 specified by @option{-march}.  By using @option{-march} and
13941 @option{-mtune} together, it is possible to generate code that will
13942 run on a family of processors, but optimize the code for one
13943 particular member of that family.
13944
13945 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
13946 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
13947 @samp{-march} ones described above.
13948
13949 @item -mips1
13950 @opindex mips1
13951 Equivalent to @samp{-march=mips1}.
13952
13953 @item -mips2
13954 @opindex mips2
13955 Equivalent to @samp{-march=mips2}.
13956
13957 @item -mips3
13958 @opindex mips3
13959 Equivalent to @samp{-march=mips3}.
13960
13961 @item -mips4
13962 @opindex mips4
13963 Equivalent to @samp{-march=mips4}.
13964
13965 @item -mips32
13966 @opindex mips32
13967 Equivalent to @samp{-march=mips32}.
13968
13969 @item -mips32r2
13970 @opindex mips32r2
13971 Equivalent to @samp{-march=mips32r2}.
13972
13973 @item -mips64
13974 @opindex mips64
13975 Equivalent to @samp{-march=mips64}.
13976
13977 @item -mips64r2
13978 @opindex mips64r2
13979 Equivalent to @samp{-march=mips64r2}.
13980
13981 @item -mips16
13982 @itemx -mno-mips16
13983 @opindex mips16
13984 @opindex mno-mips16
13985 Generate (do not generate) MIPS16 code.  If GCC is targetting a
13986 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
13987
13988 MIPS16 code generation can also be controlled on a per-function basis
13989 by means of @code{mips16} and @code{nomips16} attributes.
13990 @xref{Function Attributes}, for more information.
13991
13992 @item -mflip-mips16
13993 @opindex mflip-mips16
13994 Generate MIPS16 code on alternating functions.  This option is provided
13995 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
13996 not intended for ordinary use in compiling user code.
13997
13998 @item -minterlink-mips16
13999 @itemx -mno-interlink-mips16
14000 @opindex minterlink-mips16
14001 @opindex mno-interlink-mips16
14002 Require (do not require) that non-MIPS16 code be link-compatible with
14003 MIPS16 code.
14004
14005 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
14006 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
14007 therefore disables direct jumps unless GCC knows that the target of the
14008 jump is not MIPS16.
14009
14010 @item -mabi=32
14011 @itemx -mabi=o64
14012 @itemx -mabi=n32
14013 @itemx -mabi=64
14014 @itemx -mabi=eabi
14015 @opindex mabi=32
14016 @opindex mabi=o64
14017 @opindex mabi=n32
14018 @opindex mabi=64
14019 @opindex mabi=eabi
14020 Generate code for the given ABI@.
14021
14022 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
14023 generates 64-bit code when you select a 64-bit architecture, but you
14024 can use @option{-mgp32} to get 32-bit code instead.
14025
14026 For information about the O64 ABI, see
14027 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
14028
14029 GCC supports a variant of the o32 ABI in which floating-point registers
14030 are 64 rather than 32 bits wide.  You can select this combination with
14031 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
14032 and @samp{mfhc1} instructions and is therefore only supported for
14033 MIPS32R2 processors.
14034
14035 The register assignments for arguments and return values remain the
14036 same, but each scalar value is passed in a single 64-bit register
14037 rather than a pair of 32-bit registers.  For example, scalar
14038 floating-point values are returned in @samp{$f0} only, not a
14039 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
14040 remains the same, but all 64 bits are saved.
14041
14042 @item -mabicalls
14043 @itemx -mno-abicalls
14044 @opindex mabicalls
14045 @opindex mno-abicalls
14046 Generate (do not generate) code that is suitable for SVR4-style
14047 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
14048 systems.
14049
14050 @item -mshared
14051 @itemx -mno-shared
14052 Generate (do not generate) code that is fully position-independent,
14053 and that can therefore be linked into shared libraries.  This option
14054 only affects @option{-mabicalls}.
14055
14056 All @option{-mabicalls} code has traditionally been position-independent,
14057 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
14058 as an extension, the GNU toolchain allows executables to use absolute
14059 accesses for locally-binding symbols.  It can also use shorter GP
14060 initialization sequences and generate direct calls to locally-defined
14061 functions.  This mode is selected by @option{-mno-shared}.
14062
14063 @option{-mno-shared} depends on binutils 2.16 or higher and generates
14064 objects that can only be linked by the GNU linker.  However, the option
14065 does not affect the ABI of the final executable; it only affects the ABI
14066 of relocatable objects.  Using @option{-mno-shared} will generally make
14067 executables both smaller and quicker.
14068
14069 @option{-mshared} is the default.
14070
14071 @item -mplt
14072 @itemx -mno-plt
14073 @opindex mplt
14074 @opindex mno-plt
14075 Assume (do not assume) that the static and dynamic linkers
14076 support PLTs and copy relocations.  This option only affects
14077 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
14078 has no effect without @samp{-msym32}.
14079
14080 You can make @option{-mplt} the default by configuring
14081 GCC with @option{--with-mips-plt}.  The default is
14082 @option{-mno-plt} otherwise.
14083
14084 @item -mxgot
14085 @itemx -mno-xgot
14086 @opindex mxgot
14087 @opindex mno-xgot
14088 Lift (do not lift) the usual restrictions on the size of the global
14089 offset table.
14090
14091 GCC normally uses a single instruction to load values from the GOT@.
14092 While this is relatively efficient, it will only work if the GOT
14093 is smaller than about 64k.  Anything larger will cause the linker
14094 to report an error such as:
14095
14096 @cindex relocation truncated to fit (MIPS)
14097 @smallexample
14098 relocation truncated to fit: R_MIPS_GOT16 foobar
14099 @end smallexample
14100
14101 If this happens, you should recompile your code with @option{-mxgot}.
14102 It should then work with very large GOTs, although it will also be
14103 less efficient, since it will take three instructions to fetch the
14104 value of a global symbol.
14105
14106 Note that some linkers can create multiple GOTs.  If you have such a
14107 linker, you should only need to use @option{-mxgot} when a single object
14108 file accesses more than 64k's worth of GOT entries.  Very few do.
14109
14110 These options have no effect unless GCC is generating position
14111 independent code.
14112
14113 @item -mgp32
14114 @opindex mgp32
14115 Assume that general-purpose registers are 32 bits wide.
14116
14117 @item -mgp64
14118 @opindex mgp64
14119 Assume that general-purpose registers are 64 bits wide.
14120
14121 @item -mfp32
14122 @opindex mfp32
14123 Assume that floating-point registers are 32 bits wide.
14124
14125 @item -mfp64
14126 @opindex mfp64
14127 Assume that floating-point registers are 64 bits wide.
14128
14129 @item -mhard-float
14130 @opindex mhard-float
14131 Use floating-point coprocessor instructions.
14132
14133 @item -msoft-float
14134 @opindex msoft-float
14135 Do not use floating-point coprocessor instructions.  Implement
14136 floating-point calculations using library calls instead.
14137
14138 @item -msingle-float
14139 @opindex msingle-float
14140 Assume that the floating-point coprocessor only supports single-precision
14141 operations.
14142
14143 @item -mdouble-float
14144 @opindex mdouble-float
14145 Assume that the floating-point coprocessor supports double-precision
14146 operations.  This is the default.
14147
14148 @item -mllsc
14149 @itemx -mno-llsc
14150 @opindex mllsc
14151 @opindex mno-llsc
14152 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
14153 implement atomic memory built-in functions.  When neither option is
14154 specified, GCC will use the instructions if the target architecture
14155 supports them.
14156
14157 @option{-mllsc} is useful if the runtime environment can emulate the
14158 instructions and @option{-mno-llsc} can be useful when compiling for
14159 nonstandard ISAs.  You can make either option the default by
14160 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
14161 respectively.  @option{--with-llsc} is the default for some
14162 configurations; see the installation documentation for details.
14163
14164 @item -mdsp
14165 @itemx -mno-dsp
14166 @opindex mdsp
14167 @opindex mno-dsp
14168 Use (do not use) revision 1 of the MIPS DSP ASE@.
14169 @xref{MIPS DSP Built-in Functions}.  This option defines the
14170 preprocessor macro @samp{__mips_dsp}.  It also defines
14171 @samp{__mips_dsp_rev} to 1.
14172
14173 @item -mdspr2
14174 @itemx -mno-dspr2
14175 @opindex mdspr2
14176 @opindex mno-dspr2
14177 Use (do not use) revision 2 of the MIPS DSP ASE@.
14178 @xref{MIPS DSP Built-in Functions}.  This option defines the
14179 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
14180 It also defines @samp{__mips_dsp_rev} to 2.
14181
14182 @item -msmartmips
14183 @itemx -mno-smartmips
14184 @opindex msmartmips
14185 @opindex mno-smartmips
14186 Use (do not use) the MIPS SmartMIPS ASE.
14187
14188 @item -mpaired-single
14189 @itemx -mno-paired-single
14190 @opindex mpaired-single
14191 @opindex mno-paired-single
14192 Use (do not use) paired-single floating-point instructions.
14193 @xref{MIPS Paired-Single Support}.  This option requires
14194 hardware floating-point support to be enabled.
14195
14196 @item -mdmx
14197 @itemx -mno-mdmx
14198 @opindex mdmx
14199 @opindex mno-mdmx
14200 Use (do not use) MIPS Digital Media Extension instructions.
14201 This option can only be used when generating 64-bit code and requires
14202 hardware floating-point support to be enabled.
14203
14204 @item -mips3d
14205 @itemx -mno-mips3d
14206 @opindex mips3d
14207 @opindex mno-mips3d
14208 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
14209 The option @option{-mips3d} implies @option{-mpaired-single}.
14210
14211 @item -mmt
14212 @itemx -mno-mt
14213 @opindex mmt
14214 @opindex mno-mt
14215 Use (do not use) MT Multithreading instructions.
14216
14217 @item -mlong64
14218 @opindex mlong64
14219 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
14220 an explanation of the default and the way that the pointer size is
14221 determined.
14222
14223 @item -mlong32
14224 @opindex mlong32
14225 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
14226
14227 The default size of @code{int}s, @code{long}s and pointers depends on
14228 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
14229 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
14230 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
14231 or the same size as integer registers, whichever is smaller.
14232
14233 @item -msym32
14234 @itemx -mno-sym32
14235 @opindex msym32
14236 @opindex mno-sym32
14237 Assume (do not assume) that all symbols have 32-bit values, regardless
14238 of the selected ABI@.  This option is useful in combination with
14239 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
14240 to generate shorter and faster references to symbolic addresses.
14241
14242 @item -G @var{num}
14243 @opindex G
14244 Put definitions of externally-visible data in a small data section
14245 if that data is no bigger than @var{num} bytes.  GCC can then access
14246 the data more efficiently; see @option{-mgpopt} for details.
14247
14248 The default @option{-G} option depends on the configuration.
14249
14250 @item -mlocal-sdata
14251 @itemx -mno-local-sdata
14252 @opindex mlocal-sdata
14253 @opindex mno-local-sdata
14254 Extend (do not extend) the @option{-G} behavior to local data too,
14255 such as to static variables in C@.  @option{-mlocal-sdata} is the
14256 default for all configurations.
14257
14258 If the linker complains that an application is using too much small data,
14259 you might want to try rebuilding the less performance-critical parts with
14260 @option{-mno-local-sdata}.  You might also want to build large
14261 libraries with @option{-mno-local-sdata}, so that the libraries leave
14262 more room for the main program.
14263
14264 @item -mextern-sdata
14265 @itemx -mno-extern-sdata
14266 @opindex mextern-sdata
14267 @opindex mno-extern-sdata
14268 Assume (do not assume) that externally-defined data will be in
14269 a small data section if that data is within the @option{-G} limit.
14270 @option{-mextern-sdata} is the default for all configurations.
14271
14272 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
14273 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
14274 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
14275 is placed in a small data section.  If @var{Var} is defined by another
14276 module, you must either compile that module with a high-enough
14277 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
14278 definition.  If @var{Var} is common, you must link the application
14279 with a high-enough @option{-G} setting.
14280
14281 The easiest way of satisfying these restrictions is to compile
14282 and link every module with the same @option{-G} option.  However,
14283 you may wish to build a library that supports several different
14284 small data limits.  You can do this by compiling the library with
14285 the highest supported @option{-G} setting and additionally using
14286 @option{-mno-extern-sdata} to stop the library from making assumptions
14287 about externally-defined data.
14288
14289 @item -mgpopt
14290 @itemx -mno-gpopt
14291 @opindex mgpopt
14292 @opindex mno-gpopt
14293 Use (do not use) GP-relative accesses for symbols that are known to be
14294 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
14295 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
14296 configurations.
14297
14298 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
14299 might not hold the value of @code{_gp}.  For example, if the code is
14300 part of a library that might be used in a boot monitor, programs that
14301 call boot monitor routines will pass an unknown value in @code{$gp}.
14302 (In such situations, the boot monitor itself would usually be compiled
14303 with @option{-G0}.)
14304
14305 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
14306 @option{-mno-extern-sdata}.
14307
14308 @item -membedded-data
14309 @itemx -mno-embedded-data
14310 @opindex membedded-data
14311 @opindex mno-embedded-data
14312 Allocate variables to the read-only data section first if possible, then
14313 next in the small data section if possible, otherwise in data.  This gives
14314 slightly slower code than the default, but reduces the amount of RAM required
14315 when executing, and thus may be preferred for some embedded systems.
14316
14317 @item -muninit-const-in-rodata
14318 @itemx -mno-uninit-const-in-rodata
14319 @opindex muninit-const-in-rodata
14320 @opindex mno-uninit-const-in-rodata
14321 Put uninitialized @code{const} variables in the read-only data section.
14322 This option is only meaningful in conjunction with @option{-membedded-data}.
14323
14324 @item -mcode-readable=@var{setting}
14325 @opindex mcode-readable
14326 Specify whether GCC may generate code that reads from executable sections.
14327 There are three possible settings:
14328
14329 @table @gcctabopt
14330 @item -mcode-readable=yes
14331 Instructions may freely access executable sections.  This is the
14332 default setting.
14333
14334 @item -mcode-readable=pcrel
14335 MIPS16 PC-relative load instructions can access executable sections,
14336 but other instructions must not do so.  This option is useful on 4KSc
14337 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
14338 It is also useful on processors that can be configured to have a dual
14339 instruction/data SRAM interface and that, like the M4K, automatically
14340 redirect PC-relative loads to the instruction RAM.
14341
14342 @item -mcode-readable=no
14343 Instructions must not access executable sections.  This option can be
14344 useful on targets that are configured to have a dual instruction/data
14345 SRAM interface but that (unlike the M4K) do not automatically redirect
14346 PC-relative loads to the instruction RAM.
14347 @end table
14348
14349 @item -msplit-addresses
14350 @itemx -mno-split-addresses
14351 @opindex msplit-addresses
14352 @opindex mno-split-addresses
14353 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
14354 relocation operators.  This option has been superseded by
14355 @option{-mexplicit-relocs} but is retained for backwards compatibility.
14356
14357 @item -mexplicit-relocs
14358 @itemx -mno-explicit-relocs
14359 @opindex mexplicit-relocs
14360 @opindex mno-explicit-relocs
14361 Use (do not use) assembler relocation operators when dealing with symbolic
14362 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
14363 is to use assembler macros instead.
14364
14365 @option{-mexplicit-relocs} is the default if GCC was configured
14366 to use an assembler that supports relocation operators.
14367
14368 @item -mcheck-zero-division
14369 @itemx -mno-check-zero-division
14370 @opindex mcheck-zero-division
14371 @opindex mno-check-zero-division
14372 Trap (do not trap) on integer division by zero.
14373
14374 The default is @option{-mcheck-zero-division}.
14375
14376 @item -mdivide-traps
14377 @itemx -mdivide-breaks
14378 @opindex mdivide-traps
14379 @opindex mdivide-breaks
14380 MIPS systems check for division by zero by generating either a
14381 conditional trap or a break instruction.  Using traps results in
14382 smaller code, but is only supported on MIPS II and later.  Also, some
14383 versions of the Linux kernel have a bug that prevents trap from
14384 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
14385 allow conditional traps on architectures that support them and
14386 @option{-mdivide-breaks} to force the use of breaks.
14387
14388 The default is usually @option{-mdivide-traps}, but this can be
14389 overridden at configure time using @option{--with-divide=breaks}.
14390 Divide-by-zero checks can be completely disabled using
14391 @option{-mno-check-zero-division}.
14392
14393 @item -mmemcpy
14394 @itemx -mno-memcpy
14395 @opindex mmemcpy
14396 @opindex mno-memcpy
14397 Force (do not force) the use of @code{memcpy()} for non-trivial block
14398 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
14399 most constant-sized copies.
14400
14401 @item -mlong-calls
14402 @itemx -mno-long-calls
14403 @opindex mlong-calls
14404 @opindex mno-long-calls
14405 Disable (do not disable) use of the @code{jal} instruction.  Calling
14406 functions using @code{jal} is more efficient but requires the caller
14407 and callee to be in the same 256 megabyte segment.
14408
14409 This option has no effect on abicalls code.  The default is
14410 @option{-mno-long-calls}.
14411
14412 @item -mmad
14413 @itemx -mno-mad
14414 @opindex mmad
14415 @opindex mno-mad
14416 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
14417 instructions, as provided by the R4650 ISA@.
14418
14419 @item -mfused-madd
14420 @itemx -mno-fused-madd
14421 @opindex mfused-madd
14422 @opindex mno-fused-madd
14423 Enable (disable) use of the floating point multiply-accumulate
14424 instructions, when they are available.  The default is
14425 @option{-mfused-madd}.
14426
14427 When multiply-accumulate instructions are used, the intermediate
14428 product is calculated to infinite precision and is not subject to
14429 the FCSR Flush to Zero bit.  This may be undesirable in some
14430 circumstances.
14431
14432 @item -nocpp
14433 @opindex nocpp
14434 Tell the MIPS assembler to not run its preprocessor over user
14435 assembler files (with a @samp{.s} suffix) when assembling them.
14436
14437 @item -mfix-r4000
14438 @itemx -mno-fix-r4000
14439 @opindex mfix-r4000
14440 @opindex mno-fix-r4000
14441 Work around certain R4000 CPU errata:
14442 @itemize @minus
14443 @item
14444 A double-word or a variable shift may give an incorrect result if executed
14445 immediately after starting an integer division.
14446 @item
14447 A double-word or a variable shift may give an incorrect result if executed
14448 while an integer multiplication is in progress.
14449 @item
14450 An integer division may give an incorrect result if started in a delay slot
14451 of a taken branch or a jump.
14452 @end itemize
14453
14454 @item -mfix-r4400
14455 @itemx -mno-fix-r4400
14456 @opindex mfix-r4400
14457 @opindex mno-fix-r4400
14458 Work around certain R4400 CPU errata:
14459 @itemize @minus
14460 @item
14461 A double-word or a variable shift may give an incorrect result if executed
14462 immediately after starting an integer division.
14463 @end itemize
14464
14465 @item -mfix-r10000
14466 @itemx -mno-fix-r10000
14467 @opindex mfix-r10000
14468 @opindex mno-fix-r10000
14469 Work around certain R10000 errata:
14470 @itemize @minus
14471 @item
14472 @code{ll}/@code{sc} sequences may not behave atomically on revisions
14473 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
14474 @end itemize
14475
14476 This option can only be used if the target architecture supports
14477 branch-likely instructions.  @option{-mfix-r10000} is the default when
14478 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
14479 otherwise.
14480
14481 @item -mfix-vr4120
14482 @itemx -mno-fix-vr4120
14483 @opindex mfix-vr4120
14484 Work around certain VR4120 errata:
14485 @itemize @minus
14486 @item
14487 @code{dmultu} does not always produce the correct result.
14488 @item
14489 @code{div} and @code{ddiv} do not always produce the correct result if one
14490 of the operands is negative.
14491 @end itemize
14492 The workarounds for the division errata rely on special functions in
14493 @file{libgcc.a}.  At present, these functions are only provided by
14494 the @code{mips64vr*-elf} configurations.
14495
14496 Other VR4120 errata require a nop to be inserted between certain pairs of
14497 instructions.  These errata are handled by the assembler, not by GCC itself.
14498
14499 @item -mfix-vr4130
14500 @opindex mfix-vr4130
14501 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
14502 workarounds are implemented by the assembler rather than by GCC,
14503 although GCC will avoid using @code{mflo} and @code{mfhi} if the
14504 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
14505 instructions are available instead.
14506
14507 @item -mfix-sb1
14508 @itemx -mno-fix-sb1
14509 @opindex mfix-sb1
14510 Work around certain SB-1 CPU core errata.
14511 (This flag currently works around the SB-1 revision 2
14512 ``F1'' and ``F2'' floating point errata.)
14513
14514 @item -mr10k-cache-barrier=@var{setting}
14515 @opindex mr10k-cache-barrier
14516 Specify whether GCC should insert cache barriers to avoid the
14517 side-effects of speculation on R10K processors.
14518
14519 In common with many processors, the R10K tries to predict the outcome
14520 of a conditional branch and speculatively executes instructions from
14521 the ``taken'' branch.  It later aborts these instructions if the
14522 predicted outcome was wrong.  However, on the R10K, even aborted
14523 instructions can have side effects.
14524
14525 This problem only affects kernel stores and, depending on the system,
14526 kernel loads.  As an example, a speculatively-executed store may load
14527 the target memory into cache and mark the cache line as dirty, even if
14528 the store itself is later aborted.  If a DMA operation writes to the
14529 same area of memory before the ``dirty'' line is flushed, the cached
14530 data will overwrite the DMA-ed data.  See the R10K processor manual
14531 for a full description, including other potential problems.
14532
14533 One workaround is to insert cache barrier instructions before every memory
14534 access that might be speculatively executed and that might have side
14535 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
14536 controls GCC's implementation of this workaround.  It assumes that
14537 aborted accesses to any byte in the following regions will not have
14538 side effects:
14539
14540 @enumerate
14541 @item
14542 the memory occupied by the current function's stack frame;
14543
14544 @item
14545 the memory occupied by an incoming stack argument;
14546
14547 @item
14548 the memory occupied by an object with a link-time-constant address.
14549 @end enumerate
14550
14551 It is the kernel's responsibility to ensure that speculative
14552 accesses to these regions are indeed safe.
14553
14554 If the input program contains a function declaration such as:
14555
14556 @smallexample
14557 void foo (void);
14558 @end smallexample
14559
14560 then the implementation of @code{foo} must allow @code{j foo} and
14561 @code{jal foo} to be executed speculatively.  GCC honors this
14562 restriction for functions it compiles itself.  It expects non-GCC
14563 functions (such as hand-written assembly code) to do the same.
14564
14565 The option has three forms:
14566
14567 @table @gcctabopt
14568 @item -mr10k-cache-barrier=load-store
14569 Insert a cache barrier before a load or store that might be
14570 speculatively executed and that might have side effects even
14571 if aborted.
14572
14573 @item -mr10k-cache-barrier=store
14574 Insert a cache barrier before a store that might be speculatively
14575 executed and that might have side effects even if aborted.
14576
14577 @item -mr10k-cache-barrier=none
14578 Disable the insertion of cache barriers.  This is the default setting.
14579 @end table
14580
14581 @item -mflush-func=@var{func}
14582 @itemx -mno-flush-func
14583 @opindex mflush-func
14584 Specifies the function to call to flush the I and D caches, or to not
14585 call any such function.  If called, the function must take the same
14586 arguments as the common @code{_flush_func()}, that is, the address of the
14587 memory range for which the cache is being flushed, the size of the
14588 memory range, and the number 3 (to flush both caches).  The default
14589 depends on the target GCC was configured for, but commonly is either
14590 @samp{_flush_func} or @samp{__cpu_flush}.
14591
14592 @item mbranch-cost=@var{num}
14593 @opindex mbranch-cost
14594 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14595 This cost is only a heuristic and is not guaranteed to produce
14596 consistent results across releases.  A zero cost redundantly selects
14597 the default, which is based on the @option{-mtune} setting.
14598
14599 @item -mbranch-likely
14600 @itemx -mno-branch-likely
14601 @opindex mbranch-likely
14602 @opindex mno-branch-likely
14603 Enable or disable use of Branch Likely instructions, regardless of the
14604 default for the selected architecture.  By default, Branch Likely
14605 instructions may be generated if they are supported by the selected
14606 architecture.  An exception is for the MIPS32 and MIPS64 architectures
14607 and processors which implement those architectures; for those, Branch
14608 Likely instructions will not be generated by default because the MIPS32
14609 and MIPS64 architectures specifically deprecate their use.
14610
14611 @item -mfp-exceptions
14612 @itemx -mno-fp-exceptions
14613 @opindex mfp-exceptions
14614 Specifies whether FP exceptions are enabled.  This affects how we schedule
14615 FP instructions for some processors.  The default is that FP exceptions are
14616 enabled.
14617
14618 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
14619 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
14620 FP pipe.
14621
14622 @item -mvr4130-align
14623 @itemx -mno-vr4130-align
14624 @opindex mvr4130-align
14625 The VR4130 pipeline is two-way superscalar, but can only issue two
14626 instructions together if the first one is 8-byte aligned.  When this
14627 option is enabled, GCC will align pairs of instructions that it
14628 thinks should execute in parallel.
14629
14630 This option only has an effect when optimizing for the VR4130.
14631 It normally makes code faster, but at the expense of making it bigger.
14632 It is enabled by default at optimization level @option{-O3}.
14633
14634 @item -msynci
14635 @itemx -mno-synci
14636 @opindex msynci
14637 Enable (disable) generation of @code{synci} instructions on
14638 architectures that support it.  The @code{synci} instructions (if
14639 enabled) will be generated when @code{__builtin___clear_cache()} is
14640 compiled.
14641
14642 This option defaults to @code{-mno-synci}, but the default can be
14643 overridden by configuring with @code{--with-synci}.
14644
14645 When compiling code for single processor systems, it is generally safe
14646 to use @code{synci}.  However, on many multi-core (SMP) systems, it
14647 will not invalidate the instruction caches on all cores and may lead
14648 to undefined behavior.
14649
14650 @item -mrelax-pic-calls
14651 @itemx -mno-relax-pic-calls
14652 @opindex mrelax-pic-calls
14653 Try to turn PIC calls that are normally dispatched via register
14654 @code{$25} into direct calls.  This is only possible if the linker can
14655 resolve the destination at link-time and if the destination is within
14656 range for a direct call.
14657
14658 @option{-mrelax-pic-calls} is the default if GCC was configured to use
14659 an assembler and a linker that supports the @code{.reloc} assembly
14660 directive and @code{-mexplicit-relocs} is in effect.  With
14661 @code{-mno-explicit-relocs}, this optimization can be performed by the
14662 assembler and the linker alone without help from the compiler.
14663
14664 @item -mmcount-ra-address
14665 @itemx -mno-mcount-ra-address
14666 @opindex mmcount-ra-address
14667 @opindex mno-mcount-ra-address
14668 Emit (do not emit) code that allows @code{_mcount} to modify the
14669 calling function's return address.  When enabled, this option extends
14670 the usual @code{_mcount} interface with a new @var{ra-address}
14671 parameter, which has type @code{intptr_t *} and is passed in register
14672 @code{$12}.  @code{_mcount} can then modify the return address by
14673 doing both of the following:
14674 @itemize
14675 @item
14676 Returning the new address in register @code{$31}.
14677 @item
14678 Storing the new address in @code{*@var{ra-address}},
14679 if @var{ra-address} is nonnull.
14680 @end itemize
14681
14682 The default is @option{-mno-mcount-ra-address}.
14683
14684 @end table
14685
14686 @node MMIX Options
14687 @subsection MMIX Options
14688 @cindex MMIX Options
14689
14690 These options are defined for the MMIX:
14691
14692 @table @gcctabopt
14693 @item -mlibfuncs
14694 @itemx -mno-libfuncs
14695 @opindex mlibfuncs
14696 @opindex mno-libfuncs
14697 Specify that intrinsic library functions are being compiled, passing all
14698 values in registers, no matter the size.
14699
14700 @item -mepsilon
14701 @itemx -mno-epsilon
14702 @opindex mepsilon
14703 @opindex mno-epsilon
14704 Generate floating-point comparison instructions that compare with respect
14705 to the @code{rE} epsilon register.
14706
14707 @item -mabi=mmixware
14708 @itemx -mabi=gnu
14709 @opindex mabi=mmixware
14710 @opindex mabi=gnu
14711 Generate code that passes function parameters and return values that (in
14712 the called function) are seen as registers @code{$0} and up, as opposed to
14713 the GNU ABI which uses global registers @code{$231} and up.
14714
14715 @item -mzero-extend
14716 @itemx -mno-zero-extend
14717 @opindex mzero-extend
14718 @opindex mno-zero-extend
14719 When reading data from memory in sizes shorter than 64 bits, use (do not
14720 use) zero-extending load instructions by default, rather than
14721 sign-extending ones.
14722
14723 @item -mknuthdiv
14724 @itemx -mno-knuthdiv
14725 @opindex mknuthdiv
14726 @opindex mno-knuthdiv
14727 Make the result of a division yielding a remainder have the same sign as
14728 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
14729 remainder follows the sign of the dividend.  Both methods are
14730 arithmetically valid, the latter being almost exclusively used.
14731
14732 @item -mtoplevel-symbols
14733 @itemx -mno-toplevel-symbols
14734 @opindex mtoplevel-symbols
14735 @opindex mno-toplevel-symbols
14736 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
14737 code can be used with the @code{PREFIX} assembly directive.
14738
14739 @item -melf
14740 @opindex melf
14741 Generate an executable in the ELF format, rather than the default
14742 @samp{mmo} format used by the @command{mmix} simulator.
14743
14744 @item -mbranch-predict
14745 @itemx -mno-branch-predict
14746 @opindex mbranch-predict
14747 @opindex mno-branch-predict
14748 Use (do not use) the probable-branch instructions, when static branch
14749 prediction indicates a probable branch.
14750
14751 @item -mbase-addresses
14752 @itemx -mno-base-addresses
14753 @opindex mbase-addresses
14754 @opindex mno-base-addresses
14755 Generate (do not generate) code that uses @emph{base addresses}.  Using a
14756 base address automatically generates a request (handled by the assembler
14757 and the linker) for a constant to be set up in a global register.  The
14758 register is used for one or more base address requests within the range 0
14759 to 255 from the value held in the register.  The generally leads to short
14760 and fast code, but the number of different data items that can be
14761 addressed is limited.  This means that a program that uses lots of static
14762 data may require @option{-mno-base-addresses}.
14763
14764 @item -msingle-exit
14765 @itemx -mno-single-exit
14766 @opindex msingle-exit
14767 @opindex mno-single-exit
14768 Force (do not force) generated code to have a single exit point in each
14769 function.
14770 @end table
14771
14772 @node MN10300 Options
14773 @subsection MN10300 Options
14774 @cindex MN10300 options
14775
14776 These @option{-m} options are defined for Matsushita MN10300 architectures:
14777
14778 @table @gcctabopt
14779 @item -mmult-bug
14780 @opindex mmult-bug
14781 Generate code to avoid bugs in the multiply instructions for the MN10300
14782 processors.  This is the default.
14783
14784 @item -mno-mult-bug
14785 @opindex mno-mult-bug
14786 Do not generate code to avoid bugs in the multiply instructions for the
14787 MN10300 processors.
14788
14789 @item -mam33
14790 @opindex mam33
14791 Generate code which uses features specific to the AM33 processor.
14792
14793 @item -mno-am33
14794 @opindex mno-am33
14795 Do not generate code which uses features specific to the AM33 processor.  This
14796 is the default.
14797
14798 @item -mreturn-pointer-on-d0
14799 @opindex mreturn-pointer-on-d0
14800 When generating a function which returns a pointer, return the pointer
14801 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
14802 only in a0, and attempts to call such functions without a prototype
14803 would result in errors.  Note that this option is on by default; use
14804 @option{-mno-return-pointer-on-d0} to disable it.
14805
14806 @item -mno-crt0
14807 @opindex mno-crt0
14808 Do not link in the C run-time initialization object file.
14809
14810 @item -mrelax
14811 @opindex mrelax
14812 Indicate to the linker that it should perform a relaxation optimization pass
14813 to shorten branches, calls and absolute memory addresses.  This option only
14814 has an effect when used on the command line for the final link step.
14815
14816 This option makes symbolic debugging impossible.
14817 @end table
14818
14819 @node PDP-11 Options
14820 @subsection PDP-11 Options
14821 @cindex PDP-11 Options
14822
14823 These options are defined for the PDP-11:
14824
14825 @table @gcctabopt
14826 @item -mfpu
14827 @opindex mfpu
14828 Use hardware FPP floating point.  This is the default.  (FIS floating
14829 point on the PDP-11/40 is not supported.)
14830
14831 @item -msoft-float
14832 @opindex msoft-float
14833 Do not use hardware floating point.
14834
14835 @item -mac0
14836 @opindex mac0
14837 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
14838
14839 @item -mno-ac0
14840 @opindex mno-ac0
14841 Return floating-point results in memory.  This is the default.
14842
14843 @item -m40
14844 @opindex m40
14845 Generate code for a PDP-11/40.
14846
14847 @item -m45
14848 @opindex m45
14849 Generate code for a PDP-11/45.  This is the default.
14850
14851 @item -m10
14852 @opindex m10
14853 Generate code for a PDP-11/10.
14854
14855 @item -mbcopy-builtin
14856 @opindex mbcopy-builtin
14857 Use inline @code{movmemhi} patterns for copying memory.  This is the
14858 default.
14859
14860 @item -mbcopy
14861 @opindex mbcopy
14862 Do not use inline @code{movmemhi} patterns for copying memory.
14863
14864 @item -mint16
14865 @itemx -mno-int32
14866 @opindex mint16
14867 @opindex mno-int32
14868 Use 16-bit @code{int}.  This is the default.
14869
14870 @item -mint32
14871 @itemx -mno-int16
14872 @opindex mint32
14873 @opindex mno-int16
14874 Use 32-bit @code{int}.
14875
14876 @item -mfloat64
14877 @itemx -mno-float32
14878 @opindex mfloat64
14879 @opindex mno-float32
14880 Use 64-bit @code{float}.  This is the default.
14881
14882 @item -mfloat32
14883 @itemx -mno-float64
14884 @opindex mfloat32
14885 @opindex mno-float64
14886 Use 32-bit @code{float}.
14887
14888 @item -mabshi
14889 @opindex mabshi
14890 Use @code{abshi2} pattern.  This is the default.
14891
14892 @item -mno-abshi
14893 @opindex mno-abshi
14894 Do not use @code{abshi2} pattern.
14895
14896 @item -mbranch-expensive
14897 @opindex mbranch-expensive
14898 Pretend that branches are expensive.  This is for experimenting with
14899 code generation only.
14900
14901 @item -mbranch-cheap
14902 @opindex mbranch-cheap
14903 Do not pretend that branches are expensive.  This is the default.
14904
14905 @item -msplit
14906 @opindex msplit
14907 Generate code for a system with split I&D@.
14908
14909 @item -mno-split
14910 @opindex mno-split
14911 Generate code for a system without split I&D@.  This is the default.
14912
14913 @item -munix-asm
14914 @opindex munix-asm
14915 Use Unix assembler syntax.  This is the default when configured for
14916 @samp{pdp11-*-bsd}.
14917
14918 @item -mdec-asm
14919 @opindex mdec-asm
14920 Use DEC assembler syntax.  This is the default when configured for any
14921 PDP-11 target other than @samp{pdp11-*-bsd}.
14922 @end table
14923
14924 @node picoChip Options
14925 @subsection picoChip Options
14926 @cindex picoChip options
14927
14928 These @samp{-m} options are defined for picoChip implementations:
14929
14930 @table @gcctabopt
14931
14932 @item -mae=@var{ae_type}
14933 @opindex mcpu
14934 Set the instruction set, register set, and instruction scheduling
14935 parameters for array element type @var{ae_type}.  Supported values
14936 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
14937
14938 @option{-mae=ANY} selects a completely generic AE type.  Code
14939 generated with this option will run on any of the other AE types.  The
14940 code will not be as efficient as it would be if compiled for a specific
14941 AE type, and some types of operation (e.g., multiplication) will not
14942 work properly on all types of AE.
14943
14944 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
14945 for compiled code, and is the default.
14946
14947 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
14948 option may suffer from poor performance of byte (char) manipulation,
14949 since the DSP AE does not provide hardware support for byte load/stores.
14950
14951 @item -msymbol-as-address
14952 Enable the compiler to directly use a symbol name as an address in a
14953 load/store instruction, without first loading it into a
14954 register.  Typically, the use of this option will generate larger
14955 programs, which run faster than when the option isn't used.  However, the
14956 results vary from program to program, so it is left as a user option,
14957 rather than being permanently enabled.
14958
14959 @item -mno-inefficient-warnings
14960 Disables warnings about the generation of inefficient code.  These
14961 warnings can be generated, for example, when compiling code which
14962 performs byte-level memory operations on the MAC AE type.  The MAC AE has
14963 no hardware support for byte-level memory operations, so all byte
14964 load/stores must be synthesized from word load/store operations.  This is
14965 inefficient and a warning will be generated indicating to the programmer
14966 that they should rewrite the code to avoid byte operations, or to target
14967 an AE type which has the necessary hardware support.  This option enables
14968 the warning to be turned off.
14969
14970 @end table
14971
14972 @node PowerPC Options
14973 @subsection PowerPC Options
14974 @cindex PowerPC options
14975
14976 These are listed under @xref{RS/6000 and PowerPC Options}.
14977
14978 @node RS/6000 and PowerPC Options
14979 @subsection IBM RS/6000 and PowerPC Options
14980 @cindex RS/6000 and PowerPC Options
14981 @cindex IBM RS/6000 and PowerPC Options
14982
14983 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
14984 @table @gcctabopt
14985 @item -mpower
14986 @itemx -mno-power
14987 @itemx -mpower2
14988 @itemx -mno-power2
14989 @itemx -mpowerpc
14990 @itemx -mno-powerpc
14991 @itemx -mpowerpc-gpopt
14992 @itemx -mno-powerpc-gpopt
14993 @itemx -mpowerpc-gfxopt
14994 @itemx -mno-powerpc-gfxopt
14995 @itemx -mpowerpc64
14996 @itemx -mno-powerpc64
14997 @itemx -mmfcrf
14998 @itemx -mno-mfcrf
14999 @itemx -mpopcntb
15000 @itemx -mno-popcntb
15001 @itemx -mpopcntd
15002 @itemx -mno-popcntd
15003 @itemx -mfprnd
15004 @itemx -mno-fprnd
15005 @itemx -mcmpb
15006 @itemx -mno-cmpb
15007 @itemx -mmfpgpr
15008 @itemx -mno-mfpgpr
15009 @itemx -mhard-dfp
15010 @itemx -mno-hard-dfp
15011 @opindex mpower
15012 @opindex mno-power
15013 @opindex mpower2
15014 @opindex mno-power2
15015 @opindex mpowerpc
15016 @opindex mno-powerpc
15017 @opindex mpowerpc-gpopt
15018 @opindex mno-powerpc-gpopt
15019 @opindex mpowerpc-gfxopt
15020 @opindex mno-powerpc-gfxopt
15021 @opindex mpowerpc64
15022 @opindex mno-powerpc64
15023 @opindex mmfcrf
15024 @opindex mno-mfcrf
15025 @opindex mpopcntb
15026 @opindex mno-popcntb
15027 @opindex mpopcntd
15028 @opindex mno-popcntd
15029 @opindex mfprnd
15030 @opindex mno-fprnd
15031 @opindex mcmpb
15032 @opindex mno-cmpb
15033 @opindex mmfpgpr
15034 @opindex mno-mfpgpr
15035 @opindex mhard-dfp
15036 @opindex mno-hard-dfp
15037 GCC supports two related instruction set architectures for the
15038 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
15039 instructions supported by the @samp{rios} chip set used in the original
15040 RS/6000 systems and the @dfn{PowerPC} instruction set is the
15041 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
15042 the IBM 4xx, 6xx, and follow-on microprocessors.
15043
15044 Neither architecture is a subset of the other.  However there is a
15045 large common subset of instructions supported by both.  An MQ
15046 register is included in processors supporting the POWER architecture.
15047
15048 You use these options to specify which instructions are available on the
15049 processor you are using.  The default value of these options is
15050 determined when configuring GCC@.  Specifying the
15051 @option{-mcpu=@var{cpu_type}} overrides the specification of these
15052 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
15053 rather than the options listed above.
15054
15055 The @option{-mpower} option allows GCC to generate instructions that
15056 are found only in the POWER architecture and to use the MQ register.
15057 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
15058 to generate instructions that are present in the POWER2 architecture but
15059 not the original POWER architecture.
15060
15061 The @option{-mpowerpc} option allows GCC to generate instructions that
15062 are found only in the 32-bit subset of the PowerPC architecture.
15063 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
15064 GCC to use the optional PowerPC architecture instructions in the
15065 General Purpose group, including floating-point square root.  Specifying
15066 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
15067 use the optional PowerPC architecture instructions in the Graphics
15068 group, including floating-point select.
15069
15070 The @option{-mmfcrf} option allows GCC to generate the move from
15071 condition register field instruction implemented on the POWER4
15072 processor and other processors that support the PowerPC V2.01
15073 architecture.
15074 The @option{-mpopcntb} option allows GCC to generate the popcount and
15075 double precision FP reciprocal estimate instruction implemented on the
15076 POWER5 processor and other processors that support the PowerPC V2.02
15077 architecture.
15078 The @option{-mpopcntd} option allows GCC to generate the popcount
15079 instruction implemented on the POWER7 processor and other processors
15080 that support the PowerPC V2.06 architecture.
15081 The @option{-mfprnd} option allows GCC to generate the FP round to
15082 integer instructions implemented on the POWER5+ processor and other
15083 processors that support the PowerPC V2.03 architecture.
15084 The @option{-mcmpb} option allows GCC to generate the compare bytes
15085 instruction implemented on the POWER6 processor and other processors
15086 that support the PowerPC V2.05 architecture.
15087 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
15088 general purpose register instructions implemented on the POWER6X
15089 processor and other processors that support the extended PowerPC V2.05
15090 architecture.
15091 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
15092 point instructions implemented on some POWER processors.
15093
15094 The @option{-mpowerpc64} option allows GCC to generate the additional
15095 64-bit instructions that are found in the full PowerPC64 architecture
15096 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
15097 @option{-mno-powerpc64}.
15098
15099 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
15100 will use only the instructions in the common subset of both
15101 architectures plus some special AIX common-mode calls, and will not use
15102 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
15103 permits GCC to use any instruction from either architecture and to
15104 allow use of the MQ register; specify this for the Motorola MPC601.
15105
15106 @item -mnew-mnemonics
15107 @itemx -mold-mnemonics
15108 @opindex mnew-mnemonics
15109 @opindex mold-mnemonics
15110 Select which mnemonics to use in the generated assembler code.  With
15111 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
15112 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
15113 assembler mnemonics defined for the POWER architecture.  Instructions
15114 defined in only one architecture have only one mnemonic; GCC uses that
15115 mnemonic irrespective of which of these options is specified.
15116
15117 GCC defaults to the mnemonics appropriate for the architecture in
15118 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
15119 value of these option.  Unless you are building a cross-compiler, you
15120 should normally not specify either @option{-mnew-mnemonics} or
15121 @option{-mold-mnemonics}, but should instead accept the default.
15122
15123 @item -mcpu=@var{cpu_type}
15124 @opindex mcpu
15125 Set architecture type, register usage, choice of mnemonics, and
15126 instruction scheduling parameters for machine type @var{cpu_type}.
15127 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
15128 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
15129 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
15130 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
15131 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
15132 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
15133 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
15134 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
15135 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
15136 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
15137 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
15138
15139 @option{-mcpu=common} selects a completely generic processor.  Code
15140 generated under this option will run on any POWER or PowerPC processor.
15141 GCC will use only the instructions in the common subset of both
15142 architectures, and will not use the MQ register.  GCC assumes a generic
15143 processor model for scheduling purposes.
15144
15145 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
15146 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
15147 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
15148 types, with an appropriate, generic processor model assumed for
15149 scheduling purposes.
15150
15151 The other options specify a specific processor.  Code generated under
15152 those options will run best on that processor, and may not run at all on
15153 others.
15154
15155 The @option{-mcpu} options automatically enable or disable the
15156 following options:
15157
15158 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
15159 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
15160 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
15161 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
15162
15163 The particular options set for any particular CPU will vary between
15164 compiler versions, depending on what setting seems to produce optimal
15165 code for that CPU; it doesn't necessarily reflect the actual hardware's
15166 capabilities.  If you wish to set an individual option to a particular
15167 value, you may specify it after the @option{-mcpu} option, like
15168 @samp{-mcpu=970 -mno-altivec}.
15169
15170 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
15171 not enabled or disabled by the @option{-mcpu} option at present because
15172 AIX does not have full support for these options.  You may still
15173 enable or disable them individually if you're sure it'll work in your
15174 environment.
15175
15176 @item -mtune=@var{cpu_type}
15177 @opindex mtune
15178 Set the instruction scheduling parameters for machine type
15179 @var{cpu_type}, but do not set the architecture type, register usage, or
15180 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
15181 values for @var{cpu_type} are used for @option{-mtune} as for
15182 @option{-mcpu}.  If both are specified, the code generated will use the
15183 architecture, registers, and mnemonics set by @option{-mcpu}, but the
15184 scheduling parameters set by @option{-mtune}.
15185
15186 @item -mcmodel=small
15187 @opindex mcmodel=small
15188 Generate PowerPC64 code for the small model: The TOC is limited to
15189 64k.
15190
15191 @item -mcmodel=large
15192 @opindex mcmodel=large
15193 Generate PowerPC64 code for the large model: The TOC may be up to 4G
15194 in size.  Other data and code is only limited by the 64-bit address
15195 space.
15196
15197 @item -maltivec
15198 @itemx -mno-altivec
15199 @opindex maltivec
15200 @opindex mno-altivec
15201 Generate code that uses (does not use) AltiVec instructions, and also
15202 enable the use of built-in functions that allow more direct access to
15203 the AltiVec instruction set.  You may also need to set
15204 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
15205 enhancements.
15206
15207 @item -mvrsave
15208 @itemx -mno-vrsave
15209 @opindex mvrsave
15210 @opindex mno-vrsave
15211 Generate VRSAVE instructions when generating AltiVec code.
15212
15213 @item -mgen-cell-microcode
15214 @opindex mgen-cell-microcode
15215 Generate Cell microcode instructions
15216
15217 @item -mwarn-cell-microcode
15218 @opindex mwarn-cell-microcode
15219 Warning when a Cell microcode instruction is going to emitted.  An example
15220 of a Cell microcode instruction is a variable shift.
15221
15222 @item -msecure-plt
15223 @opindex msecure-plt
15224 Generate code that allows ld and ld.so to build executables and shared
15225 libraries with non-exec .plt and .got sections.  This is a PowerPC
15226 32-bit SYSV ABI option.
15227
15228 @item -mbss-plt
15229 @opindex mbss-plt
15230 Generate code that uses a BSS .plt section that ld.so fills in, and
15231 requires .plt and .got sections that are both writable and executable.
15232 This is a PowerPC 32-bit SYSV ABI option.
15233
15234 @item -misel
15235 @itemx -mno-isel
15236 @opindex misel
15237 @opindex mno-isel
15238 This switch enables or disables the generation of ISEL instructions.
15239
15240 @item -misel=@var{yes/no}
15241 This switch has been deprecated.  Use @option{-misel} and
15242 @option{-mno-isel} instead.
15243
15244 @item -mspe
15245 @itemx -mno-spe
15246 @opindex mspe
15247 @opindex mno-spe
15248 This switch enables or disables the generation of SPE simd
15249 instructions.
15250
15251 @item -mpaired
15252 @itemx -mno-paired
15253 @opindex mpaired
15254 @opindex mno-paired
15255 This switch enables or disables the generation of PAIRED simd
15256 instructions.
15257
15258 @item -mspe=@var{yes/no}
15259 This option has been deprecated.  Use @option{-mspe} and
15260 @option{-mno-spe} instead.
15261
15262 @item -mvsx
15263 @itemx -mno-vsx
15264 @opindex mvsx
15265 @opindex mno-vsx
15266 Generate code that uses (does not use) vector/scalar (VSX)
15267 instructions, and also enable the use of built-in functions that allow
15268 more direct access to the VSX instruction set.
15269
15270 @item -mfloat-gprs=@var{yes/single/double/no}
15271 @itemx -mfloat-gprs
15272 @opindex mfloat-gprs
15273 This switch enables or disables the generation of floating point
15274 operations on the general purpose registers for architectures that
15275 support it.
15276
15277 The argument @var{yes} or @var{single} enables the use of
15278 single-precision floating point operations.
15279
15280 The argument @var{double} enables the use of single and
15281 double-precision floating point operations.
15282
15283 The argument @var{no} disables floating point operations on the
15284 general purpose registers.
15285
15286 This option is currently only available on the MPC854x.
15287
15288 @item -m32
15289 @itemx -m64
15290 @opindex m32
15291 @opindex m64
15292 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
15293 targets (including GNU/Linux).  The 32-bit environment sets int, long
15294 and pointer to 32 bits and generates code that runs on any PowerPC
15295 variant.  The 64-bit environment sets int to 32 bits and long and
15296 pointer to 64 bits, and generates code for PowerPC64, as for
15297 @option{-mpowerpc64}.
15298
15299 @item -mfull-toc
15300 @itemx -mno-fp-in-toc
15301 @itemx -mno-sum-in-toc
15302 @itemx -mminimal-toc
15303 @opindex mfull-toc
15304 @opindex mno-fp-in-toc
15305 @opindex mno-sum-in-toc
15306 @opindex mminimal-toc
15307 Modify generation of the TOC (Table Of Contents), which is created for
15308 every executable file.  The @option{-mfull-toc} option is selected by
15309 default.  In that case, GCC will allocate at least one TOC entry for
15310 each unique non-automatic variable reference in your program.  GCC
15311 will also place floating-point constants in the TOC@.  However, only
15312 16,384 entries are available in the TOC@.
15313
15314 If you receive a linker error message that saying you have overflowed
15315 the available TOC space, you can reduce the amount of TOC space used
15316 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
15317 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
15318 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
15319 generate code to calculate the sum of an address and a constant at
15320 run-time instead of putting that sum into the TOC@.  You may specify one
15321 or both of these options.  Each causes GCC to produce very slightly
15322 slower and larger code at the expense of conserving TOC space.
15323
15324 If you still run out of space in the TOC even when you specify both of
15325 these options, specify @option{-mminimal-toc} instead.  This option causes
15326 GCC to make only one TOC entry for every file.  When you specify this
15327 option, GCC will produce code that is slower and larger but which
15328 uses extremely little TOC space.  You may wish to use this option
15329 only on files that contain less frequently executed code.
15330
15331 @item -maix64
15332 @itemx -maix32
15333 @opindex maix64
15334 @opindex maix32
15335 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
15336 @code{long} type, and the infrastructure needed to support them.
15337 Specifying @option{-maix64} implies @option{-mpowerpc64} and
15338 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
15339 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
15340
15341 @item -mxl-compat
15342 @itemx -mno-xl-compat
15343 @opindex mxl-compat
15344 @opindex mno-xl-compat
15345 Produce code that conforms more closely to IBM XL compiler semantics
15346 when using AIX-compatible ABI@.  Pass floating-point arguments to
15347 prototyped functions beyond the register save area (RSA) on the stack
15348 in addition to argument FPRs.  Do not assume that most significant
15349 double in 128-bit long double value is properly rounded when comparing
15350 values and converting to double.  Use XL symbol names for long double
15351 support routines.
15352
15353 The AIX calling convention was extended but not initially documented to
15354 handle an obscure K&R C case of calling a function that takes the
15355 address of its arguments with fewer arguments than declared.  IBM XL
15356 compilers access floating point arguments which do not fit in the
15357 RSA from the stack when a subroutine is compiled without
15358 optimization.  Because always storing floating-point arguments on the
15359 stack is inefficient and rarely needed, this option is not enabled by
15360 default and only is necessary when calling subroutines compiled by IBM
15361 XL compilers without optimization.
15362
15363 @item -mpe
15364 @opindex mpe
15365 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
15366 application written to use message passing with special startup code to
15367 enable the application to run.  The system must have PE installed in the
15368 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
15369 must be overridden with the @option{-specs=} option to specify the
15370 appropriate directory location.  The Parallel Environment does not
15371 support threads, so the @option{-mpe} option and the @option{-pthread}
15372 option are incompatible.
15373
15374 @item -malign-natural
15375 @itemx -malign-power
15376 @opindex malign-natural
15377 @opindex malign-power
15378 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
15379 @option{-malign-natural} overrides the ABI-defined alignment of larger
15380 types, such as floating-point doubles, on their natural size-based boundary.
15381 The option @option{-malign-power} instructs GCC to follow the ABI-specified
15382 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
15383
15384 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
15385 is not supported.
15386
15387 @item -msoft-float
15388 @itemx -mhard-float
15389 @opindex msoft-float
15390 @opindex mhard-float
15391 Generate code that does not use (uses) the floating-point register set.
15392 Software floating point emulation is provided if you use the
15393 @option{-msoft-float} option, and pass the option to GCC when linking.
15394
15395 @item -msingle-float
15396 @itemx -mdouble-float
15397 @opindex msingle-float
15398 @opindex mdouble-float
15399 Generate code for single or double-precision floating point operations.
15400 @option{-mdouble-float} implies @option{-msingle-float}.
15401
15402 @item -msimple-fpu
15403 @opindex msimple-fpu
15404 Do not generate sqrt and div instructions for hardware floating point unit.
15405
15406 @item -mfpu
15407 @opindex mfpu
15408 Specify type of floating point unit.  Valid values are @var{sp_lite}
15409 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
15410 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
15411 and @var{dp_full} (equivalent to -mdouble-float).
15412
15413 @item -mxilinx-fpu
15414 @opindex mxilinx-fpu
15415 Perform optimizations for floating point unit on Xilinx PPC 405/440.
15416
15417 @item -mmultiple
15418 @itemx -mno-multiple
15419 @opindex mmultiple
15420 @opindex mno-multiple
15421 Generate code that uses (does not use) the load multiple word
15422 instructions and the store multiple word instructions.  These
15423 instructions are generated by default on POWER systems, and not
15424 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
15425 endian PowerPC systems, since those instructions do not work when the
15426 processor is in little endian mode.  The exceptions are PPC740 and
15427 PPC750 which permit the instructions usage in little endian mode.
15428
15429 @item -mstring
15430 @itemx -mno-string
15431 @opindex mstring
15432 @opindex mno-string
15433 Generate code that uses (does not use) the load string instructions
15434 and the store string word instructions to save multiple registers and
15435 do small block moves.  These instructions are generated by default on
15436 POWER systems, and not generated on PowerPC systems.  Do not use
15437 @option{-mstring} on little endian PowerPC systems, since those
15438 instructions do not work when the processor is in little endian mode.
15439 The exceptions are PPC740 and PPC750 which permit the instructions
15440 usage in little endian mode.
15441
15442 @item -mupdate
15443 @itemx -mno-update
15444 @opindex mupdate
15445 @opindex mno-update
15446 Generate code that uses (does not use) the load or store instructions
15447 that update the base register to the address of the calculated memory
15448 location.  These instructions are generated by default.  If you use
15449 @option{-mno-update}, there is a small window between the time that the
15450 stack pointer is updated and the address of the previous frame is
15451 stored, which means code that walks the stack frame across interrupts or
15452 signals may get corrupted data.
15453
15454 @item -mavoid-indexed-addresses
15455 @itemx -mno-avoid-indexed-addresses
15456 @opindex mavoid-indexed-addresses
15457 @opindex mno-avoid-indexed-addresses
15458 Generate code that tries to avoid (not avoid) the use of indexed load
15459 or store instructions. These instructions can incur a performance
15460 penalty on Power6 processors in certain situations, such as when
15461 stepping through large arrays that cross a 16M boundary.  This option
15462 is enabled by default when targetting Power6 and disabled otherwise.
15463
15464 @item -mfused-madd
15465 @itemx -mno-fused-madd
15466 @opindex mfused-madd
15467 @opindex mno-fused-madd
15468 Generate code that uses (does not use) the floating point multiply and
15469 accumulate instructions.  These instructions are generated by default if
15470 hardware floating is used.
15471
15472 @item -mmulhw
15473 @itemx -mno-mulhw
15474 @opindex mmulhw
15475 @opindex mno-mulhw
15476 Generate code that uses (does not use) the half-word multiply and
15477 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
15478 These instructions are generated by default when targetting those
15479 processors.
15480
15481 @item -mdlmzb
15482 @itemx -mno-dlmzb
15483 @opindex mdlmzb
15484 @opindex mno-dlmzb
15485 Generate code that uses (does not use) the string-search @samp{dlmzb}
15486 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
15487 generated by default when targetting those processors.
15488
15489 @item -mno-bit-align
15490 @itemx -mbit-align
15491 @opindex mno-bit-align
15492 @opindex mbit-align
15493 On System V.4 and embedded PowerPC systems do not (do) force structures
15494 and unions that contain bit-fields to be aligned to the base type of the
15495 bit-field.
15496
15497 For example, by default a structure containing nothing but 8
15498 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
15499 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
15500 the structure would be aligned to a 1 byte boundary and be one byte in
15501 size.
15502
15503 @item -mno-strict-align
15504 @itemx -mstrict-align
15505 @opindex mno-strict-align
15506 @opindex mstrict-align
15507 On System V.4 and embedded PowerPC systems do not (do) assume that
15508 unaligned memory references will be handled by the system.
15509
15510 @item -mrelocatable
15511 @itemx -mno-relocatable
15512 @opindex mrelocatable
15513 @opindex mno-relocatable
15514 Generate code that allows (does not allow) a static executable to be
15515 relocated to a different address at runtime.  A simple embedded
15516 PowerPC system loader should relocate the entire contents of
15517 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
15518 a table of 32-bit addresses generated by this option.  For this to
15519 work, all objects linked together must be compiled with
15520 @option{-mrelocatable} or @option{-mrelocatable-lib}.
15521 @option{-mrelocatable} code aligns the stack to an 8 byte boundary.
15522
15523 @item -mrelocatable-lib
15524 @itemx -mno-relocatable-lib
15525 @opindex mrelocatable-lib
15526 @opindex mno-relocatable-lib
15527 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
15528 @code{.fixup} section to allow static executables to be relocated at
15529 runtime, but @option{-mrelocatable-lib} does not use the smaller stack
15530 alignment of @option{-mrelocatable}.  Objects compiled with
15531 @option{-mrelocatable-lib} may be linked with objects compiled with
15532 any combination of the @option{-mrelocatable} options.
15533
15534 @item -mno-toc
15535 @itemx -mtoc
15536 @opindex mno-toc
15537 @opindex mtoc
15538 On System V.4 and embedded PowerPC systems do not (do) assume that
15539 register 2 contains a pointer to a global area pointing to the addresses
15540 used in the program.
15541
15542 @item -mlittle
15543 @itemx -mlittle-endian
15544 @opindex mlittle
15545 @opindex mlittle-endian
15546 On System V.4 and embedded PowerPC systems compile code for the
15547 processor in little endian mode.  The @option{-mlittle-endian} option is
15548 the same as @option{-mlittle}.
15549
15550 @item -mbig
15551 @itemx -mbig-endian
15552 @opindex mbig
15553 @opindex mbig-endian
15554 On System V.4 and embedded PowerPC systems compile code for the
15555 processor in big endian mode.  The @option{-mbig-endian} option is
15556 the same as @option{-mbig}.
15557
15558 @item -mdynamic-no-pic
15559 @opindex mdynamic-no-pic
15560 On Darwin and Mac OS X systems, compile code so that it is not
15561 relocatable, but that its external references are relocatable.  The
15562 resulting code is suitable for applications, but not shared
15563 libraries.
15564
15565 @item -mprioritize-restricted-insns=@var{priority}
15566 @opindex mprioritize-restricted-insns
15567 This option controls the priority that is assigned to
15568 dispatch-slot restricted instructions during the second scheduling
15569 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
15570 @var{no/highest/second-highest} priority to dispatch slot restricted
15571 instructions.
15572
15573 @item -msched-costly-dep=@var{dependence_type}
15574 @opindex msched-costly-dep
15575 This option controls which dependences are considered costly
15576 by the target during instruction scheduling.  The argument
15577 @var{dependence_type} takes one of the following values:
15578 @var{no}: no dependence is costly,
15579 @var{all}: all dependences are costly,
15580 @var{true_store_to_load}: a true dependence from store to load is costly,
15581 @var{store_to_load}: any dependence from store to load is costly,
15582 @var{number}: any dependence which latency >= @var{number} is costly.
15583
15584 @item -minsert-sched-nops=@var{scheme}
15585 @opindex minsert-sched-nops
15586 This option controls which nop insertion scheme will be used during
15587 the second scheduling pass.  The argument @var{scheme} takes one of the
15588 following values:
15589 @var{no}: Don't insert nops.
15590 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
15591 according to the scheduler's grouping.
15592 @var{regroup_exact}: Insert nops to force costly dependent insns into
15593 separate groups.  Insert exactly as many nops as needed to force an insn
15594 to a new group, according to the estimated processor grouping.
15595 @var{number}: Insert nops to force costly dependent insns into
15596 separate groups.  Insert @var{number} nops to force an insn to a new group.
15597
15598 @item -mcall-sysv
15599 @opindex mcall-sysv
15600 On System V.4 and embedded PowerPC systems compile code using calling
15601 conventions that adheres to the March 1995 draft of the System V
15602 Application Binary Interface, PowerPC processor supplement.  This is the
15603 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
15604
15605 @item -mcall-sysv-eabi
15606 @itemx -mcall-eabi
15607 @opindex mcall-sysv-eabi
15608 @opindex mcall-eabi
15609 Specify both @option{-mcall-sysv} and @option{-meabi} options.
15610
15611 @item -mcall-sysv-noeabi
15612 @opindex mcall-sysv-noeabi
15613 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
15614
15615 @item -mcall-aixdesc
15616 @opindex m
15617 On System V.4 and embedded PowerPC systems compile code for the AIX
15618 operating system.
15619
15620 @item -mcall-linux
15621 @opindex mcall-linux
15622 On System V.4 and embedded PowerPC systems compile code for the
15623 Linux-based GNU system.
15624
15625 @item -mcall-gnu
15626 @opindex mcall-gnu
15627 On System V.4 and embedded PowerPC systems compile code for the
15628 Hurd-based GNU system.
15629
15630 @item -mcall-freebsd
15631 @opindex mcall-freebsd
15632 On System V.4 and embedded PowerPC systems compile code for the
15633 FreeBSD operating system.
15634
15635 @item -mcall-netbsd
15636 @opindex mcall-netbsd
15637 On System V.4 and embedded PowerPC systems compile code for the
15638 NetBSD operating system.
15639
15640 @item -mcall-openbsd
15641 @opindex mcall-netbsd
15642 On System V.4 and embedded PowerPC systems compile code for the
15643 OpenBSD operating system.
15644
15645 @item -maix-struct-return
15646 @opindex maix-struct-return
15647 Return all structures in memory (as specified by the AIX ABI)@.
15648
15649 @item -msvr4-struct-return
15650 @opindex msvr4-struct-return
15651 Return structures smaller than 8 bytes in registers (as specified by the
15652 SVR4 ABI)@.
15653
15654 @item -mabi=@var{abi-type}
15655 @opindex mabi
15656 Extend the current ABI with a particular extension, or remove such extension.
15657 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
15658 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
15659
15660 @item -mabi=spe
15661 @opindex mabi=spe
15662 Extend the current ABI with SPE ABI extensions.  This does not change
15663 the default ABI, instead it adds the SPE ABI extensions to the current
15664 ABI@.
15665
15666 @item -mabi=no-spe
15667 @opindex mabi=no-spe
15668 Disable Booke SPE ABI extensions for the current ABI@.
15669
15670 @item -mabi=ibmlongdouble
15671 @opindex mabi=ibmlongdouble
15672 Change the current ABI to use IBM extended precision long double.
15673 This is a PowerPC 32-bit SYSV ABI option.
15674
15675 @item -mabi=ieeelongdouble
15676 @opindex mabi=ieeelongdouble
15677 Change the current ABI to use IEEE extended precision long double.
15678 This is a PowerPC 32-bit Linux ABI option.
15679
15680 @item -mprototype
15681 @itemx -mno-prototype
15682 @opindex mprototype
15683 @opindex mno-prototype
15684 On System V.4 and embedded PowerPC systems assume that all calls to
15685 variable argument functions are properly prototyped.  Otherwise, the
15686 compiler must insert an instruction before every non prototyped call to
15687 set or clear bit 6 of the condition code register (@var{CR}) to
15688 indicate whether floating point values were passed in the floating point
15689 registers in case the function takes a variable arguments.  With
15690 @option{-mprototype}, only calls to prototyped variable argument functions
15691 will set or clear the bit.
15692
15693 @item -msim
15694 @opindex msim
15695 On embedded PowerPC systems, assume that the startup module is called
15696 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
15697 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
15698 configurations.
15699
15700 @item -mmvme
15701 @opindex mmvme
15702 On embedded PowerPC systems, assume that the startup module is called
15703 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
15704 @file{libc.a}.
15705
15706 @item -mads
15707 @opindex mads
15708 On embedded PowerPC systems, assume that the startup module is called
15709 @file{crt0.o} and the standard C libraries are @file{libads.a} and
15710 @file{libc.a}.
15711
15712 @item -myellowknife
15713 @opindex myellowknife
15714 On embedded PowerPC systems, assume that the startup module is called
15715 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
15716 @file{libc.a}.
15717
15718 @item -mvxworks
15719 @opindex mvxworks
15720 On System V.4 and embedded PowerPC systems, specify that you are
15721 compiling for a VxWorks system.
15722
15723 @item -memb
15724 @opindex memb
15725 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
15726 header to indicate that @samp{eabi} extended relocations are used.
15727
15728 @item -meabi
15729 @itemx -mno-eabi
15730 @opindex meabi
15731 @opindex mno-eabi
15732 On System V.4 and embedded PowerPC systems do (do not) adhere to the
15733 Embedded Applications Binary Interface (eabi) which is a set of
15734 modifications to the System V.4 specifications.  Selecting @option{-meabi}
15735 means that the stack is aligned to an 8 byte boundary, a function
15736 @code{__eabi} is called to from @code{main} to set up the eabi
15737 environment, and the @option{-msdata} option can use both @code{r2} and
15738 @code{r13} to point to two separate small data areas.  Selecting
15739 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
15740 do not call an initialization function from @code{main}, and the
15741 @option{-msdata} option will only use @code{r13} to point to a single
15742 small data area.  The @option{-meabi} option is on by default if you
15743 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
15744
15745 @item -msdata=eabi
15746 @opindex msdata=eabi
15747 On System V.4 and embedded PowerPC systems, put small initialized
15748 @code{const} global and static data in the @samp{.sdata2} section, which
15749 is pointed to by register @code{r2}.  Put small initialized
15750 non-@code{const} global and static data in the @samp{.sdata} section,
15751 which is pointed to by register @code{r13}.  Put small uninitialized
15752 global and static data in the @samp{.sbss} section, which is adjacent to
15753 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
15754 incompatible with the @option{-mrelocatable} option.  The
15755 @option{-msdata=eabi} option also sets the @option{-memb} option.
15756
15757 @item -msdata=sysv
15758 @opindex msdata=sysv
15759 On System V.4 and embedded PowerPC systems, put small global and static
15760 data in the @samp{.sdata} section, which is pointed to by register
15761 @code{r13}.  Put small uninitialized global and static data in the
15762 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
15763 The @option{-msdata=sysv} option is incompatible with the
15764 @option{-mrelocatable} option.
15765
15766 @item -msdata=default
15767 @itemx -msdata
15768 @opindex msdata=default
15769 @opindex msdata
15770 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
15771 compile code the same as @option{-msdata=eabi}, otherwise compile code the
15772 same as @option{-msdata=sysv}.
15773
15774 @item -msdata=data
15775 @opindex msdata=data
15776 On System V.4 and embedded PowerPC systems, put small global
15777 data in the @samp{.sdata} section.  Put small uninitialized global
15778 data in the @samp{.sbss} section.  Do not use register @code{r13}
15779 to address small data however.  This is the default behavior unless
15780 other @option{-msdata} options are used.
15781
15782 @item -msdata=none
15783 @itemx -mno-sdata
15784 @opindex msdata=none
15785 @opindex mno-sdata
15786 On embedded PowerPC systems, put all initialized global and static data
15787 in the @samp{.data} section, and all uninitialized data in the
15788 @samp{.bss} section.
15789
15790 @item -mblock-move-inline-limit=@var{num}
15791 @opindex mblock-move-inline-limit
15792 Inline all block moves (such as calls to @code{memcpy} or structure
15793 copies) less than or equal to @var{num} bytes.  The minimum value for
15794 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
15795 targets.  The default value is target-specific.
15796
15797 @item -G @var{num}
15798 @opindex G
15799 @cindex smaller data references (PowerPC)
15800 @cindex .sdata/.sdata2 references (PowerPC)
15801 On embedded PowerPC systems, put global and static items less than or
15802 equal to @var{num} bytes into the small data or bss sections instead of
15803 the normal data or bss section.  By default, @var{num} is 8.  The
15804 @option{-G @var{num}} switch is also passed to the linker.
15805 All modules should be compiled with the same @option{-G @var{num}} value.
15806
15807 @item -mregnames
15808 @itemx -mno-regnames
15809 @opindex mregnames
15810 @opindex mno-regnames
15811 On System V.4 and embedded PowerPC systems do (do not) emit register
15812 names in the assembly language output using symbolic forms.
15813
15814 @item -mlongcall
15815 @itemx -mno-longcall
15816 @opindex mlongcall
15817 @opindex mno-longcall
15818 By default assume that all calls are far away so that a longer more
15819 expensive calling sequence is required.  This is required for calls
15820 further than 32 megabytes (33,554,432 bytes) from the current location.
15821 A short call will be generated if the compiler knows
15822 the call cannot be that far away.  This setting can be overridden by
15823 the @code{shortcall} function attribute, or by @code{#pragma
15824 longcall(0)}.
15825
15826 Some linkers are capable of detecting out-of-range calls and generating
15827 glue code on the fly.  On these systems, long calls are unnecessary and
15828 generate slower code.  As of this writing, the AIX linker can do this,
15829 as can the GNU linker for PowerPC/64.  It is planned to add this feature
15830 to the GNU linker for 32-bit PowerPC systems as well.
15831
15832 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
15833 callee, L42'', plus a ``branch island'' (glue code).  The two target
15834 addresses represent the callee and the ``branch island''.  The
15835 Darwin/PPC linker will prefer the first address and generate a ``bl
15836 callee'' if the PPC ``bl'' instruction will reach the callee directly;
15837 otherwise, the linker will generate ``bl L42'' to call the ``branch
15838 island''.  The ``branch island'' is appended to the body of the
15839 calling function; it computes the full 32-bit address of the callee
15840 and jumps to it.
15841
15842 On Mach-O (Darwin) systems, this option directs the compiler emit to
15843 the glue for every direct call, and the Darwin linker decides whether
15844 to use or discard it.
15845
15846 In the future, we may cause GCC to ignore all longcall specifications
15847 when the linker is known to generate glue.
15848
15849 @item -mtls-markers
15850 @itemx -mno-tls-markers
15851 @opindex mtls-markers
15852 @opindex mno-tls-markers
15853 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
15854 specifying the function argument.  The relocation allows ld to
15855 reliably associate function call with argument setup instructions for
15856 TLS optimization, which in turn allows gcc to better schedule the
15857 sequence.
15858
15859 @item -pthread
15860 @opindex pthread
15861 Adds support for multithreading with the @dfn{pthreads} library.
15862 This option sets flags for both the preprocessor and linker.
15863
15864 @item -mrecip
15865 @itemx -mno-recip
15866 @opindex mrecip
15867 This option will enable GCC to use the reciprocal estimate and
15868 reciprocal square root estimate instructions with additional
15869 Newton-Raphson steps to increase precision instead of doing a divide or
15870 square root and divide for floating point arguments.  You should use
15871 the @option{-ffast-math} option when using @option{-mrecip} (or at
15872 least @option{-funsafe-math-optimizations},
15873 @option{-finite-math-only}, @option{-freciprocal-math} and
15874 @option{-fno-trapping-math}).  Note that while the throughput of the
15875 sequence is generally higher than the throughput of the non-reciprocal
15876 instruction, the precision of the sequence can be decreased by up to 2
15877 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
15878 roots.
15879
15880 @item -mrecip=@var{opt}
15881 @opindex mrecip=opt
15882 This option allows to control which reciprocal estimate instructions
15883 may be used.  @var{opt} is a comma separated list of options, that may
15884 be preceeded by a @code{!} to invert the option:
15885 @code{all}: enable all estimate instructions,
15886 @code{default}: enable the default instructions, equvalent to @option{-mrecip},
15887 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
15888 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
15889 @code{divf}: enable the single precision reciprocal approximation instructions;
15890 @code{divd}: enable the double precision reciprocal approximation instructions;
15891 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
15892 @code{rsqrtf}: enable the single precision reciprocal square root approximation instructions;
15893 @code{rsqrtd}: enable the double precision reciprocal square root approximation instructions;
15894
15895 So for example, @option{-mrecip=all,!rsqrtd} would enable the
15896 all of the reciprocal estimate instructions, except for the
15897 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
15898 which handle the double precision reciprocal square root calculations.
15899
15900 @item -mrecip-precision
15901 @itemx -mno-recip-precision
15902 @opindex mrecip-precision
15903 Assume (do not assume) that the reciprocal estimate instructions
15904 provide higher precision estimates than is mandated by the powerpc
15905 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
15906 automatically selects @option{-mrecip-precision}.  The double
15907 precision square root estimate instructions are not generated by
15908 default on low precision machines, since they do not provide an
15909 estimate that converges after three steps.
15910
15911 @item -mveclibabi=@var{type}
15912 @opindex mveclibabi
15913 Specifies the ABI type to use for vectorizing intrinsics using an
15914 external library.  The only type supported at present is @code{mass},
15915 which specifies to use IBM's Mathematical Acceleration Subsystem
15916 (MASS) libraries for vectorizing intrinsics using external libraries.
15917 GCC will currently emit calls to @code{acosd2}, @code{acosf4},
15918 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
15919 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
15920 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
15921 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
15922 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
15923 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
15924 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
15925 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
15926 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
15927 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
15928 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
15929 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
15930 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
15931 for power7.  Both @option{-ftree-vectorize} and
15932 @option{-funsafe-math-optimizations} have to be enabled.  The MASS
15933 libraries will have to be specified at link time.
15934 @end table
15935
15936 @node RX Options
15937 @subsection RX Options
15938 @cindex RX Options
15939
15940 These command line options are defined for RX targets:
15941
15942 @table @gcctabopt
15943 @item -m64bit-doubles
15944 @itemx -m32bit-doubles
15945 @opindex m64bit-doubles
15946 @opindex m32bit-doubles
15947 Make the @code{double} data type be 64-bits (@option{-m64bit-doubles})
15948 or 32-bits (@option{-m32bit-doubles}) in size.  The default is
15949 @option{-m32bit-doubles}.  @emph{Note} RX floating point hardware only
15950 works on 32-bit values, which is why the default is
15951 @option{-m32bit-doubles}.
15952
15953 @item -fpu
15954 @itemx -nofpu
15955 @opindex fpu
15956 @opindex nofpu
15957 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
15958 floating point hardware.  The default is enabled for the @var{RX600}
15959 series and disabled for the @var{RX200} series.
15960
15961 Floating point instructions will only be generated for 32-bit floating
15962 point values however, so if the @option{-m64bit-doubles} option is in
15963 use then the FPU hardware will not be used for doubles.
15964
15965 @emph{Note} If the @option{-fpu} option is enabled then
15966 @option{-funsafe-math-optimizations} is also enabled automatically.
15967 This is because the RX FPU instructions are themselves unsafe.
15968
15969 @item -mcpu=@var{name}
15970 @opindex -mcpu
15971 Selects the type of RX CPU to be targeted.  Currently three types are
15972 supported, the generic @var{RX600} and @var{RX200} series hardware and
15973 the specific @var{RX610} cpu.  The default is @var{RX600}.
15974
15975 The only difference between @var{RX600} and @var{RX610} is that the
15976 @var{RX610} does not support the @code{MVTIPL} instruction.
15977
15978 The @var{RX200} series does not have a hardware floating point unit
15979 and so @option{-nofpu} is enabled by default when this type is
15980 selected.
15981
15982 @item -mbig-endian-data
15983 @itemx -mlittle-endian-data
15984 @opindex mbig-endian-data
15985 @opindex mlittle-endian-data
15986 Store data (but not code) in the big-endian format.  The default is
15987 @option{-mlittle-endian-data}, ie to store data in the little endian
15988 format.
15989
15990 @item -msmall-data-limit=@var{N}
15991 @opindex msmall-data-limit
15992 Specifies the maximum size in bytes of global and static variables
15993 which can be placed into the small data area.  Using the small data
15994 area can lead to smaller and faster code, but the size of area is
15995 limited and it is up to the programmer to ensure that the area does
15996 not overflow.  Also when the small data area is used one of the RX's
15997 registers (@code{r13}) is reserved for use pointing to this area, so
15998 it is no longer available for use by the compiler.  This could result
15999 in slower and/or larger code if variables which once could have been
16000 held in @code{r13} are now pushed onto the stack.
16001
16002 Note, common variables (variables which have not been initialised) and
16003 constants are not placed into the small data area as they are assigned
16004 to other sections in the output executable.
16005
16006 The default value is zero, which disables this feature.  Note, this
16007 feature is not enabled by default with higher optimization levels
16008 (@option{-O2} etc) because of the potentially detrimental effects of
16009 reserving register @code{r13}.  It is up to the programmer to
16010 experiment and discover whether this feature is of benefit to their
16011 program.
16012
16013 @item -msim
16014 @itemx -mno-sim
16015 @opindex msim
16016 @opindex mno-sim
16017 Use the simulator runtime.  The default is to use the libgloss board
16018 specific runtime.
16019
16020 @item -mas100-syntax
16021 @itemx -mno-as100-syntax
16022 @opindex mas100-syntax
16023 @opindex mno-as100-syntax
16024 When generating assembler output use a syntax that is compatible with
16025 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
16026 assembler but it has some restrictions so generating it is not the
16027 default option.
16028
16029 @item -mmax-constant-size=@var{N}
16030 @opindex mmax-constant-size
16031 Specifies the maximum size, in bytes, of a constant that can be used as
16032 an operand in a RX instruction.  Although the RX instruction set does
16033 allow constants of up to 4 bytes in length to be used in instructions,
16034 a longer value equates to a longer instruction.  Thus in some
16035 circumstances it can be beneficial to restrict the size of constants
16036 that are used in instructions.  Constants that are too big are instead
16037 placed into a constant pool and referenced via register indirection.
16038
16039 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
16040 or 4 means that constants of any size are allowed.
16041
16042 @item -mrelax
16043 @opindex mrelax
16044 Enable linker relaxation.  Linker relaxation is a process whereby the
16045 linker will attempt to reduce the size of a program by finding shorter
16046 versions of various instructions.  Disabled by default.
16047
16048 @item -mint-register=@var{N}
16049 @opindex mint-register
16050 Specify the number of registers to reserve for fast interrupt handler
16051 functions.  The value @var{N} can be between 0 and 4.  A value of 1
16052 means that register @code{r13} will be reserved for the exclusive use
16053 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
16054 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
16055 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
16056 A value of 0, the default, does not reserve any registers.
16057
16058 @item -msave-acc-in-interrupts
16059 @opindex msave-acc-in-interrupts
16060 Specifies that interrupt handler functions should preserve the
16061 accumulator register.  This is only necessary if normal code might use
16062 the accumulator register, for example because it performs 64-bit
16063 multiplications.  The default is to ignore the accumulator as this
16064 makes the interrupt handlers faster.
16065
16066 @end table
16067
16068 @emph{Note:} The generic GCC command line @option{-ffixed-@var{reg}}
16069 has special significance to the RX port when used with the
16070 @code{interrupt} function attribute.  This attribute indicates a
16071 function intended to process fast interrupts.  GCC will will ensure
16072 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
16073 and/or @code{r13} and only provided that the normal use of the
16074 corresponding registers have been restricted via the
16075 @option{-ffixed-@var{reg}} or @option{-mint-register} command line
16076 options.
16077
16078 @node S/390 and zSeries Options
16079 @subsection S/390 and zSeries Options
16080 @cindex S/390 and zSeries Options
16081
16082 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
16083
16084 @table @gcctabopt
16085 @item -mhard-float
16086 @itemx -msoft-float
16087 @opindex mhard-float
16088 @opindex msoft-float
16089 Use (do not use) the hardware floating-point instructions and registers
16090 for floating-point operations.  When @option{-msoft-float} is specified,
16091 functions in @file{libgcc.a} will be used to perform floating-point
16092 operations.  When @option{-mhard-float} is specified, the compiler
16093 generates IEEE floating-point instructions.  This is the default.
16094
16095 @item -mhard-dfp
16096 @itemx -mno-hard-dfp
16097 @opindex mhard-dfp
16098 @opindex mno-hard-dfp
16099 Use (do not use) the hardware decimal-floating-point instructions for
16100 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
16101 specified, functions in @file{libgcc.a} will be used to perform
16102 decimal-floating-point operations.  When @option{-mhard-dfp} is
16103 specified, the compiler generates decimal-floating-point hardware
16104 instructions.  This is the default for @option{-march=z9-ec} or higher.
16105
16106 @item -mlong-double-64
16107 @itemx -mlong-double-128
16108 @opindex mlong-double-64
16109 @opindex mlong-double-128
16110 These switches control the size of @code{long double} type. A size
16111 of 64bit makes the @code{long double} type equivalent to the @code{double}
16112 type. This is the default.
16113
16114 @item -mbackchain
16115 @itemx -mno-backchain
16116 @opindex mbackchain
16117 @opindex mno-backchain
16118 Store (do not store) the address of the caller's frame as backchain pointer
16119 into the callee's stack frame.
16120 A backchain may be needed to allow debugging using tools that do not understand
16121 DWARF-2 call frame information.
16122 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
16123 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
16124 the backchain is placed into the topmost word of the 96/160 byte register
16125 save area.
16126
16127 In general, code compiled with @option{-mbackchain} is call-compatible with
16128 code compiled with @option{-mmo-backchain}; however, use of the backchain
16129 for debugging purposes usually requires that the whole binary is built with
16130 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
16131 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16132 to build a linux kernel use @option{-msoft-float}.
16133
16134 The default is to not maintain the backchain.
16135
16136 @item -mpacked-stack
16137 @itemx -mno-packed-stack
16138 @opindex mpacked-stack
16139 @opindex mno-packed-stack
16140 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
16141 specified, the compiler uses the all fields of the 96/160 byte register save
16142 area only for their default purpose; unused fields still take up stack space.
16143 When @option{-mpacked-stack} is specified, register save slots are densely
16144 packed at the top of the register save area; unused space is reused for other
16145 purposes, allowing for more efficient use of the available stack space.
16146 However, when @option{-mbackchain} is also in effect, the topmost word of
16147 the save area is always used to store the backchain, and the return address
16148 register is always saved two words below the backchain.
16149
16150 As long as the stack frame backchain is not used, code generated with
16151 @option{-mpacked-stack} is call-compatible with code generated with
16152 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
16153 S/390 or zSeries generated code that uses the stack frame backchain at run
16154 time, not just for debugging purposes.  Such code is not call-compatible
16155 with code compiled with @option{-mpacked-stack}.  Also, note that the
16156 combination of @option{-mbackchain},
16157 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16158 to build a linux kernel use @option{-msoft-float}.
16159
16160 The default is to not use the packed stack layout.
16161
16162 @item -msmall-exec
16163 @itemx -mno-small-exec
16164 @opindex msmall-exec
16165 @opindex mno-small-exec
16166 Generate (or do not generate) code using the @code{bras} instruction
16167 to do subroutine calls.
16168 This only works reliably if the total executable size does not
16169 exceed 64k.  The default is to use the @code{basr} instruction instead,
16170 which does not have this limitation.
16171
16172 @item -m64
16173 @itemx -m31
16174 @opindex m64
16175 @opindex m31
16176 When @option{-m31} is specified, generate code compliant to the
16177 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
16178 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
16179 particular to generate 64-bit instructions.  For the @samp{s390}
16180 targets, the default is @option{-m31}, while the @samp{s390x}
16181 targets default to @option{-m64}.
16182
16183 @item -mzarch
16184 @itemx -mesa
16185 @opindex mzarch
16186 @opindex mesa
16187 When @option{-mzarch} is specified, generate code using the
16188 instructions available on z/Architecture.
16189 When @option{-mesa} is specified, generate code using the
16190 instructions available on ESA/390.  Note that @option{-mesa} is
16191 not possible with @option{-m64}.
16192 When generating code compliant to the GNU/Linux for S/390 ABI,
16193 the default is @option{-mesa}.  When generating code compliant
16194 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
16195
16196 @item -mmvcle
16197 @itemx -mno-mvcle
16198 @opindex mmvcle
16199 @opindex mno-mvcle
16200 Generate (or do not generate) code using the @code{mvcle} instruction
16201 to perform block moves.  When @option{-mno-mvcle} is specified,
16202 use a @code{mvc} loop instead.  This is the default unless optimizing for
16203 size.
16204
16205 @item -mdebug
16206 @itemx -mno-debug
16207 @opindex mdebug
16208 @opindex mno-debug
16209 Print (or do not print) additional debug information when compiling.
16210 The default is to not print debug information.
16211
16212 @item -march=@var{cpu-type}
16213 @opindex march
16214 Generate code that will run on @var{cpu-type}, which is the name of a system
16215 representing a certain processor type.  Possible values for
16216 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
16217 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
16218 When generating code using the instructions available on z/Architecture,
16219 the default is @option{-march=z900}.  Otherwise, the default is
16220 @option{-march=g5}.
16221
16222 @item -mtune=@var{cpu-type}
16223 @opindex mtune
16224 Tune to @var{cpu-type} everything applicable about the generated code,
16225 except for the ABI and the set of available instructions.
16226 The list of @var{cpu-type} values is the same as for @option{-march}.
16227 The default is the value used for @option{-march}.
16228
16229 @item -mtpf-trace
16230 @itemx -mno-tpf-trace
16231 @opindex mtpf-trace
16232 @opindex mno-tpf-trace
16233 Generate code that adds (does not add) in TPF OS specific branches to trace
16234 routines in the operating system.  This option is off by default, even
16235 when compiling for the TPF OS@.
16236
16237 @item -mfused-madd
16238 @itemx -mno-fused-madd
16239 @opindex mfused-madd
16240 @opindex mno-fused-madd
16241 Generate code that uses (does not use) the floating point multiply and
16242 accumulate instructions.  These instructions are generated by default if
16243 hardware floating point is used.
16244
16245 @item -mwarn-framesize=@var{framesize}
16246 @opindex mwarn-framesize
16247 Emit a warning if the current function exceeds the given frame size.  Because
16248 this is a compile time check it doesn't need to be a real problem when the program
16249 runs.  It is intended to identify functions which most probably cause
16250 a stack overflow.  It is useful to be used in an environment with limited stack
16251 size e.g.@: the linux kernel.
16252
16253 @item -mwarn-dynamicstack
16254 @opindex mwarn-dynamicstack
16255 Emit a warning if the function calls alloca or uses dynamically
16256 sized arrays.  This is generally a bad idea with a limited stack size.
16257
16258 @item -mstack-guard=@var{stack-guard}
16259 @itemx -mstack-size=@var{stack-size}
16260 @opindex mstack-guard
16261 @opindex mstack-size
16262 If these options are provided the s390 back end emits additional instructions in
16263 the function prologue which trigger a trap if the stack size is @var{stack-guard}
16264 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
16265 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
16266 the frame size of the compiled function is chosen.
16267 These options are intended to be used to help debugging stack overflow problems.
16268 The additionally emitted code causes only little overhead and hence can also be
16269 used in production like systems without greater performance degradation.  The given
16270 values have to be exact powers of 2 and @var{stack-size} has to be greater than
16271 @var{stack-guard} without exceeding 64k.
16272 In order to be efficient the extra code makes the assumption that the stack starts
16273 at an address aligned to the value given by @var{stack-size}.
16274 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
16275 @end table
16276
16277 @node Score Options
16278 @subsection Score Options
16279 @cindex Score Options
16280
16281 These options are defined for Score implementations:
16282
16283 @table @gcctabopt
16284 @item -meb
16285 @opindex meb
16286 Compile code for big endian mode.  This is the default.
16287
16288 @item -mel
16289 @opindex mel
16290 Compile code for little endian mode.
16291
16292 @item -mnhwloop
16293 @opindex mnhwloop
16294 Disable generate bcnz instruction.
16295
16296 @item -muls
16297 @opindex muls
16298 Enable generate unaligned load and store instruction.
16299
16300 @item -mmac
16301 @opindex mmac
16302 Enable the use of multiply-accumulate instructions. Disabled by default.
16303
16304 @item -mscore5
16305 @opindex mscore5
16306 Specify the SCORE5 as the target architecture.
16307
16308 @item -mscore5u
16309 @opindex mscore5u
16310 Specify the SCORE5U of the target architecture.
16311
16312 @item -mscore7
16313 @opindex mscore7
16314 Specify the SCORE7 as the target architecture. This is the default.
16315
16316 @item -mscore7d
16317 @opindex mscore7d
16318 Specify the SCORE7D as the target architecture.
16319 @end table
16320
16321 @node SH Options
16322 @subsection SH Options
16323
16324 These @samp{-m} options are defined for the SH implementations:
16325
16326 @table @gcctabopt
16327 @item -m1
16328 @opindex m1
16329 Generate code for the SH1.
16330
16331 @item -m2
16332 @opindex m2
16333 Generate code for the SH2.
16334
16335 @item -m2e
16336 Generate code for the SH2e.
16337
16338 @item -m2a-nofpu
16339 @opindex m2a-nofpu
16340 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
16341 that the floating-point unit is not used.
16342
16343 @item -m2a-single-only
16344 @opindex m2a-single-only
16345 Generate code for the SH2a-FPU, in such a way that no double-precision
16346 floating point operations are used.
16347
16348 @item -m2a-single
16349 @opindex m2a-single
16350 Generate code for the SH2a-FPU assuming the floating-point unit is in
16351 single-precision mode by default.
16352
16353 @item -m2a
16354 @opindex m2a
16355 Generate code for the SH2a-FPU assuming the floating-point unit is in
16356 double-precision mode by default.
16357
16358 @item -m3
16359 @opindex m3
16360 Generate code for the SH3.
16361
16362 @item -m3e
16363 @opindex m3e
16364 Generate code for the SH3e.
16365
16366 @item -m4-nofpu
16367 @opindex m4-nofpu
16368 Generate code for the SH4 without a floating-point unit.
16369
16370 @item -m4-single-only
16371 @opindex m4-single-only
16372 Generate code for the SH4 with a floating-point unit that only
16373 supports single-precision arithmetic.
16374
16375 @item -m4-single
16376 @opindex m4-single
16377 Generate code for the SH4 assuming the floating-point unit is in
16378 single-precision mode by default.
16379
16380 @item -m4
16381 @opindex m4
16382 Generate code for the SH4.
16383
16384 @item -m4a-nofpu
16385 @opindex m4a-nofpu
16386 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
16387 floating-point unit is not used.
16388
16389 @item -m4a-single-only
16390 @opindex m4a-single-only
16391 Generate code for the SH4a, in such a way that no double-precision
16392 floating point operations are used.
16393
16394 @item -m4a-single
16395 @opindex m4a-single
16396 Generate code for the SH4a assuming the floating-point unit is in
16397 single-precision mode by default.
16398
16399 @item -m4a
16400 @opindex m4a
16401 Generate code for the SH4a.
16402
16403 @item -m4al
16404 @opindex m4al
16405 Same as @option{-m4a-nofpu}, except that it implicitly passes
16406 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
16407 instructions at the moment.
16408
16409 @item -mb
16410 @opindex mb
16411 Compile code for the processor in big endian mode.
16412
16413 @item -ml
16414 @opindex ml
16415 Compile code for the processor in little endian mode.
16416
16417 @item -mdalign
16418 @opindex mdalign
16419 Align doubles at 64-bit boundaries.  Note that this changes the calling
16420 conventions, and thus some functions from the standard C library will
16421 not work unless you recompile it first with @option{-mdalign}.
16422
16423 @item -mrelax
16424 @opindex mrelax
16425 Shorten some address references at link time, when possible; uses the
16426 linker option @option{-relax}.
16427
16428 @item -mbigtable
16429 @opindex mbigtable
16430 Use 32-bit offsets in @code{switch} tables.  The default is to use
16431 16-bit offsets.
16432
16433 @item -mbitops
16434 @opindex mbitops
16435 Enable the use of bit manipulation instructions on SH2A.
16436
16437 @item -mfmovd
16438 @opindex mfmovd
16439 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
16440 alignment constraints.
16441
16442 @item -mhitachi
16443 @opindex mhitachi
16444 Comply with the calling conventions defined by Renesas.
16445
16446 @item -mrenesas
16447 @opindex mhitachi
16448 Comply with the calling conventions defined by Renesas.
16449
16450 @item -mno-renesas
16451 @opindex mhitachi
16452 Comply with the calling conventions defined for GCC before the Renesas
16453 conventions were available.  This option is the default for all
16454 targets of the SH toolchain except for @samp{sh-symbianelf}.
16455
16456 @item -mnomacsave
16457 @opindex mnomacsave
16458 Mark the @code{MAC} register as call-clobbered, even if
16459 @option{-mhitachi} is given.
16460
16461 @item -mieee
16462 @opindex mieee
16463 Increase IEEE-compliance of floating-point code.
16464 At the moment, this is equivalent to @option{-fno-finite-math-only}.
16465 When generating 16 bit SH opcodes, getting IEEE-conforming results for
16466 comparisons of NANs / infinities incurs extra overhead in every
16467 floating point comparison, therefore the default is set to
16468 @option{-ffinite-math-only}.
16469
16470 @item -minline-ic_invalidate
16471 @opindex minline-ic_invalidate
16472 Inline code to invalidate instruction cache entries after setting up
16473 nested function trampolines.
16474 This option has no effect if -musermode is in effect and the selected
16475 code generation option (e.g. -m4) does not allow the use of the icbi
16476 instruction.
16477 If the selected code generation option does not allow the use of the icbi
16478 instruction, and -musermode is not in effect, the inlined code will
16479 manipulate the instruction cache address array directly with an associative
16480 write.  This not only requires privileged mode, but it will also
16481 fail if the cache line had been mapped via the TLB and has become unmapped.
16482
16483 @item -misize
16484 @opindex misize
16485 Dump instruction size and location in the assembly code.
16486
16487 @item -mpadstruct
16488 @opindex mpadstruct
16489 This option is deprecated.  It pads structures to multiple of 4 bytes,
16490 which is incompatible with the SH ABI@.
16491
16492 @item -mspace
16493 @opindex mspace
16494 Optimize for space instead of speed.  Implied by @option{-Os}.
16495
16496 @item -mprefergot
16497 @opindex mprefergot
16498 When generating position-independent code, emit function calls using
16499 the Global Offset Table instead of the Procedure Linkage Table.
16500
16501 @item -musermode
16502 @opindex musermode
16503 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
16504 if the inlined code would not work in user mode.
16505 This is the default when the target is @code{sh-*-linux*}.
16506
16507 @item -multcost=@var{number}
16508 @opindex multcost=@var{number}
16509 Set the cost to assume for a multiply insn.
16510
16511 @item -mdiv=@var{strategy}
16512 @opindex mdiv=@var{strategy}
16513 Set the division strategy to use for SHmedia code.  @var{strategy} must be
16514 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
16515 inv:call2, inv:fp .
16516 "fp" performs the operation in floating point.  This has a very high latency,
16517 but needs only a few instructions, so it might be a good choice if
16518 your code has enough easily exploitable ILP to allow the compiler to
16519 schedule the floating point instructions together with other instructions.
16520 Division by zero causes a floating point exception.
16521 "inv" uses integer operations to calculate the inverse of the divisor,
16522 and then multiplies the dividend with the inverse.  This strategy allows
16523 cse and hoisting of the inverse calculation.  Division by zero calculates
16524 an unspecified result, but does not trap.
16525 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
16526 have been found, or if the entire operation has been hoisted to the same
16527 place, the last stages of the inverse calculation are intertwined with the
16528 final multiply to reduce the overall latency, at the expense of using a few
16529 more instructions, and thus offering fewer scheduling opportunities with
16530 other code.
16531 "call" calls a library function that usually implements the inv:minlat
16532 strategy.
16533 This gives high code density for m5-*media-nofpu compilations.
16534 "call2" uses a different entry point of the same library function, where it
16535 assumes that a pointer to a lookup table has already been set up, which
16536 exposes the pointer load to cse / code hoisting optimizations.
16537 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
16538 code generation, but if the code stays unoptimized, revert to the "call",
16539 "call2", or "fp" strategies, respectively.  Note that the
16540 potentially-trapping side effect of division by zero is carried by a
16541 separate instruction, so it is possible that all the integer instructions
16542 are hoisted out, but the marker for the side effect stays where it is.
16543 A recombination to fp operations or a call is not possible in that case.
16544 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
16545 that the inverse calculation was nor separated from the multiply, they speed
16546 up division where the dividend fits into 20 bits (plus sign where applicable),
16547 by inserting a test to skip a number of operations in this case; this test
16548 slows down the case of larger dividends.  inv20u assumes the case of a such
16549 a small dividend to be unlikely, and inv20l assumes it to be likely.
16550
16551 @item -maccumulate-outgoing-args
16552 @opindex maccumulate-outgoing-args
16553 Reserve space once for outgoing arguments in the function prologue rather 
16554 than around each call.  Generally beneficial for performance and size.  Also
16555 needed for unwinding to avoid changing the stack frame around conditional code.
16556
16557 @item -mdivsi3_libfunc=@var{name}
16558 @opindex mdivsi3_libfunc=@var{name}
16559 Set the name of the library function used for 32 bit signed division to
16560 @var{name}.  This only affect the name used in the call and inv:call
16561 division strategies, and the compiler will still expect the same
16562 sets of input/output/clobbered registers as if this option was not present.
16563
16564 @item -mfixed-range=@var{register-range}
16565 @opindex mfixed-range
16566 Generate code treating the given register range as fixed registers.
16567 A fixed register is one that the register allocator can not use.  This is
16568 useful when compiling kernel code.  A register range is specified as
16569 two registers separated by a dash.  Multiple register ranges can be
16570 specified separated by a comma.
16571
16572 @item -madjust-unroll
16573 @opindex madjust-unroll
16574 Throttle unrolling to avoid thrashing target registers.
16575 This option only has an effect if the gcc code base supports the
16576 TARGET_ADJUST_UNROLL_MAX target hook.
16577
16578 @item -mindexed-addressing
16579 @opindex mindexed-addressing
16580 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
16581 This is only safe if the hardware and/or OS implement 32 bit wrap-around
16582 semantics for the indexed addressing mode.  The architecture allows the
16583 implementation of processors with 64 bit MMU, which the OS could use to
16584 get 32 bit addressing, but since no current hardware implementation supports
16585 this or any other way to make the indexed addressing mode safe to use in
16586 the 32 bit ABI, the default is -mno-indexed-addressing.
16587
16588 @item -mgettrcost=@var{number}
16589 @opindex mgettrcost=@var{number}
16590 Set the cost assumed for the gettr instruction to @var{number}.
16591 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
16592
16593 @item -mpt-fixed
16594 @opindex mpt-fixed
16595 Assume pt* instructions won't trap.  This will generally generate better
16596 scheduled code, but is unsafe on current hardware.  The current architecture
16597 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
16598 This has the unintentional effect of making it unsafe to schedule ptabs /
16599 ptrel before a branch, or hoist it out of a loop.  For example,
16600 __do_global_ctors, a part of libgcc that runs constructors at program
16601 startup, calls functions in a list which is delimited by @minus{}1.  With the
16602 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
16603 That means that all the constructors will be run a bit quicker, but when
16604 the loop comes to the end of the list, the program crashes because ptabs
16605 loads @minus{}1 into a target register.  Since this option is unsafe for any
16606 hardware implementing the current architecture specification, the default
16607 is -mno-pt-fixed.  Unless the user specifies a specific cost with
16608 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
16609 this deters register allocation using target registers for storing
16610 ordinary integers.
16611
16612 @item -minvalid-symbols
16613 @opindex minvalid-symbols
16614 Assume symbols might be invalid.  Ordinary function symbols generated by
16615 the compiler will always be valid to load with movi/shori/ptabs or
16616 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
16617 to generate symbols that will cause ptabs / ptrel to trap.
16618 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
16619 It will then prevent cross-basic-block cse, hoisting and most scheduling
16620 of symbol loads.  The default is @option{-mno-invalid-symbols}.
16621 @end table
16622
16623 @node SPARC Options
16624 @subsection SPARC Options
16625 @cindex SPARC options
16626
16627 These @samp{-m} options are supported on the SPARC:
16628
16629 @table @gcctabopt
16630 @item -mno-app-regs
16631 @itemx -mapp-regs
16632 @opindex mno-app-regs
16633 @opindex mapp-regs
16634 Specify @option{-mapp-regs} to generate output using the global registers
16635 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
16636 is the default.
16637
16638 To be fully SVR4 ABI compliant at the cost of some performance loss,
16639 specify @option{-mno-app-regs}.  You should compile libraries and system
16640 software with this option.
16641
16642 @item -mfpu
16643 @itemx -mhard-float
16644 @opindex mfpu
16645 @opindex mhard-float
16646 Generate output containing floating point instructions.  This is the
16647 default.
16648
16649 @item -mno-fpu
16650 @itemx -msoft-float
16651 @opindex mno-fpu
16652 @opindex msoft-float
16653 Generate output containing library calls for floating point.
16654 @strong{Warning:} the requisite libraries are not available for all SPARC
16655 targets.  Normally the facilities of the machine's usual C compiler are
16656 used, but this cannot be done directly in cross-compilation.  You must make
16657 your own arrangements to provide suitable library functions for
16658 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
16659 @samp{sparclite-*-*} do provide software floating point support.
16660
16661 @option{-msoft-float} changes the calling convention in the output file;
16662 therefore, it is only useful if you compile @emph{all} of a program with
16663 this option.  In particular, you need to compile @file{libgcc.a}, the
16664 library that comes with GCC, with @option{-msoft-float} in order for
16665 this to work.
16666
16667 @item -mhard-quad-float
16668 @opindex mhard-quad-float
16669 Generate output containing quad-word (long double) floating point
16670 instructions.
16671
16672 @item -msoft-quad-float
16673 @opindex msoft-quad-float
16674 Generate output containing library calls for quad-word (long double)
16675 floating point instructions.  The functions called are those specified
16676 in the SPARC ABI@.  This is the default.
16677
16678 As of this writing, there are no SPARC implementations that have hardware
16679 support for the quad-word floating point instructions.  They all invoke
16680 a trap handler for one of these instructions, and then the trap handler
16681 emulates the effect of the instruction.  Because of the trap handler overhead,
16682 this is much slower than calling the ABI library routines.  Thus the
16683 @option{-msoft-quad-float} option is the default.
16684
16685 @item -mno-unaligned-doubles
16686 @itemx -munaligned-doubles
16687 @opindex mno-unaligned-doubles
16688 @opindex munaligned-doubles
16689 Assume that doubles have 8 byte alignment.  This is the default.
16690
16691 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
16692 alignment only if they are contained in another type, or if they have an
16693 absolute address.  Otherwise, it assumes they have 4 byte alignment.
16694 Specifying this option avoids some rare compatibility problems with code
16695 generated by other compilers.  It is not the default because it results
16696 in a performance loss, especially for floating point code.
16697
16698 @item -mno-faster-structs
16699 @itemx -mfaster-structs
16700 @opindex mno-faster-structs
16701 @opindex mfaster-structs
16702 With @option{-mfaster-structs}, the compiler assumes that structures
16703 should have 8 byte alignment.  This enables the use of pairs of
16704 @code{ldd} and @code{std} instructions for copies in structure
16705 assignment, in place of twice as many @code{ld} and @code{st} pairs.
16706 However, the use of this changed alignment directly violates the SPARC
16707 ABI@.  Thus, it's intended only for use on targets where the developer
16708 acknowledges that their resulting code will not be directly in line with
16709 the rules of the ABI@.
16710
16711 @item -mimpure-text
16712 @opindex mimpure-text
16713 @option{-mimpure-text}, used in addition to @option{-shared}, tells
16714 the compiler to not pass @option{-z text} to the linker when linking a
16715 shared object.  Using this option, you can link position-dependent
16716 code into a shared object.
16717
16718 @option{-mimpure-text} suppresses the ``relocations remain against
16719 allocatable but non-writable sections'' linker error message.
16720 However, the necessary relocations will trigger copy-on-write, and the
16721 shared object is not actually shared across processes.  Instead of
16722 using @option{-mimpure-text}, you should compile all source code with
16723 @option{-fpic} or @option{-fPIC}.
16724
16725 This option is only available on SunOS and Solaris.
16726
16727 @item -mcpu=@var{cpu_type}
16728 @opindex mcpu
16729 Set the instruction set, register set, and instruction scheduling parameters
16730 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
16731 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
16732 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
16733 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
16734 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
16735
16736 Default instruction scheduling parameters are used for values that select
16737 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
16738 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
16739
16740 Here is a list of each supported architecture and their supported
16741 implementations.
16742
16743 @smallexample
16744     v7:             cypress
16745     v8:             supersparc, hypersparc
16746     sparclite:      f930, f934, sparclite86x
16747     sparclet:       tsc701
16748     v9:             ultrasparc, ultrasparc3, niagara, niagara2
16749 @end smallexample
16750
16751 By default (unless configured otherwise), GCC generates code for the V7
16752 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
16753 additionally optimizes it for the Cypress CY7C602 chip, as used in the
16754 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
16755 SPARCStation 1, 2, IPX etc.
16756
16757 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
16758 architecture.  The only difference from V7 code is that the compiler emits
16759 the integer multiply and integer divide instructions which exist in SPARC-V8
16760 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
16761 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
16762 2000 series.
16763
16764 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
16765 the SPARC architecture.  This adds the integer multiply, integer divide step
16766 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
16767 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
16768 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
16769 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
16770 MB86934 chip, which is the more recent SPARClite with FPU@.
16771
16772 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
16773 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
16774 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
16775 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
16776 optimizes it for the TEMIC SPARClet chip.
16777
16778 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
16779 architecture.  This adds 64-bit integer and floating-point move instructions,
16780 3 additional floating-point condition code registers and conditional move
16781 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
16782 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
16783 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
16784 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
16785 @option{-mcpu=niagara}, the compiler additionally optimizes it for
16786 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
16787 additionally optimizes it for Sun UltraSPARC T2 chips.
16788
16789 @item -mtune=@var{cpu_type}
16790 @opindex mtune
16791 Set the instruction scheduling parameters for machine type
16792 @var{cpu_type}, but do not set the instruction set or register set that the
16793 option @option{-mcpu=@var{cpu_type}} would.
16794
16795 The same values for @option{-mcpu=@var{cpu_type}} can be used for
16796 @option{-mtune=@var{cpu_type}}, but the only useful values are those
16797 that select a particular cpu implementation.  Those are @samp{cypress},
16798 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
16799 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
16800 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
16801
16802 @item -mv8plus
16803 @itemx -mno-v8plus
16804 @opindex mv8plus
16805 @opindex mno-v8plus
16806 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
16807 difference from the V8 ABI is that the global and out registers are
16808 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
16809 mode for all SPARC-V9 processors.
16810
16811 @item -mvis
16812 @itemx -mno-vis
16813 @opindex mvis
16814 @opindex mno-vis
16815 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
16816 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
16817 @end table
16818
16819 These @samp{-m} options are supported in addition to the above
16820 on SPARC-V9 processors in 64-bit environments:
16821
16822 @table @gcctabopt
16823 @item -mlittle-endian
16824 @opindex mlittle-endian
16825 Generate code for a processor running in little-endian mode.  It is only
16826 available for a few configurations and most notably not on Solaris and Linux.
16827
16828 @item -m32
16829 @itemx -m64
16830 @opindex m32
16831 @opindex m64
16832 Generate code for a 32-bit or 64-bit environment.
16833 The 32-bit environment sets int, long and pointer to 32 bits.
16834 The 64-bit environment sets int to 32 bits and long and pointer
16835 to 64 bits.
16836
16837 @item -mcmodel=medlow
16838 @opindex mcmodel=medlow
16839 Generate code for the Medium/Low code model: 64-bit addresses, programs
16840 must be linked in the low 32 bits of memory.  Programs can be statically
16841 or dynamically linked.
16842
16843 @item -mcmodel=medmid
16844 @opindex mcmodel=medmid
16845 Generate code for the Medium/Middle code model: 64-bit addresses, programs
16846 must be linked in the low 44 bits of memory, the text and data segments must
16847 be less than 2GB in size and the data segment must be located within 2GB of
16848 the text segment.
16849
16850 @item -mcmodel=medany
16851 @opindex mcmodel=medany
16852 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
16853 may be linked anywhere in memory, the text and data segments must be less
16854 than 2GB in size and the data segment must be located within 2GB of the
16855 text segment.
16856
16857 @item -mcmodel=embmedany
16858 @opindex mcmodel=embmedany
16859 Generate code for the Medium/Anywhere code model for embedded systems:
16860 64-bit addresses, the text and data segments must be less than 2GB in
16861 size, both starting anywhere in memory (determined at link time).  The
16862 global register %g4 points to the base of the data segment.  Programs
16863 are statically linked and PIC is not supported.
16864
16865 @item -mstack-bias
16866 @itemx -mno-stack-bias
16867 @opindex mstack-bias
16868 @opindex mno-stack-bias
16869 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
16870 frame pointer if present, are offset by @minus{}2047 which must be added back
16871 when making stack frame references.  This is the default in 64-bit mode.
16872 Otherwise, assume no such offset is present.
16873 @end table
16874
16875 These switches are supported in addition to the above on Solaris:
16876
16877 @table @gcctabopt
16878 @item -threads
16879 @opindex threads
16880 Add support for multithreading using the Solaris threads library.  This
16881 option sets flags for both the preprocessor and linker.  This option does
16882 not affect the thread safety of object code produced by the compiler or
16883 that of libraries supplied with it.
16884
16885 @item -pthreads
16886 @opindex pthreads
16887 Add support for multithreading using the POSIX threads library.  This
16888 option sets flags for both the preprocessor and linker.  This option does
16889 not affect the thread safety of object code produced  by the compiler or
16890 that of libraries supplied with it.
16891
16892 @item -pthread
16893 @opindex pthread
16894 This is a synonym for @option{-pthreads}.
16895 @end table
16896
16897 @node SPU Options
16898 @subsection SPU Options
16899 @cindex SPU options
16900
16901 These @samp{-m} options are supported on the SPU:
16902
16903 @table @gcctabopt
16904 @item -mwarn-reloc
16905 @itemx -merror-reloc
16906 @opindex mwarn-reloc
16907 @opindex merror-reloc
16908
16909 The loader for SPU does not handle dynamic relocations.  By default, GCC
16910 will give an error when it generates code that requires a dynamic
16911 relocation.  @option{-mno-error-reloc} disables the error,
16912 @option{-mwarn-reloc} will generate a warning instead.
16913
16914 @item -msafe-dma
16915 @itemx -munsafe-dma
16916 @opindex msafe-dma
16917 @opindex munsafe-dma
16918
16919 Instructions which initiate or test completion of DMA must not be
16920 reordered with respect to loads and stores of the memory which is being
16921 accessed.  Users typically address this problem using the volatile
16922 keyword, but that can lead to inefficient code in places where the
16923 memory is known to not change.  Rather than mark the memory as volatile
16924 we treat the DMA instructions as potentially effecting all memory.  With
16925 @option{-munsafe-dma} users must use the volatile keyword to protect
16926 memory accesses.
16927
16928 @item -mbranch-hints
16929 @opindex mbranch-hints
16930
16931 By default, GCC will generate a branch hint instruction to avoid
16932 pipeline stalls for always taken or probably taken branches.  A hint
16933 will not be generated closer than 8 instructions away from its branch.
16934 There is little reason to disable them, except for debugging purposes,
16935 or to make an object a little bit smaller.
16936
16937 @item -msmall-mem
16938 @itemx -mlarge-mem
16939 @opindex msmall-mem
16940 @opindex mlarge-mem
16941
16942 By default, GCC generates code assuming that addresses are never larger
16943 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
16944 a full 32 bit address.
16945
16946 @item -mstdmain
16947 @opindex mstdmain
16948
16949 By default, GCC links against startup code that assumes the SPU-style
16950 main function interface (which has an unconventional parameter list).
16951 With @option{-mstdmain}, GCC will link your program against startup
16952 code that assumes a C99-style interface to @code{main}, including a
16953 local copy of @code{argv} strings.
16954
16955 @item -mfixed-range=@var{register-range}
16956 @opindex mfixed-range
16957 Generate code treating the given register range as fixed registers.
16958 A fixed register is one that the register allocator can not use.  This is
16959 useful when compiling kernel code.  A register range is specified as
16960 two registers separated by a dash.  Multiple register ranges can be
16961 specified separated by a comma.
16962
16963 @item -mea32
16964 @itemx -mea64
16965 @opindex mea32
16966 @opindex mea64
16967 Compile code assuming that pointers to the PPU address space accessed
16968 via the @code{__ea} named address space qualifier are either 32 or 64
16969 bits wide.  The default is 32 bits.  As this is an ABI changing option,
16970 all object code in an executable must be compiled with the same setting.
16971
16972 @item -maddress-space-conversion
16973 @itemx -mno-address-space-conversion
16974 @opindex maddress-space-conversion
16975 @opindex mno-address-space-conversion
16976 Allow/disallow treating the @code{__ea} address space as superset
16977 of the generic address space.  This enables explicit type casts
16978 between @code{__ea} and generic pointer as well as implicit
16979 conversions of generic pointers to @code{__ea} pointers.  The
16980 default is to allow address space pointer conversions.
16981
16982 @item -mcache-size=@var{cache-size}
16983 @opindex mcache-size
16984 This option controls the version of libgcc that the compiler links to an
16985 executable and selects a software-managed cache for accessing variables
16986 in the @code{__ea} address space with a particular cache size.  Possible
16987 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
16988 and @samp{128}.  The default cache size is 64KB.
16989
16990 @item -matomic-updates
16991 @itemx -mno-atomic-updates
16992 @opindex matomic-updates
16993 @opindex mno-atomic-updates
16994 This option controls the version of libgcc that the compiler links to an
16995 executable and selects whether atomic updates to the software-managed
16996 cache of PPU-side variables are used.  If you use atomic updates, changes
16997 to a PPU variable from SPU code using the @code{__ea} named address space
16998 qualifier will not interfere with changes to other PPU variables residing
16999 in the same cache line from PPU code.  If you do not use atomic updates,
17000 such interference may occur; however, writing back cache lines will be
17001 more efficient.  The default behavior is to use atomic updates.
17002
17003 @item -mdual-nops
17004 @itemx -mdual-nops=@var{n}
17005 @opindex mdual-nops
17006 By default, GCC will insert nops to increase dual issue when it expects
17007 it to increase performance.  @var{n} can be a value from 0 to 10.  A
17008 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
17009 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
17010
17011 @item -mhint-max-nops=@var{n}
17012 @opindex mhint-max-nops
17013 Maximum number of nops to insert for a branch hint.  A branch hint must
17014 be at least 8 instructions away from the branch it is effecting.  GCC
17015 will insert up to @var{n} nops to enforce this, otherwise it will not
17016 generate the branch hint.
17017
17018 @item -mhint-max-distance=@var{n}
17019 @opindex mhint-max-distance
17020 The encoding of the branch hint instruction limits the hint to be within
17021 256 instructions of the branch it is effecting.  By default, GCC makes
17022 sure it is within 125.
17023
17024 @item -msafe-hints
17025 @opindex msafe-hints
17026 Work around a hardware bug which causes the SPU to stall indefinitely.
17027 By default, GCC will insert the @code{hbrp} instruction to make sure
17028 this stall won't happen.
17029
17030 @end table
17031
17032 @node System V Options
17033 @subsection Options for System V
17034
17035 These additional options are available on System V Release 4 for
17036 compatibility with other compilers on those systems:
17037
17038 @table @gcctabopt
17039 @item -G
17040 @opindex G
17041 Create a shared object.
17042 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
17043
17044 @item -Qy
17045 @opindex Qy
17046 Identify the versions of each tool used by the compiler, in a
17047 @code{.ident} assembler directive in the output.
17048
17049 @item -Qn
17050 @opindex Qn
17051 Refrain from adding @code{.ident} directives to the output file (this is
17052 the default).
17053
17054 @item -YP,@var{dirs}
17055 @opindex YP
17056 Search the directories @var{dirs}, and no others, for libraries
17057 specified with @option{-l}.
17058
17059 @item -Ym,@var{dir}
17060 @opindex Ym
17061 Look in the directory @var{dir} to find the M4 preprocessor.
17062 The assembler uses this option.
17063 @c This is supposed to go with a -Yd for predefined M4 macro files, but
17064 @c the generic assembler that comes with Solaris takes just -Ym.
17065 @end table
17066
17067 @node V850 Options
17068 @subsection V850 Options
17069 @cindex V850 Options
17070
17071 These @samp{-m} options are defined for V850 implementations:
17072
17073 @table @gcctabopt
17074 @item -mlong-calls
17075 @itemx -mno-long-calls
17076 @opindex mlong-calls
17077 @opindex mno-long-calls
17078 Treat all calls as being far away (near).  If calls are assumed to be
17079 far away, the compiler will always load the functions address up into a
17080 register, and call indirect through the pointer.
17081
17082 @item -mno-ep
17083 @itemx -mep
17084 @opindex mno-ep
17085 @opindex mep
17086 Do not optimize (do optimize) basic blocks that use the same index
17087 pointer 4 or more times to copy pointer into the @code{ep} register, and
17088 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
17089 option is on by default if you optimize.
17090
17091 @item -mno-prolog-function
17092 @itemx -mprolog-function
17093 @opindex mno-prolog-function
17094 @opindex mprolog-function
17095 Do not use (do use) external functions to save and restore registers
17096 at the prologue and epilogue of a function.  The external functions
17097 are slower, but use less code space if more than one function saves
17098 the same number of registers.  The @option{-mprolog-function} option
17099 is on by default if you optimize.
17100
17101 @item -mspace
17102 @opindex mspace
17103 Try to make the code as small as possible.  At present, this just turns
17104 on the @option{-mep} and @option{-mprolog-function} options.
17105
17106 @item -mtda=@var{n}
17107 @opindex mtda
17108 Put static or global variables whose size is @var{n} bytes or less into
17109 the tiny data area that register @code{ep} points to.  The tiny data
17110 area can hold up to 256 bytes in total (128 bytes for byte references).
17111
17112 @item -msda=@var{n}
17113 @opindex msda
17114 Put static or global variables whose size is @var{n} bytes or less into
17115 the small data area that register @code{gp} points to.  The small data
17116 area can hold up to 64 kilobytes.
17117
17118 @item -mzda=@var{n}
17119 @opindex mzda
17120 Put static or global variables whose size is @var{n} bytes or less into
17121 the first 32 kilobytes of memory.
17122
17123 @item -mv850
17124 @opindex mv850
17125 Specify that the target processor is the V850.
17126
17127 @item -mbig-switch
17128 @opindex mbig-switch
17129 Generate code suitable for big switch tables.  Use this option only if
17130 the assembler/linker complain about out of range branches within a switch
17131 table.
17132
17133 @item -mapp-regs
17134 @opindex mapp-regs
17135 This option will cause r2 and r5 to be used in the code generated by
17136 the compiler.  This setting is the default.
17137
17138 @item -mno-app-regs
17139 @opindex mno-app-regs
17140 This option will cause r2 and r5 to be treated as fixed registers.
17141
17142 @item -mv850e2v3
17143 @opindex mv850e2v3
17144 Specify that the target processor is the V850E2V3.  The preprocessor
17145 constants @samp{__v850e2v3__} will be defined if
17146 this option is used.
17147
17148 @item -mv850e2
17149 @opindex mv850e2
17150 Specify that the target processor is the V850E2.  The preprocessor
17151 constants @samp{__v850e2__} will be defined if
17152
17153 @item -mv850e1
17154 @opindex mv850e1
17155 Specify that the target processor is the V850E1.  The preprocessor
17156 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
17157
17158 @item -mv850e
17159 @opindex mv850e
17160 Specify that the target processor is the V850E@.  The preprocessor
17161 constant @samp{__v850e__} will be defined if this option is used.
17162
17163 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
17164 nor @option{-mv850e2} nor @option{-mv850e2v3}
17165 are defined then a default target processor will be chosen and the
17166 relevant @samp{__v850*__} preprocessor constant will be defined.
17167
17168 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
17169 defined, regardless of which processor variant is the target.
17170
17171 @item -mdisable-callt
17172 @opindex mdisable-callt
17173 This option will suppress generation of the CALLT instruction for the
17174 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
17175 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
17176
17177 @end table
17178
17179 @node VAX Options
17180 @subsection VAX Options
17181 @cindex VAX options
17182
17183 These @samp{-m} options are defined for the VAX:
17184
17185 @table @gcctabopt
17186 @item -munix
17187 @opindex munix
17188 Do not output certain jump instructions (@code{aobleq} and so on)
17189 that the Unix assembler for the VAX cannot handle across long
17190 ranges.
17191
17192 @item -mgnu
17193 @opindex mgnu
17194 Do output those jump instructions, on the assumption that you
17195 will assemble with the GNU assembler.
17196
17197 @item -mg
17198 @opindex mg
17199 Output code for g-format floating point numbers instead of d-format.
17200 @end table
17201
17202 @node VxWorks Options
17203 @subsection VxWorks Options
17204 @cindex VxWorks Options
17205
17206 The options in this section are defined for all VxWorks targets.
17207 Options specific to the target hardware are listed with the other
17208 options for that target.
17209
17210 @table @gcctabopt
17211 @item -mrtp
17212 @opindex mrtp
17213 GCC can generate code for both VxWorks kernels and real time processes
17214 (RTPs).  This option switches from the former to the latter.  It also
17215 defines the preprocessor macro @code{__RTP__}.
17216
17217 @item -non-static
17218 @opindex non-static
17219 Link an RTP executable against shared libraries rather than static
17220 libraries.  The options @option{-static} and @option{-shared} can
17221 also be used for RTPs (@pxref{Link Options}); @option{-static}
17222 is the default.
17223
17224 @item -Bstatic
17225 @itemx -Bdynamic
17226 @opindex Bstatic
17227 @opindex Bdynamic
17228 These options are passed down to the linker.  They are defined for
17229 compatibility with Diab.
17230
17231 @item -Xbind-lazy
17232 @opindex Xbind-lazy
17233 Enable lazy binding of function calls.  This option is equivalent to
17234 @option{-Wl,-z,now} and is defined for compatibility with Diab.
17235
17236 @item -Xbind-now
17237 @opindex Xbind-now
17238 Disable lazy binding of function calls.  This option is the default and
17239 is defined for compatibility with Diab.
17240 @end table
17241
17242 @node x86-64 Options
17243 @subsection x86-64 Options
17244 @cindex x86-64 options
17245
17246 These are listed under @xref{i386 and x86-64 Options}.
17247
17248 @node i386 and x86-64 Windows Options
17249 @subsection i386 and x86-64 Windows Options
17250 @cindex i386 and x86-64 Windows Options
17251
17252 These additional options are available for Windows targets:
17253
17254 @table @gcctabopt
17255 @item -mconsole
17256 @opindex mconsole
17257 This option is available for Cygwin and MinGW targets.  It
17258 specifies that a console application is to be generated, by
17259 instructing the linker to set the PE header subsystem type
17260 required for console applications.
17261 This is the default behavior for Cygwin and MinGW targets.
17262
17263 @item -mcygwin
17264 @opindex mcygwin
17265 This option is available for Cygwin targets.  It specifies that
17266 the Cygwin internal interface is to be used for predefined
17267 preprocessor macros, C runtime libraries and related linker
17268 paths and options.  For Cygwin targets this is the default behavior.
17269 This option is deprecated and will be removed in a future release.
17270
17271 @item -mno-cygwin
17272 @opindex mno-cygwin
17273 This option is available for Cygwin targets.  It specifies that
17274 the MinGW internal interface is to be used instead of Cygwin's, by
17275 setting MinGW-related predefined macros and linker paths and default
17276 library options.
17277 This option is deprecated and will be removed in a future release.
17278
17279 @item -mdll
17280 @opindex mdll
17281 This option is available for Cygwin and MinGW targets.  It
17282 specifies that a DLL - a dynamic link library - is to be
17283 generated, enabling the selection of the required runtime
17284 startup object and entry point.
17285
17286 @item -mnop-fun-dllimport
17287 @opindex mnop-fun-dllimport
17288 This option is available for Cygwin and MinGW targets.  It
17289 specifies that the dllimport attribute should be ignored.
17290
17291 @item -mthread
17292 @opindex mthread
17293 This option is available for MinGW targets. It specifies
17294 that MinGW-specific thread support is to be used.
17295
17296 @item -municode
17297 @opindex municode
17298 This option is available for mingw-w64 targets.  It specifies
17299 that the UNICODE macro is getting pre-defined and that the
17300 unicode capable runtime startup code is chosen.
17301
17302 @item -mwin32
17303 @opindex mwin32
17304 This option is available for Cygwin and MinGW targets.  It
17305 specifies that the typical Windows pre-defined macros are to
17306 be set in the pre-processor, but does not influence the choice
17307 of runtime library/startup code.
17308
17309 @item -mwindows
17310 @opindex mwindows
17311 This option is available for Cygwin and MinGW targets.  It
17312 specifies that a GUI application is to be generated by
17313 instructing the linker to set the PE header subsystem type
17314 appropriately.
17315
17316 @item -fno-set-stack-executable
17317 @opindex fno-set-stack-executable
17318 This option is available for MinGW targets. It specifies that
17319 the executable flag for stack used by nested functions isn't
17320 set. This is necessary for binaries running in kernel mode of
17321 Windows, as there the user32 API, which is used to set executable
17322 privileges, isn't available.
17323
17324 @item -mpe-aligned-commons
17325 @opindex mpe-aligned-commons
17326 This option is available for Cygwin and MinGW targets.  It
17327 specifies that the GNU extension to the PE file format that
17328 permits the correct alignment of COMMON variables should be
17329 used when generating code.  It will be enabled by default if
17330 GCC detects that the target assembler found during configuration
17331 supports the feature.
17332 @end table
17333
17334 See also under @ref{i386 and x86-64 Options} for standard options.
17335
17336 @node Xstormy16 Options
17337 @subsection Xstormy16 Options
17338 @cindex Xstormy16 Options
17339
17340 These options are defined for Xstormy16:
17341
17342 @table @gcctabopt
17343 @item -msim
17344 @opindex msim
17345 Choose startup files and linker script suitable for the simulator.
17346 @end table
17347
17348 @node Xtensa Options
17349 @subsection Xtensa Options
17350 @cindex Xtensa Options
17351
17352 These options are supported for Xtensa targets:
17353
17354 @table @gcctabopt
17355 @item -mconst16
17356 @itemx -mno-const16
17357 @opindex mconst16
17358 @opindex mno-const16
17359 Enable or disable use of @code{CONST16} instructions for loading
17360 constant values.  The @code{CONST16} instruction is currently not a
17361 standard option from Tensilica.  When enabled, @code{CONST16}
17362 instructions are always used in place of the standard @code{L32R}
17363 instructions.  The use of @code{CONST16} is enabled by default only if
17364 the @code{L32R} instruction is not available.
17365
17366 @item -mfused-madd
17367 @itemx -mno-fused-madd
17368 @opindex mfused-madd
17369 @opindex mno-fused-madd
17370 Enable or disable use of fused multiply/add and multiply/subtract
17371 instructions in the floating-point option.  This has no effect if the
17372 floating-point option is not also enabled.  Disabling fused multiply/add
17373 and multiply/subtract instructions forces the compiler to use separate
17374 instructions for the multiply and add/subtract operations.  This may be
17375 desirable in some cases where strict IEEE 754-compliant results are
17376 required: the fused multiply add/subtract instructions do not round the
17377 intermediate result, thereby producing results with @emph{more} bits of
17378 precision than specified by the IEEE standard.  Disabling fused multiply
17379 add/subtract instructions also ensures that the program output is not
17380 sensitive to the compiler's ability to combine multiply and add/subtract
17381 operations.
17382
17383 @item -mserialize-volatile
17384 @itemx -mno-serialize-volatile
17385 @opindex mserialize-volatile
17386 @opindex mno-serialize-volatile
17387 When this option is enabled, GCC inserts @code{MEMW} instructions before
17388 @code{volatile} memory references to guarantee sequential consistency.
17389 The default is @option{-mserialize-volatile}.  Use
17390 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
17391
17392 @item -mforce-no-pic
17393 @opindex mforce-no-pic
17394 For targets, like GNU/Linux, where all user-mode Xtensa code must be
17395 position-independent code (PIC), this option disables PIC for compiling
17396 kernel code.
17397
17398 @item -mtext-section-literals
17399 @itemx -mno-text-section-literals
17400 @opindex mtext-section-literals
17401 @opindex mno-text-section-literals
17402 Control the treatment of literal pools.  The default is
17403 @option{-mno-text-section-literals}, which places literals in a separate
17404 section in the output file.  This allows the literal pool to be placed
17405 in a data RAM/ROM, and it also allows the linker to combine literal
17406 pools from separate object files to remove redundant literals and
17407 improve code size.  With @option{-mtext-section-literals}, the literals
17408 are interspersed in the text section in order to keep them as close as
17409 possible to their references.  This may be necessary for large assembly
17410 files.
17411
17412 @item -mtarget-align
17413 @itemx -mno-target-align
17414 @opindex mtarget-align
17415 @opindex mno-target-align
17416 When this option is enabled, GCC instructs the assembler to
17417 automatically align instructions to reduce branch penalties at the
17418 expense of some code density.  The assembler attempts to widen density
17419 instructions to align branch targets and the instructions following call
17420 instructions.  If there are not enough preceding safe density
17421 instructions to align a target, no widening will be performed.  The
17422 default is @option{-mtarget-align}.  These options do not affect the
17423 treatment of auto-aligned instructions like @code{LOOP}, which the
17424 assembler will always align, either by widening density instructions or
17425 by inserting no-op instructions.
17426
17427 @item -mlongcalls
17428 @itemx -mno-longcalls
17429 @opindex mlongcalls
17430 @opindex mno-longcalls
17431 When this option is enabled, GCC instructs the assembler to translate
17432 direct calls to indirect calls unless it can determine that the target
17433 of a direct call is in the range allowed by the call instruction.  This
17434 translation typically occurs for calls to functions in other source
17435 files.  Specifically, the assembler translates a direct @code{CALL}
17436 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
17437 The default is @option{-mno-longcalls}.  This option should be used in
17438 programs where the call target can potentially be out of range.  This
17439 option is implemented in the assembler, not the compiler, so the
17440 assembly code generated by GCC will still show direct call
17441 instructions---look at the disassembled object code to see the actual
17442 instructions.  Note that the assembler will use an indirect call for
17443 every cross-file call, not just those that really will be out of range.
17444 @end table
17445
17446 @node zSeries Options
17447 @subsection zSeries Options
17448 @cindex zSeries options
17449
17450 These are listed under @xref{S/390 and zSeries Options}.
17451
17452 @node Code Gen Options
17453 @section Options for Code Generation Conventions
17454 @cindex code generation conventions
17455 @cindex options, code generation
17456 @cindex run-time options
17457
17458 These machine-independent options control the interface conventions
17459 used in code generation.
17460
17461 Most of them have both positive and negative forms; the negative form
17462 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
17463 one of the forms is listed---the one which is not the default.  You
17464 can figure out the other form by either removing @samp{no-} or adding
17465 it.
17466
17467 @table @gcctabopt
17468 @item -fbounds-check
17469 @opindex fbounds-check
17470 For front-ends that support it, generate additional code to check that
17471 indices used to access arrays are within the declared range.  This is
17472 currently only supported by the Java and Fortran front-ends, where
17473 this option defaults to true and false respectively.
17474
17475 @item -ftrapv
17476 @opindex ftrapv
17477 This option generates traps for signed overflow on addition, subtraction,
17478 multiplication operations.
17479
17480 @item -fwrapv
17481 @opindex fwrapv
17482 This option instructs the compiler to assume that signed arithmetic
17483 overflow of addition, subtraction and multiplication wraps around
17484 using twos-complement representation.  This flag enables some optimizations
17485 and disables others.  This option is enabled by default for the Java
17486 front-end, as required by the Java language specification.
17487
17488 @item -fexceptions
17489 @opindex fexceptions
17490 Enable exception handling.  Generates extra code needed to propagate
17491 exceptions.  For some targets, this implies GCC will generate frame
17492 unwind information for all functions, which can produce significant data
17493 size overhead, although it does not affect execution.  If you do not
17494 specify this option, GCC will enable it by default for languages like
17495 C++ which normally require exception handling, and disable it for
17496 languages like C that do not normally require it.  However, you may need
17497 to enable this option when compiling C code that needs to interoperate
17498 properly with exception handlers written in C++.  You may also wish to
17499 disable this option if you are compiling older C++ programs that don't
17500 use exception handling.
17501
17502 @item -fnon-call-exceptions
17503 @opindex fnon-call-exceptions
17504 Generate code that allows trapping instructions to throw exceptions.
17505 Note that this requires platform-specific runtime support that does
17506 not exist everywhere.  Moreover, it only allows @emph{trapping}
17507 instructions to throw exceptions, i.e.@: memory references or floating
17508 point instructions.  It does not allow exceptions to be thrown from
17509 arbitrary signal handlers such as @code{SIGALRM}.
17510
17511 @item -funwind-tables
17512 @opindex funwind-tables
17513 Similar to @option{-fexceptions}, except that it will just generate any needed
17514 static data, but will not affect the generated code in any other way.
17515 You will normally not enable this option; instead, a language processor
17516 that needs this handling would enable it on your behalf.
17517
17518 @item -fasynchronous-unwind-tables
17519 @opindex fasynchronous-unwind-tables
17520 Generate unwind table in dwarf2 format, if supported by target machine.  The
17521 table is exact at each instruction boundary, so it can be used for stack
17522 unwinding from asynchronous events (such as debugger or garbage collector).
17523
17524 @item -fpcc-struct-return
17525 @opindex fpcc-struct-return
17526 Return ``short'' @code{struct} and @code{union} values in memory like
17527 longer ones, rather than in registers.  This convention is less
17528 efficient, but it has the advantage of allowing intercallability between
17529 GCC-compiled files and files compiled with other compilers, particularly
17530 the Portable C Compiler (pcc).
17531
17532 The precise convention for returning structures in memory depends
17533 on the target configuration macros.
17534
17535 Short structures and unions are those whose size and alignment match
17536 that of some integer type.
17537
17538 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
17539 switch is not binary compatible with code compiled with the
17540 @option{-freg-struct-return} switch.
17541 Use it to conform to a non-default application binary interface.
17542
17543 @item -freg-struct-return
17544 @opindex freg-struct-return
17545 Return @code{struct} and @code{union} values in registers when possible.
17546 This is more efficient for small structures than
17547 @option{-fpcc-struct-return}.
17548
17549 If you specify neither @option{-fpcc-struct-return} nor
17550 @option{-freg-struct-return}, GCC defaults to whichever convention is
17551 standard for the target.  If there is no standard convention, GCC
17552 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
17553 the principal compiler.  In those cases, we can choose the standard, and
17554 we chose the more efficient register return alternative.
17555
17556 @strong{Warning:} code compiled with the @option{-freg-struct-return}
17557 switch is not binary compatible with code compiled with the
17558 @option{-fpcc-struct-return} switch.
17559 Use it to conform to a non-default application binary interface.
17560
17561 @item -fshort-enums
17562 @opindex fshort-enums
17563 Allocate to an @code{enum} type only as many bytes as it needs for the
17564 declared range of possible values.  Specifically, the @code{enum} type
17565 will be equivalent to the smallest integer type which has enough room.
17566
17567 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
17568 code that is not binary compatible with code generated without that switch.
17569 Use it to conform to a non-default application binary interface.
17570
17571 @item -fshort-double
17572 @opindex fshort-double
17573 Use the same size for @code{double} as for @code{float}.
17574
17575 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
17576 code that is not binary compatible with code generated without that switch.
17577 Use it to conform to a non-default application binary interface.
17578
17579 @item -fshort-wchar
17580 @opindex fshort-wchar
17581 Override the underlying type for @samp{wchar_t} to be @samp{short
17582 unsigned int} instead of the default for the target.  This option is
17583 useful for building programs to run under WINE@.
17584
17585 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
17586 code that is not binary compatible with code generated without that switch.
17587 Use it to conform to a non-default application binary interface.
17588
17589 @item -fno-common
17590 @opindex fno-common
17591 In C code, controls the placement of uninitialized global variables.
17592 Unix C compilers have traditionally permitted multiple definitions of
17593 such variables in different compilation units by placing the variables
17594 in a common block.
17595 This is the behavior specified by @option{-fcommon}, and is the default
17596 for GCC on most targets.
17597 On the other hand, this behavior is not required by ISO C, and on some
17598 targets may carry a speed or code size penalty on variable references.
17599 The @option{-fno-common} option specifies that the compiler should place
17600 uninitialized global variables in the data section of the object file,
17601 rather than generating them as common blocks.
17602 This has the effect that if the same variable is declared
17603 (without @code{extern}) in two different compilations,
17604 you will get a multiple-definition error when you link them.
17605 In this case, you must compile with @option{-fcommon} instead.
17606 Compiling with @option{-fno-common} is useful on targets for which
17607 it provides better performance, or if you wish to verify that the
17608 program will work on other systems which always treat uninitialized
17609 variable declarations this way.
17610
17611 @item -fno-ident
17612 @opindex fno-ident
17613 Ignore the @samp{#ident} directive.
17614
17615 @item -finhibit-size-directive
17616 @opindex finhibit-size-directive
17617 Don't output a @code{.size} assembler directive, or anything else that
17618 would cause trouble if the function is split in the middle, and the
17619 two halves are placed at locations far apart in memory.  This option is
17620 used when compiling @file{crtstuff.c}; you should not need to use it
17621 for anything else.
17622
17623 @item -fverbose-asm
17624 @opindex fverbose-asm
17625 Put extra commentary information in the generated assembly code to
17626 make it more readable.  This option is generally only of use to those
17627 who actually need to read the generated assembly code (perhaps while
17628 debugging the compiler itself).
17629
17630 @option{-fno-verbose-asm}, the default, causes the
17631 extra information to be omitted and is useful when comparing two assembler
17632 files.
17633
17634 @item -frecord-gcc-switches
17635 @opindex frecord-gcc-switches
17636 This switch causes the command line that was used to invoke the
17637 compiler to be recorded into the object file that is being created.
17638 This switch is only implemented on some targets and the exact format
17639 of the recording is target and binary file format dependent, but it
17640 usually takes the form of a section containing ASCII text.  This
17641 switch is related to the @option{-fverbose-asm} switch, but that
17642 switch only records information in the assembler output file as
17643 comments, so it never reaches the object file.
17644
17645 @item -fpic
17646 @opindex fpic
17647 @cindex global offset table
17648 @cindex PIC
17649 Generate position-independent code (PIC) suitable for use in a shared
17650 library, if supported for the target machine.  Such code accesses all
17651 constant addresses through a global offset table (GOT)@.  The dynamic
17652 loader resolves the GOT entries when the program starts (the dynamic
17653 loader is not part of GCC; it is part of the operating system).  If
17654 the GOT size for the linked executable exceeds a machine-specific
17655 maximum size, you get an error message from the linker indicating that
17656 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
17657 instead.  (These maximums are 8k on the SPARC and 32k
17658 on the m68k and RS/6000.  The 386 has no such limit.)
17659
17660 Position-independent code requires special support, and therefore works
17661 only on certain machines.  For the 386, GCC supports PIC for System V
17662 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
17663 position-independent.
17664
17665 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17666 are defined to 1.
17667
17668 @item -fPIC
17669 @opindex fPIC
17670 If supported for the target machine, emit position-independent code,
17671 suitable for dynamic linking and avoiding any limit on the size of the
17672 global offset table.  This option makes a difference on the m68k,
17673 PowerPC and SPARC@.
17674
17675 Position-independent code requires special support, and therefore works
17676 only on certain machines.
17677
17678 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17679 are defined to 2.
17680
17681 @item -fpie
17682 @itemx -fPIE
17683 @opindex fpie
17684 @opindex fPIE
17685 These options are similar to @option{-fpic} and @option{-fPIC}, but
17686 generated position independent code can be only linked into executables.
17687 Usually these options are used when @option{-pie} GCC option will be
17688 used during linking.
17689
17690 @option{-fpie} and @option{-fPIE} both define the macros
17691 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
17692 for @option{-fpie} and 2 for @option{-fPIE}.
17693
17694 @item -fno-jump-tables
17695 @opindex fno-jump-tables
17696 Do not use jump tables for switch statements even where it would be
17697 more efficient than other code generation strategies.  This option is
17698 of use in conjunction with @option{-fpic} or @option{-fPIC} for
17699 building code which forms part of a dynamic linker and cannot
17700 reference the address of a jump table.  On some targets, jump tables
17701 do not require a GOT and this option is not needed.
17702
17703 @item -ffixed-@var{reg}
17704 @opindex ffixed
17705 Treat the register named @var{reg} as a fixed register; generated code
17706 should never refer to it (except perhaps as a stack pointer, frame
17707 pointer or in some other fixed role).
17708
17709 @var{reg} must be the name of a register.  The register names accepted
17710 are machine-specific and are defined in the @code{REGISTER_NAMES}
17711 macro in the machine description macro file.
17712
17713 This flag does not have a negative form, because it specifies a
17714 three-way choice.
17715
17716 @item -fcall-used-@var{reg}
17717 @opindex fcall-used
17718 Treat the register named @var{reg} as an allocable register that is
17719 clobbered by function calls.  It may be allocated for temporaries or
17720 variables that do not live across a call.  Functions compiled this way
17721 will not save and restore the register @var{reg}.
17722
17723 It is an error to used this flag with the frame pointer or stack pointer.
17724 Use of this flag for other registers that have fixed pervasive roles in
17725 the machine's execution model will produce disastrous results.
17726
17727 This flag does not have a negative form, because it specifies a
17728 three-way choice.
17729
17730 @item -fcall-saved-@var{reg}
17731 @opindex fcall-saved
17732 Treat the register named @var{reg} as an allocable register saved by
17733 functions.  It may be allocated even for temporaries or variables that
17734 live across a call.  Functions compiled this way will save and restore
17735 the register @var{reg} if they use it.
17736
17737 It is an error to used this flag with the frame pointer or stack pointer.
17738 Use of this flag for other registers that have fixed pervasive roles in
17739 the machine's execution model will produce disastrous results.
17740
17741 A different sort of disaster will result from the use of this flag for
17742 a register in which function values may be returned.
17743
17744 This flag does not have a negative form, because it specifies a
17745 three-way choice.
17746
17747 @item -fpack-struct[=@var{n}]
17748 @opindex fpack-struct
17749 Without a value specified, pack all structure members together without
17750 holes.  When a value is specified (which must be a small power of two), pack
17751 structure members according to this value, representing the maximum
17752 alignment (that is, objects with default alignment requirements larger than
17753 this will be output potentially unaligned at the next fitting location.
17754
17755 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
17756 code that is not binary compatible with code generated without that switch.
17757 Additionally, it makes the code suboptimal.
17758 Use it to conform to a non-default application binary interface.
17759
17760 @item -finstrument-functions
17761 @opindex finstrument-functions
17762 Generate instrumentation calls for entry and exit to functions.  Just
17763 after function entry and just before function exit, the following
17764 profiling functions will be called with the address of the current
17765 function and its call site.  (On some platforms,
17766 @code{__builtin_return_address} does not work beyond the current
17767 function, so the call site information may not be available to the
17768 profiling functions otherwise.)
17769
17770 @smallexample
17771 void __cyg_profile_func_enter (void *this_fn,
17772                                void *call_site);
17773 void __cyg_profile_func_exit  (void *this_fn,
17774                                void *call_site);
17775 @end smallexample
17776
17777 The first argument is the address of the start of the current function,
17778 which may be looked up exactly in the symbol table.
17779
17780 This instrumentation is also done for functions expanded inline in other
17781 functions.  The profiling calls will indicate where, conceptually, the
17782 inline function is entered and exited.  This means that addressable
17783 versions of such functions must be available.  If all your uses of a
17784 function are expanded inline, this may mean an additional expansion of
17785 code size.  If you use @samp{extern inline} in your C code, an
17786 addressable version of such functions must be provided.  (This is
17787 normally the case anyways, but if you get lucky and the optimizer always
17788 expands the functions inline, you might have gotten away without
17789 providing static copies.)
17790
17791 A function may be given the attribute @code{no_instrument_function}, in
17792 which case this instrumentation will not be done.  This can be used, for
17793 example, for the profiling functions listed above, high-priority
17794 interrupt routines, and any functions from which the profiling functions
17795 cannot safely be called (perhaps signal handlers, if the profiling
17796 routines generate output or allocate memory).
17797
17798 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
17799 @opindex finstrument-functions-exclude-file-list
17800
17801 Set the list of functions that are excluded from instrumentation (see
17802 the description of @code{-finstrument-functions}).  If the file that
17803 contains a function definition matches with one of @var{file}, then
17804 that function is not instrumented.  The match is done on substrings:
17805 if the @var{file} parameter is a substring of the file name, it is
17806 considered to be a match.
17807
17808 For example,
17809 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
17810 will exclude any inline function defined in files whose pathnames
17811 contain @code{/bits/stl} or @code{include/sys}.
17812
17813 If, for some reason, you want to include letter @code{','} in one of
17814 @var{sym}, write @code{'\,'}. For example,
17815 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
17816 (note the single quote surrounding the option).
17817
17818 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
17819 @opindex finstrument-functions-exclude-function-list
17820
17821 This is similar to @code{-finstrument-functions-exclude-file-list},
17822 but this option sets the list of function names to be excluded from
17823 instrumentation.  The function name to be matched is its user-visible
17824 name, such as @code{vector<int> blah(const vector<int> &)}, not the
17825 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
17826 match is done on substrings: if the @var{sym} parameter is a substring
17827 of the function name, it is considered to be a match.  For C99 and C++
17828 extended identifiers, the function name must be given in UTF-8, not
17829 using universal character names.
17830
17831 @item -fstack-check
17832 @opindex fstack-check
17833 Generate code to verify that you do not go beyond the boundary of the
17834 stack.  You should specify this flag if you are running in an
17835 environment with multiple threads, but only rarely need to specify it in
17836 a single-threaded environment since stack overflow is automatically
17837 detected on nearly all systems if there is only one stack.
17838
17839 Note that this switch does not actually cause checking to be done; the
17840 operating system or the language runtime must do that.  The switch causes
17841 generation of code to ensure that they see the stack being extended.
17842
17843 You can additionally specify a string parameter: @code{no} means no
17844 checking, @code{generic} means force the use of old-style checking,
17845 @code{specific} means use the best checking method and is equivalent
17846 to bare @option{-fstack-check}.
17847
17848 Old-style checking is a generic mechanism that requires no specific
17849 target support in the compiler but comes with the following drawbacks:
17850
17851 @enumerate
17852 @item
17853 Modified allocation strategy for large objects: they will always be
17854 allocated dynamically if their size exceeds a fixed threshold.
17855
17856 @item
17857 Fixed limit on the size of the static frame of functions: when it is
17858 topped by a particular function, stack checking is not reliable and
17859 a warning is issued by the compiler.
17860
17861 @item
17862 Inefficiency: because of both the modified allocation strategy and the
17863 generic implementation, the performances of the code are hampered.
17864 @end enumerate
17865
17866 Note that old-style stack checking is also the fallback method for
17867 @code{specific} if no target support has been added in the compiler.
17868
17869 @item -fstack-limit-register=@var{reg}
17870 @itemx -fstack-limit-symbol=@var{sym}
17871 @itemx -fno-stack-limit
17872 @opindex fstack-limit-register
17873 @opindex fstack-limit-symbol
17874 @opindex fno-stack-limit
17875 Generate code to ensure that the stack does not grow beyond a certain value,
17876 either the value of a register or the address of a symbol.  If the stack
17877 would grow beyond the value, a signal is raised.  For most targets,
17878 the signal is raised before the stack overruns the boundary, so
17879 it is possible to catch the signal without taking special precautions.
17880
17881 For instance, if the stack starts at absolute address @samp{0x80000000}
17882 and grows downwards, you can use the flags
17883 @option{-fstack-limit-symbol=__stack_limit} and
17884 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
17885 of 128KB@.  Note that this may only work with the GNU linker.
17886
17887 @item -fleading-underscore
17888 @opindex fleading-underscore
17889 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
17890 change the way C symbols are represented in the object file.  One use
17891 is to help link with legacy assembly code.
17892
17893 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
17894 generate code that is not binary compatible with code generated without that
17895 switch.  Use it to conform to a non-default application binary interface.
17896 Not all targets provide complete support for this switch.
17897
17898 @item -ftls-model=@var{model}
17899 @opindex ftls-model
17900 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
17901 The @var{model} argument should be one of @code{global-dynamic},
17902 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
17903
17904 The default without @option{-fpic} is @code{initial-exec}; with
17905 @option{-fpic} the default is @code{global-dynamic}.
17906
17907 @item -fvisibility=@var{default|internal|hidden|protected}
17908 @opindex fvisibility
17909 Set the default ELF image symbol visibility to the specified option---all
17910 symbols will be marked with this unless overridden within the code.
17911 Using this feature can very substantially improve linking and
17912 load times of shared object libraries, produce more optimized
17913 code, provide near-perfect API export and prevent symbol clashes.
17914 It is @strong{strongly} recommended that you use this in any shared objects
17915 you distribute.
17916
17917 Despite the nomenclature, @code{default} always means public ie;
17918 available to be linked against from outside the shared object.
17919 @code{protected} and @code{internal} are pretty useless in real-world
17920 usage so the only other commonly used option will be @code{hidden}.
17921 The default if @option{-fvisibility} isn't specified is
17922 @code{default}, i.e., make every
17923 symbol public---this causes the same behavior as previous versions of
17924 GCC@.
17925
17926 A good explanation of the benefits offered by ensuring ELF
17927 symbols have the correct visibility is given by ``How To Write
17928 Shared Libraries'' by Ulrich Drepper (which can be found at
17929 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
17930 solution made possible by this option to marking things hidden when
17931 the default is public is to make the default hidden and mark things
17932 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
17933 and @code{__attribute__ ((visibility("default")))} instead of
17934 @code{__declspec(dllexport)} you get almost identical semantics with
17935 identical syntax.  This is a great boon to those working with
17936 cross-platform projects.
17937
17938 For those adding visibility support to existing code, you may find
17939 @samp{#pragma GCC visibility} of use.  This works by you enclosing
17940 the declarations you wish to set visibility for with (for example)
17941 @samp{#pragma GCC visibility push(hidden)} and
17942 @samp{#pragma GCC visibility pop}.
17943 Bear in mind that symbol visibility should be viewed @strong{as
17944 part of the API interface contract} and thus all new code should
17945 always specify visibility when it is not the default ie; declarations
17946 only for use within the local DSO should @strong{always} be marked explicitly
17947 as hidden as so to avoid PLT indirection overheads---making this
17948 abundantly clear also aids readability and self-documentation of the code.
17949 Note that due to ISO C++ specification requirements, operator new and
17950 operator delete must always be of default visibility.
17951
17952 Be aware that headers from outside your project, in particular system
17953 headers and headers from any other library you use, may not be
17954 expecting to be compiled with visibility other than the default.  You
17955 may need to explicitly say @samp{#pragma GCC visibility push(default)}
17956 before including any such headers.
17957
17958 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
17959 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
17960 no modifications.  However, this means that calls to @samp{extern}
17961 functions with no explicit visibility will use the PLT, so it is more
17962 effective to use @samp{__attribute ((visibility))} and/or
17963 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
17964 declarations should be treated as hidden.
17965
17966 Note that @samp{-fvisibility} does affect C++ vague linkage
17967 entities. This means that, for instance, an exception class that will
17968 be thrown between DSOs must be explicitly marked with default
17969 visibility so that the @samp{type_info} nodes will be unified between
17970 the DSOs.
17971
17972 An overview of these techniques, their benefits and how to use them
17973 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
17974
17975 @item -fstrict-volatile-bitfields
17976 This option should be used if accesses to volatile bitfields (or other
17977 structure fields, although the compiler usually honors those types
17978 anyway) should use a single access in a mode of the same size as the
17979 container's type, aligned to a natural alignment if possible.  For
17980 example, targets with memory-mapped peripheral registers might require
17981 all such accesses to be 16 bits wide; with this flag the user could
17982 declare all peripheral bitfields as ``unsigned short'' (assuming short
17983 is 16 bits on these targets) to force GCC to use 16 bit accesses
17984 instead of, perhaps, a more efficient 32 bit access.
17985
17986 If this option is disabled, the compiler will use the most efficient
17987 instruction.  In the previous example, that might be a 32-bit load
17988 instruction, even though that will access bytes that do not contain
17989 any portion of the bitfield, or memory-mapped registers unrelated to
17990 the one being updated.
17991
17992 If the target requires strict alignment, and honoring the container
17993 type would require violating this alignment, a warning is issued.
17994 However, the access happens as the user requested, under the
17995 assumption that the user knows something about the target hardware
17996 that GCC is unaware of.
17997
17998 The default value of this option is determined by the application binary
17999 interface for the target processor.
18000
18001 @end table
18002
18003 @c man end
18004
18005 @node Environment Variables
18006 @section Environment Variables Affecting GCC
18007 @cindex environment variables
18008
18009 @c man begin ENVIRONMENT
18010 This section describes several environment variables that affect how GCC
18011 operates.  Some of them work by specifying directories or prefixes to use
18012 when searching for various kinds of files.  Some are used to specify other
18013 aspects of the compilation environment.
18014
18015 Note that you can also specify places to search using options such as
18016 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
18017 take precedence over places specified using environment variables, which
18018 in turn take precedence over those specified by the configuration of GCC@.
18019 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
18020 GNU Compiler Collection (GCC) Internals}.
18021
18022 @table @env
18023 @item LANG
18024 @itemx LC_CTYPE
18025 @c @itemx LC_COLLATE
18026 @itemx LC_MESSAGES
18027 @c @itemx LC_MONETARY
18028 @c @itemx LC_NUMERIC
18029 @c @itemx LC_TIME
18030 @itemx LC_ALL
18031 @findex LANG
18032 @findex LC_CTYPE
18033 @c @findex LC_COLLATE
18034 @findex LC_MESSAGES
18035 @c @findex LC_MONETARY
18036 @c @findex LC_NUMERIC
18037 @c @findex LC_TIME
18038 @findex LC_ALL
18039 @cindex locale
18040 These environment variables control the way that GCC uses
18041 localization information that allow GCC to work with different
18042 national conventions.  GCC inspects the locale categories
18043 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
18044 so.  These locale categories can be set to any value supported by your
18045 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
18046 Kingdom encoded in UTF-8.
18047
18048 The @env{LC_CTYPE} environment variable specifies character
18049 classification.  GCC uses it to determine the character boundaries in
18050 a string; this is needed for some multibyte encodings that contain quote
18051 and escape characters that would otherwise be interpreted as a string
18052 end or escape.
18053
18054 The @env{LC_MESSAGES} environment variable specifies the language to
18055 use in diagnostic messages.
18056
18057 If the @env{LC_ALL} environment variable is set, it overrides the value
18058 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
18059 and @env{LC_MESSAGES} default to the value of the @env{LANG}
18060 environment variable.  If none of these variables are set, GCC
18061 defaults to traditional C English behavior.
18062
18063 @item TMPDIR
18064 @findex TMPDIR
18065 If @env{TMPDIR} is set, it specifies the directory to use for temporary
18066 files.  GCC uses temporary files to hold the output of one stage of
18067 compilation which is to be used as input to the next stage: for example,
18068 the output of the preprocessor, which is the input to the compiler
18069 proper.
18070
18071 @item GCC_EXEC_PREFIX
18072 @findex GCC_EXEC_PREFIX
18073 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
18074 names of the subprograms executed by the compiler.  No slash is added
18075 when this prefix is combined with the name of a subprogram, but you can
18076 specify a prefix that ends with a slash if you wish.
18077
18078 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
18079 an appropriate prefix to use based on the pathname it was invoked with.
18080
18081 If GCC cannot find the subprogram using the specified prefix, it
18082 tries looking in the usual places for the subprogram.
18083
18084 The default value of @env{GCC_EXEC_PREFIX} is
18085 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
18086 the installed compiler. In many cases @var{prefix} is the value
18087 of @code{prefix} when you ran the @file{configure} script.
18088
18089 Other prefixes specified with @option{-B} take precedence over this prefix.
18090
18091 This prefix is also used for finding files such as @file{crt0.o} that are
18092 used for linking.
18093
18094 In addition, the prefix is used in an unusual way in finding the
18095 directories to search for header files.  For each of the standard
18096 directories whose name normally begins with @samp{/usr/local/lib/gcc}
18097 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
18098 replacing that beginning with the specified prefix to produce an
18099 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
18100 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
18101 These alternate directories are searched first; the standard directories
18102 come next. If a standard directory begins with the configured
18103 @var{prefix} then the value of @var{prefix} is replaced by
18104 @env{GCC_EXEC_PREFIX} when looking for header files.
18105
18106 @item COMPILER_PATH
18107 @findex COMPILER_PATH
18108 The value of @env{COMPILER_PATH} is a colon-separated list of
18109 directories, much like @env{PATH}.  GCC tries the directories thus
18110 specified when searching for subprograms, if it can't find the
18111 subprograms using @env{GCC_EXEC_PREFIX}.
18112
18113 @item LIBRARY_PATH
18114 @findex LIBRARY_PATH
18115 The value of @env{LIBRARY_PATH} is a colon-separated list of
18116 directories, much like @env{PATH}.  When configured as a native compiler,
18117 GCC tries the directories thus specified when searching for special
18118 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
18119 using GCC also uses these directories when searching for ordinary
18120 libraries for the @option{-l} option (but directories specified with
18121 @option{-L} come first).
18122
18123 @item LANG
18124 @findex LANG
18125 @cindex locale definition
18126 This variable is used to pass locale information to the compiler.  One way in
18127 which this information is used is to determine the character set to be used
18128 when character literals, string literals and comments are parsed in C and C++.
18129 When the compiler is configured to allow multibyte characters,
18130 the following values for @env{LANG} are recognized:
18131
18132 @table @samp
18133 @item C-JIS
18134 Recognize JIS characters.
18135 @item C-SJIS
18136 Recognize SJIS characters.
18137 @item C-EUCJP
18138 Recognize EUCJP characters.
18139 @end table
18140
18141 If @env{LANG} is not defined, or if it has some other value, then the
18142 compiler will use mblen and mbtowc as defined by the default locale to
18143 recognize and translate multibyte characters.
18144 @end table
18145
18146 @noindent
18147 Some additional environments variables affect the behavior of the
18148 preprocessor.
18149
18150 @include cppenv.texi
18151
18152 @c man end
18153
18154 @node Precompiled Headers
18155 @section Using Precompiled Headers
18156 @cindex precompiled headers
18157 @cindex speed of compilation
18158
18159 Often large projects have many header files that are included in every
18160 source file.  The time the compiler takes to process these header files
18161 over and over again can account for nearly all of the time required to
18162 build the project.  To make builds faster, GCC allows users to
18163 `precompile' a header file; then, if builds can use the precompiled
18164 header file they will be much faster.
18165
18166 To create a precompiled header file, simply compile it as you would any
18167 other file, if necessary using the @option{-x} option to make the driver
18168 treat it as a C or C++ header file.  You will probably want to use a
18169 tool like @command{make} to keep the precompiled header up-to-date when
18170 the headers it contains change.
18171
18172 A precompiled header file will be searched for when @code{#include} is
18173 seen in the compilation.  As it searches for the included file
18174 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
18175 compiler looks for a precompiled header in each directory just before it
18176 looks for the include file in that directory.  The name searched for is
18177 the name specified in the @code{#include} with @samp{.gch} appended.  If
18178 the precompiled header file can't be used, it is ignored.
18179
18180 For instance, if you have @code{#include "all.h"}, and you have
18181 @file{all.h.gch} in the same directory as @file{all.h}, then the
18182 precompiled header file will be used if possible, and the original
18183 header will be used otherwise.
18184
18185 Alternatively, you might decide to put the precompiled header file in a
18186 directory and use @option{-I} to ensure that directory is searched
18187 before (or instead of) the directory containing the original header.
18188 Then, if you want to check that the precompiled header file is always
18189 used, you can put a file of the same name as the original header in this
18190 directory containing an @code{#error} command.
18191
18192 This also works with @option{-include}.  So yet another way to use
18193 precompiled headers, good for projects not designed with precompiled
18194 header files in mind, is to simply take most of the header files used by
18195 a project, include them from another header file, precompile that header
18196 file, and @option{-include} the precompiled header.  If the header files
18197 have guards against multiple inclusion, they will be skipped because
18198 they've already been included (in the precompiled header).
18199
18200 If you need to precompile the same header file for different
18201 languages, targets, or compiler options, you can instead make a
18202 @emph{directory} named like @file{all.h.gch}, and put each precompiled
18203 header in the directory, perhaps using @option{-o}.  It doesn't matter
18204 what you call the files in the directory, every precompiled header in
18205 the directory will be considered.  The first precompiled header
18206 encountered in the directory that is valid for this compilation will
18207 be used; they're searched in no particular order.
18208
18209 There are many other possibilities, limited only by your imagination,
18210 good sense, and the constraints of your build system.
18211
18212 A precompiled header file can be used only when these conditions apply:
18213
18214 @itemize
18215 @item
18216 Only one precompiled header can be used in a particular compilation.
18217
18218 @item
18219 A precompiled header can't be used once the first C token is seen.  You
18220 can have preprocessor directives before a precompiled header; you can
18221 even include a precompiled header from inside another header, so long as
18222 there are no C tokens before the @code{#include}.
18223
18224 @item
18225 The precompiled header file must be produced for the same language as
18226 the current compilation.  You can't use a C precompiled header for a C++
18227 compilation.
18228
18229 @item
18230 The precompiled header file must have been produced by the same compiler
18231 binary as the current compilation is using.
18232
18233 @item
18234 Any macros defined before the precompiled header is included must
18235 either be defined in the same way as when the precompiled header was
18236 generated, or must not affect the precompiled header, which usually
18237 means that they don't appear in the precompiled header at all.
18238
18239 The @option{-D} option is one way to define a macro before a
18240 precompiled header is included; using a @code{#define} can also do it.
18241 There are also some options that define macros implicitly, like
18242 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
18243 defined this way.
18244
18245 @item If debugging information is output when using the precompiled
18246 header, using @option{-g} or similar, the same kind of debugging information
18247 must have been output when building the precompiled header.  However,
18248 a precompiled header built using @option{-g} can be used in a compilation
18249 when no debugging information is being output.
18250
18251 @item The same @option{-m} options must generally be used when building
18252 and using the precompiled header.  @xref{Submodel Options},
18253 for any cases where this rule is relaxed.
18254
18255 @item Each of the following options must be the same when building and using
18256 the precompiled header:
18257
18258 @gccoptlist{-fexceptions}
18259
18260 @item
18261 Some other command-line options starting with @option{-f},
18262 @option{-p}, or @option{-O} must be defined in the same way as when
18263 the precompiled header was generated.  At present, it's not clear
18264 which options are safe to change and which are not; the safest choice
18265 is to use exactly the same options when generating and using the
18266 precompiled header.  The following are known to be safe:
18267
18268 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
18269 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
18270 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
18271 -pedantic-errors}
18272
18273 @end itemize
18274
18275 For all of these except the last, the compiler will automatically
18276 ignore the precompiled header if the conditions aren't met.  If you
18277 find an option combination that doesn't work and doesn't cause the
18278 precompiled header to be ignored, please consider filing a bug report,
18279 see @ref{Bugs}.
18280
18281 If you do use differing options when generating and using the
18282 precompiled header, the actual behavior will be a mixture of the
18283 behavior for the options.  For instance, if you use @option{-g} to
18284 generate the precompiled header but not when using it, you may or may
18285 not get debugging information for routines in the precompiled header.