OSDN Git Service

2009-07-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
[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
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
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.2 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  -pipe  -pass-exit-codes  @gol
165 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
166 --version -wrapper@@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}}
167
168 @item C Language Options
169 @xref{C Dialect Options,,Options Controlling C Dialect}.
170 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
171 -aux-info @var{filename} @gol
172 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
173 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
174 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
175 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
176 -fsigned-bitfields  -fsigned-char @gol
177 -funsigned-bitfields  -funsigned-char}
178
179 @item C++ Language Options
180 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
181 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
182 -fconserve-space  -ffriend-injection @gol
183 -fno-elide-constructors @gol
184 -fno-enforce-eh-specs @gol
185 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
186 -fno-implicit-templates @gol
187 -fno-implicit-inline-templates @gol
188 -fno-implement-inlines  -fms-extensions @gol
189 -fno-nonansi-builtins  -fno-operator-names @gol
190 -fno-optional-diags  -fpermissive @gol
191 -fno-pretty-templates @gol
192 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
193 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
194 -fno-default-inline  -fvisibility-inlines-hidden @gol
195 -fvisibility-ms-compat @gol
196 -Wabi  -Wctor-dtor-privacy @gol
197 -Wnon-virtual-dtor  -Wreorder @gol
198 -Weffc++  -Wstrict-null-sentinel @gol
199 -Wno-non-template-friend  -Wold-style-cast @gol
200 -Woverloaded-virtual  -Wno-pmf-conversions @gol
201 -Wsign-promo}
202
203 @item Objective-C and Objective-C++ Language Options
204 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
205 Objective-C and Objective-C++ Dialects}.
206 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
207 -fgnu-runtime  -fnext-runtime @gol
208 -fno-nil-receivers @gol
209 -fobjc-call-cxx-cdtors @gol
210 -fobjc-direct-dispatch @gol
211 -fobjc-exceptions @gol
212 -fobjc-gc @gol
213 -freplace-objc-classes @gol
214 -fzero-link @gol
215 -gen-decls @gol
216 -Wassign-intercept @gol
217 -Wno-protocol  -Wselector @gol
218 -Wstrict-selector-match @gol
219 -Wundeclared-selector}
220
221 @item Language Independent Options
222 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
223 @gccoptlist{-fmessage-length=@var{n}  @gol
224 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
225 -fdiagnostics-show-option}
226
227 @item Warning Options
228 @xref{Warning Options,,Options to Request or Suppress Warnings}.
229 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
230 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
231 -Wno-attributes -Wno-builtin-macro-redefined @gol
232 -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
233 -Wchar-subscripts -Wclobbered  -Wcomment @gol
234 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated  @gol
235 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
236 -Wno-div-by-zero -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
237 -Werror  -Werror=* @gol
238 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
239 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
240 -Wformat-security  -Wformat-y2k @gol
241 -Wframe-larger-than=@var{len} -Wjump-misses-init -Wignored-qualifiers @gol
242 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
243 -Winit-self  -Winline @gol
244 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
245 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
246 -Wlogical-op -Wlong-long @gol
247 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
248 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
249 -Wmissing-noreturn  -Wno-mudflap @gol
250 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
251 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
252 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
253 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
254 -Wredundant-decls @gol
255 -Wreturn-type  -Wsequence-point  -Wshadow @gol
256 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
257 -Wstrict-aliasing -Wstrict-aliasing=n @gol
258 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
259 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
260 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
261 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
262 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
263 -Wunused-label  -Wunused-parameter -Wno-unused-result -Wunused-value  -Wunused-variable @gol
264 -Wvariadic-macros -Wvla @gol
265 -Wvolatile-register-var  -Wwrite-strings}
266
267 @item C and Objective-C-only Warning Options
268 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
269 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
270 -Wold-style-declaration  -Wold-style-definition @gol
271 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
272 -Wdeclaration-after-statement -Wpointer-sign}
273
274 @item Debugging Options
275 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
276 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
277 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
278 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
279 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
280 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
281 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
282 -fdump-statistics @gol
283 -fdump-tree-all @gol
284 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
285 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
287 -fdump-tree-ch @gol
288 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
296 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
297 -fdump-tree-nrv -fdump-tree-vect @gol
298 -fdump-tree-sink @gol
299 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
300 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
301 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
302 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
303 -ftree-vectorizer-verbose=@var{n} @gol
304 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
305 -fdump-final-insns=@var{file} @gol
306 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
307 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
308 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
309 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
310 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
311 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
312 -ftest-coverage  -ftime-report -fvar-tracking @gol
313 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
314 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
315 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
316 -fdebug-prefix-map=@var{old}=@var{new} @gol
317 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
318 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
319 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
320 -print-multi-directory  -print-multi-lib @gol
321 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
322 -print-sysroot -print-sysroot-headers-suffix @gol
323 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
324
325 @item Optimization Options
326 @xref{Optimize Options,,Options that Control Optimization}.
327 @gccoptlist{
328 -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
329 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
330 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
331 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
332 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol
333 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
334 -fdata-sections -fdce -fdce @gol
335 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
336 -fearly-inlining -fexpensive-optimizations -ffast-math @gol
337 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
338 -fforward-propagate -ffunction-sections @gol
339 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
340 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
341 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
342 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
343 -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
344 -fipa-type-escape -fira-algorithm=@var{algorithm} @gol
345 -fira-region=@var{region} -fira-coalesce -fno-ira-share-save-slots @gol
346 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
347 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
348 -floop-block -floop-interchange -floop-strip-mine @gol
349 -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
350 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
351 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
352 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
353 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
354 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
355 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
356 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
357 -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
358 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
359 -fprofile-generate=@var{path} @gol
360 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
361 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
362 -freorder-blocks-and-partition -freorder-functions @gol
363 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
364 -frounding-math -fsched2-use-superblocks @gol
365 -fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol
366 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
367 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
368 -fselective-scheduling -fselective-scheduling2 @gol
369 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
370 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
371 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
372 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
373 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
374 -ftree-copyrename -ftree-dce @gol
375 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im @gol
376 -ftree-phiprop -ftree-loop-distribution @gol
377 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
378 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
379 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
380 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
381 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
382 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
383 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
384 -fwhole-program @gol
385 --param @var{name}=@var{value}
386 -O  -O0  -O1  -O2  -O3  -Os}
387
388 @item Preprocessor Options
389 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
390 @gccoptlist{-A@var{question}=@var{answer} @gol
391 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
392 -C  -dD  -dI  -dM  -dN @gol
393 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
394 -idirafter @var{dir} @gol
395 -include @var{file}  -imacros @var{file} @gol
396 -iprefix @var{file}  -iwithprefix @var{dir} @gol
397 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
398 -imultilib @var{dir} -isysroot @var{dir} @gol
399 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
400 -P  -fworking-directory  -remap @gol
401 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
402 -Xpreprocessor @var{option}}
403
404 @item Assembler Option
405 @xref{Assembler Options,,Passing Options to the Assembler}.
406 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
407
408 @item Linker Options
409 @xref{Link Options,,Options for Linking}.
410 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
411 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
412 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
413 -shared-libgcc  -symbolic @gol
414 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
415 -u @var{symbol}}
416
417 @item Directory Options
418 @xref{Directory Options,,Options for Directory Search}.
419 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
420 -specs=@var{file}  -I- --sysroot=@var{dir}}
421
422 @item Target Options
423 @c I wrote this xref this way to avoid overfull hbox. -- rms
424 @xref{Target Options}.
425 @gccoptlist{-V @var{version}  -b @var{machine}}
426
427 @item Machine Dependent Options
428 @xref{Submodel Options,,Hardware Models and Configurations}.
429 @c This list is ordered alphanumerically by subsection name.
430 @c Try and put the significant identifier (CPU or system) first,
431 @c so users have a clue at guessing where the ones they want will be.
432
433 @emph{ARC Options}
434 @gccoptlist{-EB  -EL @gol
435 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
436 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
437
438 @emph{ARM Options}
439 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
440 -mabi=@var{name} @gol
441 -mapcs-stack-check  -mno-apcs-stack-check @gol
442 -mapcs-float  -mno-apcs-float @gol
443 -mapcs-reentrant  -mno-apcs-reentrant @gol
444 -msched-prolog  -mno-sched-prolog @gol
445 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
446 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
447 -mfp16-format=@var{name}
448 -mthumb-interwork  -mno-thumb-interwork @gol
449 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
450 -mstructure-size-boundary=@var{n} @gol
451 -mabort-on-noreturn @gol
452 -mlong-calls  -mno-long-calls @gol
453 -msingle-pic-base  -mno-single-pic-base @gol
454 -mpic-register=@var{reg} @gol
455 -mnop-fun-dllimport @gol
456 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
457 -mpoke-function-name @gol
458 -mthumb  -marm @gol
459 -mtpcs-frame  -mtpcs-leaf-frame @gol
460 -mcaller-super-interworking  -mcallee-super-interworking @gol
461 -mtp=@var{name} @gol
462 -mword-relocations @gol
463 -mfix-cortex-m3-ldrd}
464
465 @emph{AVR Options}
466 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
467 -mcall-prologues  -mtiny-stack  -mint8}
468
469 @emph{Blackfin Options}
470 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
471 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
472 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
473 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
474 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
475 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
476 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
477 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
478 -micplb}
479
480 @emph{CRIS Options}
481 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
482 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
483 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
484 -mstack-align  -mdata-align  -mconst-align @gol
485 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
486 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
487 -mmul-bug-workaround  -mno-mul-bug-workaround}
488
489 @emph{CRX Options}
490 @gccoptlist{-mmac -mpush-args}
491
492 @emph{Darwin Options}
493 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
494 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
495 -client_name  -compatibility_version  -current_version @gol
496 -dead_strip @gol
497 -dependency-file  -dylib_file  -dylinker_install_name @gol
498 -dynamic  -dynamiclib  -exported_symbols_list @gol
499 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
500 -force_flat_namespace  -headerpad_max_install_names @gol
501 -iframework @gol
502 -image_base  -init  -install_name  -keep_private_externs @gol
503 -multi_module  -multiply_defined  -multiply_defined_unused @gol
504 -noall_load   -no_dead_strip_inits_and_terms @gol
505 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
506 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
507 -private_bundle  -read_only_relocs  -sectalign @gol
508 -sectobjectsymbols  -whyload  -seg1addr @gol
509 -sectcreate  -sectobjectsymbols  -sectorder @gol
510 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
511 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
512 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
513 -single_module  -static  -sub_library  -sub_umbrella @gol
514 -twolevel_namespace  -umbrella  -undefined @gol
515 -unexported_symbols_list  -weak_reference_mismatches @gol
516 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
517 -mkernel -mone-byte-bool}
518
519 @emph{DEC Alpha Options}
520 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
521 -mieee  -mieee-with-inexact  -mieee-conformant @gol
522 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
523 -mtrap-precision=@var{mode}  -mbuild-constants @gol
524 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
525 -mbwx  -mmax  -mfix  -mcix @gol
526 -mfloat-vax  -mfloat-ieee @gol
527 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
528 -msmall-text  -mlarge-text @gol
529 -mmemory-latency=@var{time}}
530
531 @emph{DEC Alpha/VMS Options}
532 @gccoptlist{-mvms-return-codes}
533
534 @emph{FR30 Options}
535 @gccoptlist{-msmall-model -mno-lsim}
536
537 @emph{FRV Options}
538 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
539 -mhard-float  -msoft-float @gol
540 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
541 -mdouble  -mno-double @gol
542 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
543 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
544 -mlinked-fp  -mlong-calls  -malign-labels @gol
545 -mlibrary-pic  -macc-4  -macc-8 @gol
546 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
547 -moptimize-membar -mno-optimize-membar @gol
548 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
549 -mvliw-branch  -mno-vliw-branch @gol
550 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
551 -mno-nested-cond-exec  -mtomcat-stats @gol
552 -mTLS -mtls @gol
553 -mcpu=@var{cpu}}
554
555 @emph{GNU/Linux Options}
556 @gccoptlist{-muclibc}
557
558 @emph{H8/300 Options}
559 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
560
561 @emph{HPPA Options}
562 @gccoptlist{-march=@var{architecture-type} @gol
563 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
564 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
565 -mfixed-range=@var{register-range} @gol
566 -mjump-in-delay -mlinker-opt -mlong-calls @gol
567 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
568 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
569 -mno-jump-in-delay  -mno-long-load-store @gol
570 -mno-portable-runtime  -mno-soft-float @gol
571 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
572 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
573 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
574 -munix=@var{unix-std}  -nolibdld  -static  -threads}
575
576 @emph{i386 and x86-64 Options}
577 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
578 -mfpmath=@var{unit} @gol
579 -masm=@var{dialect}  -mno-fancy-math-387 @gol
580 -mno-fp-ret-in-387  -msoft-float @gol
581 -mno-wide-multiply  -mrtd  -malign-double @gol
582 -mpreferred-stack-boundary=@var{num}
583 -mincoming-stack-boundary=@var{num}
584 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip @gol
585 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
586 -maes -mpclmul @gol
587 -msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
588 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
589 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
590 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
591 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
592 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
593 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
594 -mcmodel=@var{code-model} -mabi=@var{name} @gol
595 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
596 -mfused-madd -mno-fused-madd -msse2avx}
597
598 @emph{IA-64 Options}
599 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
600 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
601 -mconstant-gp  -mauto-pic  -mfused-madd @gol
602 -minline-float-divide-min-latency @gol
603 -minline-float-divide-max-throughput @gol
604 -mno-inline-float-divide @gol
605 -minline-int-divide-min-latency @gol
606 -minline-int-divide-max-throughput  @gol
607 -mno-inline-int-divide @gol
608 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
609 -mno-inline-sqrt @gol
610 -mdwarf2-asm -mearly-stop-bits @gol
611 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
612 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
613 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
614 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
615 -msched-spec-ldc -msched-spec-control-ldc @gol
616 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
617 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
618 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
619 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
620
621 @emph{M32R/D Options}
622 @gccoptlist{-m32r2 -m32rx -m32r @gol
623 -mdebug @gol
624 -malign-loops -mno-align-loops @gol
625 -missue-rate=@var{number} @gol
626 -mbranch-cost=@var{number} @gol
627 -mmodel=@var{code-size-model-type} @gol
628 -msdata=@var{sdata-type} @gol
629 -mno-flush-func -mflush-func=@var{name} @gol
630 -mno-flush-trap -mflush-trap=@var{number} @gol
631 -G @var{num}}
632
633 @emph{M32C Options}
634 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
635
636 @emph{M680x0 Options}
637 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
638 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
639 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
640 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
641 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
642 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
643 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
644 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
645 -mxgot -mno-xgot}
646
647 @emph{M68hc1x Options}
648 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
649 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
650 -msoft-reg-count=@var{count}}
651
652 @emph{MCore Options}
653 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
654 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
655 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
656 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
657 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
658
659 @emph{MeP Options}
660 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
661 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
662 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
663 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
664 -mtiny=@var{n}}
665
666 @emph{MIPS Options}
667 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
668 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
669 -mips64  -mips64r2 @gol
670 -mips16  -mno-mips16  -mflip-mips16 @gol
671 -minterlink-mips16  -mno-interlink-mips16 @gol
672 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
673 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
674 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
675 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
676 -mfpu=@var{fpu-type} @gol
677 -msmartmips  -mno-smartmips @gol
678 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
679 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
680 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
681 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
682 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
683 -membedded-data  -mno-embedded-data @gol
684 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
685 -mcode-readable=@var{setting} @gol
686 -msplit-addresses  -mno-split-addresses @gol
687 -mexplicit-relocs  -mno-explicit-relocs @gol
688 -mcheck-zero-division  -mno-check-zero-division @gol
689 -mdivide-traps  -mdivide-breaks @gol
690 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
691 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
692 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
693 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
694 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
695 -mflush-func=@var{func}  -mno-flush-func @gol
696 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
697 -mfp-exceptions -mno-fp-exceptions @gol
698 -mvr4130-align -mno-vr4130-align}
699
700 @emph{MMIX Options}
701 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
702 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
703 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
704 -mno-base-addresses  -msingle-exit  -mno-single-exit}
705
706 @emph{MN10300 Options}
707 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
708 -mam33  -mno-am33 @gol
709 -mam33-2  -mno-am33-2 @gol
710 -mreturn-pointer-on-d0 @gol
711 -mno-crt0  -mrelax}
712
713 @emph{PDP-11 Options}
714 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
715 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
716 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
717 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
718 -mbranch-expensive  -mbranch-cheap @gol
719 -msplit  -mno-split  -munix-asm  -mdec-asm}
720
721 @emph{picoChip Options}
722 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
723 -msymbol-as-address -mno-inefficient-warnings}
724
725 @emph{PowerPC Options}
726 See RS/6000 and PowerPC Options.
727
728 @emph{RS/6000 and PowerPC Options}
729 @gccoptlist{-mcpu=@var{cpu-type} @gol
730 -mtune=@var{cpu-type} @gol
731 -mpower  -mno-power  -mpower2  -mno-power2 @gol
732 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
733 -maltivec  -mno-altivec @gol
734 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
735 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
736 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
737 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
738 -mnew-mnemonics  -mold-mnemonics @gol
739 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
740 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
741 -malign-power  -malign-natural @gol
742 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
743 -msingle-float -mdouble-float -msimple-fpu @gol
744 -mstring  -mno-string  -mupdate  -mno-update @gol
745 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
746 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
747 -mstrict-align  -mno-strict-align  -mrelocatable @gol
748 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
749 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
750 -mdynamic-no-pic  -maltivec  -mswdiv @gol
751 -mprioritize-restricted-insns=@var{priority} @gol
752 -msched-costly-dep=@var{dependence_type} @gol
753 -minsert-sched-nops=@var{scheme} @gol
754 -mcall-sysv  -mcall-netbsd @gol
755 -maix-struct-return  -msvr4-struct-return @gol
756 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
757 -misel -mno-isel @gol
758 -misel=yes  -misel=no @gol
759 -mspe -mno-spe @gol
760 -mspe=yes  -mspe=no @gol
761 -mpaired @gol
762 -mgen-cell-microcode -mwarn-cell-microcode @gol
763 -mvrsave -mno-vrsave @gol
764 -mmulhw -mno-mulhw @gol
765 -mdlmzb -mno-dlmzb @gol
766 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
767 -mprototype  -mno-prototype @gol
768 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
769 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread}
770
771 @emph{S/390 and zSeries Options}
772 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
773 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
774 -mlong-double-64 -mlong-double-128 @gol
775 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
776 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
777 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
778 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
779 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
780
781 @emph{Score Options}
782 @gccoptlist{-meb -mel @gol
783 -mnhwloop @gol
784 -muls @gol
785 -mmac @gol
786 -mscore5 -mscore5u -mscore7 -mscore7d}
787
788 @emph{SH Options}
789 @gccoptlist{-m1  -m2  -m2e @gol
790 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
791 -m3  -m3e @gol
792 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
793 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
794 -m5-64media  -m5-64media-nofpu @gol
795 -m5-32media  -m5-32media-nofpu @gol
796 -m5-compact  -m5-compact-nofpu @gol
797 -mb  -ml  -mdalign  -mrelax @gol
798 -mbigtable  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
799 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
800 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
801 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
802 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
803 -minvalid-symbols}
804
805 @emph{SPARC Options}
806 @gccoptlist{-mcpu=@var{cpu-type} @gol
807 -mtune=@var{cpu-type} @gol
808 -mcmodel=@var{code-model} @gol
809 -m32  -m64  -mapp-regs  -mno-app-regs @gol
810 -mfaster-structs  -mno-faster-structs @gol
811 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
812 -mhard-quad-float  -msoft-quad-float @gol
813 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
814 -mstack-bias  -mno-stack-bias @gol
815 -munaligned-doubles  -mno-unaligned-doubles @gol
816 -mv8plus  -mno-v8plus  -mvis  -mno-vis
817 -threads -pthreads -pthread}
818
819 @emph{SPU Options}
820 @gccoptlist{-mwarn-reloc -merror-reloc @gol
821 -msafe-dma -munsafe-dma @gol
822 -mbranch-hints @gol
823 -msmall-mem -mlarge-mem -mstdmain @gol
824 -mfixed-range=@var{register-range}}
825
826 @emph{System V Options}
827 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
828
829 @emph{V850 Options}
830 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
831 -mprolog-function  -mno-prolog-function  -mspace @gol
832 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
833 -mapp-regs  -mno-app-regs @gol
834 -mdisable-callt  -mno-disable-callt @gol
835 -mv850e1 @gol
836 -mv850e @gol
837 -mv850  -mbig-switch}
838
839 @emph{VAX Options}
840 @gccoptlist{-mg  -mgnu  -munix}
841
842 @emph{VxWorks Options}
843 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
844 -Xbind-lazy  -Xbind-now}
845
846 @emph{x86-64 Options}
847 See i386 and x86-64 Options.
848
849 @emph{i386 and x86-64 Windows Options}
850 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
851 -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows}
852
853 @emph{Xstormy16 Options}
854 @gccoptlist{-msim}
855
856 @emph{Xtensa Options}
857 @gccoptlist{-mconst16 -mno-const16 @gol
858 -mfused-madd  -mno-fused-madd @gol
859 -mserialize-volatile  -mno-serialize-volatile @gol
860 -mtext-section-literals  -mno-text-section-literals @gol
861 -mtarget-align  -mno-target-align @gol
862 -mlongcalls  -mno-longcalls}
863
864 @emph{zSeries Options}
865 See S/390 and zSeries Options.
866
867 @item Code Generation Options
868 @xref{Code Gen Options,,Options for Code Generation Conventions}.
869 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
870 -ffixed-@var{reg}  -fexceptions @gol
871 -fnon-call-exceptions  -funwind-tables @gol
872 -fasynchronous-unwind-tables @gol
873 -finhibit-size-directive  -finstrument-functions @gol
874 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
875 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
876 -fno-common  -fno-ident @gol
877 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
878 -fno-jump-tables @gol
879 -frecord-gcc-switches @gol
880 -freg-struct-return  -fshort-enums @gol
881 -fshort-double  -fshort-wchar @gol
882 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
883 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
884 -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
885 -fargument-noalias-global  -fargument-noalias-anything @gol
886 -fleading-underscore  -ftls-model=@var{model} @gol
887 -ftrapv  -fwrapv  -fbounds-check @gol
888 -fvisibility}
889 @end table
890
891 @menu
892 * Overall Options::     Controlling the kind of output:
893                         an executable, object files, assembler files,
894                         or preprocessed source.
895 * C Dialect Options::   Controlling the variant of C language compiled.
896 * C++ Dialect Options:: Variations on C++.
897 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
898                         and Objective-C++.
899 * Language Independent Options:: Controlling how diagnostics should be
900                         formatted.
901 * Warning Options::     How picky should the compiler be?
902 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
903 * Optimize Options::    How much optimization?
904 * Preprocessor Options:: Controlling header files and macro definitions.
905                          Also, getting dependency information for Make.
906 * Assembler Options::   Passing options to the assembler.
907 * Link Options::        Specifying libraries and so on.
908 * Directory Options::   Where to find header files and libraries.
909                         Where to find the compiler executable files.
910 * Spec Files::          How to pass switches to sub-processes.
911 * Target Options::      Running a cross-compiler, or an old version of GCC.
912 @end menu
913
914 @node Overall Options
915 @section Options Controlling the Kind of Output
916
917 Compilation can involve up to four stages: preprocessing, compilation
918 proper, assembly and linking, always in that order.  GCC is capable of
919 preprocessing and compiling several files either into several
920 assembler input files, or into one assembler input file; then each
921 assembler input file produces an object file, and linking combines all
922 the object files (those newly compiled, and those specified as input)
923 into an executable file.
924
925 @cindex file name suffix
926 For any given input file, the file name suffix determines what kind of
927 compilation is done:
928
929 @table @gcctabopt
930 @item @var{file}.c
931 C source code which must be preprocessed.
932
933 @item @var{file}.i
934 C source code which should not be preprocessed.
935
936 @item @var{file}.ii
937 C++ source code which should not be preprocessed.
938
939 @item @var{file}.m
940 Objective-C source code.  Note that you must link with the @file{libobjc}
941 library to make an Objective-C program work.
942
943 @item @var{file}.mi
944 Objective-C source code which should not be preprocessed.
945
946 @item @var{file}.mm
947 @itemx @var{file}.M
948 Objective-C++ source code.  Note that you must link with the @file{libobjc}
949 library to make an Objective-C++ program work.  Note that @samp{.M} refers
950 to a literal capital M@.
951
952 @item @var{file}.mii
953 Objective-C++ source code which should not be preprocessed.
954
955 @item @var{file}.h
956 C, C++, Objective-C or Objective-C++ header file to be turned into a
957 precompiled header.
958
959 @item @var{file}.cc
960 @itemx @var{file}.cp
961 @itemx @var{file}.cxx
962 @itemx @var{file}.cpp
963 @itemx @var{file}.CPP
964 @itemx @var{file}.c++
965 @itemx @var{file}.C
966 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
967 the last two letters must both be literally @samp{x}.  Likewise,
968 @samp{.C} refers to a literal capital C@.
969
970 @item @var{file}.mm
971 @itemx @var{file}.M
972 Objective-C++ source code which must be preprocessed.
973
974 @item @var{file}.mii
975 Objective-C++ source code which should not be preprocessed.
976
977 @item @var{file}.hh
978 @itemx @var{file}.H
979 @itemx @var{file}.hp
980 @itemx @var{file}.hxx
981 @itemx @var{file}.hpp
982 @itemx @var{file}.HPP
983 @itemx @var{file}.h++
984 @itemx @var{file}.tcc
985 C++ header file to be turned into a precompiled header.
986
987 @item @var{file}.f
988 @itemx @var{file}.for
989 @itemx @var{file}.ftn
990 Fixed form Fortran source code which should not be preprocessed.
991
992 @item @var{file}.F
993 @itemx @var{file}.FOR
994 @itemx @var{file}.fpp
995 @itemx @var{file}.FPP
996 @itemx @var{file}.FTN
997 Fixed form Fortran source code which must be preprocessed (with the traditional
998 preprocessor).
999
1000 @item @var{file}.f90
1001 @itemx @var{file}.f95
1002 @itemx @var{file}.f03
1003 @itemx @var{file}.f08
1004 Free form Fortran source code which should not be preprocessed.
1005
1006 @item @var{file}.F90
1007 @itemx @var{file}.F95
1008 @itemx @var{file}.F03
1009 @itemx @var{file}.F08
1010 Free form Fortran source code which must be preprocessed (with the
1011 traditional preprocessor).
1012
1013 @c FIXME: Descriptions of Java file types.
1014 @c @var{file}.java
1015 @c @var{file}.class
1016 @c @var{file}.zip
1017 @c @var{file}.jar
1018
1019 @item @var{file}.ads
1020 Ada source code file which contains a library unit declaration (a
1021 declaration of a package, subprogram, or generic, or a generic
1022 instantiation), or a library unit renaming declaration (a package,
1023 generic, or subprogram renaming declaration).  Such files are also
1024 called @dfn{specs}.
1025
1026 @item @var{file}.adb
1027 Ada source code file containing a library unit body (a subprogram or
1028 package body).  Such files are also called @dfn{bodies}.
1029
1030 @c GCC also knows about some suffixes for languages not yet included:
1031 @c Pascal:
1032 @c @var{file}.p
1033 @c @var{file}.pas
1034 @c Ratfor:
1035 @c @var{file}.r
1036
1037 @item @var{file}.s
1038 Assembler code.
1039
1040 @item @var{file}.S
1041 @itemx @var{file}.sx
1042 Assembler code which must be preprocessed.
1043
1044 @item @var{other}
1045 An object file to be fed straight into linking.
1046 Any file name with no recognized suffix is treated this way.
1047 @end table
1048
1049 @opindex x
1050 You can specify the input language explicitly with the @option{-x} option:
1051
1052 @table @gcctabopt
1053 @item -x @var{language}
1054 Specify explicitly the @var{language} for the following input files
1055 (rather than letting the compiler choose a default based on the file
1056 name suffix).  This option applies to all following input files until
1057 the next @option{-x} option.  Possible values for @var{language} are:
1058 @smallexample
1059 c  c-header  c-cpp-output
1060 c++  c++-header  c++-cpp-output
1061 objective-c  objective-c-header  objective-c-cpp-output
1062 objective-c++ objective-c++-header objective-c++-cpp-output
1063 assembler  assembler-with-cpp
1064 ada
1065 f77  f77-cpp-input f95  f95-cpp-input
1066 java
1067 @end smallexample
1068
1069 @item -x none
1070 Turn off any specification of a language, so that subsequent files are
1071 handled according to their file name suffixes (as they are if @option{-x}
1072 has not been used at all).
1073
1074 @item -pass-exit-codes
1075 @opindex pass-exit-codes
1076 Normally the @command{gcc} program will exit with the code of 1 if any
1077 phase of the compiler returns a non-success return code.  If you specify
1078 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1079 numerically highest error produced by any phase that returned an error
1080 indication.  The C, C++, and Fortran frontends return 4, if an internal
1081 compiler error is encountered.
1082 @end table
1083
1084 If you only want some of the stages of compilation, you can use
1085 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1086 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1087 @command{gcc} is to stop.  Note that some combinations (for example,
1088 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1089
1090 @table @gcctabopt
1091 @item -c
1092 @opindex c
1093 Compile or assemble the source files, but do not link.  The linking
1094 stage simply is not done.  The ultimate output is in the form of an
1095 object file for each source file.
1096
1097 By default, the object file name for a source file is made by replacing
1098 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1099
1100 Unrecognized input files, not requiring compilation or assembly, are
1101 ignored.
1102
1103 @item -S
1104 @opindex S
1105 Stop after the stage of compilation proper; do not assemble.  The output
1106 is in the form of an assembler code file for each non-assembler input
1107 file specified.
1108
1109 By default, the assembler file name for a source file is made by
1110 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1111
1112 Input files that don't require compilation are ignored.
1113
1114 @item -E
1115 @opindex E
1116 Stop after the preprocessing stage; do not run the compiler proper.  The
1117 output is in the form of preprocessed source code, which is sent to the
1118 standard output.
1119
1120 Input files which don't require preprocessing are ignored.
1121
1122 @cindex output file option
1123 @item -o @var{file}
1124 @opindex o
1125 Place output in file @var{file}.  This applies regardless to whatever
1126 sort of output is being produced, whether it be an executable file,
1127 an object file, an assembler file or preprocessed C code.
1128
1129 If @option{-o} is not specified, the default is to put an executable
1130 file in @file{a.out}, the object file for
1131 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1132 assembler file in @file{@var{source}.s}, a precompiled header file in
1133 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1134 standard output.
1135
1136 @item -v
1137 @opindex v
1138 Print (on standard error output) the commands executed to run the stages
1139 of compilation.  Also print the version number of the compiler driver
1140 program and of the preprocessor and the compiler proper.
1141
1142 @item -###
1143 @opindex ###
1144 Like @option{-v} except the commands are not executed and all command
1145 arguments are quoted.  This is useful for shell scripts to capture the
1146 driver-generated command lines.
1147
1148 @item -pipe
1149 @opindex pipe
1150 Use pipes rather than temporary files for communication between the
1151 various stages of compilation.  This fails to work on some systems where
1152 the assembler is unable to read from a pipe; but the GNU assembler has
1153 no trouble.
1154
1155 @item -combine
1156 @opindex combine
1157 If you are compiling multiple source files, this option tells the driver
1158 to pass all the source files to the compiler at once (for those
1159 languages for which the compiler can handle this).  This will allow
1160 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1161 language for which this is supported is C@.  If you pass source files for
1162 multiple languages to the driver, using this option, the driver will invoke
1163 the compiler(s) that support IMA once each, passing each compiler all the
1164 source files appropriate for it.  For those languages that do not support
1165 IMA this option will be ignored, and the compiler will be invoked once for
1166 each source file in that language.  If you use this option in conjunction
1167 with @option{-save-temps}, the compiler will generate multiple
1168 pre-processed files
1169 (one for each source file), but only one (combined) @file{.o} or
1170 @file{.s} file.
1171
1172 @item --help
1173 @opindex help
1174 Print (on the standard output) a description of the command line options
1175 understood by @command{gcc}.  If the @option{-v} option is also specified
1176 then @option{--help} will also be passed on to the various processes
1177 invoked by @command{gcc}, so that they can display the command line options
1178 they accept.  If the @option{-Wextra} option has also been specified
1179 (prior to the @option{--help} option), then command line options which
1180 have no documentation associated with them will also be displayed.
1181
1182 @item --target-help
1183 @opindex target-help
1184 Print (on the standard output) a description of target-specific command
1185 line options for each tool.  For some targets extra target-specific
1186 information may also be printed.
1187
1188 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1189 Print (on the standard output) a description of the command line
1190 options understood by the compiler that fit into all specified classes
1191 and qualifiers.  These are the supported classes:
1192
1193 @table @asis
1194 @item @samp{optimizers}
1195 This will display all of the optimization options supported by the
1196 compiler.
1197
1198 @item @samp{warnings}
1199 This will display all of the options controlling warning messages
1200 produced by the compiler.
1201
1202 @item @samp{target}
1203 This will display target-specific options.  Unlike the
1204 @option{--target-help} option however, target-specific options of the
1205 linker and assembler will not be displayed.  This is because those
1206 tools do not currently support the extended @option{--help=} syntax.
1207
1208 @item @samp{params}
1209 This will display the values recognized by the @option{--param}
1210 option.
1211
1212 @item @var{language}
1213 This will display the options supported for @var{language}, where
1214 @var{language} is the name of one of the languages supported in this
1215 version of GCC.
1216
1217 @item @samp{common}
1218 This will display the options that are common to all languages.
1219 @end table
1220
1221 These are the supported qualifiers:
1222
1223 @table @asis
1224 @item @samp{undocumented}
1225 Display only those options which are undocumented.
1226
1227 @item @samp{joined}
1228 Display options which take an argument that appears after an equal
1229 sign in the same continuous piece of text, such as:
1230 @samp{--help=target}.
1231
1232 @item @samp{separate}
1233 Display options which take an argument that appears as a separate word
1234 following the original option, such as: @samp{-o output-file}.
1235 @end table
1236
1237 Thus for example to display all the undocumented target-specific
1238 switches supported by the compiler the following can be used:
1239
1240 @smallexample
1241 --help=target,undocumented
1242 @end smallexample
1243
1244 The sense of a qualifier can be inverted by prefixing it with the
1245 @samp{^} character, so for example to display all binary warning
1246 options (i.e., ones that are either on or off and that do not take an
1247 argument), which have a description the following can be used:
1248
1249 @smallexample
1250 --help=warnings,^joined,^undocumented
1251 @end smallexample
1252
1253 The argument to @option{--help=} should not consist solely of inverted
1254 qualifiers.
1255
1256 Combining several classes is possible, although this usually
1257 restricts the output by so much that there is nothing to display.  One
1258 case where it does work however is when one of the classes is
1259 @var{target}.  So for example to display all the target-specific
1260 optimization options the following can be used:
1261
1262 @smallexample
1263 --help=target,optimizers
1264 @end smallexample
1265
1266 The @option{--help=} option can be repeated on the command line.  Each
1267 successive use will display its requested class of options, skipping
1268 those that have already been displayed.
1269
1270 If the @option{-Q} option appears on the command line before the
1271 @option{--help=} option, then the descriptive text displayed by
1272 @option{--help=} is changed.  Instead of describing the displayed
1273 options, an indication is given as to whether the option is enabled,
1274 disabled or set to a specific value (assuming that the compiler
1275 knows this at the point where the @option{--help=} option is used).
1276
1277 Here is a truncated example from the ARM port of @command{gcc}:
1278
1279 @smallexample
1280   % gcc -Q -mabi=2 --help=target -c
1281   The following options are target specific:
1282   -mabi=                                2
1283   -mabort-on-noreturn                   [disabled]
1284   -mapcs                                [disabled]
1285 @end smallexample
1286
1287 The output is sensitive to the effects of previous command line
1288 options, so for example it is possible to find out which optimizations
1289 are enabled at @option{-O2} by using:
1290
1291 @smallexample
1292 -Q -O2 --help=optimizers
1293 @end smallexample
1294
1295 Alternatively you can discover which binary optimizations are enabled
1296 by @option{-O3} by using:
1297
1298 @smallexample
1299 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1300 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1301 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1302 @end smallexample
1303
1304 @item --version
1305 @opindex version
1306 Display the version number and copyrights of the invoked GCC@.
1307
1308 @item -wrapper
1309 @opindex wrapper
1310 Invoke all subcommands under a wrapper program. It takes a single
1311 comma separated list as an argument, which will be used to invoke
1312 the wrapper:
1313
1314 @smallexample
1315 gcc -c t.c -wrapper gdb,--args
1316 @end smallexample
1317
1318 This will invoke all subprograms of gcc under "gdb --args",
1319 thus cc1 invocation will be "gdb --args cc1 ...".
1320
1321 @item -fplugin=@var{name}.so
1322 Load the plugin code in file @var{name}.so, assumed to be a
1323 shared object to be dlopen'd by the compiler.  The base name of
1324 the shared object file is used to identify the plugin for the
1325 purposes of argument parsing (See
1326 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1327 Each plugin should define the callback functions specified in the
1328 Plugins API.
1329
1330 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1331 Define an argument called @var{key} with a value of @var{value}
1332 for the plugin called @var{name}.
1333
1334 @include @value{srcdir}/../libiberty/at-file.texi
1335 @end table
1336
1337 @node Invoking G++
1338 @section Compiling C++ Programs
1339
1340 @cindex suffixes for C++ source
1341 @cindex C++ source file suffixes
1342 C++ source files conventionally use one of the suffixes @samp{.C},
1343 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1344 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1345 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1346 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1347 files with these names and compiles them as C++ programs even if you
1348 call the compiler the same way as for compiling C programs (usually
1349 with the name @command{gcc}).
1350
1351 @findex g++
1352 @findex c++
1353 However, the use of @command{gcc} does not add the C++ library.
1354 @command{g++} is a program that calls GCC and treats @samp{.c},
1355 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1356 files unless @option{-x} is used, and automatically specifies linking
1357 against the C++ library.  This program is also useful when
1358 precompiling a C header file with a @samp{.h} extension for use in C++
1359 compilations.  On many systems, @command{g++} is also installed with
1360 the name @command{c++}.
1361
1362 @cindex invoking @command{g++}
1363 When you compile C++ programs, you may specify many of the same
1364 command-line options that you use for compiling programs in any
1365 language; or command-line options meaningful for C and related
1366 languages; or options that are meaningful only for C++ programs.
1367 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1368 explanations of options for languages related to C@.
1369 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1370 explanations of options that are meaningful only for C++ programs.
1371
1372 @node C Dialect Options
1373 @section Options Controlling C Dialect
1374 @cindex dialect options
1375 @cindex language dialect options
1376 @cindex options, dialect
1377
1378 The following options control the dialect of C (or languages derived
1379 from C, such as C++, Objective-C and Objective-C++) that the compiler
1380 accepts:
1381
1382 @table @gcctabopt
1383 @cindex ANSI support
1384 @cindex ISO support
1385 @item -ansi
1386 @opindex ansi
1387 In C mode, this is equivalent to @samp{-std=c89}. In C++ mode, it is
1388 equivalent to @samp{-std=c++98}.
1389
1390 This turns off certain features of GCC that are incompatible with ISO
1391 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1392 such as the @code{asm} and @code{typeof} keywords, and
1393 predefined macros such as @code{unix} and @code{vax} that identify the
1394 type of system you are using.  It also enables the undesirable and
1395 rarely used ISO trigraph feature.  For the C compiler,
1396 it disables recognition of C++ style @samp{//} comments as well as
1397 the @code{inline} keyword.
1398
1399 The alternate keywords @code{__asm__}, @code{__extension__},
1400 @code{__inline__} and @code{__typeof__} continue to work despite
1401 @option{-ansi}.  You would not want to use them in an ISO C program, of
1402 course, but it is useful to put them in header files that might be included
1403 in compilations done with @option{-ansi}.  Alternate predefined macros
1404 such as @code{__unix__} and @code{__vax__} are also available, with or
1405 without @option{-ansi}.
1406
1407 The @option{-ansi} option does not cause non-ISO programs to be
1408 rejected gratuitously.  For that, @option{-pedantic} is required in
1409 addition to @option{-ansi}.  @xref{Warning Options}.
1410
1411 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1412 option is used.  Some header files may notice this macro and refrain
1413 from declaring certain functions or defining certain macros that the
1414 ISO standard doesn't call for; this is to avoid interfering with any
1415 programs that might use these names for other things.
1416
1417 Functions that would normally be built in but do not have semantics
1418 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1419 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1420 built-in functions provided by GCC}, for details of the functions
1421 affected.
1422
1423 @item -std=
1424 @opindex std
1425 Determine the language standard. @xref{Standards,,Language Standards
1426 Supported by GCC}, for details of these standard versions.  This option
1427 is currently only supported when compiling C or C++.
1428
1429 The compiler can accept several base standards, such as @samp{c89} or
1430 @samp{c++98}, and GNU dialects of those standards, such as
1431 @samp{gnu89} or @samp{gnu++98}.  By specifying a base standard, the
1432 compiler will accept all programs following that standard and those
1433 using GNU extensions that do not contradict it.  For example,
1434 @samp{-std=c89} turns off certain features of GCC that are
1435 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1436 keywords, but not other GNU extensions that do not have a meaning in
1437 ISO C90, such as omitting the middle term of a @code{?:}
1438 expression. On the other hand, by specifying a GNU dialect of a
1439 standard, all features the compiler support are enabled, even when
1440 those features change the meaning of the base standard and some
1441 strict-conforming programs may be rejected.  The particular standard
1442 is used by @option{-pedantic} to identify which features are GNU
1443 extensions given that version of the standard. For example
1444 @samp{-std=gnu89 -pedantic} would warn about C++ style @samp{//}
1445 comments, while @samp{-std=gnu99 -pedantic} would not.
1446
1447 A value for this option must be provided; possible values are
1448
1449 @table @samp
1450 @item c89
1451 @itemx iso9899:1990
1452 Support all ISO C90 programs (certain GNU extensions that conflict
1453 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1454
1455 @item iso9899:199409
1456 ISO C90 as modified in amendment 1.
1457
1458 @item c99
1459 @itemx c9x
1460 @itemx iso9899:1999
1461 @itemx iso9899:199x
1462 ISO C99.  Note that this standard is not yet fully supported; see
1463 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1464 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1465
1466 @item gnu89
1467 GNU dialect of ISO C90 (including some C99 features). This
1468 is the default for C code.
1469
1470 @item gnu99
1471 @itemx gnu9x
1472 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1473 this will become the default.  The name @samp{gnu9x} is deprecated.
1474
1475 @item c++98
1476 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1477 C++ code.
1478
1479 @item gnu++98
1480 GNU dialect of @option{-std=c++98}.  This is the default for
1481 C++ code.
1482
1483 @item c++0x
1484 The working draft of the upcoming ISO C++0x standard. This option
1485 enables experimental features that are likely to be included in
1486 C++0x. The working draft is constantly changing, and any feature that is
1487 enabled by this flag may be removed from future versions of GCC if it is
1488 not part of the C++0x standard.
1489
1490 @item gnu++0x
1491 GNU dialect of @option{-std=c++0x}. This option enables
1492 experimental features that may be removed in future versions of GCC.
1493 @end table
1494
1495 @item -fgnu89-inline
1496 @opindex fgnu89-inline
1497 The option @option{-fgnu89-inline} tells GCC to use the traditional
1498 GNU semantics for @code{inline} functions when in C99 mode.
1499 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1500 is accepted and ignored by GCC versions 4.1.3 up to but not including
1501 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1502 C99 mode.  Using this option is roughly equivalent to adding the
1503 @code{gnu_inline} function attribute to all inline functions
1504 (@pxref{Function Attributes}).
1505
1506 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1507 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1508 specifies the default behavior).  This option was first supported in
1509 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1510
1511 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1512 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1513 in effect for @code{inline} functions.  @xref{Common Predefined
1514 Macros,,,cpp,The C Preprocessor}.
1515
1516 @item -aux-info @var{filename}
1517 @opindex aux-info
1518 Output to the given filename prototyped declarations for all functions
1519 declared and/or defined in a translation unit, including those in header
1520 files.  This option is silently ignored in any language other than C@.
1521
1522 Besides declarations, the file indicates, in comments, the origin of
1523 each declaration (source file and line), whether the declaration was
1524 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1525 @samp{O} for old, respectively, in the first character after the line
1526 number and the colon), and whether it came from a declaration or a
1527 definition (@samp{C} or @samp{F}, respectively, in the following
1528 character).  In the case of function definitions, a K&R-style list of
1529 arguments followed by their declarations is also provided, inside
1530 comments, after the declaration.
1531
1532 @item -fno-asm
1533 @opindex fno-asm
1534 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1535 keyword, so that code can use these words as identifiers.  You can use
1536 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1537 instead.  @option{-ansi} implies @option{-fno-asm}.
1538
1539 In C++, this switch only affects the @code{typeof} keyword, since
1540 @code{asm} and @code{inline} are standard keywords.  You may want to
1541 use the @option{-fno-gnu-keywords} flag instead, which has the same
1542 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1543 switch only affects the @code{asm} and @code{typeof} keywords, since
1544 @code{inline} is a standard keyword in ISO C99.
1545
1546 @item -fno-builtin
1547 @itemx -fno-builtin-@var{function}
1548 @opindex fno-builtin
1549 @cindex built-in functions
1550 Don't recognize built-in functions that do not begin with
1551 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1552 functions provided by GCC}, for details of the functions affected,
1553 including those which are not built-in functions when @option{-ansi} or
1554 @option{-std} options for strict ISO C conformance are used because they
1555 do not have an ISO standard meaning.
1556
1557 GCC normally generates special code to handle certain built-in functions
1558 more efficiently; for instance, calls to @code{alloca} may become single
1559 instructions that adjust the stack directly, and calls to @code{memcpy}
1560 may become inline copy loops.  The resulting code is often both smaller
1561 and faster, but since the function calls no longer appear as such, you
1562 cannot set a breakpoint on those calls, nor can you change the behavior
1563 of the functions by linking with a different library.  In addition,
1564 when a function is recognized as a built-in function, GCC may use
1565 information about that function to warn about problems with calls to
1566 that function, or to generate more efficient code, even if the
1567 resulting code still contains calls to that function.  For example,
1568 warnings are given with @option{-Wformat} for bad calls to
1569 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1570 known not to modify global memory.
1571
1572 With the @option{-fno-builtin-@var{function}} option
1573 only the built-in function @var{function} is
1574 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1575 function is named that is not built-in in this version of GCC, this
1576 option is ignored.  There is no corresponding
1577 @option{-fbuiltin-@var{function}} option; if you wish to enable
1578 built-in functions selectively when using @option{-fno-builtin} or
1579 @option{-ffreestanding}, you may define macros such as:
1580
1581 @smallexample
1582 #define abs(n)          __builtin_abs ((n))
1583 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1584 @end smallexample
1585
1586 @item -fhosted
1587 @opindex fhosted
1588 @cindex hosted environment
1589
1590 Assert that compilation takes place in a hosted environment.  This implies
1591 @option{-fbuiltin}.  A hosted environment is one in which the
1592 entire standard library is available, and in which @code{main} has a return
1593 type of @code{int}.  Examples are nearly everything except a kernel.
1594 This is equivalent to @option{-fno-freestanding}.
1595
1596 @item -ffreestanding
1597 @opindex ffreestanding
1598 @cindex hosted environment
1599
1600 Assert that compilation takes place in a freestanding environment.  This
1601 implies @option{-fno-builtin}.  A freestanding environment
1602 is one in which the standard library may not exist, and program startup may
1603 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1604 This is equivalent to @option{-fno-hosted}.
1605
1606 @xref{Standards,,Language Standards Supported by GCC}, for details of
1607 freestanding and hosted environments.
1608
1609 @item -fopenmp
1610 @opindex fopenmp
1611 @cindex openmp parallel
1612 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1613 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1614 compiler generates parallel code according to the OpenMP Application
1615 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1616 implies @option{-pthread}, and thus is only supported on targets that
1617 have support for @option{-pthread}.
1618
1619 @item -fms-extensions
1620 @opindex fms-extensions
1621 Accept some non-standard constructs used in Microsoft header files.
1622
1623 Some cases of unnamed fields in structures and unions are only
1624 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1625 fields within structs/unions}, for details.
1626
1627 @item -trigraphs
1628 @opindex trigraphs
1629 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1630 options for strict ISO C conformance) implies @option{-trigraphs}.
1631
1632 @item -no-integrated-cpp
1633 @opindex no-integrated-cpp
1634 Performs a compilation in two passes: preprocessing and compiling.  This
1635 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1636 @option{-B} option.  The user supplied compilation step can then add in
1637 an additional preprocessing step after normal preprocessing but before
1638 compiling.  The default is to use the integrated cpp (internal cpp)
1639
1640 The semantics of this option will change if "cc1", "cc1plus", and
1641 "cc1obj" are merged.
1642
1643 @cindex traditional C language
1644 @cindex C language, traditional
1645 @item -traditional
1646 @itemx -traditional-cpp
1647 @opindex traditional-cpp
1648 @opindex traditional
1649 Formerly, these options caused GCC to attempt to emulate a pre-standard
1650 C compiler.  They are now only supported with the @option{-E} switch.
1651 The preprocessor continues to support a pre-standard mode.  See the GNU
1652 CPP manual for details.
1653
1654 @item -fcond-mismatch
1655 @opindex fcond-mismatch
1656 Allow conditional expressions with mismatched types in the second and
1657 third arguments.  The value of such an expression is void.  This option
1658 is not supported for C++.
1659
1660 @item -flax-vector-conversions
1661 @opindex flax-vector-conversions
1662 Allow implicit conversions between vectors with differing numbers of
1663 elements and/or incompatible element types.  This option should not be
1664 used for new code.
1665
1666 @item -funsigned-char
1667 @opindex funsigned-char
1668 Let the type @code{char} be unsigned, like @code{unsigned char}.
1669
1670 Each kind of machine has a default for what @code{char} should
1671 be.  It is either like @code{unsigned char} by default or like
1672 @code{signed char} by default.
1673
1674 Ideally, a portable program should always use @code{signed char} or
1675 @code{unsigned char} when it depends on the signedness of an object.
1676 But many programs have been written to use plain @code{char} and
1677 expect it to be signed, or expect it to be unsigned, depending on the
1678 machines they were written for.  This option, and its inverse, let you
1679 make such a program work with the opposite default.
1680
1681 The type @code{char} is always a distinct type from each of
1682 @code{signed char} or @code{unsigned char}, even though its behavior
1683 is always just like one of those two.
1684
1685 @item -fsigned-char
1686 @opindex fsigned-char
1687 Let the type @code{char} be signed, like @code{signed char}.
1688
1689 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1690 the negative form of @option{-funsigned-char}.  Likewise, the option
1691 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1692
1693 @item -fsigned-bitfields
1694 @itemx -funsigned-bitfields
1695 @itemx -fno-signed-bitfields
1696 @itemx -fno-unsigned-bitfields
1697 @opindex fsigned-bitfields
1698 @opindex funsigned-bitfields
1699 @opindex fno-signed-bitfields
1700 @opindex fno-unsigned-bitfields
1701 These options control whether a bit-field is signed or unsigned, when the
1702 declaration does not use either @code{signed} or @code{unsigned}.  By
1703 default, such a bit-field is signed, because this is consistent: the
1704 basic integer types such as @code{int} are signed types.
1705 @end table
1706
1707 @node C++ Dialect Options
1708 @section Options Controlling C++ Dialect
1709
1710 @cindex compiler options, C++
1711 @cindex C++ options, command line
1712 @cindex options, C++
1713 This section describes the command-line options that are only meaningful
1714 for C++ programs; but you can also use most of the GNU compiler options
1715 regardless of what language your program is in.  For example, you
1716 might compile a file @code{firstClass.C} like this:
1717
1718 @smallexample
1719 g++ -g -frepo -O -c firstClass.C
1720 @end smallexample
1721
1722 @noindent
1723 In this example, only @option{-frepo} is an option meant
1724 only for C++ programs; you can use the other options with any
1725 language supported by GCC@.
1726
1727 Here is a list of options that are @emph{only} for compiling C++ programs:
1728
1729 @table @gcctabopt
1730
1731 @item -fabi-version=@var{n}
1732 @opindex fabi-version
1733 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1734 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1735 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1736 the version that conforms most closely to the C++ ABI specification.
1737 Therefore, the ABI obtained using version 0 will change as ABI bugs
1738 are fixed.
1739
1740 The default is version 2.
1741
1742 @item -fno-access-control
1743 @opindex fno-access-control
1744 Turn off all access checking.  This switch is mainly useful for working
1745 around bugs in the access control code.
1746
1747 @item -fcheck-new
1748 @opindex fcheck-new
1749 Check that the pointer returned by @code{operator new} is non-null
1750 before attempting to modify the storage allocated.  This check is
1751 normally unnecessary because the C++ standard specifies that
1752 @code{operator new} will only return @code{0} if it is declared
1753 @samp{throw()}, in which case the compiler will always check the
1754 return value even without this option.  In all other cases, when
1755 @code{operator new} has a non-empty exception specification, memory
1756 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1757 @samp{new (nothrow)}.
1758
1759 @item -fconserve-space
1760 @opindex fconserve-space
1761 Put uninitialized or runtime-initialized global variables into the
1762 common segment, as C does.  This saves space in the executable at the
1763 cost of not diagnosing duplicate definitions.  If you compile with this
1764 flag and your program mysteriously crashes after @code{main()} has
1765 completed, you may have an object that is being destroyed twice because
1766 two definitions were merged.
1767
1768 This option is no longer useful on most targets, now that support has
1769 been added for putting variables into BSS without making them common.
1770
1771 @item -ffriend-injection
1772 @opindex ffriend-injection
1773 Inject friend functions into the enclosing namespace, so that they are
1774 visible outside the scope of the class in which they are declared.
1775 Friend functions were documented to work this way in the old Annotated
1776 C++ Reference Manual, and versions of G++ before 4.1 always worked
1777 that way.  However, in ISO C++ a friend function which is not declared
1778 in an enclosing scope can only be found using argument dependent
1779 lookup.  This option causes friends to be injected as they were in
1780 earlier releases.
1781
1782 This option is for compatibility, and may be removed in a future
1783 release of G++.
1784
1785 @item -fno-elide-constructors
1786 @opindex fno-elide-constructors
1787 The C++ standard allows an implementation to omit creating a temporary
1788 which is only used to initialize another object of the same type.
1789 Specifying this option disables that optimization, and forces G++ to
1790 call the copy constructor in all cases.
1791
1792 @item -fno-enforce-eh-specs
1793 @opindex fno-enforce-eh-specs
1794 Don't generate code to check for violation of exception specifications
1795 at runtime.  This option violates the C++ standard, but may be useful
1796 for reducing code size in production builds, much like defining
1797 @samp{NDEBUG}.  This does not give user code permission to throw
1798 exceptions in violation of the exception specifications; the compiler
1799 will still optimize based on the specifications, so throwing an
1800 unexpected exception will result in undefined behavior.
1801
1802 @item -ffor-scope
1803 @itemx -fno-for-scope
1804 @opindex ffor-scope
1805 @opindex fno-for-scope
1806 If @option{-ffor-scope} is specified, the scope of variables declared in
1807 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1808 as specified by the C++ standard.
1809 If @option{-fno-for-scope} is specified, the scope of variables declared in
1810 a @i{for-init-statement} extends to the end of the enclosing scope,
1811 as was the case in old versions of G++, and other (traditional)
1812 implementations of C++.
1813
1814 The default if neither flag is given to follow the standard,
1815 but to allow and give a warning for old-style code that would
1816 otherwise be invalid, or have different behavior.
1817
1818 @item -fno-gnu-keywords
1819 @opindex fno-gnu-keywords
1820 Do not recognize @code{typeof} as a keyword, so that code can use this
1821 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1822 @option{-ansi} implies @option{-fno-gnu-keywords}.
1823
1824 @item -fno-implicit-templates
1825 @opindex fno-implicit-templates
1826 Never emit code for non-inline templates which are instantiated
1827 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1828 @xref{Template Instantiation}, for more information.
1829
1830 @item -fno-implicit-inline-templates
1831 @opindex fno-implicit-inline-templates
1832 Don't emit code for implicit instantiations of inline templates, either.
1833 The default is to handle inlines differently so that compiles with and
1834 without optimization will need the same set of explicit instantiations.
1835
1836 @item -fno-implement-inlines
1837 @opindex fno-implement-inlines
1838 To save space, do not emit out-of-line copies of inline functions
1839 controlled by @samp{#pragma implementation}.  This will cause linker
1840 errors if these functions are not inlined everywhere they are called.
1841
1842 @item -fms-extensions
1843 @opindex fms-extensions
1844 Disable pedantic warnings about constructs used in MFC, such as implicit
1845 int and getting a pointer to member function via non-standard syntax.
1846
1847 @item -fno-nonansi-builtins
1848 @opindex fno-nonansi-builtins
1849 Disable built-in declarations of functions that are not mandated by
1850 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1851 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1852
1853 @item -fno-operator-names
1854 @opindex fno-operator-names
1855 Do not treat the operator name keywords @code{and}, @code{bitand},
1856 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1857 synonyms as keywords.
1858
1859 @item -fno-optional-diags
1860 @opindex fno-optional-diags
1861 Disable diagnostics that the standard says a compiler does not need to
1862 issue.  Currently, the only such diagnostic issued by G++ is the one for
1863 a name having multiple meanings within a class.
1864
1865 @item -fpermissive
1866 @opindex fpermissive
1867 Downgrade some diagnostics about nonconformant code from errors to
1868 warnings.  Thus, using @option{-fpermissive} will allow some
1869 nonconforming code to compile.
1870
1871 @item -fno-pretty-templates
1872 @opindex fno-pretty-templates
1873 When an error message refers to a specialization of a function
1874 template, the compiler will normally print the signature of the
1875 template followed by the template arguments and any typedefs or
1876 typenames in the signature (e.g. @code{void f(T) [with T = int]}
1877 rather than @code{void f(int)}) so that it's clear which template is
1878 involved.  When an error message refers to a specialization of a class
1879 template, the compiler will omit any template arguments which match
1880 the default template arguments for that template.  If either of these
1881 behaviors make it harder to understand the error message rather than
1882 easier, using @option{-fno-pretty-templates} will disable them.
1883
1884 @item -frepo
1885 @opindex frepo
1886 Enable automatic template instantiation at link time.  This option also
1887 implies @option{-fno-implicit-templates}.  @xref{Template
1888 Instantiation}, for more information.
1889
1890 @item -fno-rtti
1891 @opindex fno-rtti
1892 Disable generation of information about every class with virtual
1893 functions for use by the C++ runtime type identification features
1894 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1895 of the language, you can save some space by using this flag.  Note that
1896 exception handling uses the same information, but it will generate it as
1897 needed. The @samp{dynamic_cast} operator can still be used for casts that
1898 do not require runtime type information, i.e.@: casts to @code{void *} or to
1899 unambiguous base classes.
1900
1901 @item -fstats
1902 @opindex fstats
1903 Emit statistics about front-end processing at the end of the compilation.
1904 This information is generally only useful to the G++ development team.
1905
1906 @item -ftemplate-depth-@var{n}
1907 @opindex ftemplate-depth
1908 Set the maximum instantiation depth for template classes to @var{n}.
1909 A limit on the template instantiation depth is needed to detect
1910 endless recursions during template class instantiation.  ANSI/ISO C++
1911 conforming programs must not rely on a maximum depth greater than 17.
1912
1913 @item -fno-threadsafe-statics
1914 @opindex fno-threadsafe-statics
1915 Do not emit the extra code to use the routines specified in the C++
1916 ABI for thread-safe initialization of local statics.  You can use this
1917 option to reduce code size slightly in code that doesn't need to be
1918 thread-safe.
1919
1920 @item -fuse-cxa-atexit
1921 @opindex fuse-cxa-atexit
1922 Register destructors for objects with static storage duration with the
1923 @code{__cxa_atexit} function rather than the @code{atexit} function.
1924 This option is required for fully standards-compliant handling of static
1925 destructors, but will only work if your C library supports
1926 @code{__cxa_atexit}.
1927
1928 @item -fno-use-cxa-get-exception-ptr
1929 @opindex fno-use-cxa-get-exception-ptr
1930 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1931 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1932 if the runtime routine is not available.
1933
1934 @item -fvisibility-inlines-hidden
1935 @opindex fvisibility-inlines-hidden
1936 This switch declares that the user does not attempt to compare
1937 pointers to inline methods where the addresses of the two functions
1938 were taken in different shared objects.
1939
1940 The effect of this is that GCC may, effectively, mark inline methods with
1941 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1942 appear in the export table of a DSO and do not require a PLT indirection
1943 when used within the DSO@.  Enabling this option can have a dramatic effect
1944 on load and link times of a DSO as it massively reduces the size of the
1945 dynamic export table when the library makes heavy use of templates.
1946
1947 The behavior of this switch is not quite the same as marking the
1948 methods as hidden directly, because it does not affect static variables
1949 local to the function or cause the compiler to deduce that
1950 the function is defined in only one shared object.
1951
1952 You may mark a method as having a visibility explicitly to negate the
1953 effect of the switch for that method.  For example, if you do want to
1954 compare pointers to a particular inline method, you might mark it as
1955 having default visibility.  Marking the enclosing class with explicit
1956 visibility will have no effect.
1957
1958 Explicitly instantiated inline methods are unaffected by this option
1959 as their linkage might otherwise cross a shared library boundary.
1960 @xref{Template Instantiation}.
1961
1962 @item -fvisibility-ms-compat
1963 @opindex fvisibility-ms-compat
1964 This flag attempts to use visibility settings to make GCC's C++
1965 linkage model compatible with that of Microsoft Visual Studio.
1966
1967 The flag makes these changes to GCC's linkage model:
1968
1969 @enumerate
1970 @item
1971 It sets the default visibility to @code{hidden}, like
1972 @option{-fvisibility=hidden}.
1973
1974 @item
1975 Types, but not their members, are not hidden by default.
1976
1977 @item
1978 The One Definition Rule is relaxed for types without explicit
1979 visibility specifications which are defined in more than one different
1980 shared object: those declarations are permitted if they would have
1981 been permitted when this option was not used.
1982 @end enumerate
1983
1984 In new code it is better to use @option{-fvisibility=hidden} and
1985 export those classes which are intended to be externally visible.
1986 Unfortunately it is possible for code to rely, perhaps accidentally,
1987 on the Visual Studio behavior.
1988
1989 Among the consequences of these changes are that static data members
1990 of the same type with the same name but defined in different shared
1991 objects will be different, so changing one will not change the other;
1992 and that pointers to function members defined in different shared
1993 objects may not compare equal.  When this flag is given, it is a
1994 violation of the ODR to define types with the same name differently.
1995
1996 @item -fno-weak
1997 @opindex fno-weak
1998 Do not use weak symbol support, even if it is provided by the linker.
1999 By default, G++ will use weak symbols if they are available.  This
2000 option exists only for testing, and should not be used by end-users;
2001 it will result in inferior code and has no benefits.  This option may
2002 be removed in a future release of G++.
2003
2004 @item -nostdinc++
2005 @opindex nostdinc++
2006 Do not search for header files in the standard directories specific to
2007 C++, but do still search the other standard directories.  (This option
2008 is used when building the C++ library.)
2009 @end table
2010
2011 In addition, these optimization, warning, and code generation options
2012 have meanings only for C++ programs:
2013
2014 @table @gcctabopt
2015 @item -fno-default-inline
2016 @opindex fno-default-inline
2017 Do not assume @samp{inline} for functions defined inside a class scope.
2018 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2019 functions will have linkage like inline functions; they just won't be
2020 inlined by default.
2021
2022 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2023 @opindex Wabi
2024 @opindex Wno-abi
2025 Warn when G++ generates code that is probably not compatible with the
2026 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2027 all such cases, there are probably some cases that are not warned about,
2028 even though G++ is generating incompatible code.  There may also be
2029 cases where warnings are emitted even though the code that is generated
2030 will be compatible.
2031
2032 You should rewrite your code to avoid these warnings if you are
2033 concerned about the fact that code generated by G++ may not be binary
2034 compatible with code generated by other compilers.
2035
2036 The known incompatibilities at this point include:
2037
2038 @itemize @bullet
2039
2040 @item
2041 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2042 pack data into the same byte as a base class.  For example:
2043
2044 @smallexample
2045 struct A @{ virtual void f(); int f1 : 1; @};
2046 struct B : public A @{ int f2 : 1; @};
2047 @end smallexample
2048
2049 @noindent
2050 In this case, G++ will place @code{B::f2} into the same byte
2051 as@code{A::f1}; other compilers will not.  You can avoid this problem
2052 by explicitly padding @code{A} so that its size is a multiple of the
2053 byte size on your platform; that will cause G++ and other compilers to
2054 layout @code{B} identically.
2055
2056 @item
2057 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2058 tail padding when laying out virtual bases.  For example:
2059
2060 @smallexample
2061 struct A @{ virtual void f(); char c1; @};
2062 struct B @{ B(); char c2; @};
2063 struct C : public A, public virtual B @{@};
2064 @end smallexample
2065
2066 @noindent
2067 In this case, G++ will not place @code{B} into the tail-padding for
2068 @code{A}; other compilers will.  You can avoid this problem by
2069 explicitly padding @code{A} so that its size is a multiple of its
2070 alignment (ignoring virtual base classes); that will cause G++ and other
2071 compilers to layout @code{C} identically.
2072
2073 @item
2074 Incorrect handling of bit-fields with declared widths greater than that
2075 of their underlying types, when the bit-fields appear in a union.  For
2076 example:
2077
2078 @smallexample
2079 union U @{ int i : 4096; @};
2080 @end smallexample
2081
2082 @noindent
2083 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2084 union too small by the number of bits in an @code{int}.
2085
2086 @item
2087 Empty classes can be placed at incorrect offsets.  For example:
2088
2089 @smallexample
2090 struct A @{@};
2091
2092 struct B @{
2093   A a;
2094   virtual void f ();
2095 @};
2096
2097 struct C : public B, public A @{@};
2098 @end smallexample
2099
2100 @noindent
2101 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2102 it should be placed at offset zero.  G++ mistakenly believes that the
2103 @code{A} data member of @code{B} is already at offset zero.
2104
2105 @item
2106 Names of template functions whose types involve @code{typename} or
2107 template template parameters can be mangled incorrectly.
2108
2109 @smallexample
2110 template <typename Q>
2111 void f(typename Q::X) @{@}
2112
2113 template <template <typename> class Q>
2114 void f(typename Q<int>::X) @{@}
2115 @end smallexample
2116
2117 @noindent
2118 Instantiations of these templates may be mangled incorrectly.
2119
2120 @end itemize
2121
2122 It also warns psABI related changes.  The known psABI changes at this
2123 point include:
2124
2125 @itemize @bullet
2126
2127 @item
2128 For SYSV/x86-64, when passing union with long double, it is changed to
2129 pass in memory as specified in psABI.  For example:
2130
2131 @smallexample
2132 union U @{
2133   long double ld;
2134   int i;
2135 @};
2136 @end smallexample
2137
2138 @noindent
2139 @code{union U} will always be passed in memory.
2140
2141 @end itemize
2142
2143 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2144 @opindex Wctor-dtor-privacy
2145 @opindex Wno-ctor-dtor-privacy
2146 Warn when a class seems unusable because all the constructors or
2147 destructors in that class are private, and it has neither friends nor
2148 public static member functions.
2149
2150 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2151 @opindex Wnon-virtual-dtor
2152 @opindex Wno-non-virtual-dtor
2153 Warn when a class has virtual functions and accessible non-virtual
2154 destructor, in which case it would be possible but unsafe to delete
2155 an instance of a derived class through a pointer to the base class.
2156 This warning is also enabled if -Weffc++ is specified.
2157
2158 @item -Wreorder @r{(C++ and Objective-C++ only)}
2159 @opindex Wreorder
2160 @opindex Wno-reorder
2161 @cindex reordering, warning
2162 @cindex warning for reordering of member initializers
2163 Warn when the order of member initializers given in the code does not
2164 match the order in which they must be executed.  For instance:
2165
2166 @smallexample
2167 struct A @{
2168   int i;
2169   int j;
2170   A(): j (0), i (1) @{ @}
2171 @};
2172 @end smallexample
2173
2174 The compiler will rearrange the member initializers for @samp{i}
2175 and @samp{j} to match the declaration order of the members, emitting
2176 a warning to that effect.  This warning is enabled by @option{-Wall}.
2177 @end table
2178
2179 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2180
2181 @table @gcctabopt
2182 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2183 @opindex Weffc++
2184 @opindex Wno-effc++
2185 Warn about violations of the following style guidelines from Scott Meyers'
2186 @cite{Effective C++} book:
2187
2188 @itemize @bullet
2189 @item
2190 Item 11:  Define a copy constructor and an assignment operator for classes
2191 with dynamically allocated memory.
2192
2193 @item
2194 Item 12:  Prefer initialization to assignment in constructors.
2195
2196 @item
2197 Item 14:  Make destructors virtual in base classes.
2198
2199 @item
2200 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2201
2202 @item
2203 Item 23:  Don't try to return a reference when you must return an object.
2204
2205 @end itemize
2206
2207 Also warn about violations of the following style guidelines from
2208 Scott Meyers' @cite{More Effective C++} book:
2209
2210 @itemize @bullet
2211 @item
2212 Item 6:  Distinguish between prefix and postfix forms of increment and
2213 decrement operators.
2214
2215 @item
2216 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2217
2218 @end itemize
2219
2220 When selecting this option, be aware that the standard library
2221 headers do not obey all of these guidelines; use @samp{grep -v}
2222 to filter out those warnings.
2223
2224 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2225 @opindex Wstrict-null-sentinel
2226 @opindex Wno-strict-null-sentinel
2227 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2228 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2229 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2230 it is guaranteed to be of the same size as a pointer.  But this use is
2231 not portable across different compilers.
2232
2233 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2234 @opindex Wno-non-template-friend
2235 @opindex Wnon-template-friend
2236 Disable warnings when non-templatized friend functions are declared
2237 within a template.  Since the advent of explicit template specification
2238 support in G++, if the name of the friend is an unqualified-id (i.e.,
2239 @samp{friend foo(int)}), the C++ language specification demands that the
2240 friend declare or define an ordinary, nontemplate function.  (Section
2241 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2242 could be interpreted as a particular specialization of a templatized
2243 function.  Because this non-conforming behavior is no longer the default
2244 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2245 check existing code for potential trouble spots and is on by default.
2246 This new compiler behavior can be turned off with
2247 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2248 but disables the helpful warning.
2249
2250 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2251 @opindex Wold-style-cast
2252 @opindex Wno-old-style-cast
2253 Warn if an old-style (C-style) cast to a non-void type is used within
2254 a C++ program.  The new-style casts (@samp{dynamic_cast},
2255 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2256 less vulnerable to unintended effects and much easier to search for.
2257
2258 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2259 @opindex Woverloaded-virtual
2260 @opindex Wno-overloaded-virtual
2261 @cindex overloaded virtual fn, warning
2262 @cindex warning for overloaded virtual fn
2263 Warn when a function declaration hides virtual functions from a
2264 base class.  For example, in:
2265
2266 @smallexample
2267 struct A @{
2268   virtual void f();
2269 @};
2270
2271 struct B: public A @{
2272   void f(int);
2273 @};
2274 @end smallexample
2275
2276 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2277 like:
2278
2279 @smallexample
2280 B* b;
2281 b->f();
2282 @end smallexample
2283
2284 will fail to compile.
2285
2286 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2287 @opindex Wno-pmf-conversions
2288 @opindex Wpmf-conversions
2289 Disable the diagnostic for converting a bound pointer to member function
2290 to a plain pointer.
2291
2292 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2293 @opindex Wsign-promo
2294 @opindex Wno-sign-promo
2295 Warn when overload resolution chooses a promotion from unsigned or
2296 enumerated type to a signed type, over a conversion to an unsigned type of
2297 the same size.  Previous versions of G++ would try to preserve
2298 unsignedness, but the standard mandates the current behavior.
2299
2300 @smallexample
2301 struct A @{
2302   operator int ();
2303   A& operator = (int);
2304 @};
2305
2306 main ()
2307 @{
2308   A a,b;
2309   a = b;
2310 @}
2311 @end smallexample
2312
2313 In this example, G++ will synthesize a default @samp{A& operator =
2314 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2315 @end table
2316
2317 @node Objective-C and Objective-C++ Dialect Options
2318 @section Options Controlling Objective-C and Objective-C++ Dialects
2319
2320 @cindex compiler options, Objective-C and Objective-C++
2321 @cindex Objective-C and Objective-C++ options, command line
2322 @cindex options, Objective-C and Objective-C++
2323 (NOTE: This manual does not describe the Objective-C and Objective-C++
2324 languages themselves.  See @xref{Standards,,Language Standards
2325 Supported by GCC}, for references.)
2326
2327 This section describes the command-line options that are only meaningful
2328 for Objective-C and Objective-C++ programs, but you can also use most of
2329 the language-independent GNU compiler options.
2330 For example, you might compile a file @code{some_class.m} like this:
2331
2332 @smallexample
2333 gcc -g -fgnu-runtime -O -c some_class.m
2334 @end smallexample
2335
2336 @noindent
2337 In this example, @option{-fgnu-runtime} is an option meant only for
2338 Objective-C and Objective-C++ programs; you can use the other options with
2339 any language supported by GCC@.
2340
2341 Note that since Objective-C is an extension of the C language, Objective-C
2342 compilations may also use options specific to the C front-end (e.g.,
2343 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2344 C++-specific options (e.g., @option{-Wabi}).
2345
2346 Here is a list of options that are @emph{only} for compiling Objective-C
2347 and Objective-C++ programs:
2348
2349 @table @gcctabopt
2350 @item -fconstant-string-class=@var{class-name}
2351 @opindex fconstant-string-class
2352 Use @var{class-name} as the name of the class to instantiate for each
2353 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2354 class name is @code{NXConstantString} if the GNU runtime is being used, and
2355 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2356 @option{-fconstant-cfstrings} option, if also present, will override the
2357 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2358 to be laid out as constant CoreFoundation strings.
2359
2360 @item -fgnu-runtime
2361 @opindex fgnu-runtime
2362 Generate object code compatible with the standard GNU Objective-C
2363 runtime.  This is the default for most types of systems.
2364
2365 @item -fnext-runtime
2366 @opindex fnext-runtime
2367 Generate output compatible with the NeXT runtime.  This is the default
2368 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2369 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2370 used.
2371
2372 @item -fno-nil-receivers
2373 @opindex fno-nil-receivers
2374 Assume that all Objective-C message dispatches (e.g.,
2375 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2376 is not @code{nil}.  This allows for more efficient entry points in the runtime
2377 to be used.  Currently, this option is only available in conjunction with
2378 the NeXT runtime on Mac OS X 10.3 and later.
2379
2380 @item -fobjc-call-cxx-cdtors
2381 @opindex fobjc-call-cxx-cdtors
2382 For each Objective-C class, check if any of its instance variables is a
2383 C++ object with a non-trivial default constructor.  If so, synthesize a
2384 special @code{- (id) .cxx_construct} instance method that will run
2385 non-trivial default constructors on any such instance variables, in order,
2386 and then return @code{self}.  Similarly, check if any instance variable
2387 is a C++ object with a non-trivial destructor, and if so, synthesize a
2388 special @code{- (void) .cxx_destruct} method that will run
2389 all such default destructors, in reverse order.
2390
2391 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2392 thusly generated will only operate on instance variables declared in the
2393 current Objective-C class, and not those inherited from superclasses.  It
2394 is the responsibility of the Objective-C runtime to invoke all such methods
2395 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2396 will be invoked by the runtime immediately after a new object
2397 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2398 be invoked immediately before the runtime deallocates an object instance.
2399
2400 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2401 support for invoking the @code{- (id) .cxx_construct} and
2402 @code{- (void) .cxx_destruct} methods.
2403
2404 @item -fobjc-direct-dispatch
2405 @opindex fobjc-direct-dispatch
2406 Allow fast jumps to the message dispatcher.  On Darwin this is
2407 accomplished via the comm page.
2408
2409 @item -fobjc-exceptions
2410 @opindex fobjc-exceptions
2411 Enable syntactic support for structured exception handling in Objective-C,
2412 similar to what is offered by C++ and Java.  This option is
2413 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2414 earlier.
2415
2416 @smallexample
2417   @@try @{
2418     @dots{}
2419        @@throw expr;
2420     @dots{}
2421   @}
2422   @@catch (AnObjCClass *exc) @{
2423     @dots{}
2424       @@throw expr;
2425     @dots{}
2426       @@throw;
2427     @dots{}
2428   @}
2429   @@catch (AnotherClass *exc) @{
2430     @dots{}
2431   @}
2432   @@catch (id allOthers) @{
2433     @dots{}
2434   @}
2435   @@finally @{
2436     @dots{}
2437       @@throw expr;
2438     @dots{}
2439   @}
2440 @end smallexample
2441
2442 The @code{@@throw} statement may appear anywhere in an Objective-C or
2443 Objective-C++ program; when used inside of a @code{@@catch} block, the
2444 @code{@@throw} may appear without an argument (as shown above), in which case
2445 the object caught by the @code{@@catch} will be rethrown.
2446
2447 Note that only (pointers to) Objective-C objects may be thrown and
2448 caught using this scheme.  When an object is thrown, it will be caught
2449 by the nearest @code{@@catch} clause capable of handling objects of that type,
2450 analogously to how @code{catch} blocks work in C++ and Java.  A
2451 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2452 any and all Objective-C exceptions not caught by previous @code{@@catch}
2453 clauses (if any).
2454
2455 The @code{@@finally} clause, if present, will be executed upon exit from the
2456 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2457 regardless of whether any exceptions are thrown, caught or rethrown
2458 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2459 of the @code{finally} clause in Java.
2460
2461 There are several caveats to using the new exception mechanism:
2462
2463 @itemize @bullet
2464 @item
2465 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2466 idioms provided by the @code{NSException} class, the new
2467 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2468 systems, due to additional functionality needed in the (NeXT) Objective-C
2469 runtime.
2470
2471 @item
2472 As mentioned above, the new exceptions do not support handling
2473 types other than Objective-C objects.   Furthermore, when used from
2474 Objective-C++, the Objective-C exception model does not interoperate with C++
2475 exceptions at this time.  This means you cannot @code{@@throw} an exception
2476 from Objective-C and @code{catch} it in C++, or vice versa
2477 (i.e., @code{throw @dots{} @@catch}).
2478 @end itemize
2479
2480 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2481 blocks for thread-safe execution:
2482
2483 @smallexample
2484   @@synchronized (ObjCClass *guard) @{
2485     @dots{}
2486   @}
2487 @end smallexample
2488
2489 Upon entering the @code{@@synchronized} block, a thread of execution shall
2490 first check whether a lock has been placed on the corresponding @code{guard}
2491 object by another thread.  If it has, the current thread shall wait until
2492 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2493 the current thread will place its own lock on it, execute the code contained in
2494 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2495 making @code{guard} available to other threads).
2496
2497 Unlike Java, Objective-C does not allow for entire methods to be marked
2498 @code{@@synchronized}.  Note that throwing exceptions out of
2499 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2500 to be unlocked properly.
2501
2502 @item -fobjc-gc
2503 @opindex fobjc-gc
2504 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2505
2506 @item -freplace-objc-classes
2507 @opindex freplace-objc-classes
2508 Emit a special marker instructing @command{ld(1)} not to statically link in
2509 the resulting object file, and allow @command{dyld(1)} to load it in at
2510 run time instead.  This is used in conjunction with the Fix-and-Continue
2511 debugging mode, where the object file in question may be recompiled and
2512 dynamically reloaded in the course of program execution, without the need
2513 to restart the program itself.  Currently, Fix-and-Continue functionality
2514 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2515 and later.
2516
2517 @item -fzero-link
2518 @opindex fzero-link
2519 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2520 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2521 compile time) with static class references that get initialized at load time,
2522 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2523 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2524 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2525 for individual class implementations to be modified during program execution.
2526
2527 @item -gen-decls
2528 @opindex gen-decls
2529 Dump interface declarations for all classes seen in the source file to a
2530 file named @file{@var{sourcename}.decl}.
2531
2532 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2533 @opindex Wassign-intercept
2534 @opindex Wno-assign-intercept
2535 Warn whenever an Objective-C assignment is being intercepted by the
2536 garbage collector.
2537
2538 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2539 @opindex Wno-protocol
2540 @opindex Wprotocol
2541 If a class is declared to implement a protocol, a warning is issued for
2542 every method in the protocol that is not implemented by the class.  The
2543 default behavior is to issue a warning for every method not explicitly
2544 implemented in the class, even if a method implementation is inherited
2545 from the superclass.  If you use the @option{-Wno-protocol} option, then
2546 methods inherited from the superclass are considered to be implemented,
2547 and no warning is issued for them.
2548
2549 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2550 @opindex Wselector
2551 @opindex Wno-selector
2552 Warn if multiple methods of different types for the same selector are
2553 found during compilation.  The check is performed on the list of methods
2554 in the final stage of compilation.  Additionally, a check is performed
2555 for each selector appearing in a @code{@@selector(@dots{})}
2556 expression, and a corresponding method for that selector has been found
2557 during compilation.  Because these checks scan the method table only at
2558 the end of compilation, these warnings are not produced if the final
2559 stage of compilation is not reached, for example because an error is
2560 found during compilation, or because the @option{-fsyntax-only} option is
2561 being used.
2562
2563 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2564 @opindex Wstrict-selector-match
2565 @opindex Wno-strict-selector-match
2566 Warn if multiple methods with differing argument and/or return types are
2567 found for a given selector when attempting to send a message using this
2568 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2569 is off (which is the default behavior), the compiler will omit such warnings
2570 if any differences found are confined to types which share the same size
2571 and alignment.
2572
2573 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2574 @opindex Wundeclared-selector
2575 @opindex Wno-undeclared-selector
2576 Warn if a @code{@@selector(@dots{})} expression referring to an
2577 undeclared selector is found.  A selector is considered undeclared if no
2578 method with that name has been declared before the
2579 @code{@@selector(@dots{})} expression, either explicitly in an
2580 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2581 an @code{@@implementation} section.  This option always performs its
2582 checks as soon as a @code{@@selector(@dots{})} expression is found,
2583 while @option{-Wselector} only performs its checks in the final stage of
2584 compilation.  This also enforces the coding style convention
2585 that methods and selectors must be declared before being used.
2586
2587 @item -print-objc-runtime-info
2588 @opindex print-objc-runtime-info
2589 Generate C header describing the largest structure that is passed by
2590 value, if any.
2591
2592 @end table
2593
2594 @node Language Independent Options
2595 @section Options to Control Diagnostic Messages Formatting
2596 @cindex options to control diagnostics formatting
2597 @cindex diagnostic messages
2598 @cindex message formatting
2599
2600 Traditionally, diagnostic messages have been formatted irrespective of
2601 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2602 below can be used to control the diagnostic messages formatting
2603 algorithm, e.g.@: how many characters per line, how often source location
2604 information should be reported.  Right now, only the C++ front end can
2605 honor these options.  However it is expected, in the near future, that
2606 the remaining front ends would be able to digest them correctly.
2607
2608 @table @gcctabopt
2609 @item -fmessage-length=@var{n}
2610 @opindex fmessage-length
2611 Try to format error messages so that they fit on lines of about @var{n}
2612 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2613 the front ends supported by GCC@.  If @var{n} is zero, then no
2614 line-wrapping will be done; each error message will appear on a single
2615 line.
2616
2617 @opindex fdiagnostics-show-location
2618 @item -fdiagnostics-show-location=once
2619 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2620 reporter to emit @emph{once} source location information; that is, in
2621 case the message is too long to fit on a single physical line and has to
2622 be wrapped, the source location won't be emitted (as prefix) again,
2623 over and over, in subsequent continuation lines.  This is the default
2624 behavior.
2625
2626 @item -fdiagnostics-show-location=every-line
2627 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2628 messages reporter to emit the same source location information (as
2629 prefix) for physical lines that result from the process of breaking
2630 a message which is too long to fit on a single line.
2631
2632 @item -fdiagnostics-show-option
2633 @opindex fdiagnostics-show-option
2634 This option instructs the diagnostic machinery to add text to each
2635 diagnostic emitted, which indicates which command line option directly
2636 controls that diagnostic, when such an option is known to the
2637 diagnostic machinery.
2638
2639 @item -Wcoverage-mismatch
2640 @opindex Wcoverage-mismatch
2641 Warn if feedback profiles do not match when using the
2642 @option{-fprofile-use} option.
2643 If a source file was changed between @option{-fprofile-gen} and
2644 @option{-fprofile-use}, the files with the profile feedback can fail
2645 to match the source file and GCC can not use the profile feedback
2646 information.  By default, GCC emits an error message in this case.
2647 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2648 error.  GCC does not use appropriate feedback profiles, so using this
2649 option can result in poorly optimized code.  This option is useful
2650 only in the case of very minor changes such as bug fixes to an
2651 existing code-base.
2652
2653 @end table
2654
2655 @node Warning Options
2656 @section Options to Request or Suppress Warnings
2657 @cindex options to control warnings
2658 @cindex warning messages
2659 @cindex messages, warning
2660 @cindex suppressing warnings
2661
2662 Warnings are diagnostic messages that report constructions which
2663 are not inherently erroneous but which are risky or suggest there
2664 may have been an error.
2665
2666 The following language-independent options do not enable specific
2667 warnings but control the kinds of diagnostics produced by GCC.
2668
2669 @table @gcctabopt
2670 @cindex syntax checking
2671 @item -fsyntax-only
2672 @opindex fsyntax-only
2673 Check the code for syntax errors, but don't do anything beyond that.
2674
2675 @item -w
2676 @opindex w
2677 Inhibit all warning messages.
2678
2679 @item -Werror
2680 @opindex Werror
2681 @opindex Wno-error
2682 Make all warnings into errors.
2683
2684 @item -Werror=
2685 @opindex Werror=
2686 @opindex Wno-error=
2687 Make the specified warning into an error.  The specifier for a warning
2688 is appended, for example @option{-Werror=switch} turns the warnings
2689 controlled by @option{-Wswitch} into errors.  This switch takes a
2690 negative form, to be used to negate @option{-Werror} for specific
2691 warnings, for example @option{-Wno-error=switch} makes
2692 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2693 is in effect.  You can use the @option{-fdiagnostics-show-option}
2694 option to have each controllable warning amended with the option which
2695 controls it, to determine what to use with this option.
2696
2697 Note that specifying @option{-Werror=}@var{foo} automatically implies
2698 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2699 imply anything.
2700
2701 @item -Wfatal-errors
2702 @opindex Wfatal-errors
2703 @opindex Wno-fatal-errors
2704 This option causes the compiler to abort compilation on the first error
2705 occurred rather than trying to keep going and printing further error
2706 messages.
2707
2708 @end table
2709
2710 You can request many specific warnings with options beginning
2711 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2712 implicit declarations.  Each of these specific warning options also
2713 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2714 example, @option{-Wno-implicit}.  This manual lists only one of the
2715 two forms, whichever is not the default.  For further,
2716 language-specific options also refer to @ref{C++ Dialect Options} and
2717 @ref{Objective-C and Objective-C++ Dialect Options}.
2718
2719 @table @gcctabopt
2720 @item -pedantic
2721 @opindex pedantic
2722 Issue all the warnings demanded by strict ISO C and ISO C++;
2723 reject all programs that use forbidden extensions, and some other
2724 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2725 version of the ISO C standard specified by any @option{-std} option used.
2726
2727 Valid ISO C and ISO C++ programs should compile properly with or without
2728 this option (though a rare few will require @option{-ansi} or a
2729 @option{-std} option specifying the required version of ISO C)@.  However,
2730 without this option, certain GNU extensions and traditional C and C++
2731 features are supported as well.  With this option, they are rejected.
2732
2733 @option{-pedantic} does not cause warning messages for use of the
2734 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2735 warnings are also disabled in the expression that follows
2736 @code{__extension__}.  However, only system header files should use
2737 these escape routes; application programs should avoid them.
2738 @xref{Alternate Keywords}.
2739
2740 Some users try to use @option{-pedantic} to check programs for strict ISO
2741 C conformance.  They soon find that it does not do quite what they want:
2742 it finds some non-ISO practices, but not all---only those for which
2743 ISO C @emph{requires} a diagnostic, and some others for which
2744 diagnostics have been added.
2745
2746 A feature to report any failure to conform to ISO C might be useful in
2747 some instances, but would require considerable additional work and would
2748 be quite different from @option{-pedantic}.  We don't have plans to
2749 support such a feature in the near future.
2750
2751 Where the standard specified with @option{-std} represents a GNU
2752 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2753 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2754 extended dialect is based.  Warnings from @option{-pedantic} are given
2755 where they are required by the base standard.  (It would not make sense
2756 for such warnings to be given only for features not in the specified GNU
2757 C dialect, since by definition the GNU dialects of C include all
2758 features the compiler supports with the given option, and there would be
2759 nothing to warn about.)
2760
2761 @item -pedantic-errors
2762 @opindex pedantic-errors
2763 Like @option{-pedantic}, except that errors are produced rather than
2764 warnings.
2765
2766 @item -Wall
2767 @opindex Wall
2768 @opindex Wno-all
2769 This enables all the warnings about constructions that some users
2770 consider questionable, and that are easy to avoid (or modify to
2771 prevent the warning), even in conjunction with macros.  This also
2772 enables some language-specific warnings described in @ref{C++ Dialect
2773 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2774
2775 @option{-Wall} turns on the following warning flags:
2776
2777 @gccoptlist{-Waddress   @gol
2778 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2779 -Wc++0x-compat  @gol
2780 -Wchar-subscripts  @gol
2781 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2782 -Wimplicit-int  @gol
2783 -Wimplicit-function-declaration  @gol
2784 -Wcomment  @gol
2785 -Wformat   @gol
2786 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2787 -Wmissing-braces  @gol
2788 -Wnonnull  @gol
2789 -Wparentheses  @gol
2790 -Wpointer-sign  @gol
2791 -Wreorder   @gol
2792 -Wreturn-type  @gol
2793 -Wsequence-point  @gol
2794 -Wsign-compare @r{(only in C++)}  @gol
2795 -Wstrict-aliasing  @gol
2796 -Wstrict-overflow=1  @gol
2797 -Wswitch  @gol
2798 -Wtrigraphs  @gol
2799 -Wuninitialized  @gol
2800 -Wunknown-pragmas  @gol
2801 -Wunused-function  @gol
2802 -Wunused-label     @gol
2803 -Wunused-value     @gol
2804 -Wunused-variable  @gol
2805 -Wvolatile-register-var @gol
2806 }
2807
2808 Note that some warning flags are not implied by @option{-Wall}.  Some of
2809 them warn about constructions that users generally do not consider
2810 questionable, but which occasionally you might wish to check for;
2811 others warn about constructions that are necessary or hard to avoid in
2812 some cases, and there is no simple way to modify the code to suppress
2813 the warning. Some of them are enabled by @option{-Wextra} but many of
2814 them must be enabled individually.
2815
2816 @item -Wextra
2817 @opindex W
2818 @opindex Wextra
2819 @opindex Wno-extra
2820 This enables some extra warning flags that are not enabled by
2821 @option{-Wall}. (This option used to be called @option{-W}.  The older
2822 name is still supported, but the newer name is more descriptive.)
2823
2824 @gccoptlist{-Wclobbered  @gol
2825 -Wempty-body  @gol
2826 -Wignored-qualifiers @gol
2827 -Wmissing-field-initializers  @gol
2828 -Wmissing-parameter-type @r{(C only)}  @gol
2829 -Wold-style-declaration @r{(C only)}  @gol
2830 -Woverride-init  @gol
2831 -Wsign-compare  @gol
2832 -Wtype-limits  @gol
2833 -Wuninitialized  @gol
2834 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2835 }
2836
2837 The option @option{-Wextra} also prints warning messages for the
2838 following cases:
2839
2840 @itemize @bullet
2841
2842 @item
2843 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2844 @samp{>}, or @samp{>=}.
2845
2846 @item
2847 (C++ only) An enumerator and a non-enumerator both appear in a
2848 conditional expression.
2849
2850 @item
2851 (C++ only) Ambiguous virtual bases.
2852
2853 @item
2854 (C++ only) Subscripting an array which has been declared @samp{register}.
2855
2856 @item
2857 (C++ only) Taking the address of a variable which has been declared
2858 @samp{register}.
2859
2860 @item
2861 (C++ only) A base class is not initialized in a derived class' copy
2862 constructor.
2863
2864 @end itemize
2865
2866 @item -Wchar-subscripts
2867 @opindex Wchar-subscripts
2868 @opindex Wno-char-subscripts
2869 Warn if an array subscript has type @code{char}.  This is a common cause
2870 of error, as programmers often forget that this type is signed on some
2871 machines.
2872 This warning is enabled by @option{-Wall}.
2873
2874 @item -Wcomment
2875 @opindex Wcomment
2876 @opindex Wno-comment
2877 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2878 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2879 This warning is enabled by @option{-Wall}.
2880
2881 @item -Wformat
2882 @opindex Wformat
2883 @opindex Wno-format
2884 @opindex ffreestanding
2885 @opindex fno-builtin
2886 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2887 the arguments supplied have types appropriate to the format string
2888 specified, and that the conversions specified in the format string make
2889 sense.  This includes standard functions, and others specified by format
2890 attributes (@pxref{Function Attributes}), in the @code{printf},
2891 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2892 not in the C standard) families (or other target-specific families).
2893 Which functions are checked without format attributes having been
2894 specified depends on the standard version selected, and such checks of
2895 functions without the attribute specified are disabled by
2896 @option{-ffreestanding} or @option{-fno-builtin}.
2897
2898 The formats are checked against the format features supported by GNU
2899 libc version 2.2.  These include all ISO C90 and C99 features, as well
2900 as features from the Single Unix Specification and some BSD and GNU
2901 extensions.  Other library implementations may not support all these
2902 features; GCC does not support warning about features that go beyond a
2903 particular library's limitations.  However, if @option{-pedantic} is used
2904 with @option{-Wformat}, warnings will be given about format features not
2905 in the selected standard version (but not for @code{strfmon} formats,
2906 since those are not in any version of the C standard).  @xref{C Dialect
2907 Options,,Options Controlling C Dialect}.
2908
2909 Since @option{-Wformat} also checks for null format arguments for
2910 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2911
2912 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2913 aspects of format checking, the options @option{-Wformat-y2k},
2914 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2915 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2916 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2917
2918 @item -Wformat-y2k
2919 @opindex Wformat-y2k
2920 @opindex Wno-format-y2k
2921 If @option{-Wformat} is specified, also warn about @code{strftime}
2922 formats which may yield only a two-digit year.
2923
2924 @item -Wno-format-contains-nul
2925 @opindex Wno-format-contains-nul
2926 @opindex Wformat-contains-nul
2927 If @option{-Wformat} is specified, do not warn about format strings that
2928 contain NUL bytes.
2929
2930 @item -Wno-format-extra-args
2931 @opindex Wno-format-extra-args
2932 @opindex Wformat-extra-args
2933 If @option{-Wformat} is specified, do not warn about excess arguments to a
2934 @code{printf} or @code{scanf} format function.  The C standard specifies
2935 that such arguments are ignored.
2936
2937 Where the unused arguments lie between used arguments that are
2938 specified with @samp{$} operand number specifications, normally
2939 warnings are still given, since the implementation could not know what
2940 type to pass to @code{va_arg} to skip the unused arguments.  However,
2941 in the case of @code{scanf} formats, this option will suppress the
2942 warning if the unused arguments are all pointers, since the Single
2943 Unix Specification says that such unused arguments are allowed.
2944
2945 @item -Wno-format-zero-length @r{(C and Objective-C only)}
2946 @opindex Wno-format-zero-length
2947 @opindex Wformat-zero-length
2948 If @option{-Wformat} is specified, do not warn about zero-length formats.
2949 The C standard specifies that zero-length formats are allowed.
2950
2951 @item -Wformat-nonliteral
2952 @opindex Wformat-nonliteral
2953 @opindex Wno-format-nonliteral
2954 If @option{-Wformat} is specified, also warn if the format string is not a
2955 string literal and so cannot be checked, unless the format function
2956 takes its format arguments as a @code{va_list}.
2957
2958 @item -Wformat-security
2959 @opindex Wformat-security
2960 @opindex Wno-format-security
2961 If @option{-Wformat} is specified, also warn about uses of format
2962 functions that represent possible security problems.  At present, this
2963 warns about calls to @code{printf} and @code{scanf} functions where the
2964 format string is not a string literal and there are no format arguments,
2965 as in @code{printf (foo);}.  This may be a security hole if the format
2966 string came from untrusted input and contains @samp{%n}.  (This is
2967 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2968 in future warnings may be added to @option{-Wformat-security} that are not
2969 included in @option{-Wformat-nonliteral}.)
2970
2971 @item -Wformat=2
2972 @opindex Wformat=2
2973 @opindex Wno-format=2
2974 Enable @option{-Wformat} plus format checks not included in
2975 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2976 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2977
2978 @item -Wnonnull @r{(C and Objective-C only)}
2979 @opindex Wnonnull
2980 @opindex Wno-nonnull
2981 Warn about passing a null pointer for arguments marked as
2982 requiring a non-null value by the @code{nonnull} function attribute.
2983
2984 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2985 can be disabled with the @option{-Wno-nonnull} option.
2986
2987 @item -Wjump-misses-init @r{(C, Objective-C only)}
2988 @opindex Wjump-misses-init
2989 @opindex Wno-jump-misses-init
2990 Warn if a @code{goto} statement or a @code{switch} statement jumps
2991 forward across the initialization of a variable, or jumps backward to a
2992 label after the variable has been initialized.  This only warns about
2993 variables which are initialized when they are declared.  This warning is
2994 only supported for C and Objective C; in C++ this sort of branch is an
2995 error in any case.
2996
2997 @option{-Wjump-misses-init} is included in @option{-Wall} and
2998 @option{-Wc++-compat}.  It can be disabled with the
2999 @option{-Wno-jump-misses-init} option.
3000
3001 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3002 @opindex Winit-self
3003 @opindex Wno-init-self
3004 Warn about uninitialized variables which are initialized with themselves.
3005 Note this option can only be used with the @option{-Wuninitialized} option.
3006
3007 For example, GCC will warn about @code{i} being uninitialized in the
3008 following snippet only when @option{-Winit-self} has been specified:
3009 @smallexample
3010 @group
3011 int f()
3012 @{
3013   int i = i;
3014   return i;
3015 @}
3016 @end group
3017 @end smallexample
3018
3019 @item -Wimplicit-int @r{(C and Objective-C only)}
3020 @opindex Wimplicit-int
3021 @opindex Wno-implicit-int
3022 Warn when a declaration does not specify a type.
3023 This warning is enabled by @option{-Wall}.
3024
3025 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3026 @opindex Wimplicit-function-declaration
3027 @opindex Wno-implicit-function-declaration
3028 Give a warning whenever a function is used before being declared. In
3029 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3030 enabled by default and it is made into an error by
3031 @option{-pedantic-errors}. This warning is also enabled by
3032 @option{-Wall}.
3033
3034 @item -Wimplicit
3035 @opindex Wimplicit
3036 @opindex Wno-implicit
3037 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3038 This warning is enabled by @option{-Wall}.
3039
3040 @item -Wignored-qualifiers @r{(C and C++ only)}
3041 @opindex Wignored-qualifiers
3042 @opindex Wno-ignored-qualifiers
3043 Warn if the return type of a function has a type qualifier
3044 such as @code{const}.  For ISO C such a type qualifier has no effect,
3045 since the value returned by a function is not an lvalue.
3046 For C++, the warning is only emitted for scalar types or @code{void}.
3047 ISO C prohibits qualified @code{void} return types on function
3048 definitions, so such return types always receive a warning
3049 even without this option.
3050
3051 This warning is also enabled by @option{-Wextra}.
3052
3053 @item -Wmain
3054 @opindex Wmain
3055 @opindex Wno-main
3056 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3057 a function with external linkage, returning int, taking either zero
3058 arguments, two, or three arguments of appropriate types.  This warning
3059 is enabled by default in C++ and is enabled by either @option{-Wall}
3060 or @option{-pedantic}.
3061
3062 @item -Wmissing-braces
3063 @opindex Wmissing-braces
3064 @opindex Wno-missing-braces
3065 Warn if an aggregate or union initializer is not fully bracketed.  In
3066 the following example, the initializer for @samp{a} is not fully
3067 bracketed, but that for @samp{b} is fully bracketed.
3068
3069 @smallexample
3070 int a[2][2] = @{ 0, 1, 2, 3 @};
3071 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3072 @end smallexample
3073
3074 This warning is enabled by @option{-Wall}.
3075
3076 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3077 @opindex Wmissing-include-dirs
3078 @opindex Wno-missing-include-dirs
3079 Warn if a user-supplied include directory does not exist.
3080
3081 @item -Wparentheses
3082 @opindex Wparentheses
3083 @opindex Wno-parentheses
3084 Warn if parentheses are omitted in certain contexts, such
3085 as when there is an assignment in a context where a truth value
3086 is expected, or when operators are nested whose precedence people
3087 often get confused about.
3088
3089 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3090 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3091 interpretation from that of ordinary mathematical notation.
3092
3093 Also warn about constructions where there may be confusion to which
3094 @code{if} statement an @code{else} branch belongs.  Here is an example of
3095 such a case:
3096
3097 @smallexample
3098 @group
3099 @{
3100   if (a)
3101     if (b)
3102       foo ();
3103   else
3104     bar ();
3105 @}
3106 @end group
3107 @end smallexample
3108
3109 In C/C++, every @code{else} branch belongs to the innermost possible
3110 @code{if} statement, which in this example is @code{if (b)}.  This is
3111 often not what the programmer expected, as illustrated in the above
3112 example by indentation the programmer chose.  When there is the
3113 potential for this confusion, GCC will issue a warning when this flag
3114 is specified.  To eliminate the warning, add explicit braces around
3115 the innermost @code{if} statement so there is no way the @code{else}
3116 could belong to the enclosing @code{if}.  The resulting code would
3117 look like this:
3118
3119 @smallexample
3120 @group
3121 @{
3122   if (a)
3123     @{
3124       if (b)
3125         foo ();
3126       else
3127         bar ();
3128     @}
3129 @}
3130 @end group
3131 @end smallexample
3132
3133 This warning is enabled by @option{-Wall}.
3134
3135 @item -Wsequence-point
3136 @opindex Wsequence-point
3137 @opindex Wno-sequence-point
3138 Warn about code that may have undefined semantics because of violations
3139 of sequence point rules in the C and C++ standards.
3140
3141 The C and C++ standards defines the order in which expressions in a C/C++
3142 program are evaluated in terms of @dfn{sequence points}, which represent
3143 a partial ordering between the execution of parts of the program: those
3144 executed before the sequence point, and those executed after it.  These
3145 occur after the evaluation of a full expression (one which is not part
3146 of a larger expression), after the evaluation of the first operand of a
3147 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3148 function is called (but after the evaluation of its arguments and the
3149 expression denoting the called function), and in certain other places.
3150 Other than as expressed by the sequence point rules, the order of
3151 evaluation of subexpressions of an expression is not specified.  All
3152 these rules describe only a partial order rather than a total order,
3153 since, for example, if two functions are called within one expression
3154 with no sequence point between them, the order in which the functions
3155 are called is not specified.  However, the standards committee have
3156 ruled that function calls do not overlap.
3157
3158 It is not specified when between sequence points modifications to the
3159 values of objects take effect.  Programs whose behavior depends on this
3160 have undefined behavior; the C and C++ standards specify that ``Between
3161 the previous and next sequence point an object shall have its stored
3162 value modified at most once by the evaluation of an expression.
3163 Furthermore, the prior value shall be read only to determine the value
3164 to be stored.''.  If a program breaks these rules, the results on any
3165 particular implementation are entirely unpredictable.
3166
3167 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3168 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3169 diagnosed by this option, and it may give an occasional false positive
3170 result, but in general it has been found fairly effective at detecting
3171 this sort of problem in programs.
3172
3173 The standard is worded confusingly, therefore there is some debate
3174 over the precise meaning of the sequence point rules in subtle cases.
3175 Links to discussions of the problem, including proposed formal
3176 definitions, may be found on the GCC readings page, at
3177 @w{@uref{http://gcc.gnu.org/readings.html}}.
3178
3179 This warning is enabled by @option{-Wall} for C and C++.
3180
3181 @item -Wreturn-type
3182 @opindex Wreturn-type
3183 @opindex Wno-return-type
3184 Warn whenever a function is defined with a return-type that defaults
3185 to @code{int}.  Also warn about any @code{return} statement with no
3186 return-value in a function whose return-type is not @code{void}
3187 (falling off the end of the function body is considered returning
3188 without a value), and about a @code{return} statement with an
3189 expression in a function whose return-type is @code{void}.
3190
3191 For C++, a function without return type always produces a diagnostic
3192 message, even when @option{-Wno-return-type} is specified.  The only
3193 exceptions are @samp{main} and functions defined in system headers.
3194
3195 This warning is enabled by @option{-Wall}.
3196
3197 @item -Wswitch
3198 @opindex Wswitch
3199 @opindex Wno-switch
3200 Warn whenever a @code{switch} statement has an index of enumerated type
3201 and lacks a @code{case} for one or more of the named codes of that
3202 enumeration.  (The presence of a @code{default} label prevents this
3203 warning.)  @code{case} labels outside the enumeration range also
3204 provoke warnings when this option is used (even if there is a
3205 @code{default} label).
3206 This warning is enabled by @option{-Wall}.
3207
3208 @item -Wswitch-default
3209 @opindex Wswitch-default
3210 @opindex Wno-switch-default
3211 Warn whenever a @code{switch} statement does not have a @code{default}
3212 case.
3213
3214 @item -Wswitch-enum
3215 @opindex Wswitch-enum
3216 @opindex Wno-switch-enum
3217 Warn whenever a @code{switch} statement has an index of enumerated type
3218 and lacks a @code{case} for one or more of the named codes of that
3219 enumeration.  @code{case} labels outside the enumeration range also
3220 provoke warnings when this option is used.  The only difference
3221 between @option{-Wswitch} and this option is that this option gives a
3222 warning about an omitted enumeration code even if there is a
3223 @code{default} label.
3224
3225 @item -Wsync-nand @r{(C and C++ only)}
3226 @opindex Wsync-nand
3227 @opindex Wno-sync-nand
3228 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3229 built-in functions are used.  These functions changed semantics in GCC 4.4.
3230
3231 @item -Wtrigraphs
3232 @opindex Wtrigraphs
3233 @opindex Wno-trigraphs
3234 Warn if any trigraphs are encountered that might change the meaning of
3235 the program (trigraphs within comments are not warned about).
3236 This warning is enabled by @option{-Wall}.
3237
3238 @item -Wunused-function
3239 @opindex Wunused-function
3240 @opindex Wno-unused-function
3241 Warn whenever a static function is declared but not defined or a
3242 non-inline static function is unused.
3243 This warning is enabled by @option{-Wall}.
3244
3245 @item -Wunused-label
3246 @opindex Wunused-label
3247 @opindex Wno-unused-label
3248 Warn whenever a label is declared but not used.
3249 This warning is enabled by @option{-Wall}.
3250
3251 To suppress this warning use the @samp{unused} attribute
3252 (@pxref{Variable Attributes}).
3253
3254 @item -Wunused-parameter
3255 @opindex Wunused-parameter
3256 @opindex Wno-unused-parameter
3257 Warn whenever a function parameter is unused aside from its declaration.
3258
3259 To suppress this warning use the @samp{unused} attribute
3260 (@pxref{Variable Attributes}).
3261
3262 @item -Wno-unused-result
3263 @opindex Wunused-result
3264 @opindex Wno-unused-result
3265 Do not warn if a caller of a function marked with attribute
3266 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3267 its return value. The default is @option{-Wunused-result}.
3268
3269 @item -Wunused-variable
3270 @opindex Wunused-variable
3271 @opindex Wno-unused-variable
3272 Warn whenever a local variable or non-constant static variable is unused
3273 aside from its declaration.
3274 This warning is enabled by @option{-Wall}.
3275
3276 To suppress this warning use the @samp{unused} attribute
3277 (@pxref{Variable Attributes}).
3278
3279 @item -Wunused-value
3280 @opindex Wunused-value
3281 @opindex Wno-unused-value
3282 Warn whenever a statement computes a result that is explicitly not
3283 used. To suppress this warning cast the unused expression to
3284 @samp{void}. This includes an expression-statement or the left-hand
3285 side of a comma expression that contains no side effects. For example,
3286 an expression such as @samp{x[i,j]} will cause a warning, while
3287 @samp{x[(void)i,j]} will not.
3288
3289 This warning is enabled by @option{-Wall}.
3290
3291 @item -Wunused
3292 @opindex Wunused
3293 @opindex Wno-unused
3294 All the above @option{-Wunused} options combined.
3295
3296 In order to get a warning about an unused function parameter, you must
3297 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3298 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3299
3300 @item -Wuninitialized
3301 @opindex Wuninitialized
3302 @opindex Wno-uninitialized
3303 Warn if an automatic variable is used without first being initialized
3304 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3305 warn if a non-static reference or non-static @samp{const} member
3306 appears in a class without constructors.
3307
3308 If you want to warn about code which uses the uninitialized value of the
3309 variable in its own initializer, use the @option{-Winit-self} option.
3310
3311 These warnings occur for individual uninitialized or clobbered
3312 elements of structure, union or array variables as well as for
3313 variables which are uninitialized or clobbered as a whole.  They do
3314 not occur for variables or elements declared @code{volatile}.  Because
3315 these warnings depend on optimization, the exact variables or elements
3316 for which there are warnings will depend on the precise optimization
3317 options and version of GCC used.
3318
3319 Note that there may be no warning about a variable that is used only
3320 to compute a value that itself is never used, because such
3321 computations may be deleted by data flow analysis before the warnings
3322 are printed.
3323
3324 These warnings are made optional because GCC is not smart
3325 enough to see all the reasons why the code might be correct
3326 despite appearing to have an error.  Here is one example of how
3327 this can happen:
3328
3329 @smallexample
3330 @group
3331 @{
3332   int x;
3333   switch (y)
3334     @{
3335     case 1: x = 1;
3336       break;
3337     case 2: x = 4;
3338       break;
3339     case 3: x = 5;
3340     @}
3341   foo (x);
3342 @}
3343 @end group
3344 @end smallexample
3345
3346 @noindent
3347 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3348 always initialized, but GCC doesn't know this.  Here is
3349 another common case:
3350
3351 @smallexample
3352 @{
3353   int save_y;
3354   if (change_y) save_y = y, y = new_y;
3355   @dots{}
3356   if (change_y) y = save_y;
3357 @}
3358 @end smallexample
3359
3360 @noindent
3361 This has no bug because @code{save_y} is used only if it is set.
3362
3363 @cindex @code{longjmp} warnings
3364 This option also warns when a non-volatile automatic variable might be
3365 changed by a call to @code{longjmp}.  These warnings as well are possible
3366 only in optimizing compilation.
3367
3368 The compiler sees only the calls to @code{setjmp}.  It cannot know
3369 where @code{longjmp} will be called; in fact, a signal handler could
3370 call it at any point in the code.  As a result, you may get a warning
3371 even when there is in fact no problem because @code{longjmp} cannot
3372 in fact be called at the place which would cause a problem.
3373
3374 Some spurious warnings can be avoided if you declare all the functions
3375 you use that never return as @code{noreturn}.  @xref{Function
3376 Attributes}.
3377
3378 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3379
3380 @item -Wunknown-pragmas
3381 @opindex Wunknown-pragmas
3382 @opindex Wno-unknown-pragmas
3383 @cindex warning for unknown pragmas
3384 @cindex unknown pragmas, warning
3385 @cindex pragmas, warning of unknown
3386 Warn when a #pragma directive is encountered which is not understood by
3387 GCC@.  If this command line option is used, warnings will even be issued
3388 for unknown pragmas in system header files.  This is not the case if
3389 the warnings were only enabled by the @option{-Wall} command line option.
3390
3391 @item -Wno-pragmas
3392 @opindex Wno-pragmas
3393 @opindex Wpragmas
3394 Do not warn about misuses of pragmas, such as incorrect parameters,
3395 invalid syntax, or conflicts between pragmas.  See also
3396 @samp{-Wunknown-pragmas}.
3397
3398 @item -Wstrict-aliasing
3399 @opindex Wstrict-aliasing
3400 @opindex Wno-strict-aliasing
3401 This option is only active when @option{-fstrict-aliasing} is active.
3402 It warns about code which might break the strict aliasing rules that the
3403 compiler is using for optimization.  The warning does not catch all
3404 cases, but does attempt to catch the more common pitfalls.  It is
3405 included in @option{-Wall}.
3406 It is equivalent to @option{-Wstrict-aliasing=3}
3407
3408 @item -Wstrict-aliasing=n
3409 @opindex Wstrict-aliasing=n
3410 @opindex Wno-strict-aliasing=n
3411 This option is only active when @option{-fstrict-aliasing} is active.
3412 It warns about code which might break the strict aliasing rules that the
3413 compiler is using for optimization.
3414 Higher levels correspond to higher accuracy (fewer false positives).
3415 Higher levels also correspond to more effort, similar to the way -O works.
3416 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3417 with n=3.
3418
3419 Level 1: Most aggressive, quick, least accurate.
3420 Possibly useful when higher levels
3421 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3422 false negatives.  However, it has many false positives.
3423 Warns for all pointer conversions between possibly incompatible types,
3424 even if never dereferenced.  Runs in the frontend only.
3425
3426 Level 2: Aggressive, quick, not too precise.
3427 May still have many false positives (not as many as level 1 though),
3428 and few false negatives (but possibly more than level 1).
3429 Unlike level 1, it only warns when an address is taken.  Warns about
3430 incomplete types.  Runs in the frontend only.
3431
3432 Level 3 (default for @option{-Wstrict-aliasing}):
3433 Should have very few false positives and few false
3434 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3435 Takes care of the common punn+dereference pattern in the frontend:
3436 @code{*(int*)&some_float}.
3437 If optimization is enabled, it also runs in the backend, where it deals
3438 with multiple statement cases using flow-sensitive points-to information.
3439 Only warns when the converted pointer is dereferenced.
3440 Does not warn about incomplete types.
3441
3442 @item -Wstrict-overflow
3443 @itemx -Wstrict-overflow=@var{n}
3444 @opindex Wstrict-overflow
3445 @opindex Wno-strict-overflow
3446 This option is only active when @option{-fstrict-overflow} is active.
3447 It warns about cases where the compiler optimizes based on the
3448 assumption that signed overflow does not occur.  Note that it does not
3449 warn about all cases where the code might overflow: it only warns
3450 about cases where the compiler implements some optimization.  Thus
3451 this warning depends on the optimization level.
3452
3453 An optimization which assumes that signed overflow does not occur is
3454 perfectly safe if the values of the variables involved are such that
3455 overflow never does, in fact, occur.  Therefore this warning can
3456 easily give a false positive: a warning about code which is not
3457 actually a problem.  To help focus on important issues, several
3458 warning levels are defined.  No warnings are issued for the use of
3459 undefined signed overflow when estimating how many iterations a loop
3460 will require, in particular when determining whether a loop will be
3461 executed at all.
3462
3463 @table @gcctabopt
3464 @item -Wstrict-overflow=1
3465 Warn about cases which are both questionable and easy to avoid.  For
3466 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3467 compiler will simplify this to @code{1}.  This level of
3468 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3469 are not, and must be explicitly requested.
3470
3471 @item -Wstrict-overflow=2
3472 Also warn about other cases where a comparison is simplified to a
3473 constant.  For example: @code{abs (x) >= 0}.  This can only be
3474 simplified when @option{-fstrict-overflow} is in effect, because
3475 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3476 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3477 @option{-Wstrict-overflow=2}.
3478
3479 @item -Wstrict-overflow=3
3480 Also warn about other cases where a comparison is simplified.  For
3481 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3482
3483 @item -Wstrict-overflow=4
3484 Also warn about other simplifications not covered by the above cases.
3485 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3486
3487 @item -Wstrict-overflow=5
3488 Also warn about cases where the compiler reduces the magnitude of a
3489 constant involved in a comparison.  For example: @code{x + 2 > y} will
3490 be simplified to @code{x + 1 >= y}.  This is reported only at the
3491 highest warning level because this simplification applies to many
3492 comparisons, so this warning level will give a very large number of
3493 false positives.
3494 @end table
3495
3496 @item -Warray-bounds
3497 @opindex Wno-array-bounds
3498 @opindex Warray-bounds
3499 This option is only active when @option{-ftree-vrp} is active
3500 (default for -O2 and above). It warns about subscripts to arrays
3501 that are always out of bounds. This warning is enabled by @option{-Wall}.
3502
3503 @item -Wno-div-by-zero
3504 @opindex Wno-div-by-zero
3505 @opindex Wdiv-by-zero
3506 Do not warn about compile-time integer division by zero.  Floating point
3507 division by zero is not warned about, as it can be a legitimate way of
3508 obtaining infinities and NaNs.
3509
3510 @item -Wsystem-headers
3511 @opindex Wsystem-headers
3512 @opindex Wno-system-headers
3513 @cindex warnings from system headers
3514 @cindex system headers, warnings from
3515 Print warning messages for constructs found in system header files.
3516 Warnings from system headers are normally suppressed, on the assumption
3517 that they usually do not indicate real problems and would only make the
3518 compiler output harder to read.  Using this command line option tells
3519 GCC to emit warnings from system headers as if they occurred in user
3520 code.  However, note that using @option{-Wall} in conjunction with this
3521 option will @emph{not} warn about unknown pragmas in system
3522 headers---for that, @option{-Wunknown-pragmas} must also be used.
3523
3524 @item -Wfloat-equal
3525 @opindex Wfloat-equal
3526 @opindex Wno-float-equal
3527 Warn if floating point values are used in equality comparisons.
3528
3529 The idea behind this is that sometimes it is convenient (for the
3530 programmer) to consider floating-point values as approximations to
3531 infinitely precise real numbers.  If you are doing this, then you need
3532 to compute (by analyzing the code, or in some other way) the maximum or
3533 likely maximum error that the computation introduces, and allow for it
3534 when performing comparisons (and when producing output, but that's a
3535 different problem).  In particular, instead of testing for equality, you
3536 would check to see whether the two values have ranges that overlap; and
3537 this is done with the relational operators, so equality comparisons are
3538 probably mistaken.
3539
3540 @item -Wtraditional @r{(C and Objective-C only)}
3541 @opindex Wtraditional
3542 @opindex Wno-traditional
3543 Warn about certain constructs that behave differently in traditional and
3544 ISO C@.  Also warn about ISO C constructs that have no traditional C
3545 equivalent, and/or problematic constructs which should be avoided.
3546
3547 @itemize @bullet
3548 @item
3549 Macro parameters that appear within string literals in the macro body.
3550 In traditional C macro replacement takes place within string literals,
3551 but does not in ISO C@.
3552
3553 @item
3554 In traditional C, some preprocessor directives did not exist.
3555 Traditional preprocessors would only consider a line to be a directive
3556 if the @samp{#} appeared in column 1 on the line.  Therefore
3557 @option{-Wtraditional} warns about directives that traditional C
3558 understands but would ignore because the @samp{#} does not appear as the
3559 first character on the line.  It also suggests you hide directives like
3560 @samp{#pragma} not understood by traditional C by indenting them.  Some
3561 traditional implementations would not recognize @samp{#elif}, so it
3562 suggests avoiding it altogether.
3563
3564 @item
3565 A function-like macro that appears without arguments.
3566
3567 @item
3568 The unary plus operator.
3569
3570 @item
3571 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3572 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3573 constants.)  Note, these suffixes appear in macros defined in the system
3574 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3575 Use of these macros in user code might normally lead to spurious
3576 warnings, however GCC's integrated preprocessor has enough context to
3577 avoid warning in these cases.
3578
3579 @item
3580 A function declared external in one block and then used after the end of
3581 the block.
3582
3583 @item
3584 A @code{switch} statement has an operand of type @code{long}.
3585
3586 @item
3587 A non-@code{static} function declaration follows a @code{static} one.
3588 This construct is not accepted by some traditional C compilers.
3589
3590 @item
3591 The ISO type of an integer constant has a different width or
3592 signedness from its traditional type.  This warning is only issued if
3593 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3594 typically represent bit patterns, are not warned about.
3595
3596 @item
3597 Usage of ISO string concatenation is detected.
3598
3599 @item
3600 Initialization of automatic aggregates.
3601
3602 @item
3603 Identifier conflicts with labels.  Traditional C lacks a separate
3604 namespace for labels.
3605
3606 @item
3607 Initialization of unions.  If the initializer is zero, the warning is
3608 omitted.  This is done under the assumption that the zero initializer in
3609 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3610 initializer warnings and relies on default initialization to zero in the
3611 traditional C case.
3612
3613 @item
3614 Conversions by prototypes between fixed/floating point values and vice
3615 versa.  The absence of these prototypes when compiling with traditional
3616 C would cause serious problems.  This is a subset of the possible
3617 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3618
3619 @item
3620 Use of ISO C style function definitions.  This warning intentionally is
3621 @emph{not} issued for prototype declarations or variadic functions
3622 because these ISO C features will appear in your code when using
3623 libiberty's traditional C compatibility macros, @code{PARAMS} and
3624 @code{VPARAMS}.  This warning is also bypassed for nested functions
3625 because that feature is already a GCC extension and thus not relevant to
3626 traditional C compatibility.
3627 @end itemize
3628
3629 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3630 @opindex Wtraditional-conversion
3631 @opindex Wno-traditional-conversion
3632 Warn if a prototype causes a type conversion that is different from what
3633 would happen to the same argument in the absence of a prototype.  This
3634 includes conversions of fixed point to floating and vice versa, and
3635 conversions changing the width or signedness of a fixed point argument
3636 except when the same as the default promotion.
3637
3638 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3639 @opindex Wdeclaration-after-statement
3640 @opindex Wno-declaration-after-statement
3641 Warn when a declaration is found after a statement in a block.  This
3642 construct, known from C++, was introduced with ISO C99 and is by default
3643 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3644 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3645
3646 @item -Wundef
3647 @opindex Wundef
3648 @opindex Wno-undef
3649 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3650
3651 @item -Wno-endif-labels
3652 @opindex Wno-endif-labels
3653 @opindex Wendif-labels
3654 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3655
3656 @item -Wshadow
3657 @opindex Wshadow
3658 @opindex Wno-shadow
3659 Warn whenever a local variable shadows another local variable, parameter or
3660 global variable or whenever a built-in function is shadowed.
3661
3662 @item -Wlarger-than=@var{len}
3663 @opindex Wlarger-than=@var{len}
3664 @opindex Wlarger-than-@var{len}
3665 Warn whenever an object of larger than @var{len} bytes is defined.
3666
3667 @item -Wframe-larger-than=@var{len}
3668 @opindex Wframe-larger-than
3669 Warn if the size of a function frame is larger than @var{len} bytes.
3670 The computation done to determine the stack frame size is approximate
3671 and not conservative.
3672 The actual requirements may be somewhat greater than @var{len}
3673 even if you do not get a warning.  In addition, any space allocated
3674 via @code{alloca}, variable-length arrays, or related constructs
3675 is not included by the compiler when determining
3676 whether or not to issue a warning.
3677
3678 @item -Wunsafe-loop-optimizations
3679 @opindex Wunsafe-loop-optimizations
3680 @opindex Wno-unsafe-loop-optimizations
3681 Warn if the loop cannot be optimized because the compiler could not
3682 assume anything on the bounds of the loop indices.  With
3683 @option{-funsafe-loop-optimizations} warn if the compiler made
3684 such assumptions.
3685
3686 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3687 @opindex Wno-pedantic-ms-format
3688 @opindex Wpedantic-ms-format
3689 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3690 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3691 depending on the MS runtime, when you are using the options @option{-Wformat}
3692 and @option{-pedantic} without gnu-extensions.
3693
3694 @item -Wpointer-arith
3695 @opindex Wpointer-arith
3696 @opindex Wno-pointer-arith
3697 Warn about anything that depends on the ``size of'' a function type or
3698 of @code{void}.  GNU C assigns these types a size of 1, for
3699 convenience in calculations with @code{void *} pointers and pointers
3700 to functions.  In C++, warn also when an arithmetic operation involves
3701 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3702
3703 @item -Wtype-limits
3704 @opindex Wtype-limits
3705 @opindex Wno-type-limits
3706 Warn if a comparison is always true or always false due to the limited
3707 range of the data type, but do not warn for constant expressions.  For
3708 example, warn if an unsigned variable is compared against zero with
3709 @samp{<} or @samp{>=}.  This warning is also enabled by
3710 @option{-Wextra}.
3711
3712 @item -Wbad-function-cast @r{(C and Objective-C only)}
3713 @opindex Wbad-function-cast
3714 @opindex Wno-bad-function-cast
3715 Warn whenever a function call is cast to a non-matching type.
3716 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3717
3718 @item -Wc++-compat @r{(C and Objective-C only)}
3719 Warn about ISO C constructs that are outside of the common subset of
3720 ISO C and ISO C++, e.g.@: request for implicit conversion from
3721 @code{void *} to a pointer to non-@code{void} type.
3722
3723 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3724 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3725 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3726 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3727
3728 @item -Wcast-qual
3729 @opindex Wcast-qual
3730 @opindex Wno-cast-qual
3731 Warn whenever a pointer is cast so as to remove a type qualifier from
3732 the target type.  For example, warn if a @code{const char *} is cast
3733 to an ordinary @code{char *}.
3734
3735 Also warn when making a cast which introduces a type qualifier in an
3736 unsafe way.  For example, casting @code{char **} to @code{const char **}
3737 is unsafe, as in this example:
3738
3739 @smallexample
3740   /* p is char ** value.  */
3741   const char **q = (const char **) p;
3742   /* Assignment of readonly string to const char * is OK.  */
3743   *q = "string";
3744   /* Now char** pointer points to read-only memory.  */
3745   **p = 'b';
3746 @end smallexample
3747
3748 @item -Wcast-align
3749 @opindex Wcast-align
3750 @opindex Wno-cast-align
3751 Warn whenever a pointer is cast such that the required alignment of the
3752 target is increased.  For example, warn if a @code{char *} is cast to
3753 an @code{int *} on machines where integers can only be accessed at
3754 two- or four-byte boundaries.
3755
3756 @item -Wwrite-strings
3757 @opindex Wwrite-strings
3758 @opindex Wno-write-strings
3759 When compiling C, give string constants the type @code{const
3760 char[@var{length}]} so that copying the address of one into a
3761 non-@code{const} @code{char *} pointer will get a warning.  These
3762 warnings will help you find at compile time code that can try to write
3763 into a string constant, but only if you have been very careful about
3764 using @code{const} in declarations and prototypes.  Otherwise, it will
3765 just be a nuisance. This is why we did not make @option{-Wall} request
3766 these warnings.
3767
3768 When compiling C++, warn about the deprecated conversion from string
3769 literals to @code{char *}.  This warning is enabled by default for C++
3770 programs.
3771
3772 @item -Wclobbered
3773 @opindex Wclobbered
3774 @opindex Wno-clobbered
3775 Warn for variables that might be changed by @samp{longjmp} or
3776 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3777
3778 @item -Wconversion
3779 @opindex Wconversion
3780 @opindex Wno-conversion
3781 Warn for implicit conversions that may alter a value. This includes
3782 conversions between real and integer, like @code{abs (x)} when
3783 @code{x} is @code{double}; conversions between signed and unsigned,
3784 like @code{unsigned ui = -1}; and conversions to smaller types, like
3785 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3786 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3787 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3788 conversions between signed and unsigned integers can be disabled by
3789 using @option{-Wno-sign-conversion}.
3790
3791 For C++, also warn for conversions between @code{NULL} and non-pointer
3792 types; confusing overload resolution for user-defined conversions; and
3793 conversions that will never use a type conversion operator:
3794 conversions to @code{void}, the same type, a base class or a reference
3795 to them. Warnings about conversions between signed and unsigned
3796 integers are disabled by default in C++ unless
3797 @option{-Wsign-conversion} is explicitly enabled.
3798
3799 @item -Wempty-body
3800 @opindex Wempty-body
3801 @opindex Wno-empty-body
3802 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3803 while} statement.  This warning is also enabled by @option{-Wextra}.
3804
3805 @item -Wenum-compare
3806 @opindex Wenum-compare
3807 @opindex Wno-enum-compare
3808 Warn about a comparison between values of different enum types. In C++
3809 this warning is enabled by default.  In C this warning is enabled by
3810 @option{-Wall}.
3811
3812 @item -Wsign-compare
3813 @opindex Wsign-compare
3814 @opindex Wno-sign-compare
3815 @cindex warning for comparison of signed and unsigned values
3816 @cindex comparison of signed and unsigned values, warning
3817 @cindex signed and unsigned values, comparison warning
3818 Warn when a comparison between signed and unsigned values could produce
3819 an incorrect result when the signed value is converted to unsigned.
3820 This warning is also enabled by @option{-Wextra}; to get the other warnings
3821 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3822
3823 @item -Wsign-conversion
3824 @opindex Wsign-conversion
3825 @opindex Wno-sign-conversion
3826 Warn for implicit conversions that may change the sign of an integer
3827 value, like assigning a signed integer expression to an unsigned
3828 integer variable. An explicit cast silences the warning. In C, this
3829 option is enabled also by @option{-Wconversion}.
3830
3831 @item -Waddress
3832 @opindex Waddress
3833 @opindex Wno-address
3834 Warn about suspicious uses of memory addresses. These include using
3835 the address of a function in a conditional expression, such as
3836 @code{void func(void); if (func)}, and comparisons against the memory
3837 address of a string literal, such as @code{if (x == "abc")}.  Such
3838 uses typically indicate a programmer error: the address of a function
3839 always evaluates to true, so their use in a conditional usually
3840 indicate that the programmer forgot the parentheses in a function
3841 call; and comparisons against string literals result in unspecified
3842 behavior and are not portable in C, so they usually indicate that the
3843 programmer intended to use @code{strcmp}.  This warning is enabled by
3844 @option{-Wall}.
3845
3846 @item -Wlogical-op
3847 @opindex Wlogical-op
3848 @opindex Wno-logical-op
3849 Warn about suspicious uses of logical operators in expressions.
3850 This includes using logical operators in contexts where a
3851 bit-wise operator is likely to be expected.
3852
3853 @item -Waggregate-return
3854 @opindex Waggregate-return
3855 @opindex Wno-aggregate-return
3856 Warn if any functions that return structures or unions are defined or
3857 called.  (In languages where you can return an array, this also elicits
3858 a warning.)
3859
3860 @item -Wno-attributes
3861 @opindex Wno-attributes
3862 @opindex Wattributes
3863 Do not warn if an unexpected @code{__attribute__} is used, such as
3864 unrecognized attributes, function attributes applied to variables,
3865 etc.  This will not stop errors for incorrect use of supported
3866 attributes.
3867
3868 @item -Wno-builtin-macro-redefined
3869 @opindex Wno-builtin-macro-redefined
3870 @opindex Wbuiltin-macro-redefined
3871 Do not warn if certain built-in macros are redefined.  This suppresses
3872 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
3873 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
3874
3875 @item -Wstrict-prototypes @r{(C and Objective-C only)}
3876 @opindex Wstrict-prototypes
3877 @opindex Wno-strict-prototypes
3878 Warn if a function is declared or defined without specifying the
3879 argument types.  (An old-style function definition is permitted without
3880 a warning if preceded by a declaration which specifies the argument
3881 types.)
3882
3883 @item -Wold-style-declaration @r{(C and Objective-C only)}
3884 @opindex Wold-style-declaration
3885 @opindex Wno-old-style-declaration
3886 Warn for obsolescent usages, according to the C Standard, in a
3887 declaration. For example, warn if storage-class specifiers like
3888 @code{static} are not the first things in a declaration.  This warning
3889 is also enabled by @option{-Wextra}.
3890
3891 @item -Wold-style-definition @r{(C and Objective-C only)}
3892 @opindex Wold-style-definition
3893 @opindex Wno-old-style-definition
3894 Warn if an old-style function definition is used.  A warning is given
3895 even if there is a previous prototype.
3896
3897 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
3898 @opindex Wmissing-parameter-type
3899 @opindex Wno-missing-parameter-type
3900 A function parameter is declared without a type specifier in K&R-style
3901 functions:
3902
3903 @smallexample
3904 void foo(bar) @{ @}
3905 @end smallexample
3906
3907 This warning is also enabled by @option{-Wextra}.
3908
3909 @item -Wmissing-prototypes @r{(C and Objective-C only)}
3910 @opindex Wmissing-prototypes
3911 @opindex Wno-missing-prototypes
3912 Warn if a global function is defined without a previous prototype
3913 declaration.  This warning is issued even if the definition itself
3914 provides a prototype.  The aim is to detect global functions that fail
3915 to be declared in header files.
3916
3917 @item -Wmissing-declarations
3918 @opindex Wmissing-declarations
3919 @opindex Wno-missing-declarations
3920 Warn if a global function is defined without a previous declaration.
3921 Do so even if the definition itself provides a prototype.
3922 Use this option to detect global functions that are not declared in
3923 header files.  In C++, no warnings are issued for function templates,
3924 or for inline functions, or for functions in anonymous namespaces.
3925
3926 @item -Wmissing-field-initializers
3927 @opindex Wmissing-field-initializers
3928 @opindex Wno-missing-field-initializers
3929 @opindex W
3930 @opindex Wextra
3931 @opindex Wno-extra
3932 Warn if a structure's initializer has some fields missing.  For
3933 example, the following code would cause such a warning, because
3934 @code{x.h} is implicitly zero:
3935
3936 @smallexample
3937 struct s @{ int f, g, h; @};
3938 struct s x = @{ 3, 4 @};
3939 @end smallexample
3940
3941 This option does not warn about designated initializers, so the following
3942 modification would not trigger a warning:
3943
3944 @smallexample
3945 struct s @{ int f, g, h; @};
3946 struct s x = @{ .f = 3, .g = 4 @};
3947 @end smallexample
3948
3949 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3950 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3951
3952 @item -Wmissing-noreturn
3953 @opindex Wmissing-noreturn
3954 @opindex Wno-missing-noreturn
3955 Warn about functions which might be candidates for attribute @code{noreturn}.
3956 Note these are only possible candidates, not absolute ones.  Care should
3957 be taken to manually verify functions actually do not ever return before
3958 adding the @code{noreturn} attribute, otherwise subtle code generation
3959 bugs could be introduced.  You will not get a warning for @code{main} in
3960 hosted C environments.
3961
3962 @item -Wmissing-format-attribute
3963 @opindex Wmissing-format-attribute
3964 @opindex Wno-missing-format-attribute
3965 @opindex Wformat
3966 @opindex Wno-format
3967 Warn about function pointers which might be candidates for @code{format}
3968 attributes.  Note these are only possible candidates, not absolute ones.
3969 GCC will guess that function pointers with @code{format} attributes that
3970 are used in assignment, initialization, parameter passing or return
3971 statements should have a corresponding @code{format} attribute in the
3972 resulting type.  I.e.@: the left-hand side of the assignment or
3973 initialization, the type of the parameter variable, or the return type
3974 of the containing function respectively should also have a @code{format}
3975 attribute to avoid the warning.
3976
3977 GCC will also warn about function definitions which might be
3978 candidates for @code{format} attributes.  Again, these are only
3979 possible candidates.  GCC will guess that @code{format} attributes
3980 might be appropriate for any function that calls a function like
3981 @code{vprintf} or @code{vscanf}, but this might not always be the
3982 case, and some functions for which @code{format} attributes are
3983 appropriate may not be detected.
3984
3985 @item -Wno-multichar
3986 @opindex Wno-multichar
3987 @opindex Wmultichar
3988 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3989 Usually they indicate a typo in the user's code, as they have
3990 implementation-defined values, and should not be used in portable code.
3991
3992 @item -Wnormalized=<none|id|nfc|nfkc>
3993 @opindex Wnormalized=
3994 @cindex NFC
3995 @cindex NFKC
3996 @cindex character set, input normalization
3997 In ISO C and ISO C++, two identifiers are different if they are
3998 different sequences of characters.  However, sometimes when characters
3999 outside the basic ASCII character set are used, you can have two
4000 different character sequences that look the same.  To avoid confusion,
4001 the ISO 10646 standard sets out some @dfn{normalization rules} which
4002 when applied ensure that two sequences that look the same are turned into
4003 the same sequence.  GCC can warn you if you are using identifiers which
4004 have not been normalized; this option controls that warning.
4005
4006 There are four levels of warning that GCC supports.  The default is
4007 @option{-Wnormalized=nfc}, which warns about any identifier which is
4008 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4009 recommended form for most uses.
4010
4011 Unfortunately, there are some characters which ISO C and ISO C++ allow
4012 in identifiers that when turned into NFC aren't allowable as
4013 identifiers.  That is, there's no way to use these symbols in portable
4014 ISO C or C++ and have all your identifiers in NFC@.
4015 @option{-Wnormalized=id} suppresses the warning for these characters.
4016 It is hoped that future versions of the standards involved will correct
4017 this, which is why this option is not the default.
4018
4019 You can switch the warning off for all characters by writing
4020 @option{-Wnormalized=none}.  You would only want to do this if you
4021 were using some other normalization scheme (like ``D''), because
4022 otherwise you can easily create bugs that are literally impossible to see.
4023
4024 Some characters in ISO 10646 have distinct meanings but look identical
4025 in some fonts or display methodologies, especially once formatting has
4026 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4027 LETTER N'', will display just like a regular @code{n} which has been
4028 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4029 normalization scheme to convert all these into a standard form as
4030 well, and GCC will warn if your code is not in NFKC if you use
4031 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4032 about every identifier that contains the letter O because it might be
4033 confused with the digit 0, and so is not the default, but may be
4034 useful as a local coding convention if the programming environment is
4035 unable to be fixed to display these characters distinctly.
4036
4037 @item -Wno-deprecated
4038 @opindex Wno-deprecated
4039 @opindex Wdeprecated
4040 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4041
4042 @item -Wno-deprecated-declarations
4043 @opindex Wno-deprecated-declarations
4044 @opindex Wdeprecated-declarations
4045 Do not warn about uses of functions (@pxref{Function Attributes}),
4046 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4047 Attributes}) marked as deprecated by using the @code{deprecated}
4048 attribute.
4049
4050 @item -Wno-overflow
4051 @opindex Wno-overflow
4052 @opindex Woverflow
4053 Do not warn about compile-time overflow in constant expressions.
4054
4055 @item -Woverride-init @r{(C and Objective-C only)}
4056 @opindex Woverride-init
4057 @opindex Wno-override-init
4058 @opindex W
4059 @opindex Wextra
4060 @opindex Wno-extra
4061 Warn if an initialized field without side effects is overridden when
4062 using designated initializers (@pxref{Designated Inits, , Designated
4063 Initializers}).
4064
4065 This warning is included in @option{-Wextra}.  To get other
4066 @option{-Wextra} warnings without this one, use @samp{-Wextra
4067 -Wno-override-init}.
4068
4069 @item -Wpacked
4070 @opindex Wpacked
4071 @opindex Wno-packed
4072 Warn if a structure is given the packed attribute, but the packed
4073 attribute has no effect on the layout or size of the structure.
4074 Such structures may be mis-aligned for little benefit.  For
4075 instance, in this code, the variable @code{f.x} in @code{struct bar}
4076 will be misaligned even though @code{struct bar} does not itself
4077 have the packed attribute:
4078
4079 @smallexample
4080 @group
4081 struct foo @{
4082   int x;
4083   char a, b, c, d;
4084 @} __attribute__((packed));
4085 struct bar @{
4086   char z;
4087   struct foo f;
4088 @};
4089 @end group
4090 @end smallexample
4091
4092 @item -Wpacked-bitfield-compat
4093 @opindex Wpacked-bitfield-compat
4094 @opindex Wno-packed-bitfield-compat
4095 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4096 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4097 the change can lead to differences in the structure layout.  GCC
4098 informs you when the offset of such a field has changed in GCC 4.4.
4099 For example there is no longer a 4-bit padding between field @code{a}
4100 and @code{b} in this structure:
4101
4102 @smallexample
4103 struct foo
4104 @{
4105   char a:4;
4106   char b:8;
4107 @} __attribute__ ((packed));
4108 @end smallexample
4109
4110 This warning is enabled by default.  Use
4111 @option{-Wno-packed-bitfield-compat} to disable this warning.
4112
4113 @item -Wpadded
4114 @opindex Wpadded
4115 @opindex Wno-padded
4116 Warn if padding is included in a structure, either to align an element
4117 of the structure or to align the whole structure.  Sometimes when this
4118 happens it is possible to rearrange the fields of the structure to
4119 reduce the padding and so make the structure smaller.
4120
4121 @item -Wredundant-decls
4122 @opindex Wredundant-decls
4123 @opindex Wno-redundant-decls
4124 Warn if anything is declared more than once in the same scope, even in
4125 cases where multiple declaration is valid and changes nothing.
4126
4127 @item -Wnested-externs @r{(C and Objective-C only)}
4128 @opindex Wnested-externs
4129 @opindex Wno-nested-externs
4130 Warn if an @code{extern} declaration is encountered within a function.
4131
4132 @item -Wunreachable-code
4133 @opindex Wunreachable-code
4134 @opindex Wno-unreachable-code
4135 Warn if the compiler detects that code will never be executed.
4136
4137 This option is intended to warn when the compiler detects that at
4138 least a whole line of source code will never be executed, because
4139 some condition is never satisfied or because it is after a
4140 procedure that never returns.
4141
4142 It is possible for this option to produce a warning even though there
4143 are circumstances under which part of the affected line can be executed,
4144 so care should be taken when removing apparently-unreachable code.
4145
4146 For instance, when a function is inlined, a warning may mean that the
4147 line is unreachable in only one inlined copy of the function.
4148
4149 This option is not made part of @option{-Wall} because in a debugging
4150 version of a program there is often substantial code which checks
4151 correct functioning of the program and is, hopefully, unreachable
4152 because the program does work.  Another common use of unreachable
4153 code is to provide behavior which is selectable at compile-time.
4154
4155 @item -Winline
4156 @opindex Winline
4157 @opindex Wno-inline
4158 Warn if a function can not be inlined and it was declared as inline.
4159 Even with this option, the compiler will not warn about failures to
4160 inline functions declared in system headers.
4161
4162 The compiler uses a variety of heuristics to determine whether or not
4163 to inline a function.  For example, the compiler takes into account
4164 the size of the function being inlined and the amount of inlining
4165 that has already been done in the current function.  Therefore,
4166 seemingly insignificant changes in the source program can cause the
4167 warnings produced by @option{-Winline} to appear or disappear.
4168
4169 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4170 @opindex Wno-invalid-offsetof
4171 @opindex Winvalid-offsetof
4172 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4173 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4174 to a non-POD type is undefined.  In existing C++ implementations,
4175 however, @samp{offsetof} typically gives meaningful results even when
4176 applied to certain kinds of non-POD types. (Such as a simple
4177 @samp{struct} that fails to be a POD type only by virtue of having a
4178 constructor.)  This flag is for users who are aware that they are
4179 writing nonportable code and who have deliberately chosen to ignore the
4180 warning about it.
4181
4182 The restrictions on @samp{offsetof} may be relaxed in a future version
4183 of the C++ standard.
4184
4185 @item -Wno-int-to-pointer-cast @r{(C and Objective-C only)}
4186 @opindex Wno-int-to-pointer-cast
4187 @opindex Wint-to-pointer-cast
4188 Suppress warnings from casts to pointer type of an integer of a
4189 different size.
4190
4191 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4192 @opindex Wno-pointer-to-int-cast
4193 @opindex Wpointer-to-int-cast
4194 Suppress warnings from casts from a pointer to an integer type of a
4195 different size.
4196
4197 @item -Winvalid-pch
4198 @opindex Winvalid-pch
4199 @opindex Wno-invalid-pch
4200 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4201 the search path but can't be used.
4202
4203 @item -Wlong-long
4204 @opindex Wlong-long
4205 @opindex Wno-long-long
4206 Warn if @samp{long long} type is used.  This is enabled by either
4207 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4208 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4209
4210 @item -Wvariadic-macros
4211 @opindex Wvariadic-macros
4212 @opindex Wno-variadic-macros
4213 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4214 alternate syntax when in pedantic ISO C99 mode.  This is default.
4215 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4216
4217 @item -Wvla
4218 @opindex Wvla
4219 @opindex Wno-vla
4220 Warn if variable length array is used in the code.
4221 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4222 the variable length array.
4223
4224 @item -Wvolatile-register-var
4225 @opindex Wvolatile-register-var
4226 @opindex Wno-volatile-register-var
4227 Warn if a register variable is declared volatile.  The volatile
4228 modifier does not inhibit all optimizations that may eliminate reads
4229 and/or writes to register variables.  This warning is enabled by
4230 @option{-Wall}.
4231
4232 @item -Wdisabled-optimization
4233 @opindex Wdisabled-optimization
4234 @opindex Wno-disabled-optimization
4235 Warn if a requested optimization pass is disabled.  This warning does
4236 not generally indicate that there is anything wrong with your code; it
4237 merely indicates that GCC's optimizers were unable to handle the code
4238 effectively.  Often, the problem is that your code is too big or too
4239 complex; GCC will refuse to optimize programs when the optimization
4240 itself is likely to take inordinate amounts of time.
4241
4242 @item -Wpointer-sign @r{(C and Objective-C only)}
4243 @opindex Wpointer-sign
4244 @opindex Wno-pointer-sign
4245 Warn for pointer argument passing or assignment with different signedness.
4246 This option is only supported for C and Objective-C@.  It is implied by
4247 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4248 @option{-Wno-pointer-sign}.
4249
4250 @item -Wstack-protector
4251 @opindex Wstack-protector
4252 @opindex Wno-stack-protector
4253 This option is only active when @option{-fstack-protector} is active.  It
4254 warns about functions that will not be protected against stack smashing.
4255
4256 @item -Wno-mudflap
4257 @opindex Wno-mudflap
4258 Suppress warnings about constructs that cannot be instrumented by
4259 @option{-fmudflap}.
4260
4261 @item -Woverlength-strings
4262 @opindex Woverlength-strings
4263 @opindex Wno-overlength-strings
4264 Warn about string constants which are longer than the ``minimum
4265 maximum'' length specified in the C standard.  Modern compilers
4266 generally allow string constants which are much longer than the
4267 standard's minimum limit, but very portable programs should avoid
4268 using longer strings.
4269
4270 The limit applies @emph{after} string constant concatenation, and does
4271 not count the trailing NUL@.  In C89, the limit was 509 characters; in
4272 C99, it was raised to 4095.  C++98 does not specify a normative
4273 minimum maximum, so we do not diagnose overlength strings in C++@.
4274
4275 This option is implied by @option{-pedantic}, and can be disabled with
4276 @option{-Wno-overlength-strings}.
4277
4278 @item -Wunsuffixed-float-constants
4279 @opindex Wunsuffixed-float-constants
4280
4281 GCC will issue a warning for any floating constant that does not have
4282 a suffix.  When used together with @option{-Wsystem-headers} it will
4283 warn about such constants in system header files.  This can be useful
4284 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4285 from the decimal floating-point extension to C99.
4286 @end table
4287
4288 @node Debugging Options
4289 @section Options for Debugging Your Program or GCC
4290 @cindex options, debugging
4291 @cindex debugging information options
4292
4293 GCC has various special options that are used for debugging
4294 either your program or GCC:
4295
4296 @table @gcctabopt
4297 @item -g
4298 @opindex g
4299 Produce debugging information in the operating system's native format
4300 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4301 information.
4302
4303 On most systems that use stabs format, @option{-g} enables use of extra
4304 debugging information that only GDB can use; this extra information
4305 makes debugging work better in GDB but will probably make other debuggers
4306 crash or
4307 refuse to read the program.  If you want to control for certain whether
4308 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4309 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4310
4311 GCC allows you to use @option{-g} with
4312 @option{-O}.  The shortcuts taken by optimized code may occasionally
4313 produce surprising results: some variables you declared may not exist
4314 at all; flow of control may briefly move where you did not expect it;
4315 some statements may not be executed because they compute constant
4316 results or their values were already at hand; some statements may
4317 execute in different places because they were moved out of loops.
4318
4319 Nevertheless it proves possible to debug optimized output.  This makes
4320 it reasonable to use the optimizer for programs that might have bugs.
4321
4322 The following options are useful when GCC is generated with the
4323 capability for more than one debugging format.
4324
4325 @item -ggdb
4326 @opindex ggdb
4327 Produce debugging information for use by GDB@.  This means to use the
4328 most expressive format available (DWARF 2, stabs, or the native format
4329 if neither of those are supported), including GDB extensions if at all
4330 possible.
4331
4332 @item -gstabs
4333 @opindex gstabs
4334 Produce debugging information in stabs format (if that is supported),
4335 without GDB extensions.  This is the format used by DBX on most BSD
4336 systems.  On MIPS, Alpha and System V Release 4 systems this option
4337 produces stabs debugging output which is not understood by DBX or SDB@.
4338 On System V Release 4 systems this option requires the GNU assembler.
4339
4340 @item -feliminate-unused-debug-symbols
4341 @opindex feliminate-unused-debug-symbols
4342 Produce debugging information in stabs format (if that is supported),
4343 for only symbols that are actually used.
4344
4345 @item -femit-class-debug-always
4346 Instead of emitting debugging information for a C++ class in only one
4347 object file, emit it in all object files using the class.  This option
4348 should be used only with debuggers that are unable to handle the way GCC
4349 normally emits debugging information for classes because using this
4350 option will increase the size of debugging information by as much as a
4351 factor of two.
4352
4353 @item -gstabs+
4354 @opindex gstabs+
4355 Produce debugging information in stabs format (if that is supported),
4356 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4357 use of these extensions is likely to make other debuggers crash or
4358 refuse to read the program.
4359
4360 @item -gcoff
4361 @opindex gcoff
4362 Produce debugging information in COFF format (if that is supported).
4363 This is the format used by SDB on most System V systems prior to
4364 System V Release 4.
4365
4366 @item -gxcoff
4367 @opindex gxcoff
4368 Produce debugging information in XCOFF format (if that is supported).
4369 This is the format used by the DBX debugger on IBM RS/6000 systems.
4370
4371 @item -gxcoff+
4372 @opindex gxcoff+
4373 Produce debugging information in XCOFF format (if that is supported),
4374 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4375 use of these extensions is likely to make other debuggers crash or
4376 refuse to read the program, and may cause assemblers other than the GNU
4377 assembler (GAS) to fail with an error.
4378
4379 @item -gdwarf-@var{version}
4380 @opindex gdwarf-@var{version}
4381 Produce debugging information in DWARF format (if that is
4382 supported).  This is the format used by DBX on IRIX 6.  The value
4383 of @var{version} may be either 2 or 3; the default version is 2.
4384
4385 Note that with DWARF version 2 some ports require, and will always
4386 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4387
4388 @item -gvms
4389 @opindex gvms
4390 Produce debugging information in VMS debug format (if that is
4391 supported).  This is the format used by DEBUG on VMS systems.
4392
4393 @item -g@var{level}
4394 @itemx -ggdb@var{level}
4395 @itemx -gstabs@var{level}
4396 @itemx -gcoff@var{level}
4397 @itemx -gxcoff@var{level}
4398 @itemx -gvms@var{level}
4399 Request debugging information and also use @var{level} to specify how
4400 much information.  The default level is 2.
4401
4402 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4403 @option{-g}.
4404
4405 Level 1 produces minimal information, enough for making backtraces in
4406 parts of the program that you don't plan to debug.  This includes
4407 descriptions of functions and external variables, but no information
4408 about local variables and no line numbers.
4409
4410 Level 3 includes extra information, such as all the macro definitions
4411 present in the program.  Some debuggers support macro expansion when
4412 you use @option{-g3}.
4413
4414 @option{-gdwarf-2} does not accept a concatenated debug level, because
4415 GCC used to support an option @option{-gdwarf} that meant to generate
4416 debug information in version 1 of the DWARF format (which is very
4417 different from version 2), and it would have been too confusing.  That
4418 debug format is long obsolete, but the option cannot be changed now.
4419 Instead use an additional @option{-g@var{level}} option to change the
4420 debug level for DWARF.
4421
4422 @item -gtoggle
4423 @opindex gtoggle
4424 Turn off generation of debug info, if leaving out this option would have
4425 generated it, or turn it on at level 2 otherwise.  The position of this
4426 argument in the command line does not matter, it takes effect after all
4427 other options are processed, and it does so only once, no matter how
4428 many times it is given.  This is mainly intended to be used with
4429 @option{-fcompare-debug}.
4430
4431 @item -fdump-final-insns=@var{file}
4432 @opindex fdump-final-insns=
4433 Dump the final internal representation (RTL) to @var{file}.
4434
4435 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4436 @opindex fcompare-debug
4437 @opindex fno-compare-debug
4438 If no error occurs during compilation, run the compiler a second time,
4439 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4440 passed to the second compilation.  Dump the final internal
4441 representation in both compilations, and print an error if they differ.
4442
4443 If the equal sign is omitted, the default @option{-gtoggle} is used.
4444
4445 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4446 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4447 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4448 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4449 is used.
4450
4451 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4452 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4453 of the final representation and the second compilation, preventing even
4454 @env{GCC_COMPARE_DEBUG} from taking effect.
4455
4456 To verify full coverage during @option{-fcompare-debug} testing, set
4457 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4458 which GCC will reject as an invalid option in any actual compilation
4459 (rather than preprocessing, assembly or linking).  To get just a
4460 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4461 not overridden} will do.
4462
4463 @item -fcompare-debug-second
4464 @opindex fcompare-debug-second
4465 This option is implicitly passed to the compiler for the second
4466 compilation requested by @option{-fcompare-debug}, along with options to
4467 silence warnings, and omitting other options that would cause
4468 side-effect compiler outputs to files or to the standard output.  Dump
4469 files and preserved temporary files are renamed so as to contain the
4470 @code{.gk} additional extension during the second compilation, to avoid
4471 overwriting those generated by the first.
4472
4473 When this option is passed to the compiler driver, it causes the
4474 @emph{first} compilation to be skipped, which makes it useful for little
4475 other than debugging the compiler proper.
4476
4477 @item -feliminate-dwarf2-dups
4478 @opindex feliminate-dwarf2-dups
4479 Compress DWARF2 debugging information by eliminating duplicated
4480 information about each symbol.  This option only makes sense when
4481 generating DWARF2 debugging information with @option{-gdwarf-2}.
4482
4483 @item -femit-struct-debug-baseonly
4484 Emit debug information for struct-like types
4485 only when the base name of the compilation source file
4486 matches the base name of file in which the struct was defined.
4487
4488 This option substantially reduces the size of debugging information,
4489 but at significant potential loss in type information to the debugger.
4490 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4491 See @option{-femit-struct-debug-detailed} for more detailed control.
4492
4493 This option works only with DWARF 2.
4494
4495 @item -femit-struct-debug-reduced
4496 Emit debug information for struct-like types
4497 only when the base name of the compilation source file
4498 matches the base name of file in which the type was defined,
4499 unless the struct is a template or defined in a system header.
4500
4501 This option significantly reduces the size of debugging information,
4502 with some potential loss in type information to the debugger.
4503 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4504 See @option{-femit-struct-debug-detailed} for more detailed control.
4505
4506 This option works only with DWARF 2.
4507
4508 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4509 Specify the struct-like types
4510 for which the compiler will generate debug information.
4511 The intent is to reduce duplicate struct debug information
4512 between different object files within the same program.
4513
4514 This option is a detailed version of
4515 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4516 which will serve for most needs.
4517
4518 A specification has the syntax
4519 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4520
4521 The optional first word limits the specification to
4522 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4523 A struct type is used directly when it is the type of a variable, member.
4524 Indirect uses arise through pointers to structs.
4525 That is, when use of an incomplete struct would be legal, the use is indirect.
4526 An example is
4527 @samp{struct one direct; struct two * indirect;}.
4528
4529 The optional second word limits the specification to
4530 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4531 Generic structs are a bit complicated to explain.
4532 For C++, these are non-explicit specializations of template classes,
4533 or non-template classes within the above.
4534 Other programming languages have generics,
4535 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4536
4537 The third word specifies the source files for those
4538 structs for which the compiler will emit debug information.
4539 The values @samp{none} and @samp{any} have the normal meaning.
4540 The value @samp{base} means that
4541 the base of name of the file in which the type declaration appears
4542 must match the base of the name of the main compilation file.
4543 In practice, this means that
4544 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4545 but types declared in other header will not.
4546 The value @samp{sys} means those types satisfying @samp{base}
4547 or declared in system or compiler headers.
4548
4549 You may need to experiment to determine the best settings for your application.
4550
4551 The default is @samp{-femit-struct-debug-detailed=all}.
4552
4553 This option works only with DWARF 2.
4554
4555 @item -fno-merge-debug-strings
4556 @opindex fmerge-debug-strings
4557 @opindex fno-merge-debug-strings
4558 Direct the linker to not merge together strings in the debugging
4559 information which are identical in different object files.  Merging is
4560 not supported by all assemblers or linkers.  Merging decreases the size
4561 of the debug information in the output file at the cost of increasing
4562 link processing time.  Merging is enabled by default.
4563
4564 @item -fdebug-prefix-map=@var{old}=@var{new}
4565 @opindex fdebug-prefix-map
4566 When compiling files in directory @file{@var{old}}, record debugging
4567 information describing them as in @file{@var{new}} instead.
4568
4569 @item -fno-dwarf2-cfi-asm
4570 @opindex fdwarf2-cfi-asm
4571 @opindex fno-dwarf2-cfi-asm
4572 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4573 instead of using GAS @code{.cfi_*} directives.
4574
4575 @cindex @command{prof}
4576 @item -p
4577 @opindex p
4578 Generate extra code to write profile information suitable for the
4579 analysis program @command{prof}.  You must use this option when compiling
4580 the source files you want data about, and you must also use it when
4581 linking.
4582
4583 @cindex @command{gprof}
4584 @item -pg
4585 @opindex pg
4586 Generate extra code to write profile information suitable for the
4587 analysis program @command{gprof}.  You must use this option when compiling
4588 the source files you want data about, and you must also use it when
4589 linking.
4590
4591 @item -Q
4592 @opindex Q
4593 Makes the compiler print out each function name as it is compiled, and
4594 print some statistics about each pass when it finishes.
4595
4596 @item -ftime-report
4597 @opindex ftime-report
4598 Makes the compiler print some statistics about the time consumed by each
4599 pass when it finishes.
4600
4601 @item -fmem-report
4602 @opindex fmem-report
4603 Makes the compiler print some statistics about permanent memory
4604 allocation when it finishes.
4605
4606 @item -fpre-ipa-mem-report
4607 @opindex fpre-ipa-mem-report
4608 @item -fpost-ipa-mem-report
4609 @opindex fpost-ipa-mem-report
4610 Makes the compiler print some statistics about permanent memory
4611 allocation before or after interprocedural optimization.
4612
4613 @item -fprofile-arcs
4614 @opindex fprofile-arcs
4615 Add code so that program flow @dfn{arcs} are instrumented.  During
4616 execution the program records how many times each branch and call is
4617 executed and how many times it is taken or returns.  When the compiled
4618 program exits it saves this data to a file called
4619 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4620 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4621 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4622 @var{auxname} is generated from the name of the output file, if
4623 explicitly specified and it is not the final executable, otherwise it is
4624 the basename of the source file.  In both cases any suffix is removed
4625 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4626 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4627 @xref{Cross-profiling}.
4628
4629 @cindex @command{gcov}
4630 @item --coverage
4631 @opindex coverage
4632
4633 This option is used to compile and link code instrumented for coverage
4634 analysis.  The option is a synonym for @option{-fprofile-arcs}
4635 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4636 linking).  See the documentation for those options for more details.
4637
4638 @itemize
4639
4640 @item
4641 Compile the source files with @option{-fprofile-arcs} plus optimization
4642 and code generation options.  For test coverage analysis, use the
4643 additional @option{-ftest-coverage} option.  You do not need to profile
4644 every source file in a program.
4645
4646 @item
4647 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4648 (the latter implies the former).
4649
4650 @item
4651 Run the program on a representative workload to generate the arc profile
4652 information.  This may be repeated any number of times.  You can run
4653 concurrent instances of your program, and provided that the file system
4654 supports locking, the data files will be correctly updated.  Also
4655 @code{fork} calls are detected and correctly handled (double counting
4656 will not happen).
4657
4658 @item
4659 For profile-directed optimizations, compile the source files again with
4660 the same optimization and code generation options plus
4661 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4662 Control Optimization}).
4663
4664 @item
4665 For test coverage analysis, use @command{gcov} to produce human readable
4666 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4667 @command{gcov} documentation for further information.
4668
4669 @end itemize
4670
4671 With @option{-fprofile-arcs}, for each function of your program GCC
4672 creates a program flow graph, then finds a spanning tree for the graph.
4673 Only arcs that are not on the spanning tree have to be instrumented: the
4674 compiler adds code to count the number of times that these arcs are
4675 executed.  When an arc is the only exit or only entrance to a block, the
4676 instrumentation code can be added to the block; otherwise, a new basic
4677 block must be created to hold the instrumentation code.
4678
4679 @need 2000
4680 @item -ftest-coverage
4681 @opindex ftest-coverage
4682 Produce a notes file that the @command{gcov} code-coverage utility
4683 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4684 show program coverage.  Each source file's note file is called
4685 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4686 above for a description of @var{auxname} and instructions on how to
4687 generate test coverage data.  Coverage data will match the source files
4688 more closely, if you do not optimize.
4689
4690 @item -fdbg-cnt-list
4691 @opindex fdbg-cnt-list
4692 Print the name and the counter upperbound for all debug counters.
4693
4694 @item -fdbg-cnt=@var{counter-value-list}
4695 @opindex fdbg-cnt
4696 Set the internal debug counter upperbound. @var{counter-value-list}
4697 is a comma-separated list of @var{name}:@var{value} pairs
4698 which sets the upperbound of each debug counter @var{name} to @var{value}.
4699 All debug counters have the initial upperbound of @var{UINT_MAX},
4700 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4701 e.g. With -fdbg-cnt=dce:10,tail_call:0
4702 dbg_cnt(dce) will return true only for first 10 invocations
4703 and dbg_cnt(tail_call) will return false always.
4704
4705 @item -d@var{letters}
4706 @itemx -fdump-rtl-@var{pass}
4707 @opindex d
4708 Says to make debugging dumps during compilation at times specified by
4709 @var{letters}.  This is used for debugging the RTL-based passes of the
4710 compiler.  The file names for most of the dumps are made by appending
4711 a pass number and a word to the @var{dumpname}, and the files are
4712 created in the directory of the output file.  @var{dumpname} is
4713 generated from the name of the output file, if explicitly specified
4714 and it is not an executable, otherwise it is the basename of the
4715 source file. These switches may have different effects when
4716 @option{-E} is used for preprocessing.
4717
4718 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
4719 @option{-d} option @var{letters}.  Here are the possible
4720 letters for use in @var{pass} and @var{letters}, and their meanings:
4721
4722 @table @gcctabopt
4723
4724 @item -fdump-rtl-alignments
4725 @opindex fdump-rtl-alignments
4726 Dump after branch alignments have been computed.
4727
4728 @item -fdump-rtl-asmcons
4729 @opindex fdump-rtl-asmcons
4730 Dump after fixing rtl statements that have unsatisfied in/out constraints.
4731
4732 @item -fdump-rtl-auto_inc_dec
4733 @opindex fdump-rtl-auto_inc_dec
4734 Dump after auto-inc-dec discovery.  This pass is only run on
4735 architectures that have auto inc or auto dec instructions.
4736
4737 @item -fdump-rtl-barriers
4738 @opindex fdump-rtl-barriers
4739 Dump after cleaning up the barrier instructions.
4740
4741 @item -fdump-rtl-bbpart
4742 @opindex fdump-rtl-bbpart
4743 Dump after partitioning hot and cold basic blocks.
4744
4745 @item -fdump-rtl-bbro
4746 @opindex fdump-rtl-bbro
4747 Dump after block reordering.
4748
4749 @item -fdump-rtl-btl1
4750 @itemx -fdump-rtl-btl2
4751 @opindex fdump-rtl-btl2
4752 @opindex fdump-rtl-btl2
4753 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
4754 after the two branch
4755 target load optimization passes.
4756
4757 @item -fdump-rtl-bypass
4758 @opindex fdump-rtl-bypass
4759 Dump after jump bypassing and control flow optimizations.
4760
4761 @item -fdump-rtl-combine
4762 @opindex fdump-rtl-combine
4763 Dump after the RTL instruction combination pass.
4764
4765 @item -fdump-rtl-compgotos
4766 @opindex fdump-rtl-compgotos
4767 Dump after duplicating the computed gotos.
4768
4769 @item -fdump-rtl-ce1
4770 @itemx -fdump-rtl-ce2
4771 @itemx -fdump-rtl-ce3
4772 @opindex fdump-rtl-ce1
4773 @opindex fdump-rtl-ce2
4774 @opindex fdump-rtl-ce3
4775 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
4776 @option{-fdump-rtl-ce3} enable dumping after the three
4777 if conversion passes.
4778
4779 @itemx -fdump-rtl-cprop_hardreg
4780 @opindex fdump-rtl-cprop_hardreg
4781 Dump after hard register copy propagation.
4782
4783 @itemx -fdump-rtl-csa
4784 @opindex fdump-rtl-csa
4785 Dump after combining stack adjustments.
4786
4787 @item -fdump-rtl-cse1
4788 @itemx -fdump-rtl-cse2
4789 @opindex fdump-rtl-cse1
4790 @opindex fdump-rtl-cse2
4791 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
4792 the two common sub-expression elimination passes.
4793
4794 @itemx -fdump-rtl-dce
4795 @opindex fdump-rtl-dce
4796 Dump after the standalone dead code elimination passes.
4797
4798 @itemx -fdump-rtl-dbr
4799 @opindex fdump-rtl-dbr
4800 Dump after delayed branch scheduling.
4801
4802 @item -fdump-rtl-dce1
4803 @itemx -fdump-rtl-dce2
4804 @opindex fdump-rtl-dce1
4805 @opindex fdump-rtl-dce2
4806 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
4807 the two dead store elimination passes.
4808
4809 @item -fdump-rtl-eh
4810 @opindex fdump-rtl-eh
4811 Dump after finalization of EH handling code.
4812
4813 @item -fdump-rtl-eh_ranges
4814 @opindex fdump-rtl-eh_ranges
4815 Dump after conversion of EH handling range regions.
4816
4817 @item -fdump-rtl-expand
4818 @opindex fdump-rtl-expand
4819 Dump after RTL generation.
4820
4821 @item -fdump-rtl-fwprop1
4822 @itemx -fdump-rtl-fwprop2
4823 @opindex fdump-rtl-fwprop1
4824 @opindex fdump-rtl-fwprop2
4825 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
4826 dumping after the two forward propagation passes.
4827
4828 @item -fdump-rtl-gcse1
4829 @itemx -fdump-rtl-gcse2
4830 @opindex fdump-rtl-gcse1
4831 @opindex fdump-rtl-gcse2
4832 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
4833 after global common subexpression elimination.
4834
4835 @item -fdump-rtl-init-regs
4836 @opindex fdump-rtl-init-regs
4837 Dump after the initialization of the registers.
4838
4839 @item -fdump-rtl-initvals
4840 @opindex fdump-rtl-initvals
4841 Dump after the computation of the initial value sets.
4842
4843 @itemx -fdump-rtl-into_cfglayout
4844 @opindex fdump-rtl-into_cfglayout
4845 Dump after converting to cfglayout mode.
4846
4847 @item -fdump-rtl-ira
4848 @opindex fdump-rtl-ira
4849 Dump after iterated register allocation.
4850
4851 @item -fdump-rtl-jump
4852 @opindex fdump-rtl-jump
4853 Dump after the second jump optimization.
4854
4855 @item -fdump-rtl-loop2
4856 @opindex fdump-rtl-loop2
4857 @option{-fdump-rtl-loop2} enables dumping after the rtl
4858 loop optimization passes.
4859
4860 @item -fdump-rtl-mach
4861 @opindex fdump-rtl-mach
4862 Dump after performing the machine dependent reorganization pass, if that
4863 pass exists.
4864
4865 @item -fdump-rtl-mode_sw
4866 @opindex fdump-rtl-mode_sw
4867 Dump after removing redundant mode switches.
4868
4869 @item -fdump-rtl-rnreg
4870 @opindex fdump-rtl-rnreg
4871 Dump after register renumbering.
4872
4873 @itemx -fdump-rtl-outof_cfglayout
4874 @opindex fdump-rtl-outof_cfglayout
4875 Dump after converting from cfglayout mode.
4876
4877 @item -fdump-rtl-peephole2
4878 @opindex fdump-rtl-peephole2
4879 Dump after the peephole pass.
4880
4881 @item -fdump-rtl-postreload
4882 @opindex fdump-rtl-postreload
4883 Dump after post-reload optimizations.
4884
4885 @itemx -fdump-rtl-pro_and_epilogue
4886 @opindex fdump-rtl-pro_and_epilogue
4887 Dump after generating the function pro and epilogues.
4888
4889 @item -fdump-rtl-regmove
4890 @opindex fdump-rtl-regmove
4891 Dump after the register move pass.
4892
4893 @item -fdump-rtl-sched1
4894 @itemx -fdump-rtl-sched2
4895 @opindex fdump-rtl-sched1
4896 @opindex fdump-rtl-sched2
4897 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
4898 after the basic block scheduling passes.
4899
4900 @item -fdump-rtl-see
4901 @opindex fdump-rtl-see
4902 Dump after sign extension elimination.
4903
4904 @item -fdump-rtl-seqabstr
4905 @opindex fdump-rtl-seqabstr
4906 Dump after common sequence discovery.
4907
4908 @item -fdump-rtl-shorten
4909 @opindex fdump-rtl-shorten
4910 Dump after shortening branches.
4911
4912 @item -fdump-rtl-sibling
4913 @opindex fdump-rtl-sibling
4914 Dump after sibling call optimizations.
4915
4916 @item -fdump-rtl-split1
4917 @itemx -fdump-rtl-split2
4918 @itemx -fdump-rtl-split3
4919 @itemx -fdump-rtl-split4
4920 @itemx -fdump-rtl-split5
4921 @opindex fdump-rtl-split1
4922 @opindex fdump-rtl-split2
4923 @opindex fdump-rtl-split3
4924 @opindex fdump-rtl-split4
4925 @opindex fdump-rtl-split5
4926 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
4927 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
4928 @option{-fdump-rtl-split5} enable dumping after five rounds of
4929 instruction splitting.
4930
4931 @item -fdump-rtl-sms
4932 @opindex fdump-rtl-sms
4933 Dump after modulo scheduling.  This pass is only run on some
4934 architectures.
4935
4936 @item -fdump-rtl-stack
4937 @opindex fdump-rtl-stack
4938 Dump after conversion from GCC's "flat register file" registers to the
4939 x87's stack-like registers.  This pass is only run on x86 variants.
4940
4941 @item -fdump-rtl-subreg1
4942 @itemx -fdump-rtl-subreg2
4943 @opindex fdump-rtl-subreg1
4944 @opindex fdump-rtl-subreg2
4945 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
4946 the two subreg expansion passes.
4947
4948 @item -fdump-rtl-unshare
4949 @opindex fdump-rtl-unshare
4950 Dump after all rtl has been unshared.
4951
4952 @item -fdump-rtl-vartrack
4953 @opindex fdump-rtl-vartrack
4954 Dump after variable tracking.
4955
4956 @item -fdump-rtl-vregs
4957 @opindex fdump-rtl-vregs
4958 Dump after converting virtual registers to hard registers.
4959
4960 @item -fdump-rtl-web
4961 @opindex fdump-rtl-web
4962 Dump after live range splitting.
4963
4964 @item -fdump-rtl-regclass
4965 @itemx -fdump-rtl-subregs_of_mode_init
4966 @itemx -fdump-rtl-subregs_of_mode_finish
4967 @itemx -fdump-rtl-dfinit
4968 @itemx -fdump-rtl-dfinish
4969 @opindex fdump-rtl-regclass
4970 @opindex fdump-rtl-subregs_of_mode_init
4971 @opindex fdump-rtl-subregs_of_mode_finish
4972 @opindex fdump-rtl-dfinit
4973 @opindex fdump-rtl-dfinish
4974 These dumps are defined but always produce empty files.
4975
4976 @item -fdump-rtl-all
4977 @opindex fdump-rtl-all
4978 Produce all the dumps listed above.
4979
4980 @item -dA
4981 @opindex dA
4982 Annotate the assembler output with miscellaneous debugging information.
4983
4984 @item -dD
4985 @opindex dD
4986 Dump all macro definitions, at the end of preprocessing, in addition to
4987 normal output.
4988
4989 @item -dH
4990 @opindex dH
4991 Produce a core dump whenever an error occurs.
4992
4993 @item -dm
4994 @opindex dm
4995 Print statistics on memory usage, at the end of the run, to
4996 standard error.
4997
4998 @item -dp
4999 @opindex dp
5000 Annotate the assembler output with a comment indicating which
5001 pattern and alternative was used.  The length of each instruction is
5002 also printed.
5003
5004 @item -dP
5005 @opindex dP
5006 Dump the RTL in the assembler output as a comment before each instruction.
5007 Also turns on @option{-dp} annotation.
5008
5009 @item -dv
5010 @opindex dv
5011 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5012 dump a representation of the control flow graph suitable for viewing with VCG
5013 to @file{@var{file}.@var{pass}.vcg}.
5014
5015 @item -dx
5016 @opindex dx
5017 Just generate RTL for a function instead of compiling it.  Usually used
5018 with @option{-fdump-rtl-expand}.
5019
5020 @item -dy
5021 @opindex dy
5022 Dump debugging information during parsing, to standard error.
5023 @end table
5024
5025 @item -fdump-noaddr
5026 @opindex fdump-noaddr
5027 When doing debugging dumps, suppress address output.  This makes it more
5028 feasible to use diff on debugging dumps for compiler invocations with
5029 different compiler binaries and/or different
5030 text / bss / data / heap / stack / dso start locations.
5031
5032 @item -fdump-unnumbered
5033 @opindex fdump-unnumbered
5034 When doing debugging dumps, suppress instruction numbers and address output.
5035 This makes it more feasible to use diff on debugging dumps for compiler
5036 invocations with different options, in particular with and without
5037 @option{-g}.
5038
5039 @item -fdump-unnumbered-links
5040 @opindex fdump-unnumbered-links
5041 When doing debugging dumps (see @option{-d} option above), suppress
5042 instruction numbers for the links to the previous and next instructions
5043 in a sequence.
5044
5045 @item -fdump-translation-unit @r{(C++ only)}
5046 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5047 @opindex fdump-translation-unit
5048 Dump a representation of the tree structure for the entire translation
5049 unit to a file.  The file name is made by appending @file{.tu} to the
5050 source file name, and the file is created in the same directory as the
5051 output file.  If the @samp{-@var{options}} form is used, @var{options}
5052 controls the details of the dump as described for the
5053 @option{-fdump-tree} options.
5054
5055 @item -fdump-class-hierarchy @r{(C++ only)}
5056 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5057 @opindex fdump-class-hierarchy
5058 Dump a representation of each class's hierarchy and virtual function
5059 table layout to a file.  The file name is made by appending
5060 @file{.class} to the source file name, and the file is created in the
5061 same directory as the output file.  If the @samp{-@var{options}} form
5062 is used, @var{options} controls the details of the dump as described
5063 for the @option{-fdump-tree} options.
5064
5065 @item -fdump-ipa-@var{switch}
5066 @opindex fdump-ipa
5067 Control the dumping at various stages of inter-procedural analysis
5068 language tree to a file.  The file name is generated by appending a
5069 switch specific suffix to the source file name, and the file is created
5070 in the same directory as the output file.  The following dumps are
5071 possible:
5072
5073 @table @samp
5074 @item all
5075 Enables all inter-procedural analysis dumps.
5076
5077 @item cgraph
5078 Dumps information about call-graph optimization, unused function removal,
5079 and inlining decisions.
5080
5081 @item inline
5082 Dump after function inlining.
5083
5084 @end table
5085
5086 @item -fdump-statistics-@var{option}
5087 @opindex fdump-statistics
5088 Enable and control dumping of pass statistics in a separate file.  The
5089 file name is generated by appending a suffix ending in
5090 @samp{.statistics} to the source file name, and the file is created in
5091 the same directory as the output file.  If the @samp{-@var{option}}
5092 form is used, @samp{-stats} will cause counters to be summed over the
5093 whole compilation unit while @samp{-details} will dump every event as
5094 the passes generate them.  The default with no option is to sum
5095 counters for each function compiled.
5096
5097 @item -fdump-tree-@var{switch}
5098 @itemx -fdump-tree-@var{switch}-@var{options}
5099 @opindex fdump-tree
5100 Control the dumping at various stages of processing the intermediate
5101 language tree to a file.  The file name is generated by appending a
5102 switch specific suffix to the source file name, and the file is
5103 created in the same directory as the output file.  If the
5104 @samp{-@var{options}} form is used, @var{options} is a list of
5105 @samp{-} separated options that control the details of the dump.  Not
5106 all options are applicable to all dumps, those which are not
5107 meaningful will be ignored.  The following options are available
5108
5109 @table @samp
5110 @item address
5111 Print the address of each node.  Usually this is not meaningful as it
5112 changes according to the environment and source file.  Its primary use
5113 is for tying up a dump file with a debug environment.
5114 @item asmname
5115 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5116 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5117 use working backward from mangled names in the assembly file.
5118 @item slim
5119 Inhibit dumping of members of a scope or body of a function merely
5120 because that scope has been reached.  Only dump such items when they
5121 are directly reachable by some other path.  When dumping pretty-printed
5122 trees, this option inhibits dumping the bodies of control structures.
5123 @item raw
5124 Print a raw representation of the tree.  By default, trees are
5125 pretty-printed into a C-like representation.
5126 @item details
5127 Enable more detailed dumps (not honored by every dump option).
5128 @item stats
5129 Enable dumping various statistics about the pass (not honored by every dump
5130 option).
5131 @item blocks
5132 Enable showing basic block boundaries (disabled in raw dumps).
5133 @item vops
5134 Enable showing virtual operands for every statement.
5135 @item lineno
5136 Enable showing line numbers for statements.
5137 @item uid
5138 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5139 @item verbose
5140 Enable showing the tree dump for each statement.
5141 @item all
5142 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5143 and @option{lineno}.
5144 @end table
5145
5146 The following tree dumps are possible:
5147 @table @samp
5148
5149 @item original
5150 @opindex fdump-tree-original
5151 Dump before any tree based optimization, to @file{@var{file}.original}.
5152
5153 @item optimized
5154 @opindex fdump-tree-optimized
5155 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5156
5157 @item gimple
5158 @opindex fdump-tree-gimple
5159 Dump each function before and after the gimplification pass to a file.  The
5160 file name is made by appending @file{.gimple} to the source file name.
5161
5162 @item cfg
5163 @opindex fdump-tree-cfg
5164 Dump the control flow graph of each function to a file.  The file name is
5165 made by appending @file{.cfg} to the source file name.
5166
5167 @item vcg
5168 @opindex fdump-tree-vcg
5169 Dump the control flow graph of each function to a file in VCG format.  The
5170 file name is made by appending @file{.vcg} to the source file name.  Note
5171 that if the file contains more than one function, the generated file cannot
5172 be used directly by VCG@.  You will need to cut and paste each function's
5173 graph into its own separate file first.
5174
5175 @item ch
5176 @opindex fdump-tree-ch
5177 Dump each function after copying loop headers.  The file name is made by
5178 appending @file{.ch} to the source file name.
5179
5180 @item ssa
5181 @opindex fdump-tree-ssa
5182 Dump SSA related information to a file.  The file name is made by appending
5183 @file{.ssa} to the source file name.
5184
5185 @item alias
5186 @opindex fdump-tree-alias
5187 Dump aliasing information for each function.  The file name is made by
5188 appending @file{.alias} to the source file name.
5189
5190 @item ccp
5191 @opindex fdump-tree-ccp
5192 Dump each function after CCP@.  The file name is made by appending
5193 @file{.ccp} to the source file name.
5194
5195 @item storeccp
5196 @opindex fdump-tree-storeccp
5197 Dump each function after STORE-CCP@.  The file name is made by appending
5198 @file{.storeccp} to the source file name.
5199
5200 @item pre
5201 @opindex fdump-tree-pre
5202 Dump trees after partial redundancy elimination.  The file name is made
5203 by appending @file{.pre} to the source file name.
5204
5205 @item fre
5206 @opindex fdump-tree-fre
5207 Dump trees after full redundancy elimination.  The file name is made
5208 by appending @file{.fre} to the source file name.
5209
5210 @item copyprop
5211 @opindex fdump-tree-copyprop
5212 Dump trees after copy propagation.  The file name is made
5213 by appending @file{.copyprop} to the source file name.
5214
5215 @item store_copyprop
5216 @opindex fdump-tree-store_copyprop
5217 Dump trees after store copy-propagation.  The file name is made
5218 by appending @file{.store_copyprop} to the source file name.
5219
5220 @item dce
5221 @opindex fdump-tree-dce
5222 Dump each function after dead code elimination.  The file name is made by
5223 appending @file{.dce} to the source file name.
5224
5225 @item mudflap
5226 @opindex fdump-tree-mudflap
5227 Dump each function after adding mudflap instrumentation.  The file name is
5228 made by appending @file{.mudflap} to the source file name.
5229
5230 @item sra
5231 @opindex fdump-tree-sra
5232 Dump each function after performing scalar replacement of aggregates.  The
5233 file name is made by appending @file{.sra} to the source file name.
5234
5235 @item sink
5236 @opindex fdump-tree-sink
5237 Dump each function after performing code sinking.  The file name is made
5238 by appending @file{.sink} to the source file name.
5239
5240 @item dom
5241 @opindex fdump-tree-dom
5242 Dump each function after applying dominator tree optimizations.  The file
5243 name is made by appending @file{.dom} to the source file name.
5244
5245 @item dse
5246 @opindex fdump-tree-dse
5247 Dump each function after applying dead store elimination.  The file
5248 name is made by appending @file{.dse} to the source file name.
5249
5250 @item phiopt
5251 @opindex fdump-tree-phiopt
5252 Dump each function after optimizing PHI nodes into straightline code.  The file
5253 name is made by appending @file{.phiopt} to the source file name.
5254
5255 @item forwprop
5256 @opindex fdump-tree-forwprop
5257 Dump each function after forward propagating single use variables.  The file
5258 name is made by appending @file{.forwprop} to the source file name.
5259
5260 @item copyrename
5261 @opindex fdump-tree-copyrename
5262 Dump each function after applying the copy rename optimization.  The file
5263 name is made by appending @file{.copyrename} to the source file name.
5264
5265 @item nrv
5266 @opindex fdump-tree-nrv
5267 Dump each function after applying the named return value optimization on
5268 generic trees.  The file name is made by appending @file{.nrv} to the source
5269 file name.
5270
5271 @item vect
5272 @opindex fdump-tree-vect
5273 Dump each function after applying vectorization of loops.  The file name is
5274 made by appending @file{.vect} to the source file name.
5275
5276 @item vrp
5277 @opindex fdump-tree-vrp
5278 Dump each function after Value Range Propagation (VRP).  The file name
5279 is made by appending @file{.vrp} to the source file name.
5280
5281 @item all
5282 @opindex fdump-tree-all
5283 Enable all the available tree dumps with the flags provided in this option.
5284 @end table
5285
5286 @item -ftree-vectorizer-verbose=@var{n}
5287 @opindex ftree-vectorizer-verbose
5288 This option controls the amount of debugging output the vectorizer prints.
5289 This information is written to standard error, unless
5290 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5291 in which case it is output to the usual dump listing file, @file{.vect}.
5292 For @var{n}=0 no diagnostic information is reported.
5293 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5294 and the total number of loops that got vectorized.
5295 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5296 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5297 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5298 level that @option{-fdump-tree-vect-stats} uses.
5299 Higher verbosity levels mean either more information dumped for each
5300 reported loop, or same amount of information reported for more loops:
5301 If @var{n}=3, alignment related information is added to the reports.
5302 If @var{n}=4, data-references related information (e.g.@: memory dependences,
5303 memory access-patterns) is added to the reports.
5304 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
5305 that did not pass the first analysis phase (i.e., may not be countable, or
5306 may have complicated control-flow).
5307 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
5308 For @var{n}=7, all the information the vectorizer generates during its
5309 analysis and transformation is reported.  This is the same verbosity level
5310 that @option{-fdump-tree-vect-details} uses.
5311
5312 @item -frandom-seed=@var{string}
5313 @opindex frandom-seed
5314 This option provides a seed that GCC uses when it would otherwise use
5315 random numbers.  It is used to generate certain symbol names
5316 that have to be different in every compiled file.  It is also used to
5317 place unique stamps in coverage data files and the object files that
5318 produce them.  You can use the @option{-frandom-seed} option to produce
5319 reproducibly identical object files.
5320
5321 The @var{string} should be different for every file you compile.
5322
5323 @item -fsched-verbose=@var{n}
5324 @opindex fsched-verbose
5325 On targets that use instruction scheduling, this option controls the
5326 amount of debugging output the scheduler prints.  This information is
5327 written to standard error, unless @option{-fdump-rtl-sched1} or
5328 @option{-fdump-rtl-sched2} is specified, in which case it is output
5329 to the usual dump listing file, @file{.sched} or @file{.sched2}
5330 respectively.  However for @var{n} greater than nine, the output is
5331 always printed to standard error.
5332
5333 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5334 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5335 For @var{n} greater than one, it also output basic block probabilities,
5336 detailed ready list information and unit/insn info.  For @var{n} greater
5337 than two, it includes RTL at abort point, control-flow and regions info.
5338 And for @var{n} over four, @option{-fsched-verbose} also includes
5339 dependence info.
5340
5341 @item -save-temps
5342 @itemx -save-temps=cwd
5343 @opindex save-temps
5344 Store the usual ``temporary'' intermediate files permanently; place them
5345 in the current directory and name them based on the source file.  Thus,
5346 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5347 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5348 preprocessed @file{foo.i} output file even though the compiler now
5349 normally uses an integrated preprocessor.
5350
5351 When used in combination with the @option{-x} command line option,
5352 @option{-save-temps} is sensible enough to avoid over writing an
5353 input source file with the same extension as an intermediate file.
5354 The corresponding intermediate file may be obtained by renaming the
5355 source file before using @option{-save-temps}.
5356
5357 If you invoke GCC in parallel, compiling several different source
5358 files that share a common base name in different subdirectories or the
5359 same source file compiled for multiple output destinations, it is
5360 likely that the different parallel compilers will interfere with each
5361 other, and overwrite the temporary files.  For instance:
5362
5363 @smallexample
5364 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5365 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5366 @end smallexample
5367
5368 may result in @file{foo.i} and @file{foo.o} being written to
5369 simultaneously by both compilers.
5370
5371 @item -save-temps=obj
5372 @opindex save-temps=obj
5373 Store the usual ``temporary'' intermediate files permanently.  If the
5374 @option{-o} option is used, the temporary files are based on the
5375 object file.  If the @option{-o} option is not used, the
5376 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5377
5378 For example:
5379
5380 @smallexample
5381 gcc -save-temps=obj -c foo.c
5382 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5383 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5384 @end smallexample
5385
5386 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5387 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5388 @file{dir2/yfoobar.o}.
5389
5390 @item -time@r{[}=@var{file}@r{]}
5391 @opindex time
5392 Report the CPU time taken by each subprocess in the compilation
5393 sequence.  For C source files, this is the compiler proper and assembler
5394 (plus the linker if linking is done).
5395
5396 Without the specification of an output file, the output looks like this:
5397
5398 @smallexample
5399 # cc1 0.12 0.01
5400 # as 0.00 0.01
5401 @end smallexample
5402
5403 The first number on each line is the ``user time'', that is time spent
5404 executing the program itself.  The second number is ``system time'',
5405 time spent executing operating system routines on behalf of the program.
5406 Both numbers are in seconds.
5407
5408 With the specification of an output file, the output is appended to the
5409 named file, and it looks like this:
5410
5411 @smallexample
5412 0.12 0.01 cc1 @var{options}
5413 0.00 0.01 as @var{options}
5414 @end smallexample
5415
5416 The ``user time'' and the ``system time'' are moved before the program
5417 name, and the options passed to the program are displayed, so that one
5418 can later tell what file was being compiled, and with which options.
5419
5420 @item -fvar-tracking
5421 @opindex fvar-tracking
5422 Run variable tracking pass.  It computes where variables are stored at each
5423 position in code.  Better debugging information is then generated
5424 (if the debugging information format supports this information).
5425
5426 It is enabled by default when compiling with optimization (@option{-Os},
5427 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5428 the debug info format supports it.
5429
5430 @item -print-file-name=@var{library}
5431 @opindex print-file-name
5432 Print the full absolute name of the library file @var{library} that
5433 would be used when linking---and don't do anything else.  With this
5434 option, GCC does not compile or link anything; it just prints the
5435 file name.
5436
5437 @item -print-multi-directory
5438 @opindex print-multi-directory
5439 Print the directory name corresponding to the multilib selected by any
5440 other switches present in the command line.  This directory is supposed
5441 to exist in @env{GCC_EXEC_PREFIX}.
5442
5443 @item -print-multi-lib
5444 @opindex print-multi-lib
5445 Print the mapping from multilib directory names to compiler switches
5446 that enable them.  The directory name is separated from the switches by
5447 @samp{;}, and each switch starts with an @samp{@@} instead of the
5448 @samp{-}, without spaces between multiple switches.  This is supposed to
5449 ease shell-processing.
5450
5451 @item -print-prog-name=@var{program}
5452 @opindex print-prog-name
5453 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5454
5455 @item -print-libgcc-file-name
5456 @opindex print-libgcc-file-name
5457 Same as @option{-print-file-name=libgcc.a}.
5458
5459 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5460 but you do want to link with @file{libgcc.a}.  You can do
5461
5462 @smallexample
5463 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5464 @end smallexample
5465
5466 @item -print-search-dirs
5467 @opindex print-search-dirs
5468 Print the name of the configured installation directory and a list of
5469 program and library directories @command{gcc} will search---and don't do anything else.
5470
5471 This is useful when @command{gcc} prints the error message
5472 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5473 To resolve this you either need to put @file{cpp0} and the other compiler
5474 components where @command{gcc} expects to find them, or you can set the environment
5475 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5476 Don't forget the trailing @samp{/}.
5477 @xref{Environment Variables}.
5478
5479 @item -print-sysroot
5480 @opindex print-sysroot
5481 Print the target sysroot directory that will be used during
5482 compilation.  This is the target sysroot specified either at configure
5483 time or using the @option{--sysroot} option, possibly with an extra
5484 suffix that depends on compilation options.  If no target sysroot is
5485 specified, the option prints nothing.
5486
5487 @item -print-sysroot-headers-suffix
5488 @opindex print-sysroot-headers-suffix
5489 Print the suffix added to the target sysroot when searching for
5490 headers, or give an error if the compiler is not configured with such
5491 a suffix---and don't do anything else.
5492
5493 @item -dumpmachine
5494 @opindex dumpmachine
5495 Print the compiler's target machine (for example,
5496 @samp{i686-pc-linux-gnu})---and don't do anything else.
5497
5498 @item -dumpversion
5499 @opindex dumpversion
5500 Print the compiler version (for example, @samp{3.0})---and don't do
5501 anything else.
5502
5503 @item -dumpspecs
5504 @opindex dumpspecs
5505 Print the compiler's built-in specs---and don't do anything else.  (This
5506 is used when GCC itself is being built.)  @xref{Spec Files}.
5507
5508 @item -feliminate-unused-debug-types
5509 @opindex feliminate-unused-debug-types
5510 Normally, when producing DWARF2 output, GCC will emit debugging
5511 information for all types declared in a compilation
5512 unit, regardless of whether or not they are actually used
5513 in that compilation unit.  Sometimes this is useful, such as
5514 if, in the debugger, you want to cast a value to a type that is
5515 not actually used in your program (but is declared).  More often,
5516 however, this results in a significant amount of wasted space.
5517 With this option, GCC will avoid producing debug symbol output
5518 for types that are nowhere used in the source file being compiled.
5519 @end table
5520
5521 @node Optimize Options
5522 @section Options That Control Optimization
5523 @cindex optimize options
5524 @cindex options, optimization
5525
5526 These options control various sorts of optimizations.
5527
5528 Without any optimization option, the compiler's goal is to reduce the
5529 cost of compilation and to make debugging produce the expected
5530 results.  Statements are independent: if you stop the program with a
5531 breakpoint between statements, you can then assign a new value to any
5532 variable or change the program counter to any other statement in the
5533 function and get exactly the results you would expect from the source
5534 code.
5535
5536 Turning on optimization flags makes the compiler attempt to improve
5537 the performance and/or code size at the expense of compilation time
5538 and possibly the ability to debug the program.
5539
5540 The compiler performs optimization based on the knowledge it has of the
5541 program.  Compiling multiple files at once to a single output file mode allows
5542 the compiler to use information gained from all of the files when compiling
5543 each of them.
5544
5545 Not all optimizations are controlled directly by a flag.  Only
5546 optimizations that have a flag are listed in this section.
5547
5548 Depending on the target and how GCC was configured, a slightly different
5549 set of optimizations may be enabled at each @option{-O} level than
5550 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
5551 to find out the exact set of optimizations that are enabled at each level.
5552 @xref{Overall Options}, for examples.
5553
5554 @table @gcctabopt
5555 @item -O
5556 @itemx -O1
5557 @opindex O
5558 @opindex O1
5559 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5560 more memory for a large function.
5561
5562 With @option{-O}, the compiler tries to reduce code size and execution
5563 time, without performing any optimizations that take a great deal of
5564 compilation time.
5565
5566 @option{-O} turns on the following optimization flags:
5567 @gccoptlist{
5568 -fauto-inc-dec @gol
5569 -fcprop-registers @gol
5570 -fdce @gol
5571 -fdefer-pop @gol
5572 -fdelayed-branch @gol
5573 -fdse @gol
5574 -fguess-branch-probability @gol
5575 -fif-conversion2 @gol
5576 -fif-conversion @gol
5577 -finline-small-functions @gol
5578 -fipa-pure-const @gol
5579 -fipa-reference @gol
5580 -fmerge-constants
5581 -fsplit-wide-types @gol
5582 -ftree-builtin-call-dce @gol
5583 -ftree-ccp @gol
5584 -ftree-ch @gol
5585 -ftree-copyrename @gol
5586 -ftree-dce @gol
5587 -ftree-dominator-opts @gol
5588 -ftree-dse @gol
5589 -ftree-forwprop @gol
5590 -ftree-fre @gol
5591 -ftree-phiprop @gol
5592 -ftree-sra @gol
5593 -ftree-pta @gol
5594 -ftree-ter @gol
5595 -funit-at-a-time}
5596
5597 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5598 where doing so does not interfere with debugging.
5599
5600 @item -O2
5601 @opindex O2
5602 Optimize even more.  GCC performs nearly all supported optimizations
5603 that do not involve a space-speed tradeoff.
5604 As compared to @option{-O}, this option increases both compilation time
5605 and the performance of the generated code.
5606
5607 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5608 also turns on the following optimization flags:
5609 @gccoptlist{-fthread-jumps @gol
5610 -falign-functions  -falign-jumps @gol
5611 -falign-loops  -falign-labels @gol
5612 -fcaller-saves @gol
5613 -fcrossjumping @gol
5614 -fcse-follow-jumps  -fcse-skip-blocks @gol
5615 -fdelete-null-pointer-checks @gol
5616 -fexpensive-optimizations @gol
5617 -fgcse  -fgcse-lm  @gol
5618 -findirect-inlining @gol
5619 -foptimize-sibling-calls @gol
5620 -fpeephole2 @gol
5621 -fregmove @gol
5622 -freorder-blocks  -freorder-functions @gol
5623 -frerun-cse-after-loop  @gol
5624 -fsched-interblock  -fsched-spec @gol
5625 -fschedule-insns  -fschedule-insns2 @gol
5626 -fstrict-aliasing -fstrict-overflow @gol
5627 -ftree-switch-conversion @gol
5628 -ftree-pre @gol
5629 -ftree-vrp}
5630
5631 Please note the warning under @option{-fgcse} about
5632 invoking @option{-O2} on programs that use computed gotos.
5633
5634 @item -O3
5635 @opindex O3
5636 Optimize yet more.  @option{-O3} turns on all optimizations specified
5637 by @option{-O2} and also turns on the @option{-finline-functions},
5638 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5639 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5640
5641 @item -O0
5642 @opindex O0
5643 Reduce compilation time and make debugging produce the expected
5644 results.  This is the default.
5645
5646 @item -Os
5647 @opindex Os
5648 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5649 do not typically increase code size.  It also performs further
5650 optimizations designed to reduce code size.
5651
5652 @option{-Os} disables the following optimization flags:
5653 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5654 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5655 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5656
5657 If you use multiple @option{-O} options, with or without level numbers,
5658 the last such option is the one that is effective.
5659 @end table
5660
5661 Options of the form @option{-f@var{flag}} specify machine-independent
5662 flags.  Most flags have both positive and negative forms; the negative
5663 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5664 below, only one of the forms is listed---the one you typically will
5665 use.  You can figure out the other form by either removing @samp{no-}
5666 or adding it.
5667
5668 The following options control specific optimizations.  They are either
5669 activated by @option{-O} options or are related to ones that are.  You
5670 can use the following flags in the rare cases when ``fine-tuning'' of
5671 optimizations to be performed is desired.
5672
5673 @table @gcctabopt
5674 @item -fno-default-inline
5675 @opindex fno-default-inline
5676 Do not make member functions inline by default merely because they are
5677 defined inside the class scope (C++ only).  Otherwise, when you specify
5678 @w{@option{-O}}, member functions defined inside class scope are compiled
5679 inline by default; i.e., you don't need to add @samp{inline} in front of
5680 the member function name.
5681
5682 @item -fno-defer-pop
5683 @opindex fno-defer-pop
5684 Always pop the arguments to each function call as soon as that function
5685 returns.  For machines which must pop arguments after a function call,
5686 the compiler normally lets arguments accumulate on the stack for several
5687 function calls and pops them all at once.
5688
5689 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5690
5691 @item -fforward-propagate
5692 @opindex fforward-propagate
5693 Perform a forward propagation pass on RTL@.  The pass tries to combine two
5694 instructions and checks if the result can be simplified.  If loop unrolling
5695 is active, two passes are performed and the second is scheduled after
5696 loop unrolling.
5697
5698 This option is enabled by default at optimization levels @option{-O},
5699 @option{-O2}, @option{-O3}, @option{-Os}.
5700
5701 @item -fomit-frame-pointer
5702 @opindex fomit-frame-pointer
5703 Don't keep the frame pointer in a register for functions that
5704 don't need one.  This avoids the instructions to save, set up and
5705 restore frame pointers; it also makes an extra register available
5706 in many functions.  @strong{It also makes debugging impossible on
5707 some machines.}
5708
5709 On some machines, such as the VAX, this flag has no effect, because
5710 the standard calling sequence automatically handles the frame pointer
5711 and nothing is saved by pretending it doesn't exist.  The
5712 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5713 whether a target machine supports this flag.  @xref{Registers,,Register
5714 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5715
5716 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5717
5718 @item -foptimize-sibling-calls
5719 @opindex foptimize-sibling-calls
5720 Optimize sibling and tail recursive calls.
5721
5722 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5723
5724 @item -fno-inline
5725 @opindex fno-inline
5726 Don't pay attention to the @code{inline} keyword.  Normally this option
5727 is used to keep the compiler from expanding any functions inline.
5728 Note that if you are not optimizing, no functions can be expanded inline.
5729
5730 @item -finline-small-functions
5731 @opindex finline-small-functions
5732 Integrate functions into their callers when their body is smaller than expected
5733 function call code (so overall size of program gets smaller).  The compiler
5734 heuristically decides which functions are simple enough to be worth integrating
5735 in this way.
5736
5737 Enabled at level @option{-O2}.
5738
5739 @item -findirect-inlining
5740 @opindex findirect-inlining
5741 Inline also indirect calls that are discovered to be known at compile
5742 time thanks to previous inlining.  This option has any effect only
5743 when inlining itself is turned on by the @option{-finline-functions}
5744 or @option{-finline-small-functions} options.
5745
5746 Enabled at level @option{-O2}.
5747
5748 @item -finline-functions
5749 @opindex finline-functions
5750 Integrate all simple functions into their callers.  The compiler
5751 heuristically decides which functions are simple enough to be worth
5752 integrating in this way.
5753
5754 If all calls to a given function are integrated, and the function is
5755 declared @code{static}, then the function is normally not output as
5756 assembler code in its own right.
5757
5758 Enabled at level @option{-O3}.
5759
5760 @item -finline-functions-called-once
5761 @opindex finline-functions-called-once
5762 Consider all @code{static} functions called once for inlining into their
5763 caller even if they are not marked @code{inline}.  If a call to a given
5764 function is integrated, then the function is not output as assembler code
5765 in its own right.
5766
5767 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
5768
5769 @item -fearly-inlining
5770 @opindex fearly-inlining
5771 Inline functions marked by @code{always_inline} and functions whose body seems
5772 smaller than the function call overhead early before doing
5773 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5774 makes profiling significantly cheaper and usually inlining faster on programs
5775 having large chains of nested wrapper functions.
5776
5777 Enabled by default.
5778
5779 @item -finline-limit=@var{n}
5780 @opindex finline-limit
5781 By default, GCC limits the size of functions that can be inlined.  This flag
5782 allows coarse control of this limit.  @var{n} is the size of functions that
5783 can be inlined in number of pseudo instructions.
5784
5785 Inlining is actually controlled by a number of parameters, which may be
5786 specified individually by using @option{--param @var{name}=@var{value}}.
5787 The @option{-finline-limit=@var{n}} option sets some of these parameters
5788 as follows:
5789
5790 @table @gcctabopt
5791 @item max-inline-insns-single
5792 is set to @var{n}/2.
5793 @item max-inline-insns-auto
5794 is set to @var{n}/2.
5795 @end table
5796
5797 See below for a documentation of the individual
5798 parameters controlling inlining and for the defaults of these parameters.
5799
5800 @emph{Note:} there may be no value to @option{-finline-limit} that results
5801 in default behavior.
5802
5803 @emph{Note:} pseudo instruction represents, in this particular context, an
5804 abstract measurement of function's size.  In no way does it represent a count
5805 of assembly instructions and as such its exact meaning might change from one
5806 release to an another.
5807
5808 @item -fkeep-inline-functions
5809 @opindex fkeep-inline-functions
5810 In C, emit @code{static} functions that are declared @code{inline}
5811 into the object file, even if the function has been inlined into all
5812 of its callers.  This switch does not affect functions using the
5813 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5814 inline functions into the object file.
5815
5816 @item -fkeep-static-consts
5817 @opindex fkeep-static-consts
5818 Emit variables declared @code{static const} when optimization isn't turned
5819 on, even if the variables aren't referenced.
5820
5821 GCC enables this option by default.  If you want to force the compiler to
5822 check if the variable was referenced, regardless of whether or not
5823 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5824
5825 @item -fmerge-constants
5826 @opindex fmerge-constants
5827 Attempt to merge identical constants (string constants and floating point
5828 constants) across compilation units.
5829
5830 This option is the default for optimized compilation if the assembler and
5831 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5832 behavior.
5833
5834 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5835
5836 @item -fmerge-all-constants
5837 @opindex fmerge-all-constants
5838 Attempt to merge identical constants and identical variables.
5839
5840 This option implies @option{-fmerge-constants}.  In addition to
5841 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5842 arrays or initialized constant variables with integral or floating point
5843 types.  Languages like C or C++ require each variable, including multiple
5844 instances of the same variable in recursive calls, to have distinct locations,
5845 so using this option will result in non-conforming
5846 behavior.
5847
5848 @item -fmodulo-sched
5849 @opindex fmodulo-sched
5850 Perform swing modulo scheduling immediately before the first scheduling
5851 pass.  This pass looks at innermost loops and reorders their
5852 instructions by overlapping different iterations.
5853
5854 @item -fmodulo-sched-allow-regmoves
5855 @opindex fmodulo-sched-allow-regmoves
5856 Perform more aggressive SMS based modulo scheduling with register moves
5857 allowed.  By setting this flag certain anti-dependences edges will be
5858 deleted which will trigger the generation of reg-moves based on the
5859 life-range analysis.  This option is effective only with
5860 @option{-fmodulo-sched} enabled.
5861
5862 @item -fno-branch-count-reg
5863 @opindex fno-branch-count-reg
5864 Do not use ``decrement and branch'' instructions on a count register,
5865 but instead generate a sequence of instructions that decrement a
5866 register, compare it against zero, then branch based upon the result.
5867 This option is only meaningful on architectures that support such
5868 instructions, which include x86, PowerPC, IA-64 and S/390.
5869
5870 The default is @option{-fbranch-count-reg}.
5871
5872 @item -fno-function-cse
5873 @opindex fno-function-cse
5874 Do not put function addresses in registers; make each instruction that
5875 calls a constant function contain the function's address explicitly.
5876
5877 This option results in less efficient code, but some strange hacks
5878 that alter the assembler output may be confused by the optimizations
5879 performed when this option is not used.
5880
5881 The default is @option{-ffunction-cse}
5882
5883 @item -fno-zero-initialized-in-bss
5884 @opindex fno-zero-initialized-in-bss
5885 If the target supports a BSS section, GCC by default puts variables that
5886 are initialized to zero into BSS@.  This can save space in the resulting
5887 code.
5888
5889 This option turns off this behavior because some programs explicitly
5890 rely on variables going to the data section.  E.g., so that the
5891 resulting executable can find the beginning of that section and/or make
5892 assumptions based on that.
5893
5894 The default is @option{-fzero-initialized-in-bss}.
5895
5896 @item -fmudflap -fmudflapth -fmudflapir
5897 @opindex fmudflap
5898 @opindex fmudflapth
5899 @opindex fmudflapir
5900 @cindex bounds checking
5901 @cindex mudflap
5902 For front-ends that support it (C and C++), instrument all risky
5903 pointer/array dereferencing operations, some standard library
5904 string/heap functions, and some other associated constructs with
5905 range/validity tests.  Modules so instrumented should be immune to
5906 buffer overflows, invalid heap use, and some other classes of C/C++
5907 programming errors.  The instrumentation relies on a separate runtime
5908 library (@file{libmudflap}), which will be linked into a program if
5909 @option{-fmudflap} is given at link time.  Run-time behavior of the
5910 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5911 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5912 for its options.
5913
5914 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5915 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5916 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5917 instrumentation should ignore pointer reads.  This produces less
5918 instrumentation (and therefore faster execution) and still provides
5919 some protection against outright memory corrupting writes, but allows
5920 erroneously read data to propagate within a program.
5921
5922 @item -fthread-jumps
5923 @opindex fthread-jumps
5924 Perform optimizations where we check to see if a jump branches to a
5925 location where another comparison subsumed by the first is found.  If
5926 so, the first branch is redirected to either the destination of the
5927 second branch or a point immediately following it, depending on whether
5928 the condition is known to be true or false.
5929
5930 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5931
5932 @item -fsplit-wide-types
5933 @opindex fsplit-wide-types
5934 When using a type that occupies multiple registers, such as @code{long
5935 long} on a 32-bit system, split the registers apart and allocate them
5936 independently.  This normally generates better code for those types,
5937 but may make debugging more difficult.
5938
5939 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5940 @option{-Os}.
5941
5942 @item -fcse-follow-jumps
5943 @opindex fcse-follow-jumps
5944 In common subexpression elimination (CSE), scan through jump instructions
5945 when the target of the jump is not reached by any other path.  For
5946 example, when CSE encounters an @code{if} statement with an
5947 @code{else} clause, CSE will follow the jump when the condition
5948 tested is false.
5949
5950 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5951
5952 @item -fcse-skip-blocks
5953 @opindex fcse-skip-blocks
5954 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5955 follow jumps which conditionally skip over blocks.  When CSE
5956 encounters a simple @code{if} statement with no else clause,
5957 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5958 body of the @code{if}.
5959
5960 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5961
5962 @item -frerun-cse-after-loop
5963 @opindex frerun-cse-after-loop
5964 Re-run common subexpression elimination after loop optimizations has been
5965 performed.
5966
5967 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5968
5969 @item -fgcse
5970 @opindex fgcse
5971 Perform a global common subexpression elimination pass.
5972 This pass also performs global constant and copy propagation.
5973
5974 @emph{Note:} When compiling a program using computed gotos, a GCC
5975 extension, you may get better runtime performance if you disable
5976 the global common subexpression elimination pass by adding
5977 @option{-fno-gcse} to the command line.
5978
5979 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5980
5981 @item -fgcse-lm
5982 @opindex fgcse-lm
5983 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5984 attempt to move loads which are only killed by stores into themselves.  This
5985 allows a loop containing a load/store sequence to be changed to a load outside
5986 the loop, and a copy/store within the loop.
5987
5988 Enabled by default when gcse is enabled.
5989
5990 @item -fgcse-sm
5991 @opindex fgcse-sm
5992 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5993 global common subexpression elimination.  This pass will attempt to move
5994 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5995 loops containing a load/store sequence can be changed to a load before
5996 the loop and a store after the loop.
5997
5998 Not enabled at any optimization level.
5999
6000 @item -fgcse-las
6001 @opindex fgcse-las
6002 When @option{-fgcse-las} is enabled, the global common subexpression
6003 elimination pass eliminates redundant loads that come after stores to the
6004 same memory location (both partial and full redundancies).
6005
6006 Not enabled at any optimization level.
6007
6008 @item -fgcse-after-reload
6009 @opindex fgcse-after-reload
6010 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6011 pass is performed after reload.  The purpose of this pass is to cleanup
6012 redundant spilling.
6013
6014 @item -funsafe-loop-optimizations
6015 @opindex funsafe-loop-optimizations
6016 If given, the loop optimizer will assume that loop indices do not
6017 overflow, and that the loops with nontrivial exit condition are not
6018 infinite.  This enables a wider range of loop optimizations even if
6019 the loop optimizer itself cannot prove that these assumptions are valid.
6020 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6021 if it finds this kind of loop.
6022
6023 @item -fcrossjumping
6024 @opindex fcrossjumping
6025 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6026 resulting code may or may not perform better than without cross-jumping.
6027
6028 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6029
6030 @item -fauto-inc-dec
6031 @opindex fauto-inc-dec
6032 Combine increments or decrements of addresses with memory accesses.
6033 This pass is always skipped on architectures that do not have
6034 instructions to support this.  Enabled by default at @option{-O} and
6035 higher on architectures that support this.
6036
6037 @item -fdce
6038 @opindex fdce
6039 Perform dead code elimination (DCE) on RTL@.
6040 Enabled by default at @option{-O} and higher.
6041
6042 @item -fdse
6043 @opindex fdse
6044 Perform dead store elimination (DSE) on RTL@.
6045 Enabled by default at @option{-O} and higher.
6046
6047 @item -fif-conversion
6048 @opindex fif-conversion
6049 Attempt to transform conditional jumps into branch-less equivalents.  This
6050 include use of conditional moves, min, max, set flags and abs instructions, and
6051 some tricks doable by standard arithmetics.  The use of conditional execution
6052 on chips where it is available is controlled by @code{if-conversion2}.
6053
6054 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6055
6056 @item -fif-conversion2
6057 @opindex fif-conversion2
6058 Use conditional execution (where available) to transform conditional jumps into
6059 branch-less equivalents.
6060
6061 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6062
6063 @item -fdelete-null-pointer-checks
6064 @opindex fdelete-null-pointer-checks
6065 Assume that programs cannot safely dereference null pointers, and that
6066 no code or data element resides there.  This enables simple constant
6067 folding optimizations at all optimization levels.  In addition, other
6068 optimization passes in GCC use this flag to control global dataflow
6069 analyses that eliminate useless checks for null pointers; these assume
6070 that if a pointer is checked after it has already been dereferenced,
6071 it cannot be null.
6072
6073 Note however that in some environments this assumption is not true.
6074 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6075 for programs which depend on that behavior.
6076
6077 Some targets, especially embedded ones, disable this option at all levels.
6078 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6079 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6080 are enabled independently at different optimization levels.
6081
6082 @item -fexpensive-optimizations
6083 @opindex fexpensive-optimizations
6084 Perform a number of minor optimizations that are relatively expensive.
6085
6086 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6087
6088 @item -foptimize-register-move
6089 @itemx -fregmove
6090 @opindex foptimize-register-move
6091 @opindex fregmove
6092 Attempt to reassign register numbers in move instructions and as
6093 operands of other simple instructions in order to maximize the amount of
6094 register tying.  This is especially helpful on machines with two-operand
6095 instructions.
6096
6097 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6098 optimization.
6099
6100 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6101
6102 @item -fira-algorithm=@var{algorithm}
6103 Use specified coloring algorithm for the integrated register
6104 allocator.  The @var{algorithm} argument should be @code{priority} or
6105 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6106 the second one specifies Chaitin-Briggs coloring.  The second
6107 algorithm can be unimplemented for some architectures.  If it is
6108 implemented, it is the default because Chaitin-Briggs coloring as a
6109 rule generates a better code.
6110
6111 @item -fira-region=@var{region}
6112 Use specified regions for the integrated register allocator.  The
6113 @var{region} argument should be one of @code{all}, @code{mixed}, or
6114 @code{one}.  The first value means using all loops as register
6115 allocation regions, the second value which is the default means using
6116 all loops except for loops with small register pressure as the
6117 regions, and third one means using all function as a single region.
6118 The first value can give best result for machines with small size and
6119 irregular register set, the third one results in faster and generates
6120 decent code and the smallest size code, and the default value usually
6121 give the best results in most cases and for most architectures.
6122
6123 @item -fira-coalesce
6124 @opindex fira-coalesce
6125 Do optimistic register coalescing.  This option might be profitable for
6126 architectures with big regular register files.
6127
6128 @item -fno-ira-share-save-slots
6129 @opindex fno-ira-share-save-slots
6130 Switch off sharing stack slots used for saving call used hard
6131 registers living through a call.  Each hard register will get a
6132 separate stack slot and as a result function stack frame will be
6133 bigger.
6134
6135 @item -fno-ira-share-spill-slots
6136 @opindex fno-ira-share-spill-slots
6137 Switch off sharing stack slots allocated for pseudo-registers.  Each
6138 pseudo-register which did not get a hard register will get a separate
6139 stack slot and as a result function stack frame will be bigger.
6140
6141 @item -fira-verbose=@var{n}
6142 @opindex fira-verbose
6143 Set up how verbose dump file for the integrated register allocator
6144 will be.  Default value is 5.  If the value is greater or equal to 10,
6145 the dump file will be stderr as if the value were @var{n} minus 10.
6146
6147 @item -fdelayed-branch
6148 @opindex fdelayed-branch
6149 If supported for the target machine, attempt to reorder instructions
6150 to exploit instruction slots available after delayed branch
6151 instructions.
6152
6153 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6154
6155 @item -fschedule-insns
6156 @opindex fschedule-insns
6157 If supported for the target machine, attempt to reorder instructions to
6158 eliminate execution stalls due to required data being unavailable.  This
6159 helps machines that have slow floating point or memory load instructions
6160 by allowing other instructions to be issued until the result of the load
6161 or floating point instruction is required.
6162
6163 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6164
6165 @item -fschedule-insns2
6166 @opindex fschedule-insns2
6167 Similar to @option{-fschedule-insns}, but requests an additional pass of
6168 instruction scheduling after register allocation has been done.  This is
6169 especially useful on machines with a relatively small number of
6170 registers and where memory load instructions take more than one cycle.
6171
6172 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6173
6174 @item -fno-sched-interblock
6175 @opindex fno-sched-interblock
6176 Don't schedule instructions across basic blocks.  This is normally
6177 enabled by default when scheduling before register allocation, i.e.@:
6178 with @option{-fschedule-insns} or at @option{-O2} or higher.
6179
6180 @item -fno-sched-spec
6181 @opindex fno-sched-spec
6182 Don't allow speculative motion of non-load instructions.  This is normally
6183 enabled by default when scheduling before register allocation, i.e.@:
6184 with @option{-fschedule-insns} or at @option{-O2} or higher.
6185
6186 @item -fsched-spec-load
6187 @opindex fsched-spec-load
6188 Allow speculative motion of some load instructions.  This only makes
6189 sense when scheduling before register allocation, i.e.@: with
6190 @option{-fschedule-insns} or at @option{-O2} or higher.
6191
6192 @item -fsched-spec-load-dangerous
6193 @opindex fsched-spec-load-dangerous
6194 Allow speculative motion of more load instructions.  This only makes
6195 sense when scheduling before register allocation, i.e.@: with
6196 @option{-fschedule-insns} or at @option{-O2} or higher.
6197
6198 @item -fsched-stalled-insns
6199 @itemx -fsched-stalled-insns=@var{n}
6200 @opindex fsched-stalled-insns
6201 Define how many insns (if any) can be moved prematurely from the queue
6202 of stalled insns into the ready list, during the second scheduling pass.
6203 @option{-fno-sched-stalled-insns} means that no insns will be moved
6204 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6205 on how many queued insns can be moved prematurely.
6206 @option{-fsched-stalled-insns} without a value is equivalent to
6207 @option{-fsched-stalled-insns=1}.
6208
6209 @item -fsched-stalled-insns-dep
6210 @itemx -fsched-stalled-insns-dep=@var{n}
6211 @opindex fsched-stalled-insns-dep
6212 Define how many insn groups (cycles) will be examined for a dependency
6213 on a stalled insn that is candidate for premature removal from the queue
6214 of stalled insns.  This has an effect only during the second scheduling pass,
6215 and only if @option{-fsched-stalled-insns} is used.
6216 @option{-fno-sched-stalled-insns-dep} is equivalent to
6217 @option{-fsched-stalled-insns-dep=0}.
6218 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6219 @option{-fsched-stalled-insns-dep=1}.
6220
6221 @item -fsched2-use-superblocks
6222 @opindex fsched2-use-superblocks
6223 When scheduling after register allocation, do use superblock scheduling
6224 algorithm.  Superblock scheduling allows motion across basic block boundaries
6225 resulting on faster schedules.  This option is experimental, as not all machine
6226 descriptions used by GCC model the CPU closely enough to avoid unreliable
6227 results from the algorithm.
6228
6229 This only makes sense when scheduling after register allocation, i.e.@: with
6230 @option{-fschedule-insns2} or at @option{-O2} or higher.
6231
6232 @item -fsched2-use-traces
6233 @opindex fsched2-use-traces
6234 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
6235 allocation and additionally perform code duplication in order to increase the
6236 size of superblocks using tracer pass.  See @option{-ftracer} for details on
6237 trace formation.
6238
6239 This mode should produce faster but significantly longer programs.  Also
6240 without @option{-fbranch-probabilities} the traces constructed may not
6241 match the reality and hurt the performance.  This only makes
6242 sense when scheduling after register allocation, i.e.@: with
6243 @option{-fschedule-insns2} or at @option{-O2} or higher.
6244
6245 @item -freschedule-modulo-scheduled-loops
6246 @opindex freschedule-modulo-scheduled-loops
6247 The modulo scheduling comes before the traditional scheduling, if a loop
6248 was modulo scheduled we may want to prevent the later scheduling passes
6249 from changing its schedule, we use this option to control that.
6250
6251 @item -fselective-scheduling
6252 @opindex fselective-scheduling
6253 Schedule instructions using selective scheduling algorithm.  Selective
6254 scheduling runs instead of the first scheduler pass.
6255
6256 @item -fselective-scheduling2
6257 @opindex fselective-scheduling2
6258 Schedule instructions using selective scheduling algorithm.  Selective
6259 scheduling runs instead of the second scheduler pass.
6260
6261 @item -fsel-sched-pipelining
6262 @opindex fsel-sched-pipelining
6263 Enable software pipelining of innermost loops during selective scheduling.
6264 This option has no effect until one of @option{-fselective-scheduling} or
6265 @option{-fselective-scheduling2} is turned on.
6266
6267 @item -fsel-sched-pipelining-outer-loops
6268 @opindex fsel-sched-pipelining-outer-loops
6269 When pipelining loops during selective scheduling, also pipeline outer loops.
6270 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6271
6272 @item -fcaller-saves
6273 @opindex fcaller-saves
6274 Enable values to be allocated in registers that will be clobbered by
6275 function calls, by emitting extra instructions to save and restore the
6276 registers around such calls.  Such allocation is done only when it
6277 seems to result in better code than would otherwise be produced.
6278
6279 This option is always enabled by default on certain machines, usually
6280 those which have no call-preserved registers to use instead.
6281
6282 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6283
6284 @item -fconserve-stack
6285 @opindex fconserve-stack
6286 Attempt to minimize stack usage.  The compiler will attempt to use less
6287 stack space, even if that makes the program slower.  This option
6288 implies setting the @option{large-stack-frame} parameter to 100
6289 and the @option{large-stack-frame-growth} parameter to 400.
6290
6291 @item -ftree-reassoc
6292 @opindex ftree-reassoc
6293 Perform reassociation on trees.  This flag is enabled by default
6294 at @option{-O} and higher.
6295
6296 @item -ftree-pre
6297 @opindex ftree-pre
6298 Perform partial redundancy elimination (PRE) on trees.  This flag is
6299 enabled by default at @option{-O2} and @option{-O3}.
6300
6301 @item -ftree-forwprop
6302 @opindex ftree-forwprop
6303 Perform forward propagation on trees.  This flag is enabled by default
6304 at @option{-O} and higher.
6305
6306 @item -ftree-fre
6307 @opindex ftree-fre
6308 Perform full redundancy elimination (FRE) on trees.  The difference
6309 between FRE and PRE is that FRE only considers expressions
6310 that are computed on all paths leading to the redundant computation.
6311 This analysis is faster than PRE, though it exposes fewer redundancies.
6312 This flag is enabled by default at @option{-O} and higher.
6313
6314 @item -ftree-phiprop
6315 @opindex ftree-phiprop
6316 Perform hoisting of loads from conditional pointers on trees.  This
6317 pass is enabled by default at @option{-O} and higher.
6318
6319 @item -ftree-copy-prop
6320 @opindex ftree-copy-prop
6321 Perform copy propagation on trees.  This pass eliminates unnecessary
6322 copy operations.  This flag is enabled by default at @option{-O} and
6323 higher.
6324
6325 @item -fipa-pure-const
6326 @opindex fipa-pure-const
6327 Discover which functions are pure or constant.
6328 Enabled by default at @option{-O} and higher.
6329
6330 @item -fipa-reference
6331 @opindex fipa-reference
6332 Discover which static variables do not escape cannot escape the
6333 compilation unit.
6334 Enabled by default at @option{-O} and higher.
6335
6336 @item -fipa-struct-reorg
6337 @opindex fipa-struct-reorg
6338 Perform structure reorganization optimization, that change C-like structures
6339 layout in order to better utilize spatial locality.  This transformation is
6340 affective for programs containing arrays of structures.  Available in two
6341 compilation modes: profile-based (enabled with @option{-fprofile-generate})
6342 or static (which uses built-in heuristics).  Require @option{-fipa-type-escape}
6343 to provide the safety of this transformation.  It works only in whole program
6344 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
6345 enabled.  Structures considered @samp{cold} by this transformation are not
6346 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
6347
6348 With this flag, the program debug info reflects a new structure layout.
6349
6350 @item -fipa-pta
6351 @opindex fipa-pta
6352 Perform interprocedural pointer analysis.  This option is experimental
6353 and does not affect generated code.
6354
6355 @item -fipa-cp
6356 @opindex fipa-cp
6357 Perform interprocedural constant propagation.
6358 This optimization analyzes the program to determine when values passed
6359 to functions are constants and then optimizes accordingly.
6360 This optimization can substantially increase performance
6361 if the application has constants passed to functions.
6362 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6363
6364 @item -fipa-cp-clone
6365 @opindex fipa-cp-clone
6366 Perform function cloning to make interprocedural constant propagation stronger.
6367 When enabled, interprocedural constant propagation will perform function cloning
6368 when externally visible function can be called with constant arguments.
6369 Because this optimization can create multiple copies of functions,
6370 it may significantly increase code size
6371 (see @option{--param ipcp-unit-growth=@var{value}}).
6372 This flag is enabled by default at @option{-O3}.
6373
6374 @item -fipa-matrix-reorg
6375 @opindex fipa-matrix-reorg
6376 Perform matrix flattening and transposing.
6377 Matrix flattening tries to replace an @math{m}-dimensional matrix
6378 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
6379 This reduces the level of indirection needed for accessing the elements
6380 of the matrix. The second optimization is matrix transposing that
6381 attempts to change the order of the matrix's dimensions in order to
6382 improve cache locality.
6383 Both optimizations need the @option{-fwhole-program} flag.
6384 Transposing is enabled only if profiling information is available.
6385
6386 @item -ftree-sink
6387 @opindex ftree-sink
6388 Perform forward store motion  on trees.  This flag is
6389 enabled by default at @option{-O} and higher.
6390
6391 @item -ftree-ccp
6392 @opindex ftree-ccp
6393 Perform sparse conditional constant propagation (CCP) on trees.  This
6394 pass only operates on local scalar variables and is enabled by default
6395 at @option{-O} and higher.
6396
6397 @item -ftree-switch-conversion
6398 Perform conversion of simple initializations in a switch to
6399 initializations from a scalar array.  This flag is enabled by default
6400 at @option{-O2} and higher.
6401
6402 @item -ftree-dce
6403 @opindex ftree-dce
6404 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6405 default at @option{-O} and higher.
6406
6407 @item -ftree-builtin-call-dce
6408 @opindex ftree-builtin-call-dce
6409 Perform conditional dead code elimination (DCE) for calls to builtin functions
6410 that may set @code{errno} but are otherwise side-effect free.  This flag is
6411 enabled by default at @option{-O2} and higher if @option{-Os} is not also
6412 specified.
6413
6414 @item -ftree-dominator-opts
6415 @opindex ftree-dominator-opts
6416 Perform a variety of simple scalar cleanups (constant/copy
6417 propagation, redundancy elimination, range propagation and expression
6418 simplification) based on a dominator tree traversal.  This also
6419 performs jump threading (to reduce jumps to jumps). This flag is
6420 enabled by default at @option{-O} and higher.
6421
6422 @item -ftree-dse
6423 @opindex ftree-dse
6424 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6425 a memory location which will later be overwritten by another store without
6426 any intervening loads.  In this case the earlier store can be deleted.  This
6427 flag is enabled by default at @option{-O} and higher.
6428
6429 @item -ftree-ch
6430 @opindex ftree-ch
6431 Perform loop header copying on trees.  This is beneficial since it increases
6432 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6433 is enabled by default at @option{-O} and higher.  It is not enabled
6434 for @option{-Os}, since it usually increases code size.
6435
6436 @item -ftree-loop-optimize
6437 @opindex ftree-loop-optimize
6438 Perform loop optimizations on trees.  This flag is enabled by default
6439 at @option{-O} and higher.
6440
6441 @item -ftree-loop-linear
6442 @opindex ftree-loop-linear
6443 Perform linear loop transformations on tree.  This flag can improve cache
6444 performance and allow further loop optimizations to take place.
6445
6446 @item -floop-interchange
6447 Perform loop interchange transformations on loops.  Interchanging two
6448 nested loops switches the inner and outer loops.  For example, given a
6449 loop like:
6450 @smallexample
6451 DO J = 1, M
6452   DO I = 1, N
6453     A(J, I) = A(J, I) * C
6454   ENDDO
6455 ENDDO
6456 @end smallexample
6457 loop interchange will transform the loop as if the user had written:
6458 @smallexample
6459 DO I = 1, N
6460   DO J = 1, M
6461     A(J, I) = A(J, I) * C
6462   ENDDO
6463 ENDDO
6464 @end smallexample
6465 which can be beneficial when @code{N} is larger than the caches,
6466 because in Fortran, the elements of an array are stored in memory
6467 contiguously by column, and the original loop iterates over rows,
6468 potentially creating at each access a cache miss.  This optimization
6469 applies to all the languages supported by GCC and is not limited to
6470 Fortran.  To use this code transformation, GCC has to be configured
6471 with @option{--with-ppl} and @option{--with-cloog} to enable the
6472 Graphite loop transformation infrastructure.
6473
6474 @item -floop-strip-mine
6475 Perform loop strip mining transformations on loops.  Strip mining
6476 splits a loop into two nested loops.  The outer loop has strides
6477 equal to the strip size and the inner loop has strides of the
6478 original loop within a strip.  For example, given a loop like:
6479 @smallexample
6480 DO I = 1, N
6481   A(I) = A(I) + C
6482 ENDDO
6483 @end smallexample
6484 loop strip mining will transform the loop as if the user had written:
6485 @smallexample
6486 DO II = 1, N, 4
6487   DO I = II, min (II + 3, N)
6488     A(I) = A(I) + C
6489   ENDDO
6490 ENDDO
6491 @end smallexample
6492 This optimization applies to all the languages supported by GCC and is
6493 not limited to Fortran.  To use this code transformation, GCC has to
6494 be configured with @option{--with-ppl} and @option{--with-cloog} to
6495 enable the Graphite loop transformation infrastructure.
6496
6497 @item -floop-block
6498 Perform loop blocking transformations on loops.  Blocking strip mines
6499 each loop in the loop nest such that the memory accesses of the
6500 element loops fit inside caches.  For example, given a loop like:
6501 @smallexample
6502 DO I = 1, N
6503   DO J = 1, M
6504     A(J, I) = B(I) + C(J)
6505   ENDDO
6506 ENDDO
6507 @end smallexample
6508 loop blocking will transform the loop as if the user had written:
6509 @smallexample
6510 DO II = 1, N, 64
6511   DO JJ = 1, M, 64
6512     DO I = II, min (II + 63, N)
6513       DO J = JJ, min (JJ + 63, M)
6514         A(J, I) = B(I) + C(J)
6515       ENDDO
6516     ENDDO
6517   ENDDO
6518 ENDDO
6519 @end smallexample
6520 which can be beneficial when @code{M} is larger than the caches,
6521 because the innermost loop will iterate over a smaller amount of data
6522 that can be kept in the caches.  This optimization applies to all the
6523 languages supported by GCC and is not limited to Fortran.  To use this
6524 code transformation, GCC has to be configured with @option{--with-ppl}
6525 and @option{--with-cloog} to enable the Graphite loop transformation
6526 infrastructure.
6527
6528 @item -fcheck-data-deps
6529 @opindex fcheck-data-deps
6530 Compare the results of several data dependence analyzers.  This option
6531 is used for debugging the data dependence analyzers.
6532
6533 @item -ftree-loop-distribution
6534 Perform loop distribution.  This flag can improve cache performance on
6535 big loop bodies and allow further loop optimizations, like
6536 parallelization or vectorization, to take place.  For example, the loop
6537 @smallexample
6538 DO I = 1, N
6539   A(I) = B(I) + C
6540   D(I) = E(I) * F
6541 ENDDO
6542 @end smallexample
6543 is transformed to
6544 @smallexample
6545 DO I = 1, N
6546    A(I) = B(I) + C
6547 ENDDO
6548 DO I = 1, N
6549    D(I) = E(I) * F
6550 ENDDO
6551 @end smallexample
6552
6553 @item -ftree-loop-im
6554 @opindex ftree-loop-im
6555 Perform loop invariant motion on trees.  This pass moves only invariants that
6556 would be hard to handle at RTL level (function calls, operations that expand to
6557 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
6558 operands of conditions that are invariant out of the loop, so that we can use
6559 just trivial invariantness analysis in loop unswitching.  The pass also includes
6560 store motion.
6561
6562 @item -ftree-loop-ivcanon
6563 @opindex ftree-loop-ivcanon
6564 Create a canonical counter for number of iterations in the loop for that
6565 determining number of iterations requires complicated analysis.  Later
6566 optimizations then may determine the number easily.  Useful especially
6567 in connection with unrolling.
6568
6569 @item -fivopts
6570 @opindex fivopts
6571 Perform induction variable optimizations (strength reduction, induction
6572 variable merging and induction variable elimination) on trees.
6573
6574 @item -ftree-parallelize-loops=n
6575 @opindex ftree-parallelize-loops
6576 Parallelize loops, i.e., split their iteration space to run in n threads.
6577 This is only possible for loops whose iterations are independent
6578 and can be arbitrarily reordered.  The optimization is only
6579 profitable on multiprocessor machines, for loops that are CPU-intensive,
6580 rather than constrained e.g.@: by memory bandwidth.  This option
6581 implies @option{-pthread}, and thus is only supported on targets
6582 that have support for @option{-pthread}.
6583
6584 @item -ftree-pta
6585 @opindex ftree-pta
6586 Perform function-local points-to analysis on trees.  This flag is
6587 enabled by default at @option{-O} and higher.
6588
6589 @item -ftree-sra
6590 @opindex ftree-sra
6591 Perform scalar replacement of aggregates.  This pass replaces structure
6592 references with scalars to prevent committing structures to memory too
6593 early.  This flag is enabled by default at @option{-O} and higher.
6594
6595 @item -ftree-copyrename
6596 @opindex ftree-copyrename
6597 Perform copy renaming on trees.  This pass attempts to rename compiler
6598 temporaries to other variables at copy locations, usually resulting in
6599 variable names which more closely resemble the original variables.  This flag
6600 is enabled by default at @option{-O} and higher.
6601
6602 @item -ftree-ter
6603 @opindex ftree-ter
6604 Perform temporary expression replacement during the SSA->normal phase.  Single
6605 use/single def temporaries are replaced at their use location with their
6606 defining expression.  This results in non-GIMPLE code, but gives the expanders
6607 much more complex trees to work on resulting in better RTL generation.  This is
6608 enabled by default at @option{-O} and higher.
6609
6610 @item -ftree-vectorize
6611 @opindex ftree-vectorize
6612 Perform loop vectorization on trees. This flag is enabled by default at
6613 @option{-O3}.
6614
6615 @item -ftree-vect-loop-version
6616 @opindex ftree-vect-loop-version
6617 Perform loop versioning when doing loop vectorization on trees.  When a loop
6618 appears to be vectorizable except that data alignment or data dependence cannot
6619 be determined at compile time then vectorized and non-vectorized versions of
6620 the loop are generated along with runtime checks for alignment or dependence
6621 to control which version is executed.  This option is enabled by default
6622 except at level @option{-Os} where it is disabled.
6623
6624 @item -fvect-cost-model
6625 @opindex fvect-cost-model
6626 Enable cost model for vectorization.
6627
6628 @item -ftree-vrp
6629 @opindex ftree-vrp
6630 Perform Value Range Propagation on trees.  This is similar to the
6631 constant propagation pass, but instead of values, ranges of values are
6632 propagated.  This allows the optimizers to remove unnecessary range
6633 checks like array bound checks and null pointer checks.  This is
6634 enabled by default at @option{-O2} and higher.  Null pointer check
6635 elimination is only done if @option{-fdelete-null-pointer-checks} is
6636 enabled.
6637
6638 @item -ftracer
6639 @opindex ftracer
6640 Perform tail duplication to enlarge superblock size.  This transformation
6641 simplifies the control flow of the function allowing other optimizations to do
6642 better job.
6643
6644 @item -funroll-loops
6645 @opindex funroll-loops
6646 Unroll loops whose number of iterations can be determined at compile
6647 time or upon entry to the loop.  @option{-funroll-loops} implies
6648 @option{-frerun-cse-after-loop}.  This option makes code larger,
6649 and may or may not make it run faster.
6650
6651 @item -funroll-all-loops
6652 @opindex funroll-all-loops
6653 Unroll all loops, even if their number of iterations is uncertain when
6654 the loop is entered.  This usually makes programs run more slowly.
6655 @option{-funroll-all-loops} implies the same options as
6656 @option{-funroll-loops},
6657
6658 @item -fsplit-ivs-in-unroller
6659 @opindex fsplit-ivs-in-unroller
6660 Enables expressing of values of induction variables in later iterations
6661 of the unrolled loop using the value in the first iteration.  This breaks
6662 long dependency chains, thus improving efficiency of the scheduling passes.
6663
6664 Combination of @option{-fweb} and CSE is often sufficient to obtain the
6665 same effect.  However in cases the loop body is more complicated than
6666 a single basic block, this is not reliable.  It also does not work at all
6667 on some of the architectures due to restrictions in the CSE pass.
6668
6669 This optimization is enabled by default.
6670
6671 @item -fvariable-expansion-in-unroller
6672 @opindex fvariable-expansion-in-unroller
6673 With this option, the compiler will create multiple copies of some
6674 local variables when unrolling a loop which can result in superior code.
6675
6676 @item -fpredictive-commoning
6677 @opindex fpredictive-commoning
6678 Perform predictive commoning optimization, i.e., reusing computations
6679 (especially memory loads and stores) performed in previous
6680 iterations of loops.
6681
6682 This option is enabled at level @option{-O3}.
6683
6684 @item -fprefetch-loop-arrays
6685 @opindex fprefetch-loop-arrays
6686 If supported by the target machine, generate instructions to prefetch
6687 memory to improve the performance of loops that access large arrays.
6688
6689 This option may generate better or worse code; results are highly
6690 dependent on the structure of loops within the source code.
6691
6692 Disabled at level @option{-Os}.
6693
6694 @item -fno-peephole
6695 @itemx -fno-peephole2
6696 @opindex fno-peephole
6697 @opindex fno-peephole2
6698 Disable any machine-specific peephole optimizations.  The difference
6699 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
6700 are implemented in the compiler; some targets use one, some use the
6701 other, a few use both.
6702
6703 @option{-fpeephole} is enabled by default.
6704 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6705
6706 @item -fno-guess-branch-probability
6707 @opindex fno-guess-branch-probability
6708 Do not guess branch probabilities using heuristics.
6709
6710 GCC will use heuristics to guess branch probabilities if they are
6711 not provided by profiling feedback (@option{-fprofile-arcs}).  These
6712 heuristics are based on the control flow graph.  If some branch probabilities
6713 are specified by @samp{__builtin_expect}, then the heuristics will be
6714 used to guess branch probabilities for the rest of the control flow graph,
6715 taking the @samp{__builtin_expect} info into account.  The interactions
6716 between the heuristics and @samp{__builtin_expect} can be complex, and in
6717 some cases, it may be useful to disable the heuristics so that the effects
6718 of @samp{__builtin_expect} are easier to understand.
6719
6720 The default is @option{-fguess-branch-probability} at levels
6721 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6722
6723 @item -freorder-blocks
6724 @opindex freorder-blocks
6725 Reorder basic blocks in the compiled function in order to reduce number of
6726 taken branches and improve code locality.
6727
6728 Enabled at levels @option{-O2}, @option{-O3}.
6729
6730 @item -freorder-blocks-and-partition
6731 @opindex freorder-blocks-and-partition
6732 In addition to reordering basic blocks in the compiled function, in order
6733 to reduce number of taken branches, partitions hot and cold basic blocks
6734 into separate sections of the assembly and .o files, to improve
6735 paging and cache locality performance.
6736
6737 This optimization is automatically turned off in the presence of
6738 exception handling, for linkonce sections, for functions with a user-defined
6739 section attribute and on any architecture that does not support named
6740 sections.
6741
6742 @item -freorder-functions
6743 @opindex freorder-functions
6744 Reorder functions in the object file in order to
6745 improve code locality.  This is implemented by using special
6746 subsections @code{.text.hot} for most frequently executed functions and
6747 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
6748 the linker so object file format must support named sections and linker must
6749 place them in a reasonable way.
6750
6751 Also profile feedback must be available in to make this option effective.  See
6752 @option{-fprofile-arcs} for details.
6753
6754 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6755
6756 @item -fstrict-aliasing
6757 @opindex fstrict-aliasing
6758 Allows the compiler to assume the strictest aliasing rules applicable to
6759 the language being compiled.  For C (and C++), this activates
6760 optimizations based on the type of expressions.  In particular, an
6761 object of one type is assumed never to reside at the same address as an
6762 object of a different type, unless the types are almost the same.  For
6763 example, an @code{unsigned int} can alias an @code{int}, but not a
6764 @code{void*} or a @code{double}.  A character type may alias any other
6765 type.
6766
6767 @anchor{Type-punning}Pay special attention to code like this:
6768 @smallexample
6769 union a_union @{
6770   int i;
6771   double d;
6772 @};
6773
6774 int f() @{
6775   a_union t;
6776   t.d = 3.0;
6777   return t.i;
6778 @}
6779 @end smallexample
6780 The practice of reading from a different union member than the one most
6781 recently written to (called ``type-punning'') is common.  Even with
6782 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
6783 is accessed through the union type.  So, the code above will work as
6784 expected.  @xref{Structures unions enumerations and bit-fields
6785 implementation}.  However, this code might not:
6786 @smallexample
6787 int f() @{
6788   a_union t;
6789   int* ip;
6790   t.d = 3.0;
6791   ip = &t.i;
6792   return *ip;
6793 @}
6794 @end smallexample
6795
6796 Similarly, access by taking the address, casting the resulting pointer
6797 and dereferencing the result has undefined behavior, even if the cast
6798 uses a union type, e.g.:
6799 @smallexample
6800 int f() @{
6801   double d = 3.0;
6802   return ((union a_union *) &d)->i;
6803 @}
6804 @end smallexample
6805
6806 The @option{-fstrict-aliasing} option is enabled at levels
6807 @option{-O2}, @option{-O3}, @option{-Os}.
6808
6809 @item -fstrict-overflow
6810 @opindex fstrict-overflow
6811 Allow the compiler to assume strict signed overflow rules, depending
6812 on the language being compiled.  For C (and C++) this means that
6813 overflow when doing arithmetic with signed numbers is undefined, which
6814 means that the compiler may assume that it will not happen.  This
6815 permits various optimizations.  For example, the compiler will assume
6816 that an expression like @code{i + 10 > i} will always be true for
6817 signed @code{i}.  This assumption is only valid if signed overflow is
6818 undefined, as the expression is false if @code{i + 10} overflows when
6819 using twos complement arithmetic.  When this option is in effect any
6820 attempt to determine whether an operation on signed numbers will
6821 overflow must be written carefully to not actually involve overflow.
6822
6823 This option also allows the compiler to assume strict pointer
6824 semantics: given a pointer to an object, if adding an offset to that
6825 pointer does not produce a pointer to the same object, the addition is
6826 undefined.  This permits the compiler to conclude that @code{p + u >
6827 p} is always true for a pointer @code{p} and unsigned integer
6828 @code{u}.  This assumption is only valid because pointer wraparound is
6829 undefined, as the expression is false if @code{p + u} overflows using
6830 twos complement arithmetic.
6831
6832 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
6833 that integer signed overflow is fully defined: it wraps.  When
6834 @option{-fwrapv} is used, there is no difference between
6835 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
6836 integers.  With @option{-fwrapv} certain types of overflow are
6837 permitted.  For example, if the compiler gets an overflow when doing
6838 arithmetic on constants, the overflowed value can still be used with
6839 @option{-fwrapv}, but not otherwise.
6840
6841 The @option{-fstrict-overflow} option is enabled at levels
6842 @option{-O2}, @option{-O3}, @option{-Os}.
6843
6844 @item -falign-functions
6845 @itemx -falign-functions=@var{n}
6846 @opindex falign-functions
6847 Align the start of functions to the next power-of-two greater than
6848 @var{n}, skipping up to @var{n} bytes.  For instance,
6849 @option{-falign-functions=32} aligns functions to the next 32-byte
6850 boundary, but @option{-falign-functions=24} would align to the next
6851 32-byte boundary only if this can be done by skipping 23 bytes or less.
6852
6853 @option{-fno-align-functions} and @option{-falign-functions=1} are
6854 equivalent and mean that functions will not be aligned.
6855
6856 Some assemblers only support this flag when @var{n} is a power of two;
6857 in that case, it is rounded up.
6858
6859 If @var{n} is not specified or is zero, use a machine-dependent default.
6860
6861 Enabled at levels @option{-O2}, @option{-O3}.
6862
6863 @item -falign-labels
6864 @itemx -falign-labels=@var{n}
6865 @opindex falign-labels
6866 Align all branch targets to a power-of-two boundary, skipping up to
6867 @var{n} bytes like @option{-falign-functions}.  This option can easily
6868 make code slower, because it must insert dummy operations for when the
6869 branch target is reached in the usual flow of the code.
6870
6871 @option{-fno-align-labels} and @option{-falign-labels=1} are
6872 equivalent and mean that labels will not be aligned.
6873
6874 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
6875 are greater than this value, then their values are used instead.
6876
6877 If @var{n} is not specified or is zero, use a machine-dependent default
6878 which is very likely to be @samp{1}, meaning no alignment.
6879
6880 Enabled at levels @option{-O2}, @option{-O3}.
6881
6882 @item -falign-loops
6883 @itemx -falign-loops=@var{n}
6884 @opindex falign-loops
6885 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
6886 like @option{-falign-functions}.  The hope is that the loop will be
6887 executed many times, which will make up for any execution of the dummy
6888 operations.
6889
6890 @option{-fno-align-loops} and @option{-falign-loops=1} are
6891 equivalent and mean that loops will not be aligned.
6892
6893 If @var{n} is not specified or is zero, use a machine-dependent default.
6894
6895 Enabled at levels @option{-O2}, @option{-O3}.
6896
6897 @item -falign-jumps
6898 @itemx -falign-jumps=@var{n}
6899 @opindex falign-jumps
6900 Align branch targets to a power-of-two boundary, for branch targets
6901 where the targets can only be reached by jumping, skipping up to @var{n}
6902 bytes like @option{-falign-functions}.  In this case, no dummy operations
6903 need be executed.
6904
6905 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6906 equivalent and mean that loops will not be aligned.
6907
6908 If @var{n} is not specified or is zero, use a machine-dependent default.
6909
6910 Enabled at levels @option{-O2}, @option{-O3}.
6911
6912 @item -funit-at-a-time
6913 @opindex funit-at-a-time
6914 This option is left for compatibility reasons. @option{-funit-at-a-time}
6915 has no effect, while @option{-fno-unit-at-a-time} implies
6916 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
6917
6918 Enabled by default.
6919
6920 @item -fno-toplevel-reorder
6921 @opindex fno-toplevel-reorder
6922 Do not reorder top-level functions, variables, and @code{asm}
6923 statements.  Output them in the same order that they appear in the
6924 input file.  When this option is used, unreferenced static variables
6925 will not be removed.  This option is intended to support existing code
6926 which relies on a particular ordering.  For new code, it is better to
6927 use attributes.
6928
6929 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
6930 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
6931 targets.
6932
6933 @item -fweb
6934 @opindex fweb
6935 Constructs webs as commonly used for register allocation purposes and assign
6936 each web individual pseudo register.  This allows the register allocation pass
6937 to operate on pseudos directly, but also strengthens several other optimization
6938 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6939 however, make debugging impossible, since variables will no longer stay in a
6940 ``home register''.
6941
6942 Enabled by default with @option{-funroll-loops}.
6943
6944 @item -fwhole-program
6945 @opindex fwhole-program
6946 Assume that the current compilation unit represents the whole program being
6947 compiled.  All public functions and variables with the exception of @code{main}
6948 and those merged by attribute @code{externally_visible} become static functions
6949 and in effect are optimized more aggressively by interprocedural optimizers.
6950 While this option is equivalent to proper use of the @code{static} keyword for
6951 programs consisting of a single file, in combination with option
6952 @option{--combine} this flag can be used to compile many smaller scale C
6953 programs since the functions and variables become local for the whole combined
6954 compilation unit, not for the single source file itself.
6955
6956 This option implies @option{-fwhole-file} for Fortran programs.
6957
6958 @item -fcprop-registers
6959 @opindex fcprop-registers
6960 After register allocation and post-register allocation instruction splitting,
6961 we perform a copy-propagation pass to try to reduce scheduling dependencies
6962 and occasionally eliminate the copy.
6963
6964 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6965
6966 @item -fprofile-correction
6967 @opindex fprofile-correction
6968 Profiles collected using an instrumented binary for multi-threaded programs may
6969 be inconsistent due to missed counter updates. When this option is specified,
6970 GCC will use heuristics to correct or smooth out such inconsistencies. By
6971 default, GCC will emit an error message when an inconsistent profile is detected.
6972
6973 @item -fprofile-dir=@var{path}
6974 @opindex fprofile-dir
6975
6976 Set the directory to search the profile data files in to @var{path}.
6977 This option affects only the profile data generated by
6978 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
6979 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
6980 and its related options.
6981 By default, GCC will use the current directory as @var{path}
6982 thus the profile data file will appear in the same directory as the object file.
6983
6984 @item -fprofile-generate
6985 @itemx -fprofile-generate=@var{path}
6986 @opindex fprofile-generate
6987
6988 Enable options usually used for instrumenting application to produce
6989 profile useful for later recompilation with profile feedback based
6990 optimization.  You must use @option{-fprofile-generate} both when
6991 compiling and when linking your program.
6992
6993 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6994
6995 If @var{path} is specified, GCC will look at the @var{path} to find
6996 the profile feedback data files. See @option{-fprofile-dir}.
6997
6998 @item -fprofile-use
6999 @itemx -fprofile-use=@var{path}
7000 @opindex fprofile-use
7001 Enable profile feedback directed optimizations, and optimizations
7002 generally profitable only with profile feedback available.
7003
7004 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
7005 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
7006
7007 By default, GCC emits an error message if the feedback profiles do not
7008 match the source code.  This error can be turned into a warning by using
7009 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
7010 code.
7011
7012 If @var{path} is specified, GCC will look at the @var{path} to find
7013 the profile feedback data files. See @option{-fprofile-dir}.
7014 @end table
7015
7016 The following options control compiler behavior regarding floating
7017 point arithmetic.  These options trade off between speed and
7018 correctness.  All must be specifically enabled.
7019
7020 @table @gcctabopt
7021 @item -ffloat-store
7022 @opindex ffloat-store
7023 Do not store floating point variables in registers, and inhibit other
7024 options that might change whether a floating point value is taken from a
7025 register or memory.
7026
7027 @cindex floating point precision
7028 This option prevents undesirable excess precision on machines such as
7029 the 68000 where the floating registers (of the 68881) keep more
7030 precision than a @code{double} is supposed to have.  Similarly for the
7031 x86 architecture.  For most programs, the excess precision does only
7032 good, but a few programs rely on the precise definition of IEEE floating
7033 point.  Use @option{-ffloat-store} for such programs, after modifying
7034 them to store all pertinent intermediate computations into variables.
7035
7036 @item -fexcess-precision=@var{style}
7037 @opindex fexcess-precision
7038 This option allows further control over excess precision on machines
7039 where floating-point registers have more precision than the IEEE
7040 @code{float} and @code{double} types and the processor does not
7041 support operations rounding to those types.  By default,
7042 @option{-fexcess-precision=fast} is in effect; this means that
7043 operations are carried out in the precision of the registers and that
7044 it is unpredictable when rounding to the types specified in the source
7045 code takes place.  When compiling C, if
7046 @option{-fexcess-precision=standard} is specified then excess
7047 precision will follow the rules specified in ISO C99; in particular,
7048 both casts and assignments cause values to be rounded to their
7049 semantic types (whereas @option{-ffloat-store} only affects
7050 assignments).  This option is enabled by default for C if a strict
7051 conformance option such as @option{-std=c99} is used.
7052
7053 @opindex mfpmath
7054 @option{-fexcess-precision=standard} is not implemented for languages
7055 other than C, and has no effect if
7056 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
7057 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
7058 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
7059 semantics apply without excess precision, and in the latter, rounding
7060 is unpredictable.
7061
7062 @item -ffast-math
7063 @opindex ffast-math
7064 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
7065 @option{-ffinite-math-only}, @option{-fno-rounding-math},
7066 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
7067
7068 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
7069
7070 This option is not turned on by any @option{-O} option since
7071 it can result in incorrect output for programs which depend on
7072 an exact implementation of IEEE or ISO rules/specifications for
7073 math functions. It may, however, yield faster code for programs
7074 that do not require the guarantees of these specifications.
7075
7076 @item -fno-math-errno
7077 @opindex fno-math-errno
7078 Do not set ERRNO after calling math functions that are executed
7079 with a single instruction, e.g., sqrt.  A program that relies on
7080 IEEE exceptions for math error handling may want to use this flag
7081 for speed while maintaining IEEE arithmetic compatibility.
7082
7083 This option is not turned on by any @option{-O} option since
7084 it can result in incorrect output for programs which depend on
7085 an exact implementation of IEEE or ISO rules/specifications for
7086 math functions. It may, however, yield faster code for programs
7087 that do not require the guarantees of these specifications.
7088
7089 The default is @option{-fmath-errno}.
7090
7091 On Darwin systems, the math library never sets @code{errno}.  There is
7092 therefore no reason for the compiler to consider the possibility that
7093 it might, and @option{-fno-math-errno} is the default.
7094
7095 @item -funsafe-math-optimizations
7096 @opindex funsafe-math-optimizations
7097
7098 Allow optimizations for floating-point arithmetic that (a) assume
7099 that arguments and results are valid and (b) may violate IEEE or
7100 ANSI standards.  When used at link-time, it may include libraries
7101 or startup files that change the default FPU control word or other
7102 similar optimizations.
7103
7104 This option is not turned on by any @option{-O} option since
7105 it can result in incorrect output for programs which depend on
7106 an exact implementation of IEEE or ISO rules/specifications for
7107 math functions. It may, however, yield faster code for programs
7108 that do not require the guarantees of these specifications.
7109 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
7110 @option{-fassociative-math} and @option{-freciprocal-math}.
7111
7112 The default is @option{-fno-unsafe-math-optimizations}.
7113
7114 @item -fassociative-math
7115 @opindex fassociative-math
7116
7117 Allow re-association of operands in series of floating-point operations.
7118 This violates the ISO C and C++ language standard by possibly changing
7119 computation result.  NOTE: re-ordering may change the sign of zero as
7120 well as ignore NaNs and inhibit or create underflow or overflow (and
7121 thus cannot be used on a code which relies on rounding behavior like
7122 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
7123 and thus may not be used when ordered comparisons are required.
7124 This option requires that both @option{-fno-signed-zeros} and
7125 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
7126 much sense with @option{-frounding-math}.
7127
7128 The default is @option{-fno-associative-math}.
7129
7130 @item -freciprocal-math
7131 @opindex freciprocal-math
7132
7133 Allow the reciprocal of a value to be used instead of dividing by
7134 the value if this enables optimizations.  For example @code{x / y}
7135 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
7136 is subject to common subexpression elimination.  Note that this loses
7137 precision and increases the number of flops operating on the value.
7138
7139 The default is @option{-fno-reciprocal-math}.
7140
7141 @item -ffinite-math-only
7142 @opindex ffinite-math-only
7143 Allow optimizations for floating-point arithmetic that assume
7144 that arguments and results are not NaNs or +-Infs.
7145
7146 This option is not turned on by any @option{-O} option since
7147 it can result in incorrect output for programs which depend on
7148 an exact implementation of IEEE or ISO rules/specifications for
7149 math functions. It may, however, yield faster code for programs
7150 that do not require the guarantees of these specifications.
7151
7152 The default is @option{-fno-finite-math-only}.
7153
7154 @item -fno-signed-zeros
7155 @opindex fno-signed-zeros
7156 Allow optimizations for floating point arithmetic that ignore the
7157 signedness of zero.  IEEE arithmetic specifies the behavior of
7158 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
7159 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
7160 This option implies that the sign of a zero result isn't significant.
7161
7162 The default is @option{-fsigned-zeros}.
7163
7164 @item -fno-trapping-math
7165 @opindex fno-trapping-math
7166 Compile code assuming that floating-point operations cannot generate
7167 user-visible traps.  These traps include division by zero, overflow,
7168 underflow, inexact result and invalid operation.  This option requires
7169 that @option{-fno-signaling-nans} be in effect.  Setting this option may
7170 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
7171
7172 This option should never be turned on by any @option{-O} option since
7173 it can result in incorrect output for programs which depend on
7174 an exact implementation of IEEE or ISO rules/specifications for
7175 math functions.
7176
7177 The default is @option{-ftrapping-math}.
7178
7179 @item -frounding-math
7180 @opindex frounding-math
7181 Disable transformations and optimizations that assume default floating
7182 point rounding behavior.  This is round-to-zero for all floating point
7183 to integer conversions, and round-to-nearest for all other arithmetic
7184 truncations.  This option should be specified for programs that change
7185 the FP rounding mode dynamically, or that may be executed with a
7186 non-default rounding mode.  This option disables constant folding of
7187 floating point expressions at compile-time (which may be affected by
7188 rounding mode) and arithmetic transformations that are unsafe in the
7189 presence of sign-dependent rounding modes.
7190
7191 The default is @option{-fno-rounding-math}.
7192
7193 This option is experimental and does not currently guarantee to
7194 disable all GCC optimizations that are affected by rounding mode.
7195 Future versions of GCC may provide finer control of this setting
7196 using C99's @code{FENV_ACCESS} pragma.  This command line option
7197 will be used to specify the default state for @code{FENV_ACCESS}.
7198
7199 @item -fsignaling-nans
7200 @opindex fsignaling-nans
7201 Compile code assuming that IEEE signaling NaNs may generate user-visible
7202 traps during floating-point operations.  Setting this option disables
7203 optimizations that may change the number of exceptions visible with
7204 signaling NaNs.  This option implies @option{-ftrapping-math}.
7205
7206 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
7207 be defined.
7208
7209 The default is @option{-fno-signaling-nans}.
7210
7211 This option is experimental and does not currently guarantee to
7212 disable all GCC optimizations that affect signaling NaN behavior.
7213
7214 @item -fsingle-precision-constant
7215 @opindex fsingle-precision-constant
7216 Treat floating point constant as single precision constant instead of
7217 implicitly converting it to double precision constant.
7218
7219 @item -fcx-limited-range
7220 @opindex fcx-limited-range
7221 When enabled, this option states that a range reduction step is not
7222 needed when performing complex division.  Also, there is no checking
7223 whether the result of a complex multiplication or division is @code{NaN
7224 + I*NaN}, with an attempt to rescue the situation in that case.  The
7225 default is @option{-fno-cx-limited-range}, but is enabled by
7226 @option{-ffast-math}.
7227
7228 This option controls the default setting of the ISO C99
7229 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
7230 all languages.
7231
7232 @item -fcx-fortran-rules
7233 @opindex fcx-fortran-rules
7234 Complex multiplication and division follow Fortran rules.  Range
7235 reduction is done as part of complex division, but there is no checking
7236 whether the result of a complex multiplication or division is @code{NaN
7237 + I*NaN}, with an attempt to rescue the situation in that case.
7238
7239 The default is @option{-fno-cx-fortran-rules}.
7240
7241 @end table
7242
7243 The following options control optimizations that may improve
7244 performance, but are not enabled by any @option{-O} options.  This
7245 section includes experimental options that may produce broken code.
7246
7247 @table @gcctabopt
7248 @item -fbranch-probabilities
7249 @opindex fbranch-probabilities
7250 After running a program compiled with @option{-fprofile-arcs}
7251 (@pxref{Debugging Options,, Options for Debugging Your Program or
7252 @command{gcc}}), you can compile it a second time using
7253 @option{-fbranch-probabilities}, to improve optimizations based on
7254 the number of times each branch was taken.  When the program
7255 compiled with @option{-fprofile-arcs} exits it saves arc execution
7256 counts to a file called @file{@var{sourcename}.gcda} for each source
7257 file.  The information in this data file is very dependent on the
7258 structure of the generated code, so you must use the same source code
7259 and the same optimization options for both compilations.
7260
7261 With @option{-fbranch-probabilities}, GCC puts a
7262 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
7263 These can be used to improve optimization.  Currently, they are only
7264 used in one place: in @file{reorg.c}, instead of guessing which path a
7265 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
7266 exactly determine which path is taken more often.
7267
7268 @item -fprofile-values
7269 @opindex fprofile-values
7270 If combined with @option{-fprofile-arcs}, it adds code so that some
7271 data about values of expressions in the program is gathered.
7272
7273 With @option{-fbranch-probabilities}, it reads back the data gathered
7274 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
7275 notes to instructions for their later usage in optimizations.
7276
7277 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
7278
7279 @item -fvpt
7280 @opindex fvpt
7281 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
7282 a code to gather information about values of expressions.
7283
7284 With @option{-fbranch-probabilities}, it reads back the data gathered
7285 and actually performs the optimizations based on them.
7286 Currently the optimizations include specialization of division operation
7287 using the knowledge about the value of the denominator.
7288
7289 @item -frename-registers
7290 @opindex frename-registers
7291 Attempt to avoid false dependencies in scheduled code by making use
7292 of registers left over after register allocation.  This optimization
7293 will most benefit processors with lots of registers.  Depending on the
7294 debug information format adopted by the target, however, it can
7295 make debugging impossible, since variables will no longer stay in
7296 a ``home register''.
7297
7298 Enabled by default with @option{-funroll-loops}.
7299
7300 @item -ftracer
7301 @opindex ftracer
7302 Perform tail duplication to enlarge superblock size.  This transformation
7303 simplifies the control flow of the function allowing other optimizations to do
7304 better job.
7305
7306 Enabled with @option{-fprofile-use}.
7307
7308 @item -funroll-loops
7309 @opindex funroll-loops
7310 Unroll loops whose number of iterations can be determined at compile time or
7311 upon entry to the loop.  @option{-funroll-loops} implies
7312 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
7313 It also turns on complete loop peeling (i.e.@: complete removal of loops with
7314 small constant number of iterations).  This option makes code larger, and may
7315 or may not make it run faster.
7316
7317 Enabled with @option{-fprofile-use}.
7318
7319 @item -funroll-all-loops
7320 @opindex funroll-all-loops
7321 Unroll all loops, even if their number of iterations is uncertain when
7322 the loop is entered.  This usually makes programs run more slowly.
7323 @option{-funroll-all-loops} implies the same options as
7324 @option{-funroll-loops}.
7325
7326 @item -fpeel-loops
7327 @opindex fpeel-loops
7328 Peels the loops for that there is enough information that they do not
7329 roll much (from profile feedback).  It also turns on complete loop peeling
7330 (i.e.@: complete removal of loops with small constant number of iterations).
7331
7332 Enabled with @option{-fprofile-use}.
7333
7334 @item -fmove-loop-invariants
7335 @opindex fmove-loop-invariants
7336 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
7337 at level @option{-O1}
7338
7339 @item -funswitch-loops
7340 @opindex funswitch-loops
7341 Move branches with loop invariant conditions out of the loop, with duplicates
7342 of the loop on both branches (modified according to result of the condition).
7343
7344 @item -ffunction-sections
7345 @itemx -fdata-sections
7346 @opindex ffunction-sections
7347 @opindex fdata-sections
7348 Place each function or data item into its own section in the output
7349 file if the target supports arbitrary sections.  The name of the
7350 function or the name of the data item determines the section's name
7351 in the output file.
7352
7353 Use these options on systems where the linker can perform optimizations
7354 to improve locality of reference in the instruction space.  Most systems
7355 using the ELF object format and SPARC processors running Solaris 2 have
7356 linkers with such optimizations.  AIX may have these optimizations in
7357 the future.
7358
7359 Only use these options when there are significant benefits from doing
7360 so.  When you specify these options, the assembler and linker will
7361 create larger object and executable files and will also be slower.
7362 You will not be able to use @code{gprof} on all systems if you
7363 specify this option and you may have problems with debugging if
7364 you specify both this option and @option{-g}.
7365
7366 @item -fbranch-target-load-optimize
7367 @opindex fbranch-target-load-optimize
7368 Perform branch target register load optimization before prologue / epilogue
7369 threading.
7370 The use of target registers can typically be exposed only during reload,
7371 thus hoisting loads out of loops and doing inter-block scheduling needs
7372 a separate optimization pass.
7373
7374 @item -fbranch-target-load-optimize2
7375 @opindex fbranch-target-load-optimize2
7376 Perform branch target register load optimization after prologue / epilogue
7377 threading.
7378
7379 @item -fbtr-bb-exclusive
7380 @opindex fbtr-bb-exclusive
7381 When performing branch target register load optimization, don't reuse
7382 branch target registers in within any basic block.
7383
7384 @item -fstack-protector
7385 @opindex fstack-protector
7386 Emit extra code to check for buffer overflows, such as stack smashing
7387 attacks.  This is done by adding a guard variable to functions with
7388 vulnerable objects.  This includes functions that call alloca, and
7389 functions with buffers larger than 8 bytes.  The guards are initialized
7390 when a function is entered and then checked when the function exits.
7391 If a guard check fails, an error message is printed and the program exits.
7392
7393 @item -fstack-protector-all
7394 @opindex fstack-protector-all
7395 Like @option{-fstack-protector} except that all functions are protected.
7396
7397 @item -fsection-anchors
7398 @opindex fsection-anchors
7399 Try to reduce the number of symbolic address calculations by using
7400 shared ``anchor'' symbols to address nearby objects.  This transformation
7401 can help to reduce the number of GOT entries and GOT accesses on some
7402 targets.
7403
7404 For example, the implementation of the following function @code{foo}:
7405
7406 @smallexample
7407 static int a, b, c;
7408 int foo (void) @{ return a + b + c; @}
7409 @end smallexample
7410
7411 would usually calculate the addresses of all three variables, but if you
7412 compile it with @option{-fsection-anchors}, it will access the variables
7413 from a common anchor point instead.  The effect is similar to the
7414 following pseudocode (which isn't valid C):
7415
7416 @smallexample
7417 int foo (void)
7418 @{
7419   register int *xr = &x;
7420   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
7421 @}
7422 @end smallexample
7423
7424 Not all targets support this option.
7425
7426 @item --param @var{name}=@var{value}
7427 @opindex param
7428 In some places, GCC uses various constants to control the amount of
7429 optimization that is done.  For example, GCC will not inline functions
7430 that contain more that a certain number of instructions.  You can
7431 control some of these constants on the command-line using the
7432 @option{--param} option.
7433
7434 The names of specific parameters, and the meaning of the values, are
7435 tied to the internals of the compiler, and are subject to change
7436 without notice in future releases.
7437
7438 In each case, the @var{value} is an integer.  The allowable choices for
7439 @var{name} are given in the following table:
7440
7441 @table @gcctabopt
7442 @item struct-reorg-cold-struct-ratio
7443 The threshold ratio (as a percentage) between a structure frequency
7444 and the frequency of the hottest structure in the program.  This parameter
7445 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
7446 We say that if the ratio of a structure frequency, calculated by profiling,
7447 to the hottest structure frequency in the program is less than this
7448 parameter, then structure reorganization is not applied to this structure.
7449 The default is 10.
7450
7451 @item predictable-branch-cost-outcome
7452 When branch is predicted to be taken with probability lower than this threshold
7453 (in percent), then it is considered well predictable. The default is 10.
7454
7455 @item max-crossjump-edges
7456 The maximum number of incoming edges to consider for crossjumping.
7457 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
7458 the number of edges incoming to each block.  Increasing values mean
7459 more aggressive optimization, making the compile time increase with
7460 probably small improvement in executable size.
7461
7462 @item min-crossjump-insns
7463 The minimum number of instructions which must be matched at the end
7464 of two blocks before crossjumping will be performed on them.  This
7465 value is ignored in the case where all instructions in the block being
7466 crossjumped from are matched.  The default value is 5.
7467
7468 @item max-grow-copy-bb-insns
7469 The maximum code size expansion factor when copying basic blocks
7470 instead of jumping.  The expansion is relative to a jump instruction.
7471 The default value is 8.
7472
7473 @item max-goto-duplication-insns
7474 The maximum number of instructions to duplicate to a block that jumps
7475 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
7476 passes, GCC factors computed gotos early in the compilation process,
7477 and unfactors them as late as possible.  Only computed jumps at the
7478 end of a basic blocks with no more than max-goto-duplication-insns are
7479 unfactored.  The default value is 8.
7480
7481 @item max-delay-slot-insn-search
7482 The maximum number of instructions to consider when looking for an
7483 instruction to fill a delay slot.  If more than this arbitrary number of
7484 instructions is searched, the time savings from filling the delay slot
7485 will be minimal so stop searching.  Increasing values mean more
7486 aggressive optimization, making the compile time increase with probably
7487 small improvement in executable run time.
7488
7489 @item max-delay-slot-live-search
7490 When trying to fill delay slots, the maximum number of instructions to
7491 consider when searching for a block with valid live register
7492 information.  Increasing this arbitrarily chosen value means more
7493 aggressive optimization, increasing the compile time.  This parameter
7494 should be removed when the delay slot code is rewritten to maintain the
7495 control-flow graph.
7496
7497 @item max-gcse-memory
7498 The approximate maximum amount of memory that will be allocated in
7499 order to perform the global common subexpression elimination
7500 optimization.  If more memory than specified is required, the
7501 optimization will not be done.
7502
7503 @item max-pending-list-length
7504 The maximum number of pending dependencies scheduling will allow
7505 before flushing the current state and starting over.  Large functions
7506 with few branches or calls can create excessively large lists which
7507 needlessly consume memory and resources.
7508
7509 @item max-inline-insns-single
7510 Several parameters control the tree inliner used in gcc.
7511 This number sets the maximum number of instructions (counted in GCC's
7512 internal representation) in a single function that the tree inliner
7513 will consider for inlining.  This only affects functions declared
7514 inline and methods implemented in a class declaration (C++).
7515 The default value is 300.
7516
7517 @item max-inline-insns-auto
7518 When you use @option{-finline-functions} (included in @option{-O3}),
7519 a lot of functions that would otherwise not be considered for inlining
7520 by the compiler will be investigated.  To those functions, a different
7521 (more restrictive) limit compared to functions declared inline can
7522 be applied.
7523 The default value is 60.
7524
7525 @item large-function-insns
7526 The limit specifying really large functions.  For functions larger than this
7527 limit after inlining, inlining is constrained by
7528 @option{--param large-function-growth}.  This parameter is useful primarily
7529 to avoid extreme compilation time caused by non-linear algorithms used by the
7530 backend.
7531 The default value is 2700.
7532
7533 @item large-function-growth
7534 Specifies maximal growth of large function caused by inlining in percents.
7535 The default value is 100 which limits large function growth to 2.0 times
7536 the original size.
7537
7538 @item large-unit-insns
7539 The limit specifying large translation unit.  Growth caused by inlining of
7540 units larger than this limit is limited by @option{--param inline-unit-growth}.
7541 For small units this might be too tight (consider unit consisting of function A
7542 that is inline and B that just calls A three time.  If B is small relative to
7543 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
7544 large units consisting of small inlineable functions however the overall unit
7545 growth limit is needed to avoid exponential explosion of code size.  Thus for
7546 smaller units, the size is increased to @option{--param large-unit-insns}
7547 before applying @option{--param inline-unit-growth}.  The default is 10000
7548
7549 @item inline-unit-growth
7550 Specifies maximal overall growth of the compilation unit caused by inlining.
7551 The default value is 30 which limits unit growth to 1.3 times the original
7552 size.
7553
7554 @item ipcp-unit-growth
7555 Specifies maximal overall growth of the compilation unit caused by
7556 interprocedural constant propagation.  The default value is 10 which limits
7557 unit growth to 1.1 times the original size.
7558
7559 @item large-stack-frame
7560 The limit specifying large stack frames.  While inlining the algorithm is trying
7561 to not grow past this limit too much.  Default value is 256 bytes.
7562
7563 @item large-stack-frame-growth
7564 Specifies maximal growth of large stack frames caused by inlining in percents.
7565 The default value is 1000 which limits large stack frame growth to 11 times
7566 the original size.
7567
7568 @item max-inline-insns-recursive
7569 @itemx max-inline-insns-recursive-auto
7570 Specifies maximum number of instructions out-of-line copy of self recursive inline
7571 function can grow into by performing recursive inlining.
7572
7573 For functions declared inline @option{--param max-inline-insns-recursive} is
7574 taken into account.  For function not declared inline, recursive inlining
7575 happens only when @option{-finline-functions} (included in @option{-O3}) is
7576 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
7577 default value is 450.
7578
7579 @item max-inline-recursive-depth
7580 @itemx max-inline-recursive-depth-auto
7581 Specifies maximum recursion depth used by the recursive inlining.
7582
7583 For functions declared inline @option{--param max-inline-recursive-depth} is
7584 taken into account.  For function not declared inline, recursive inlining
7585 happens only when @option{-finline-functions} (included in @option{-O3}) is
7586 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
7587 default value is 8.
7588
7589 @item min-inline-recursive-probability
7590 Recursive inlining is profitable only for function having deep recursion
7591 in average and can hurt for function having little recursion depth by
7592 increasing the prologue size or complexity of function body to other
7593 optimizers.
7594
7595 When profile feedback is available (see @option{-fprofile-generate}) the actual
7596 recursion depth can be guessed from probability that function will recurse via
7597 given call expression.  This parameter limits inlining only to call expression
7598 whose probability exceeds given threshold (in percents).  The default value is
7599 10.
7600
7601 @item early-inlining-insns
7602 Specify growth that early inliner can make.  In effect it increases amount of
7603 inlining for code having large abstraction penalty.  The default value is 12.
7604
7605 @item max-early-inliner-iterations
7606 @itemx max-early-inliner-iterations
7607 Limit of iterations of early inliner.  This basically bounds number of nested
7608 indirect calls early inliner can resolve.  Deeper chains are still handled by
7609 late inlining.
7610
7611 @item min-vect-loop-bound
7612 The minimum number of iterations under which a loop will not get vectorized
7613 when @option{-ftree-vectorize} is used.  The number of iterations after
7614 vectorization needs to be greater than the value specified by this option
7615 to allow vectorization.  The default value is 0.
7616
7617 @item max-unrolled-insns
7618 The maximum number of instructions that a loop should have if that loop
7619 is unrolled, and if the loop is unrolled, it determines how many times
7620 the loop code is unrolled.
7621
7622 @item max-average-unrolled-insns
7623 The maximum number of instructions biased by probabilities of their execution
7624 that a loop should have if that loop is unrolled, and if the loop is unrolled,
7625 it determines how many times the loop code is unrolled.
7626
7627 @item max-unroll-times
7628 The maximum number of unrollings of a single loop.
7629
7630 @item max-peeled-insns
7631 The maximum number of instructions that a loop should have if that loop
7632 is peeled, and if the loop is peeled, it determines how many times
7633 the loop code is peeled.
7634
7635 @item max-peel-times
7636 The maximum number of peelings of a single loop.
7637
7638 @item max-completely-peeled-insns
7639 The maximum number of insns of a completely peeled loop.
7640
7641 @item max-completely-peel-times
7642 The maximum number of iterations of a loop to be suitable for complete peeling.
7643
7644 @item max-unswitch-insns
7645 The maximum number of insns of an unswitched loop.
7646
7647 @item max-unswitch-level
7648 The maximum number of branches unswitched in a single loop.
7649
7650 @item lim-expensive
7651 The minimum cost of an expensive expression in the loop invariant motion.
7652
7653 @item iv-consider-all-candidates-bound
7654 Bound on number of candidates for induction variables below that
7655 all candidates are considered for each use in induction variable
7656 optimizations.  Only the most relevant candidates are considered
7657 if there are more candidates, to avoid quadratic time complexity.
7658
7659 @item iv-max-considered-uses
7660 The induction variable optimizations give up on loops that contain more
7661 induction variable uses.
7662
7663 @item iv-always-prune-cand-set-bound
7664 If number of candidates in the set is smaller than this value,
7665 we always try to remove unnecessary ivs from the set during its
7666 optimization when a new iv is added to the set.
7667
7668 @item scev-max-expr-size
7669 Bound on size of expressions used in the scalar evolutions analyzer.
7670 Large expressions slow the analyzer.
7671
7672 @item omega-max-vars
7673 The maximum number of variables in an Omega constraint system.
7674 The default value is 128.
7675
7676 @item omega-max-geqs
7677 The maximum number of inequalities in an Omega constraint system.
7678 The default value is 256.
7679
7680 @item omega-max-eqs
7681 The maximum number of equalities in an Omega constraint system.
7682 The default value is 128.
7683
7684 @item omega-max-wild-cards
7685 The maximum number of wildcard variables that the Omega solver will
7686 be able to insert.  The default value is 18.
7687
7688 @item omega-hash-table-size
7689 The size of the hash table in the Omega solver.  The default value is
7690 550.
7691
7692 @item omega-max-keys
7693 The maximal number of keys used by the Omega solver.  The default
7694 value is 500.
7695
7696 @item omega-eliminate-redundant-constraints
7697 When set to 1, use expensive methods to eliminate all redundant
7698 constraints.  The default value is 0.
7699
7700 @item vect-max-version-for-alignment-checks
7701 The maximum number of runtime checks that can be performed when
7702 doing loop versioning for alignment in the vectorizer.  See option
7703 ftree-vect-loop-version for more information.
7704
7705 @item vect-max-version-for-alias-checks
7706 The maximum number of runtime checks that can be performed when
7707 doing loop versioning for alias in the vectorizer.  See option
7708 ftree-vect-loop-version for more information.
7709
7710 @item max-iterations-to-track
7711
7712 The maximum number of iterations of a loop the brute force algorithm
7713 for analysis of # of iterations of the loop tries to evaluate.
7714
7715 @item hot-bb-count-fraction
7716 Select fraction of the maximal count of repetitions of basic block in program
7717 given basic block needs to have to be considered hot.
7718
7719 @item hot-bb-frequency-fraction
7720 Select fraction of the maximal frequency of executions of basic block in
7721 function given basic block needs to have to be considered hot
7722
7723 @item max-predicted-iterations
7724 The maximum number of loop iterations we predict statically.  This is useful
7725 in cases where function contain single loop with known bound and other loop
7726 with unknown.  We predict the known number of iterations correctly, while
7727 the unknown number of iterations average to roughly 10.  This means that the
7728 loop without bounds would appear artificially cold relative to the other one.
7729
7730 @item align-threshold
7731
7732 Select fraction of the maximal frequency of executions of basic block in
7733 function given basic block will get aligned.
7734
7735 @item align-loop-iterations
7736
7737 A loop expected to iterate at lest the selected number of iterations will get
7738 aligned.
7739
7740 @item tracer-dynamic-coverage
7741 @itemx tracer-dynamic-coverage-feedback
7742
7743 This value is used to limit superblock formation once the given percentage of
7744 executed instructions is covered.  This limits unnecessary code size
7745 expansion.
7746
7747 The @option{tracer-dynamic-coverage-feedback} is used only when profile
7748 feedback is available.  The real profiles (as opposed to statically estimated
7749 ones) are much less balanced allowing the threshold to be larger value.
7750
7751 @item tracer-max-code-growth
7752 Stop tail duplication once code growth has reached given percentage.  This is
7753 rather hokey argument, as most of the duplicates will be eliminated later in
7754 cross jumping, so it may be set to much higher values than is the desired code
7755 growth.
7756
7757 @item tracer-min-branch-ratio
7758
7759 Stop reverse growth when the reverse probability of best edge is less than this
7760 threshold (in percent).
7761
7762 @item tracer-min-branch-ratio
7763 @itemx tracer-min-branch-ratio-feedback
7764
7765 Stop forward growth if the best edge do have probability lower than this
7766 threshold.
7767
7768 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
7769 compilation for profile feedback and one for compilation without.  The value
7770 for compilation with profile feedback needs to be more conservative (higher) in
7771 order to make tracer effective.
7772
7773 @item max-cse-path-length
7774
7775 Maximum number of basic blocks on path that cse considers.  The default is 10.
7776
7777 @item max-cse-insns
7778 The maximum instructions CSE process before flushing. The default is 1000.
7779
7780 @item ggc-min-expand
7781
7782 GCC uses a garbage collector to manage its own memory allocation.  This
7783 parameter specifies the minimum percentage by which the garbage
7784 collector's heap should be allowed to expand between collections.
7785 Tuning this may improve compilation speed; it has no effect on code
7786 generation.
7787
7788 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
7789 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
7790 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
7791 GCC is not able to calculate RAM on a particular platform, the lower
7792 bound of 30% is used.  Setting this parameter and
7793 @option{ggc-min-heapsize} to zero causes a full collection to occur at
7794 every opportunity.  This is extremely slow, but can be useful for
7795 debugging.
7796
7797 @item ggc-min-heapsize
7798
7799 Minimum size of the garbage collector's heap before it begins bothering
7800 to collect garbage.  The first collection occurs after the heap expands
7801 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
7802 tuning this may improve compilation speed, and has no effect on code
7803 generation.
7804
7805 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
7806 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
7807 with a lower bound of 4096 (four megabytes) and an upper bound of
7808 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
7809 particular platform, the lower bound is used.  Setting this parameter
7810 very large effectively disables garbage collection.  Setting this
7811 parameter and @option{ggc-min-expand} to zero causes a full collection
7812 to occur at every opportunity.
7813
7814 @item max-reload-search-insns
7815 The maximum number of instruction reload should look backward for equivalent
7816 register.  Increasing values mean more aggressive optimization, making the
7817 compile time increase with probably slightly better performance.  The default
7818 value is 100.
7819
7820 @item max-cselib-memory-locations
7821 The maximum number of memory locations cselib should take into account.
7822 Increasing values mean more aggressive optimization, making the compile time
7823 increase with probably slightly better performance.  The default value is 500.
7824
7825 @item reorder-blocks-duplicate
7826 @itemx reorder-blocks-duplicate-feedback
7827
7828 Used by basic block reordering pass to decide whether to use unconditional
7829 branch or duplicate the code on its destination.  Code is duplicated when its
7830 estimated size is smaller than this value multiplied by the estimated size of
7831 unconditional jump in the hot spots of the program.
7832
7833 The @option{reorder-block-duplicate-feedback} is used only when profile
7834 feedback is available and may be set to higher values than
7835 @option{reorder-block-duplicate} since information about the hot spots is more
7836 accurate.
7837
7838 @item max-sched-ready-insns
7839 The maximum number of instructions ready to be issued the scheduler should
7840 consider at any given time during the first scheduling pass.  Increasing
7841 values mean more thorough searches, making the compilation time increase
7842 with probably little benefit.  The default value is 100.
7843
7844 @item max-sched-region-blocks
7845 The maximum number of blocks in a region to be considered for
7846 interblock scheduling.  The default value is 10.
7847
7848 @item max-pipeline-region-blocks
7849 The maximum number of blocks in a region to be considered for
7850 pipelining in the selective scheduler.  The default value is 15.
7851
7852 @item max-sched-region-insns
7853 The maximum number of insns in a region to be considered for
7854 interblock scheduling.  The default value is 100.
7855
7856 @item max-pipeline-region-insns
7857 The maximum number of insns in a region to be considered for
7858 pipelining in the selective scheduler.  The default value is 200.
7859
7860 @item min-spec-prob
7861 The minimum probability (in percents) of reaching a source block
7862 for interblock speculative scheduling.  The default value is 40.
7863
7864 @item max-sched-extend-regions-iters
7865 The maximum number of iterations through CFG to extend regions.
7866 0 - disable region extension,
7867 N - do at most N iterations.
7868 The default value is 0.
7869
7870 @item max-sched-insn-conflict-delay
7871 The maximum conflict delay for an insn to be considered for speculative motion.
7872 The default value is 3.
7873
7874 @item sched-spec-prob-cutoff
7875 The minimal probability of speculation success (in percents), so that
7876 speculative insn will be scheduled.
7877 The default value is 40.
7878
7879 @item sched-mem-true-dep-cost
7880 Minimal distance (in CPU cycles) between store and load targeting same
7881 memory locations.  The default value is 1.
7882
7883 @item selsched-max-lookahead
7884 The maximum size of the lookahead window of selective scheduling.  It is a
7885 depth of search for available instructions.
7886 The default value is 50.
7887
7888 @item selsched-max-sched-times
7889 The maximum number of times that an instruction will be scheduled during
7890 selective scheduling.  This is the limit on the number of iterations
7891 through which the instruction may be pipelined.  The default value is 2.
7892
7893 @item selsched-max-insns-to-rename
7894 The maximum number of best instructions in the ready list that are considered
7895 for renaming in the selective scheduler.  The default value is 2.
7896
7897 @item max-last-value-rtl
7898 The maximum size measured as number of RTLs that can be recorded in an expression
7899 in combiner for a pseudo register as last known value of that register.  The default
7900 is 10000.
7901
7902 @item integer-share-limit
7903 Small integer constants can use a shared data structure, reducing the
7904 compiler's memory usage and increasing its speed.  This sets the maximum
7905 value of a shared integer constant.  The default value is 256.
7906
7907 @item min-virtual-mappings
7908 Specifies the minimum number of virtual mappings in the incremental
7909 SSA updater that should be registered to trigger the virtual mappings
7910 heuristic defined by virtual-mappings-ratio.  The default value is
7911 100.
7912
7913 @item virtual-mappings-ratio
7914 If the number of virtual mappings is virtual-mappings-ratio bigger
7915 than the number of virtual symbols to be updated, then the incremental
7916 SSA updater switches to a full update for those symbols.  The default
7917 ratio is 3.
7918
7919 @item ssp-buffer-size
7920 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
7921 protection when @option{-fstack-protection} is used.
7922
7923 @item max-jump-thread-duplication-stmts
7924 Maximum number of statements allowed in a block that needs to be
7925 duplicated when threading jumps.
7926
7927 @item max-fields-for-field-sensitive
7928 Maximum number of fields in a structure we will treat in
7929 a field sensitive manner during pointer analysis.  The default is zero
7930 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
7931
7932 @item prefetch-latency
7933 Estimate on average number of instructions that are executed before
7934 prefetch finishes.  The distance we prefetch ahead is proportional
7935 to this constant.  Increasing this number may also lead to less
7936 streams being prefetched (see @option{simultaneous-prefetches}).
7937
7938 @item simultaneous-prefetches
7939 Maximum number of prefetches that can run at the same time.
7940
7941 @item l1-cache-line-size
7942 The size of cache line in L1 cache, in bytes.
7943
7944 @item l1-cache-size
7945 The size of L1 cache, in kilobytes.
7946
7947 @item l2-cache-size
7948 The size of L2 cache, in kilobytes.
7949
7950 @item min-insn-to-prefetch-ratio
7951 The minimum ratio between the number of instructions and the
7952 number of prefetches to enable prefetching in a loop with an
7953 unknown trip count.
7954
7955 @item prefetch-min-insn-to-mem-ratio
7956 The minimum ratio between the number of instructions and the
7957 number of memory references to enable prefetching in a loop.
7958
7959 @item use-canonical-types
7960 Whether the compiler should use the ``canonical'' type system.  By
7961 default, this should always be 1, which uses a more efficient internal
7962 mechanism for comparing types in C++ and Objective-C++.  However, if
7963 bugs in the canonical type system are causing compilation failures,
7964 set this value to 0 to disable canonical types.
7965
7966 @item switch-conversion-max-branch-ratio
7967 Switch initialization conversion will refuse to create arrays that are
7968 bigger than @option{switch-conversion-max-branch-ratio} times the number of
7969 branches in the switch.
7970
7971 @item max-partial-antic-length
7972 Maximum length of the partial antic set computed during the tree
7973 partial redundancy elimination optimization (@option{-ftree-pre}) when
7974 optimizing at @option{-O3} and above.  For some sorts of source code
7975 the enhanced partial redundancy elimination optimization can run away,
7976 consuming all of the memory available on the host machine.  This
7977 parameter sets a limit on the length of the sets that are computed,
7978 which prevents the runaway behavior.  Setting a value of 0 for
7979 this parameter will allow an unlimited set length.
7980
7981 @item sccvn-max-scc-size
7982 Maximum size of a strongly connected component (SCC) during SCCVN
7983 processing.  If this limit is hit, SCCVN processing for the whole
7984 function will not be done and optimizations depending on it will
7985 be disabled.  The default maximum SCC size is 10000.
7986
7987 @item ira-max-loops-num
7988 IRA uses a regional register allocation by default.  If a function
7989 contains loops more than number given by the parameter, only at most
7990 given number of the most frequently executed loops will form regions
7991 for the regional register allocation.  The default value of the
7992 parameter is 100.
7993
7994 @item ira-max-conflict-table-size
7995 Although IRA uses a sophisticated algorithm of compression conflict
7996 table, the table can be still big for huge functions.  If the conflict
7997 table for a function could be more than size in MB given by the
7998 parameter, the conflict table is not built and faster, simpler, and
7999 lower quality register allocation algorithm will be used.  The
8000 algorithm do not use pseudo-register conflicts.  The default value of
8001 the parameter is 2000.
8002
8003 @item loop-invariant-max-bbs-in-loop
8004 Loop invariant motion can be very expensive, both in compile time and
8005 in amount of needed compile time memory, with very large loops.  Loops
8006 with more basic blocks than this parameter won't have loop invariant
8007 motion optimization performed on them.  The default value of the
8008 parameter is 1000 for -O1 and 10000 for -O2 and above.
8009
8010 @end table
8011 @end table
8012
8013 @node Preprocessor Options
8014 @section Options Controlling the Preprocessor
8015 @cindex preprocessor options
8016 @cindex options, preprocessor
8017
8018 These options control the C preprocessor, which is run on each C source
8019 file before actual compilation.
8020
8021 If you use the @option{-E} option, nothing is done except preprocessing.
8022 Some of these options make sense only together with @option{-E} because
8023 they cause the preprocessor output to be unsuitable for actual
8024 compilation.
8025
8026 @table @gcctabopt
8027 @item -Wp,@var{option}
8028 @opindex Wp
8029 You can use @option{-Wp,@var{option}} to bypass the compiler driver
8030 and pass @var{option} directly through to the preprocessor.  If
8031 @var{option} contains commas, it is split into multiple options at the
8032 commas.  However, many options are modified, translated or interpreted
8033 by the compiler driver before being passed to the preprocessor, and
8034 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
8035 interface is undocumented and subject to change, so whenever possible
8036 you should avoid using @option{-Wp} and let the driver handle the
8037 options instead.
8038
8039 @item -Xpreprocessor @var{option}
8040 @opindex Xpreprocessor
8041 Pass @var{option} as an option to the preprocessor.  You can use this to
8042 supply system-specific preprocessor options which GCC does not know how to
8043 recognize.
8044
8045 If you want to pass an option that takes an argument, you must use
8046 @option{-Xpreprocessor} twice, once for the option and once for the argument.
8047 @end table
8048
8049 @include cppopts.texi
8050
8051 @node Assembler Options
8052 @section Passing Options to the Assembler
8053
8054 @c prevent bad page break with this line
8055 You can pass options to the assembler.
8056
8057 @table @gcctabopt
8058 @item -Wa,@var{option}
8059 @opindex Wa
8060 Pass @var{option} as an option to the assembler.  If @var{option}
8061 contains commas, it is split into multiple options at the commas.
8062
8063 @item -Xassembler @var{option}
8064 @opindex Xassembler
8065 Pass @var{option} as an option to the assembler.  You can use this to
8066 supply system-specific assembler options which GCC does not know how to
8067 recognize.
8068
8069 If you want to pass an option that takes an argument, you must use
8070 @option{-Xassembler} twice, once for the option and once for the argument.
8071
8072 @end table
8073
8074 @node Link Options
8075 @section Options for Linking
8076 @cindex link options
8077 @cindex options, linking
8078
8079 These options come into play when the compiler links object files into
8080 an executable output file.  They are meaningless if the compiler is
8081 not doing a link step.
8082
8083 @table @gcctabopt
8084 @cindex file names
8085 @item @var{object-file-name}
8086 A file name that does not end in a special recognized suffix is
8087 considered to name an object file or library.  (Object files are
8088 distinguished from libraries by the linker according to the file
8089 contents.)  If linking is done, these object files are used as input
8090 to the linker.
8091
8092 @item -c
8093 @itemx -S
8094 @itemx -E
8095 @opindex c
8096 @opindex S
8097 @opindex E
8098 If any of these options is used, then the linker is not run, and
8099 object file names should not be used as arguments.  @xref{Overall
8100 Options}.
8101
8102 @cindex Libraries
8103 @item -l@var{library}
8104 @itemx -l @var{library}
8105 @opindex l
8106 Search the library named @var{library} when linking.  (The second
8107 alternative with the library as a separate argument is only for
8108 POSIX compliance and is not recommended.)
8109
8110 It makes a difference where in the command you write this option; the
8111 linker searches and processes libraries and object files in the order they
8112 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
8113 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
8114 to functions in @samp{z}, those functions may not be loaded.
8115
8116 The linker searches a standard list of directories for the library,
8117 which is actually a file named @file{lib@var{library}.a}.  The linker
8118 then uses this file as if it had been specified precisely by name.
8119
8120 The directories searched include several standard system directories
8121 plus any that you specify with @option{-L}.
8122
8123 Normally the files found this way are library files---archive files
8124 whose members are object files.  The linker handles an archive file by
8125 scanning through it for members which define symbols that have so far
8126 been referenced but not defined.  But if the file that is found is an
8127 ordinary object file, it is linked in the usual fashion.  The only
8128 difference between using an @option{-l} option and specifying a file name
8129 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
8130 and searches several directories.
8131
8132 @item -lobjc
8133 @opindex lobjc
8134 You need this special case of the @option{-l} option in order to
8135 link an Objective-C or Objective-C++ program.
8136
8137 @item -nostartfiles
8138 @opindex nostartfiles
8139 Do not use the standard system startup files when linking.
8140 The standard system libraries are used normally, unless @option{-nostdlib}
8141 or @option{-nodefaultlibs} is used.
8142
8143 @item -nodefaultlibs
8144 @opindex nodefaultlibs
8145 Do not use the standard system libraries when linking.
8146 Only the libraries you specify will be passed to the linker, options
8147 specifying linkage of the system libraries, such as @code{-static-libgcc}
8148 or @code{-shared-libgcc}, will be ignored.
8149 The standard startup files are used normally, unless @option{-nostartfiles}
8150 is used.  The compiler may generate calls to @code{memcmp},
8151 @code{memset}, @code{memcpy} and @code{memmove}.
8152 These entries are usually resolved by entries in
8153 libc.  These entry points should be supplied through some other
8154 mechanism when this option is specified.
8155
8156 @item -nostdlib
8157 @opindex nostdlib
8158 Do not use the standard system startup files or libraries when linking.
8159 No startup files and only the libraries you specify will be passed to
8160 the linker, options specifying linkage of the system libraries, such as
8161 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
8162 The compiler may generate calls to @code{memcmp}, @code{memset},
8163 @code{memcpy} and @code{memmove}.
8164 These entries are usually resolved by entries in
8165 libc.  These entry points should be supplied through some other
8166 mechanism when this option is specified.
8167
8168 @cindex @option{-lgcc}, use with @option{-nostdlib}
8169 @cindex @option{-nostdlib} and unresolved references
8170 @cindex unresolved references and @option{-nostdlib}
8171 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
8172 @cindex @option{-nodefaultlibs} and unresolved references
8173 @cindex unresolved references and @option{-nodefaultlibs}
8174 One of the standard libraries bypassed by @option{-nostdlib} and
8175 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
8176 that GCC uses to overcome shortcomings of particular machines, or special
8177 needs for some languages.
8178 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
8179 Collection (GCC) Internals},
8180 for more discussion of @file{libgcc.a}.)
8181 In most cases, you need @file{libgcc.a} even when you want to avoid
8182 other standard libraries.  In other words, when you specify @option{-nostdlib}
8183 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
8184 This ensures that you have no unresolved references to internal GCC
8185 library subroutines.  (For example, @samp{__main}, used to ensure C++
8186 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
8187 GNU Compiler Collection (GCC) Internals}.)
8188
8189 @item -pie
8190 @opindex pie
8191 Produce a position independent executable on targets which support it.
8192 For predictable results, you must also specify the same set of options
8193 that were used to generate code (@option{-fpie}, @option{-fPIE},
8194 or model suboptions) when you specify this option.
8195
8196 @item -rdynamic
8197 @opindex rdynamic
8198 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
8199 that support it. This instructs the linker to add all symbols, not
8200 only used ones, to the dynamic symbol table. This option is needed
8201 for some uses of @code{dlopen} or to allow obtaining backtraces
8202 from within a program.
8203
8204 @item -s
8205 @opindex s
8206 Remove all symbol table and relocation information from the executable.
8207
8208 @item -static
8209 @opindex static
8210 On systems that support dynamic linking, this prevents linking with the shared
8211 libraries.  On other systems, this option has no effect.
8212
8213 @item -shared
8214 @opindex shared
8215 Produce a shared object which can then be linked with other objects to
8216 form an executable.  Not all systems support this option.  For predictable
8217 results, you must also specify the same set of options that were used to
8218 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
8219 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
8220 needs to build supplementary stub code for constructors to work.  On
8221 multi-libbed systems, @samp{gcc -shared} must select the correct support
8222 libraries to link against.  Failing to supply the correct flags may lead
8223 to subtle defects.  Supplying them in cases where they are not necessary
8224 is innocuous.}
8225
8226 @item -shared-libgcc
8227 @itemx -static-libgcc
8228 @opindex shared-libgcc
8229 @opindex static-libgcc
8230 On systems that provide @file{libgcc} as a shared library, these options
8231 force the use of either the shared or static version respectively.
8232 If no shared version of @file{libgcc} was built when the compiler was
8233 configured, these options have no effect.
8234
8235 There are several situations in which an application should use the
8236 shared @file{libgcc} instead of the static version.  The most common
8237 of these is when the application wishes to throw and catch exceptions
8238 across different shared libraries.  In that case, each of the libraries
8239 as well as the application itself should use the shared @file{libgcc}.
8240
8241 Therefore, the G++ and GCJ drivers automatically add
8242 @option{-shared-libgcc} whenever you build a shared library or a main
8243 executable, because C++ and Java programs typically use exceptions, so
8244 this is the right thing to do.
8245
8246 If, instead, you use the GCC driver to create shared libraries, you may
8247 find that they will not always be linked with the shared @file{libgcc}.
8248 If GCC finds, at its configuration time, that you have a non-GNU linker
8249 or a GNU linker that does not support option @option{--eh-frame-hdr},
8250 it will link the shared version of @file{libgcc} into shared libraries
8251 by default.  Otherwise, it will take advantage of the linker and optimize
8252 away the linking with the shared version of @file{libgcc}, linking with
8253 the static version of libgcc by default.  This allows exceptions to
8254 propagate through such shared libraries, without incurring relocation
8255 costs at library load time.
8256
8257 However, if a library or main executable is supposed to throw or catch
8258 exceptions, you must link it using the G++ or GCJ driver, as appropriate
8259 for the languages used in the program, or using the option
8260 @option{-shared-libgcc}, such that it is linked with the shared
8261 @file{libgcc}.
8262
8263 @item -static-libstdc++
8264 When the @command{g++} program is used to link a C++ program, it will
8265 normally automatically link against @option{libstdc++}.  If
8266 @file{libstdc++} is available as a shared library, and the
8267 @option{-static} option is not used, then this will link against the
8268 shared version of @file{libstdc++}.  That is normally fine.  However, it
8269 is sometimes useful to freeze the version of @file{libstdc++} used by
8270 the program without going all the way to a fully static link.  The
8271 @option{-static-libstdc++} option directs the @command{g++} driver to
8272 link @file{libstdc++} statically, without necessarily linking other
8273 libraries statically.
8274
8275 @item -symbolic
8276 @opindex symbolic
8277 Bind references to global symbols when building a shared object.  Warn
8278 about any unresolved references (unless overridden by the link editor
8279 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
8280 this option.
8281
8282 @item -T @var{script}
8283 @opindex T
8284 @cindex linker script
8285 Use @var{script} as the linker script.  This option is supported by most
8286 systems using the GNU linker.  On some targets, such as bare-board
8287 targets without an operating system, the @option{-T} option may be required
8288 when linking to avoid references to undefined symbols.
8289
8290 @item -Xlinker @var{option}
8291 @opindex Xlinker
8292 Pass @var{option} as an option to the linker.  You can use this to
8293 supply system-specific linker options which GCC does not know how to
8294 recognize.
8295
8296 If you want to pass an option that takes a separate argument, you must use
8297 @option{-Xlinker} twice, once for the option and once for the argument.
8298 For example, to pass @option{-assert definitions}, you must write
8299 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
8300 @option{-Xlinker "-assert definitions"}, because this passes the entire
8301 string as a single argument, which is not what the linker expects.
8302
8303 When using the GNU linker, it is usually more convenient to pass
8304 arguments to linker options using the @option{@var{option}=@var{value}}
8305 syntax than as separate arguments.  For example, you can specify
8306 @samp{-Xlinker -Map=output.map} rather than
8307 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
8308 this syntax for command-line options.
8309
8310 @item -Wl,@var{option}
8311 @opindex Wl
8312 Pass @var{option} as an option to the linker.  If @var{option} contains
8313 commas, it is split into multiple options at the commas.  You can use this
8314 syntax to pass an argument to the option.
8315 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
8316 linker.  When using the GNU linker, you can also get the same effect with
8317 @samp{-Wl,-Map=output.map}.
8318
8319 @item -u @var{symbol}
8320 @opindex u
8321 Pretend the symbol @var{symbol} is undefined, to force linking of
8322 library modules to define it.  You can use @option{-u} multiple times with
8323 different symbols to force loading of additional library modules.
8324 @end table
8325
8326 @node Directory Options
8327 @section Options for Directory Search
8328 @cindex directory options
8329 @cindex options, directory search
8330 @cindex search path
8331
8332 These options specify directories to search for header files, for
8333 libraries and for parts of the compiler:
8334
8335 @table @gcctabopt
8336 @item -I@var{dir}
8337 @opindex I
8338 Add the directory @var{dir} to the head of the list of directories to be
8339 searched for header files.  This can be used to override a system header
8340 file, substituting your own version, since these directories are
8341 searched before the system header file directories.  However, you should
8342 not use this option to add directories that contain vendor-supplied
8343 system header files (use @option{-isystem} for that).  If you use more than
8344 one @option{-I} option, the directories are scanned in left-to-right
8345 order; the standard system directories come after.
8346
8347 If a standard system include directory, or a directory specified with
8348 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
8349 option will be ignored.  The directory will still be searched but as a
8350 system directory at its normal position in the system include chain.
8351 This is to ensure that GCC's procedure to fix buggy system headers and
8352 the ordering for the include_next directive are not inadvertently changed.
8353 If you really need to change the search order for system directories,
8354 use the @option{-nostdinc} and/or @option{-isystem} options.
8355
8356 @item -iquote@var{dir}
8357 @opindex iquote
8358 Add the directory @var{dir} to the head of the list of directories to
8359 be searched for header files only for the case of @samp{#include
8360 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
8361 otherwise just like @option{-I}.
8362
8363 @item -L@var{dir}
8364 @opindex L
8365 Add directory @var{dir} to the list of directories to be searched
8366 for @option{-l}.
8367
8368 @item -B@var{prefix}
8369 @opindex B
8370 This option specifies where to find the executables, libraries,
8371 include files, and data files of the compiler itself.
8372
8373 The compiler driver program runs one or more of the subprograms
8374 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
8375 @var{prefix} as a prefix for each program it tries to run, both with and
8376 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
8377
8378 For each subprogram to be run, the compiler driver first tries the
8379 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
8380 was not specified, the driver tries two standard prefixes, which are
8381 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
8382 those results in a file name that is found, the unmodified program
8383 name is searched for using the directories specified in your
8384 @env{PATH} environment variable.
8385
8386 The compiler will check to see if the path provided by the @option{-B}
8387 refers to a directory, and if necessary it will add a directory
8388 separator character at the end of the path.
8389
8390 @option{-B} prefixes that effectively specify directory names also apply
8391 to libraries in the linker, because the compiler translates these
8392 options into @option{-L} options for the linker.  They also apply to
8393 includes files in the preprocessor, because the compiler translates these
8394 options into @option{-isystem} options for the preprocessor.  In this case,
8395 the compiler appends @samp{include} to the prefix.
8396
8397 The run-time support file @file{libgcc.a} can also be searched for using
8398 the @option{-B} prefix, if needed.  If it is not found there, the two
8399 standard prefixes above are tried, and that is all.  The file is left
8400 out of the link if it is not found by those means.
8401
8402 Another way to specify a prefix much like the @option{-B} prefix is to use
8403 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
8404 Variables}.
8405
8406 As a special kludge, if the path provided by @option{-B} is
8407 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
8408 9, then it will be replaced by @file{[dir/]include}.  This is to help
8409 with boot-strapping the compiler.
8410
8411 @item -specs=@var{file}
8412 @opindex specs
8413 Process @var{file} after the compiler reads in the standard @file{specs}
8414 file, in order to override the defaults that the @file{gcc} driver
8415 program uses when determining what switches to pass to @file{cc1},
8416 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
8417 @option{-specs=@var{file}} can be specified on the command line, and they
8418 are processed in order, from left to right.
8419
8420 @item --sysroot=@var{dir}
8421 @opindex sysroot
8422 Use @var{dir} as the logical root directory for headers and libraries.
8423 For example, if the compiler would normally search for headers in
8424 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
8425 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
8426
8427 If you use both this option and the @option{-isysroot} option, then
8428 the @option{--sysroot} option will apply to libraries, but the
8429 @option{-isysroot} option will apply to header files.
8430
8431 The GNU linker (beginning with version 2.16) has the necessary support
8432 for this option.  If your linker does not support this option, the
8433 header file aspect of @option{--sysroot} will still work, but the
8434 library aspect will not.
8435
8436 @item -I-
8437 @opindex I-
8438 This option has been deprecated.  Please use @option{-iquote} instead for
8439 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
8440 Any directories you specify with @option{-I} options before the @option{-I-}
8441 option are searched only for the case of @samp{#include "@var{file}"};
8442 they are not searched for @samp{#include <@var{file}>}.
8443
8444 If additional directories are specified with @option{-I} options after
8445 the @option{-I-}, these directories are searched for all @samp{#include}
8446 directives.  (Ordinarily @emph{all} @option{-I} directories are used
8447 this way.)
8448
8449 In addition, the @option{-I-} option inhibits the use of the current
8450 directory (where the current input file came from) as the first search
8451 directory for @samp{#include "@var{file}"}.  There is no way to
8452 override this effect of @option{-I-}.  With @option{-I.} you can specify
8453 searching the directory which was current when the compiler was
8454 invoked.  That is not exactly the same as what the preprocessor does
8455 by default, but it is often satisfactory.
8456
8457 @option{-I-} does not inhibit the use of the standard system directories
8458 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
8459 independent.
8460 @end table
8461
8462 @c man end
8463
8464 @node Spec Files
8465 @section Specifying subprocesses and the switches to pass to them
8466 @cindex Spec Files
8467
8468 @command{gcc} is a driver program.  It performs its job by invoking a
8469 sequence of other programs to do the work of compiling, assembling and
8470 linking.  GCC interprets its command-line parameters and uses these to
8471 deduce which programs it should invoke, and which command-line options
8472 it ought to place on their command lines.  This behavior is controlled
8473 by @dfn{spec strings}.  In most cases there is one spec string for each
8474 program that GCC can invoke, but a few programs have multiple spec
8475 strings to control their behavior.  The spec strings built into GCC can
8476 be overridden by using the @option{-specs=} command-line switch to specify
8477 a spec file.
8478
8479 @dfn{Spec files} are plaintext files that are used to construct spec
8480 strings.  They consist of a sequence of directives separated by blank
8481 lines.  The type of directive is determined by the first non-whitespace
8482 character on the line and it can be one of the following:
8483
8484 @table @code
8485 @item %@var{command}
8486 Issues a @var{command} to the spec file processor.  The commands that can
8487 appear here are:
8488
8489 @table @code
8490 @item %include <@var{file}>
8491 @cindex %include
8492 Search for @var{file} and insert its text at the current point in the
8493 specs file.
8494
8495 @item %include_noerr <@var{file}>
8496 @cindex %include_noerr
8497 Just like @samp{%include}, but do not generate an error message if the include
8498 file cannot be found.
8499
8500 @item %rename @var{old_name} @var{new_name}
8501 @cindex %rename
8502 Rename the spec string @var{old_name} to @var{new_name}.
8503
8504 @end table
8505
8506 @item *[@var{spec_name}]:
8507 This tells the compiler to create, override or delete the named spec
8508 string.  All lines after this directive up to the next directive or
8509 blank line are considered to be the text for the spec string.  If this
8510 results in an empty string then the spec will be deleted.  (Or, if the
8511 spec did not exist, then nothing will happened.)  Otherwise, if the spec
8512 does not currently exist a new spec will be created.  If the spec does
8513 exist then its contents will be overridden by the text of this
8514 directive, unless the first character of that text is the @samp{+}
8515 character, in which case the text will be appended to the spec.
8516
8517 @item [@var{suffix}]:
8518 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
8519 and up to the next directive or blank line are considered to make up the
8520 spec string for the indicated suffix.  When the compiler encounters an
8521 input file with the named suffix, it will processes the spec string in
8522 order to work out how to compile that file.  For example:
8523
8524 @smallexample
8525 .ZZ:
8526 z-compile -input %i
8527 @end smallexample
8528
8529 This says that any input file whose name ends in @samp{.ZZ} should be
8530 passed to the program @samp{z-compile}, which should be invoked with the
8531 command-line switch @option{-input} and with the result of performing the
8532 @samp{%i} substitution.  (See below.)
8533
8534 As an alternative to providing a spec string, the text that follows a
8535 suffix directive can be one of the following:
8536
8537 @table @code
8538 @item @@@var{language}
8539 This says that the suffix is an alias for a known @var{language}.  This is
8540 similar to using the @option{-x} command-line switch to GCC to specify a
8541 language explicitly.  For example:
8542
8543 @smallexample
8544 .ZZ:
8545 @@c++
8546 @end smallexample
8547
8548 Says that .ZZ files are, in fact, C++ source files.
8549
8550 @item #@var{name}
8551 This causes an error messages saying:
8552
8553 @smallexample
8554 @var{name} compiler not installed on this system.
8555 @end smallexample
8556 @end table
8557
8558 GCC already has an extensive list of suffixes built into it.
8559 This directive will add an entry to the end of the list of suffixes, but
8560 since the list is searched from the end backwards, it is effectively
8561 possible to override earlier entries using this technique.
8562
8563 @end table
8564
8565 GCC has the following spec strings built into it.  Spec files can
8566 override these strings or create their own.  Note that individual
8567 targets can also add their own spec strings to this list.
8568
8569 @smallexample
8570 asm          Options to pass to the assembler
8571 asm_final    Options to pass to the assembler post-processor
8572 cpp          Options to pass to the C preprocessor
8573 cc1          Options to pass to the C compiler
8574 cc1plus      Options to pass to the C++ compiler
8575 endfile      Object files to include at the end of the link
8576 link         Options to pass to the linker
8577 lib          Libraries to include on the command line to the linker
8578 libgcc       Decides which GCC support library to pass to the linker
8579 linker       Sets the name of the linker
8580 predefines   Defines to be passed to the C preprocessor
8581 signed_char  Defines to pass to CPP to say whether @code{char} is signed
8582              by default
8583 startfile    Object files to include at the start of the link
8584 @end smallexample
8585
8586 Here is a small example of a spec file:
8587
8588 @smallexample
8589 %rename lib                 old_lib
8590
8591 *lib:
8592 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
8593 @end smallexample
8594
8595 This example renames the spec called @samp{lib} to @samp{old_lib} and
8596 then overrides the previous definition of @samp{lib} with a new one.
8597 The new definition adds in some extra command-line options before
8598 including the text of the old definition.
8599
8600 @dfn{Spec strings} are a list of command-line options to be passed to their
8601 corresponding program.  In addition, the spec strings can contain
8602 @samp{%}-prefixed sequences to substitute variable text or to
8603 conditionally insert text into the command line.  Using these constructs
8604 it is possible to generate quite complex command lines.
8605
8606 Here is a table of all defined @samp{%}-sequences for spec
8607 strings.  Note that spaces are not generated automatically around the
8608 results of expanding these sequences.  Therefore you can concatenate them
8609 together or combine them with constant text in a single argument.
8610
8611 @table @code
8612 @item %%
8613 Substitute one @samp{%} into the program name or argument.
8614
8615 @item %i
8616 Substitute the name of the input file being processed.
8617
8618 @item %b
8619 Substitute the basename of the input file being processed.
8620 This is the substring up to (and not including) the last period
8621 and not including the directory.
8622
8623 @item %B
8624 This is the same as @samp{%b}, but include the file suffix (text after
8625 the last period).
8626
8627 @item %d
8628 Marks the argument containing or following the @samp{%d} as a
8629 temporary file name, so that that file will be deleted if GCC exits
8630 successfully.  Unlike @samp{%g}, this contributes no text to the
8631 argument.
8632
8633 @item %g@var{suffix}
8634 Substitute a file name that has suffix @var{suffix} and is chosen
8635 once per compilation, and mark the argument in the same way as
8636 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
8637 name is now chosen in a way that is hard to predict even when previously
8638 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
8639 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
8640 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
8641 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
8642 was simply substituted with a file name chosen once per compilation,
8643 without regard to any appended suffix (which was therefore treated
8644 just like ordinary text), making such attacks more likely to succeed.
8645
8646 @item %u@var{suffix}
8647 Like @samp{%g}, but generates a new temporary file name even if
8648 @samp{%u@var{suffix}} was already seen.
8649
8650 @item %U@var{suffix}
8651 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
8652 new one if there is no such last file name.  In the absence of any
8653 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
8654 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
8655 would involve the generation of two distinct file names, one
8656 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
8657 simply substituted with a file name chosen for the previous @samp{%u},
8658 without regard to any appended suffix.
8659
8660 @item %j@var{suffix}
8661 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
8662 writable, and if save-temps is off; otherwise, substitute the name
8663 of a temporary file, just like @samp{%u}.  This temporary file is not
8664 meant for communication between processes, but rather as a junk
8665 disposal mechanism.
8666
8667 @item %|@var{suffix}
8668 @itemx %m@var{suffix}
8669 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
8670 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
8671 all.  These are the two most common ways to instruct a program that it
8672 should read from standard input or write to standard output.  If you
8673 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
8674 construct: see for example @file{f/lang-specs.h}.
8675
8676 @item %.@var{SUFFIX}
8677 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
8678 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
8679 terminated by the next space or %.
8680
8681 @item %w
8682 Marks the argument containing or following the @samp{%w} as the
8683 designated output file of this compilation.  This puts the argument
8684 into the sequence of arguments that @samp{%o} will substitute later.
8685
8686 @item %o
8687 Substitutes the names of all the output files, with spaces
8688 automatically placed around them.  You should write spaces
8689 around the @samp{%o} as well or the results are undefined.
8690 @samp{%o} is for use in the specs for running the linker.
8691 Input files whose names have no recognized suffix are not compiled
8692 at all, but they are included among the output files, so they will
8693 be linked.
8694
8695 @item %O
8696 Substitutes the suffix for object files.  Note that this is
8697 handled specially when it immediately follows @samp{%g, %u, or %U},
8698 because of the need for those to form complete file names.  The
8699 handling is such that @samp{%O} is treated exactly as if it had already
8700 been substituted, except that @samp{%g, %u, and %U} do not currently
8701 support additional @var{suffix} characters following @samp{%O} as they would
8702 following, for example, @samp{.o}.
8703
8704 @item %p
8705 Substitutes the standard macro predefinitions for the
8706 current target machine.  Use this when running @code{cpp}.
8707
8708 @item %P
8709 Like @samp{%p}, but puts @samp{__} before and after the name of each
8710 predefined macro, except for macros that start with @samp{__} or with
8711 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
8712 C@.
8713
8714 @item %I
8715 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
8716 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
8717 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
8718 and @option{-imultilib} as necessary.
8719
8720 @item %s
8721 Current argument is the name of a library or startup file of some sort.
8722 Search for that file in a standard list of directories and substitute
8723 the full name found.
8724
8725 @item %e@var{str}
8726 Print @var{str} as an error message.  @var{str} is terminated by a newline.
8727 Use this when inconsistent options are detected.
8728
8729 @item %(@var{name})
8730 Substitute the contents of spec string @var{name} at this point.
8731
8732 @item %[@var{name}]
8733 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
8734
8735 @item %x@{@var{option}@}
8736 Accumulate an option for @samp{%X}.
8737
8738 @item %X
8739 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
8740 spec string.
8741
8742 @item %Y
8743 Output the accumulated assembler options specified by @option{-Wa}.
8744
8745 @item %Z
8746 Output the accumulated preprocessor options specified by @option{-Wp}.
8747
8748 @item %a
8749 Process the @code{asm} spec.  This is used to compute the
8750 switches to be passed to the assembler.
8751
8752 @item %A
8753 Process the @code{asm_final} spec.  This is a spec string for
8754 passing switches to an assembler post-processor, if such a program is
8755 needed.
8756
8757 @item %l
8758 Process the @code{link} spec.  This is the spec for computing the
8759 command line passed to the linker.  Typically it will make use of the
8760 @samp{%L %G %S %D and %E} sequences.
8761
8762 @item %D
8763 Dump out a @option{-L} option for each directory that GCC believes might
8764 contain startup files.  If the target supports multilibs then the
8765 current multilib directory will be prepended to each of these paths.
8766
8767 @item %L
8768 Process the @code{lib} spec.  This is a spec string for deciding which
8769 libraries should be included on the command line to the linker.
8770
8771 @item %G
8772 Process the @code{libgcc} spec.  This is a spec string for deciding
8773 which GCC support library should be included on the command line to the linker.
8774
8775 @item %S
8776 Process the @code{startfile} spec.  This is a spec for deciding which
8777 object files should be the first ones passed to the linker.  Typically
8778 this might be a file named @file{crt0.o}.
8779
8780 @item %E
8781 Process the @code{endfile} spec.  This is a spec string that specifies
8782 the last object files that will be passed to the linker.
8783
8784 @item %C
8785 Process the @code{cpp} spec.  This is used to construct the arguments
8786 to be passed to the C preprocessor.
8787
8788 @item %1
8789 Process the @code{cc1} spec.  This is used to construct the options to be
8790 passed to the actual C compiler (@samp{cc1}).
8791
8792 @item %2
8793 Process the @code{cc1plus} spec.  This is used to construct the options to be
8794 passed to the actual C++ compiler (@samp{cc1plus}).
8795
8796 @item %*
8797 Substitute the variable part of a matched option.  See below.
8798 Note that each comma in the substituted string is replaced by
8799 a single space.
8800
8801 @item %<@code{S}
8802 Remove all occurrences of @code{-S} from the command line.  Note---this
8803 command is position dependent.  @samp{%} commands in the spec string
8804 before this one will see @code{-S}, @samp{%} commands in the spec string
8805 after this one will not.
8806
8807 @item %:@var{function}(@var{args})
8808 Call the named function @var{function}, passing it @var{args}.
8809 @var{args} is first processed as a nested spec string, then split
8810 into an argument vector in the usual fashion.  The function returns
8811 a string which is processed as if it had appeared literally as part
8812 of the current spec.
8813
8814 The following built-in spec functions are provided:
8815
8816 @table @code
8817 @item @code{getenv}
8818 The @code{getenv} spec function takes two arguments: an environment
8819 variable name and a string.  If the environment variable is not
8820 defined, a fatal error is issued.  Otherwise, the return value is the
8821 value of the environment variable concatenated with the string.  For
8822 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
8823
8824 @smallexample
8825 %:getenv(TOPDIR /include)
8826 @end smallexample
8827
8828 expands to @file{/path/to/top/include}.
8829
8830 @item @code{if-exists}
8831 The @code{if-exists} spec function takes one argument, an absolute
8832 pathname to a file.  If the file exists, @code{if-exists} returns the
8833 pathname.  Here is a small example of its usage:
8834
8835 @smallexample
8836 *startfile:
8837 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
8838 @end smallexample
8839
8840 @item @code{if-exists-else}
8841 The @code{if-exists-else} spec function is similar to the @code{if-exists}
8842 spec function, except that it takes two arguments.  The first argument is
8843 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
8844 returns the pathname.  If it does not exist, it returns the second argument.
8845 This way, @code{if-exists-else} can be used to select one file or another,
8846 based on the existence of the first.  Here is a small example of its usage:
8847
8848 @smallexample
8849 *startfile:
8850 crt0%O%s %:if-exists(crti%O%s) \
8851 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
8852 @end smallexample
8853
8854 @item @code{replace-outfile}
8855 The @code{replace-outfile} spec function takes two arguments.  It looks for the
8856 first argument in the outfiles array and replaces it with the second argument.  Here
8857 is a small example of its usage:
8858
8859 @smallexample
8860 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
8861 @end smallexample
8862
8863 @item @code{print-asm-header}
8864 The @code{print-asm-header} function takes no arguments and simply
8865 prints a banner like:
8866
8867 @smallexample
8868 Assembler options
8869 =================
8870
8871 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
8872 @end smallexample
8873
8874 It is used to separate compiler options from assembler options
8875 in the @option{--target-help} output.
8876 @end table
8877
8878 @item %@{@code{S}@}
8879 Substitutes the @code{-S} switch, if that switch was given to GCC@.
8880 If that switch was not specified, this substitutes nothing.  Note that
8881 the leading dash is omitted when specifying this option, and it is
8882 automatically inserted if the substitution is performed.  Thus the spec
8883 string @samp{%@{foo@}} would match the command-line option @option{-foo}
8884 and would output the command line option @option{-foo}.
8885
8886 @item %W@{@code{S}@}
8887 Like %@{@code{S}@} but mark last argument supplied within as a file to be
8888 deleted on failure.
8889
8890 @item %@{@code{S}*@}
8891 Substitutes all the switches specified to GCC whose names start
8892 with @code{-S}, but which also take an argument.  This is used for
8893 switches like @option{-o}, @option{-D}, @option{-I}, etc.
8894 GCC considers @option{-o foo} as being
8895 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
8896 text, including the space.  Thus two arguments would be generated.
8897
8898 @item %@{@code{S}*&@code{T}*@}
8899 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
8900 (the order of @code{S} and @code{T} in the spec is not significant).
8901 There can be any number of ampersand-separated variables; for each the
8902 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
8903
8904 @item %@{@code{S}:@code{X}@}
8905 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
8906
8907 @item %@{!@code{S}:@code{X}@}
8908 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
8909
8910 @item %@{@code{S}*:@code{X}@}
8911 Substitutes @code{X} if one or more switches whose names start with
8912 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
8913 once, no matter how many such switches appeared.  However, if @code{%*}
8914 appears somewhere in @code{X}, then @code{X} will be substituted once
8915 for each matching switch, with the @code{%*} replaced by the part of
8916 that switch that matched the @code{*}.
8917
8918 @item %@{.@code{S}:@code{X}@}
8919 Substitutes @code{X}, if processing a file with suffix @code{S}.
8920
8921 @item %@{!.@code{S}:@code{X}@}
8922 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
8923
8924 @item %@{,@code{S}:@code{X}@}
8925 Substitutes @code{X}, if processing a file for language @code{S}.
8926
8927 @item %@{!,@code{S}:@code{X}@}
8928 Substitutes @code{X}, if not processing a file for language @code{S}.
8929
8930 @item %@{@code{S}|@code{P}:@code{X}@}
8931 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
8932 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
8933 @code{*} sequences as well, although they have a stronger binding than
8934 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
8935 alternatives must be starred, and only the first matching alternative
8936 is substituted.
8937
8938 For example, a spec string like this:
8939
8940 @smallexample
8941 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
8942 @end smallexample
8943
8944 will output the following command-line options from the following input
8945 command-line options:
8946
8947 @smallexample
8948 fred.c        -foo -baz
8949 jim.d         -bar -boggle
8950 -d fred.c     -foo -baz -boggle
8951 -d jim.d      -bar -baz -boggle
8952 @end smallexample
8953
8954 @item %@{S:X; T:Y; :D@}
8955
8956 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
8957 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
8958 be as many clauses as you need.  This may be combined with @code{.},
8959 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
8960
8961
8962 @end table
8963
8964 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
8965 construct may contain other nested @samp{%} constructs or spaces, or
8966 even newlines.  They are processed as usual, as described above.
8967 Trailing white space in @code{X} is ignored.  White space may also
8968 appear anywhere on the left side of the colon in these constructs,
8969 except between @code{.} or @code{*} and the corresponding word.
8970
8971 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
8972 handled specifically in these constructs.  If another value of
8973 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
8974 @option{-W} switch is found later in the command line, the earlier
8975 switch value is ignored, except with @{@code{S}*@} where @code{S} is
8976 just one letter, which passes all matching options.
8977
8978 The character @samp{|} at the beginning of the predicate text is used to
8979 indicate that a command should be piped to the following command, but
8980 only if @option{-pipe} is specified.
8981
8982 It is built into GCC which switches take arguments and which do not.
8983 (You might think it would be useful to generalize this to allow each
8984 compiler's spec to say which switches take arguments.  But this cannot
8985 be done in a consistent fashion.  GCC cannot even decide which input
8986 files have been specified without knowing which switches take arguments,
8987 and it must know which input files to compile in order to tell which
8988 compilers to run).
8989
8990 GCC also knows implicitly that arguments starting in @option{-l} are to be
8991 treated as compiler output files, and passed to the linker in their
8992 proper position among the other output files.
8993
8994 @c man begin OPTIONS
8995
8996 @node Target Options
8997 @section Specifying Target Machine and Compiler Version
8998 @cindex target options
8999 @cindex cross compiling
9000 @cindex specifying machine version
9001 @cindex specifying compiler version and target machine
9002 @cindex compiler version, specifying
9003 @cindex target machine, specifying
9004
9005 The usual way to run GCC is to run the executable called @file{gcc}, or
9006 @file{<machine>-gcc} when cross-compiling, or
9007 @file{<machine>-gcc-<version>} to run a version other than the one that
9008 was installed last.  Sometimes this is inconvenient, so GCC provides
9009 options that will switch to another cross-compiler or version.
9010
9011 @table @gcctabopt
9012 @item -b @var{machine}
9013 @opindex b
9014 The argument @var{machine} specifies the target machine for compilation.
9015
9016 The value to use for @var{machine} is the same as was specified as the
9017 machine type when configuring GCC as a cross-compiler.  For
9018 example, if a cross-compiler was configured with @samp{configure
9019 arm-elf}, meaning to compile for an arm processor with elf binaries,
9020 then you would specify @option{-b arm-elf} to run that cross compiler.
9021 Because there are other options beginning with @option{-b}, the
9022 configuration must contain a hyphen, or @option{-b} alone should be one
9023 argument followed by the configuration in the next argument.
9024
9025 @item -V @var{version}
9026 @opindex V
9027 The argument @var{version} specifies which version of GCC to run.
9028 This is useful when multiple versions are installed.  For example,
9029 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
9030 @end table
9031
9032 The @option{-V} and @option{-b} options work by running the
9033 @file{<machine>-gcc-<version>} executable, so there's no real reason to
9034 use them if you can just run that directly.
9035
9036 @node Submodel Options
9037 @section Hardware Models and Configurations
9038 @cindex submodel options
9039 @cindex specifying hardware config
9040 @cindex hardware models and configurations, specifying
9041 @cindex machine dependent options
9042
9043 Earlier we discussed the standard option @option{-b} which chooses among
9044 different installed compilers for completely different target
9045 machines, such as VAX vs.@: 68000 vs.@: 80386.
9046
9047 In addition, each of these target machine types can have its own
9048 special options, starting with @samp{-m}, to choose among various
9049 hardware models or configurations---for example, 68010 vs 68020,
9050 floating coprocessor or none.  A single installed version of the
9051 compiler can compile for any model or configuration, according to the
9052 options specified.
9053
9054 Some configurations of the compiler also support additional special
9055 options, usually for compatibility with other compilers on the same
9056 platform.
9057
9058 @c This list is ordered alphanumerically by subsection name.
9059 @c It should be the same order and spelling as these options are listed
9060 @c in Machine Dependent Options
9061
9062 @menu
9063 * ARC Options::
9064 * ARM Options::
9065 * AVR Options::
9066 * Blackfin Options::
9067 * CRIS Options::
9068 * CRX Options::
9069 * Darwin Options::
9070 * DEC Alpha Options::
9071 * DEC Alpha/VMS Options::
9072 * FR30 Options::
9073 * FRV Options::
9074 * GNU/Linux Options::
9075 * H8/300 Options::
9076 * HPPA Options::
9077 * i386 and x86-64 Options::
9078 * i386 and x86-64 Windows Options::
9079 * IA-64 Options::
9080 * M32C Options::
9081 * M32R/D Options::
9082 * M680x0 Options::
9083 * M68hc1x Options::
9084 * MCore Options::
9085 * MeP Options::
9086 * MIPS Options::
9087 * MMIX Options::
9088 * MN10300 Options::
9089 * PDP-11 Options::
9090 * picoChip Options::
9091 * PowerPC Options::
9092 * RS/6000 and PowerPC Options::
9093 * S/390 and zSeries Options::
9094 * Score Options::
9095 * SH Options::
9096 * SPARC Options::
9097 * SPU Options::
9098 * System V Options::
9099 * V850 Options::
9100 * VAX Options::
9101 * VxWorks Options::
9102 * x86-64 Options::
9103 * Xstormy16 Options::
9104 * Xtensa Options::
9105 * zSeries Options::
9106 @end menu
9107
9108 @node ARC Options
9109 @subsection ARC Options
9110 @cindex ARC Options
9111
9112 These options are defined for ARC implementations:
9113
9114 @table @gcctabopt
9115 @item -EL
9116 @opindex EL
9117 Compile code for little endian mode.  This is the default.
9118
9119 @item -EB
9120 @opindex EB
9121 Compile code for big endian mode.
9122
9123 @item -mmangle-cpu
9124 @opindex mmangle-cpu
9125 Prepend the name of the cpu to all public symbol names.
9126 In multiple-processor systems, there are many ARC variants with different
9127 instruction and register set characteristics.  This flag prevents code
9128 compiled for one cpu to be linked with code compiled for another.
9129 No facility exists for handling variants that are ``almost identical''.
9130 This is an all or nothing option.
9131
9132 @item -mcpu=@var{cpu}
9133 @opindex mcpu
9134 Compile code for ARC variant @var{cpu}.
9135 Which variants are supported depend on the configuration.
9136 All variants support @option{-mcpu=base}, this is the default.
9137
9138 @item -mtext=@var{text-section}
9139 @itemx -mdata=@var{data-section}
9140 @itemx -mrodata=@var{readonly-data-section}
9141 @opindex mtext
9142 @opindex mdata
9143 @opindex mrodata
9144 Put functions, data, and readonly data in @var{text-section},
9145 @var{data-section}, and @var{readonly-data-section} respectively
9146 by default.  This can be overridden with the @code{section} attribute.
9147 @xref{Variable Attributes}.
9148
9149 @item -mfix-cortex-m3-ldrd
9150 @opindex mfix-cortex-m3-ldrd
9151 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
9152 with overlapping destination and base registers are used.  This option avoids
9153 generating these instructions.  This option is enabled by default when
9154 @option{-mcpu=cortex-m3} is specified.
9155
9156 @end table
9157
9158 @node ARM Options
9159 @subsection ARM Options
9160 @cindex ARM options
9161
9162 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
9163 architectures:
9164
9165 @table @gcctabopt
9166 @item -mabi=@var{name}
9167 @opindex mabi
9168 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
9169 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
9170
9171 @item -mapcs-frame
9172 @opindex mapcs-frame
9173 Generate a stack frame that is compliant with the ARM Procedure Call
9174 Standard for all functions, even if this is not strictly necessary for
9175 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
9176 with this option will cause the stack frames not to be generated for
9177 leaf functions.  The default is @option{-mno-apcs-frame}.
9178
9179 @item -mapcs
9180 @opindex mapcs
9181 This is a synonym for @option{-mapcs-frame}.
9182
9183 @ignore
9184 @c not currently implemented
9185 @item -mapcs-stack-check
9186 @opindex mapcs-stack-check
9187 Generate code to check the amount of stack space available upon entry to
9188 every function (that actually uses some stack space).  If there is
9189 insufficient space available then either the function
9190 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
9191 called, depending upon the amount of stack space required.  The run time
9192 system is required to provide these functions.  The default is
9193 @option{-mno-apcs-stack-check}, since this produces smaller code.
9194
9195 @c not currently implemented
9196 @item -mapcs-float
9197 @opindex mapcs-float
9198 Pass floating point arguments using the float point registers.  This is
9199 one of the variants of the APCS@.  This option is recommended if the
9200 target hardware has a floating point unit or if a lot of floating point
9201 arithmetic is going to be performed by the code.  The default is
9202 @option{-mno-apcs-float}, since integer only code is slightly increased in
9203 size if @option{-mapcs-float} is used.
9204
9205 @c not currently implemented
9206 @item -mapcs-reentrant
9207 @opindex mapcs-reentrant
9208 Generate reentrant, position independent code.  The default is
9209 @option{-mno-apcs-reentrant}.
9210 @end ignore
9211
9212 @item -mthumb-interwork
9213 @opindex mthumb-interwork
9214 Generate code which supports calling between the ARM and Thumb
9215 instruction sets.  Without this option the two instruction sets cannot
9216 be reliably used inside one program.  The default is
9217 @option{-mno-thumb-interwork}, since slightly larger code is generated
9218 when @option{-mthumb-interwork} is specified.
9219
9220 @item -mno-sched-prolog
9221 @opindex mno-sched-prolog
9222 Prevent the reordering of instructions in the function prolog, or the
9223 merging of those instruction with the instructions in the function's
9224 body.  This means that all functions will start with a recognizable set
9225 of instructions (or in fact one of a choice from a small set of
9226 different function prologues), and this information can be used to
9227 locate the start if functions inside an executable piece of code.  The
9228 default is @option{-msched-prolog}.
9229
9230 @item -mfloat-abi=@var{name}
9231 @opindex mfloat-abi
9232 Specifies which floating-point ABI to use.  Permissible values
9233 are: @samp{soft}, @samp{softfp} and @samp{hard}.
9234
9235 Specifying @samp{soft} causes GCC to generate output containing
9236 library calls for floating-point operations.
9237 @samp{softfp} allows the generation of code using hardware floating-point
9238 instructions, but still uses the soft-float calling conventions.
9239 @samp{hard} allows generation of floating-point instructions
9240 and uses FPU-specific calling conventions.
9241
9242 Using @option{-mfloat-abi=hard} with VFP coprocessors is not supported.
9243 Use @option{-mfloat-abi=softfp} with the appropriate @option{-mfpu} option
9244 to allow the compiler to generate code that makes use of the hardware
9245 floating-point capabilities for these CPUs.
9246
9247 The default depends on the specific target configuration.  Note that
9248 the hard-float and soft-float ABIs are not link-compatible; you must
9249 compile your entire program with the same ABI, and link with a
9250 compatible set of libraries.
9251
9252 @item -mhard-float
9253 @opindex mhard-float
9254 Equivalent to @option{-mfloat-abi=hard}.
9255
9256 @item -msoft-float
9257 @opindex msoft-float
9258 Equivalent to @option{-mfloat-abi=soft}.
9259
9260 @item -mlittle-endian
9261 @opindex mlittle-endian
9262 Generate code for a processor running in little-endian mode.  This is
9263 the default for all standard configurations.
9264
9265 @item -mbig-endian
9266 @opindex mbig-endian
9267 Generate code for a processor running in big-endian mode; the default is
9268 to compile code for a little-endian processor.
9269
9270 @item -mwords-little-endian
9271 @opindex mwords-little-endian
9272 This option only applies when generating code for big-endian processors.
9273 Generate code for a little-endian word order but a big-endian byte
9274 order.  That is, a byte order of the form @samp{32107654}.  Note: this
9275 option should only be used if you require compatibility with code for
9276 big-endian ARM processors generated by versions of the compiler prior to
9277 2.8.
9278
9279 @item -mcpu=@var{name}
9280 @opindex mcpu
9281 This specifies the name of the target ARM processor.  GCC uses this name
9282 to determine what kind of instructions it can emit when generating
9283 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
9284 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
9285 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
9286 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
9287 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
9288 @samp{arm720},
9289 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
9290 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
9291 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
9292 @samp{strongarm1110},
9293 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
9294 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
9295 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
9296 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
9297 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
9298 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
9299 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
9300 @samp{cortex-a8}, @samp{cortex-a9},
9301 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
9302 @samp{cortex-m1},
9303 @samp{cortex-m0},
9304 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9305
9306 @item -mtune=@var{name}
9307 @opindex mtune
9308 This option is very similar to the @option{-mcpu=} option, except that
9309 instead of specifying the actual target processor type, and hence
9310 restricting which instructions can be used, it specifies that GCC should
9311 tune the performance of the code as if the target were of the type
9312 specified in this option, but still choosing the instructions that it
9313 will generate based on the cpu specified by a @option{-mcpu=} option.
9314 For some ARM implementations better performance can be obtained by using
9315 this option.
9316
9317 @item -march=@var{name}
9318 @opindex march
9319 This specifies the name of the target ARM architecture.  GCC uses this
9320 name to determine what kind of instructions it can emit when generating
9321 assembly code.  This option can be used in conjunction with or instead
9322 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
9323 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
9324 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
9325 @samp{armv6}, @samp{armv6j},
9326 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
9327 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
9328 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9329
9330 @item -mfpu=@var{name}
9331 @itemx -mfpe=@var{number}
9332 @itemx -mfp=@var{number}
9333 @opindex mfpu
9334 @opindex mfpe
9335 @opindex mfp
9336 This specifies what floating point hardware (or hardware emulation) is
9337 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
9338 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-d16},
9339 @samp{neon}, and @samp{neon-fp16}.  @option{-mfp} and @option{-mfpe}
9340 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
9341 with older versions of GCC@.
9342
9343 If @option{-msoft-float} is specified this specifies the format of
9344 floating point values.
9345
9346 @item -mfp16-format=@var{name}
9347 @opindex mfp16-format
9348 Specify the format of the @code{__fp16} half-precision floating-point type.
9349 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
9350 the default is @samp{none}, in which case the @code{__fp16} type is not
9351 defined.  @xref{Half-Precision}, for more information.
9352
9353 @item -mstructure-size-boundary=@var{n}
9354 @opindex mstructure-size-boundary
9355 The size of all structures and unions will be rounded up to a multiple
9356 of the number of bits set by this option.  Permissible values are 8, 32
9357 and 64.  The default value varies for different toolchains.  For the COFF
9358 targeted toolchain the default value is 8.  A value of 64 is only allowed
9359 if the underlying ABI supports it.
9360
9361 Specifying the larger number can produce faster, more efficient code, but
9362 can also increase the size of the program.  Different values are potentially
9363 incompatible.  Code compiled with one value cannot necessarily expect to
9364 work with code or libraries compiled with another value, if they exchange
9365 information using structures or unions.
9366
9367 @item -mabort-on-noreturn
9368 @opindex mabort-on-noreturn
9369 Generate a call to the function @code{abort} at the end of a
9370 @code{noreturn} function.  It will be executed if the function tries to
9371 return.
9372
9373 @item -mlong-calls
9374 @itemx -mno-long-calls
9375 @opindex mlong-calls
9376 @opindex mno-long-calls
9377 Tells the compiler to perform function calls by first loading the
9378 address of the function into a register and then performing a subroutine
9379 call on this register.  This switch is needed if the target function
9380 will lie outside of the 64 megabyte addressing range of the offset based
9381 version of subroutine call instruction.
9382
9383 Even if this switch is enabled, not all function calls will be turned
9384 into long calls.  The heuristic is that static functions, functions
9385 which have the @samp{short-call} attribute, functions that are inside
9386 the scope of a @samp{#pragma no_long_calls} directive and functions whose
9387 definitions have already been compiled within the current compilation
9388 unit, will not be turned into long calls.  The exception to this rule is
9389 that weak function definitions, functions with the @samp{long-call}
9390 attribute or the @samp{section} attribute, and functions that are within
9391 the scope of a @samp{#pragma long_calls} directive, will always be
9392 turned into long calls.
9393
9394 This feature is not enabled by default.  Specifying
9395 @option{-mno-long-calls} will restore the default behavior, as will
9396 placing the function calls within the scope of a @samp{#pragma
9397 long_calls_off} directive.  Note these switches have no effect on how
9398 the compiler generates code to handle function calls via function
9399 pointers.
9400
9401 @item -msingle-pic-base
9402 @opindex msingle-pic-base
9403 Treat the register used for PIC addressing as read-only, rather than
9404 loading it in the prologue for each function.  The run-time system is
9405 responsible for initializing this register with an appropriate value
9406 before execution begins.
9407
9408 @item -mpic-register=@var{reg}
9409 @opindex mpic-register
9410 Specify the register to be used for PIC addressing.  The default is R10
9411 unless stack-checking is enabled, when R9 is used.
9412
9413 @item -mcirrus-fix-invalid-insns
9414 @opindex mcirrus-fix-invalid-insns
9415 @opindex mno-cirrus-fix-invalid-insns
9416 Insert NOPs into the instruction stream to in order to work around
9417 problems with invalid Maverick instruction combinations.  This option
9418 is only valid if the @option{-mcpu=ep9312} option has been used to
9419 enable generation of instructions for the Cirrus Maverick floating
9420 point co-processor.  This option is not enabled by default, since the
9421 problem is only present in older Maverick implementations.  The default
9422 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
9423 switch.
9424
9425 @item -mpoke-function-name
9426 @opindex mpoke-function-name
9427 Write the name of each function into the text section, directly
9428 preceding the function prologue.  The generated code is similar to this:
9429
9430 @smallexample
9431      t0
9432          .ascii "arm_poke_function_name", 0
9433          .align
9434      t1
9435          .word 0xff000000 + (t1 - t0)
9436      arm_poke_function_name
9437          mov     ip, sp
9438          stmfd   sp!, @{fp, ip, lr, pc@}
9439          sub     fp, ip, #4
9440 @end smallexample
9441
9442 When performing a stack backtrace, code can inspect the value of
9443 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
9444 location @code{pc - 12} and the top 8 bits are set, then we know that
9445 there is a function name embedded immediately preceding this location
9446 and has length @code{((pc[-3]) & 0xff000000)}.
9447
9448 @item -mthumb
9449 @opindex mthumb
9450 Generate code for the Thumb instruction set.  The default is to
9451 use the 32-bit ARM instruction set.
9452 This option automatically enables either 16-bit Thumb-1 or
9453 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
9454 and @option{-march=@var{name}} options.  This option is not passed to the
9455 assembler. If you want to force assembler files to be interpreted as Thumb code,
9456 either add a @samp{.thumb} directive to the source or pass the @option{-mthumb}
9457 option directly to the assembler by prefixing it with @option{-Wa}.
9458
9459 @item -mtpcs-frame
9460 @opindex mtpcs-frame
9461 Generate a stack frame that is compliant with the Thumb Procedure Call
9462 Standard for all non-leaf functions.  (A leaf function is one that does
9463 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
9464
9465 @item -mtpcs-leaf-frame
9466 @opindex mtpcs-leaf-frame
9467 Generate a stack frame that is compliant with the Thumb Procedure Call
9468 Standard for all leaf functions.  (A leaf function is one that does
9469 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
9470
9471 @item -mcallee-super-interworking
9472 @opindex mcallee-super-interworking
9473 Gives all externally visible functions in the file being compiled an ARM
9474 instruction set header which switches to Thumb mode before executing the
9475 rest of the function.  This allows these functions to be called from
9476 non-interworking code.  This option is not valid in AAPCS configurations
9477 because interworking is enabled by default.
9478
9479 @item -mcaller-super-interworking
9480 @opindex mcaller-super-interworking
9481 Allows calls via function pointers (including virtual functions) to
9482 execute correctly regardless of whether the target code has been
9483 compiled for interworking or not.  There is a small overhead in the cost
9484 of executing a function pointer if this option is enabled.  This option
9485 is not valid in AAPCS configurations because interworking is enabled
9486 by default.
9487
9488 @item -mtp=@var{name}
9489 @opindex mtp
9490 Specify the access model for the thread local storage pointer.  The valid
9491 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
9492 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
9493 (supported in the arm6k architecture), and @option{auto}, which uses the
9494 best available method for the selected processor.  The default setting is
9495 @option{auto}.
9496
9497 @item -mword-relocations
9498 @opindex mword-relocations
9499 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
9500 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
9501 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
9502 is specified.
9503
9504 @end table
9505
9506 @node AVR Options
9507 @subsection AVR Options
9508 @cindex AVR Options
9509
9510 These options are defined for AVR implementations:
9511
9512 @table @gcctabopt
9513 @item -mmcu=@var{mcu}
9514 @opindex mmcu
9515 Specify ATMEL AVR instruction set or MCU type.
9516
9517 Instruction set avr1 is for the minimal AVR core, not supported by the C
9518 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
9519 attiny11, attiny12, attiny15, attiny28).
9520
9521 Instruction set avr2 (default) is for the classic AVR core with up to
9522 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
9523 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
9524 at90c8534, at90s8535).
9525
9526 Instruction set avr3 is for the classic AVR core with up to 128K program
9527 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
9528
9529 Instruction set avr4 is for the enhanced AVR core with up to 8K program
9530 memory space (MCU types: atmega8, atmega83, atmega85).
9531
9532 Instruction set avr5 is for the enhanced AVR core with up to 128K program
9533 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
9534 atmega64, atmega128, at43usb355, at94k).
9535
9536 @item -msize
9537 @opindex msize
9538 Output instruction sizes to the asm file.
9539
9540 @item -minit-stack=@var{N}
9541 @opindex minit-stack
9542 Specify the initial stack address, which may be a symbol or numeric value,
9543 @samp{__stack} is the default.
9544
9545 @item -mno-interrupts
9546 @opindex mno-interrupts
9547 Generated code is not compatible with hardware interrupts.
9548 Code size will be smaller.
9549
9550 @item -mcall-prologues
9551 @opindex mcall-prologues
9552 Functions prologues/epilogues expanded as call to appropriate
9553 subroutines.  Code size will be smaller.
9554
9555 @item -mtiny-stack
9556 @opindex mtiny-stack
9557 Change only the low 8 bits of the stack pointer.
9558
9559 @item -mint8
9560 @opindex mint8
9561 Assume int to be 8 bit integer.  This affects the sizes of all types: A
9562 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
9563 and long long will be 4 bytes.  Please note that this option does not
9564 comply to the C standards, but it will provide you with smaller code
9565 size.
9566 @end table
9567
9568 @node Blackfin Options
9569 @subsection Blackfin Options
9570 @cindex Blackfin Options
9571
9572 @table @gcctabopt
9573 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
9574 @opindex mcpu=
9575 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
9576 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
9577 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
9578 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
9579 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
9580 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
9581 @samp{bf561}.
9582 The optional @var{sirevision} specifies the silicon revision of the target
9583 Blackfin processor.  Any workarounds available for the targeted silicon revision
9584 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
9585 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
9586 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
9587 hexadecimal digits representing the major and minor numbers in the silicon
9588 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
9589 is not defined.  If @var{sirevision} is @samp{any}, the
9590 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
9591 If this optional @var{sirevision} is not used, GCC assumes the latest known
9592 silicon revision of the targeted Blackfin processor.
9593
9594 Support for @samp{bf561} is incomplete.  For @samp{bf561},
9595 Only the processor macro is defined.
9596 Without this option, @samp{bf532} is used as the processor by default.
9597 The corresponding predefined processor macros for @var{cpu} is to
9598 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
9599 provided by libgloss to be linked in if @option{-msim} is not given.
9600
9601 @item -msim
9602 @opindex msim
9603 Specifies that the program will be run on the simulator.  This causes
9604 the simulator BSP provided by libgloss to be linked in.  This option
9605 has effect only for @samp{bfin-elf} toolchain.
9606 Certain other options, such as @option{-mid-shared-library} and
9607 @option{-mfdpic}, imply @option{-msim}.
9608
9609 @item -momit-leaf-frame-pointer
9610 @opindex momit-leaf-frame-pointer
9611 Don't keep the frame pointer in a register for leaf functions.  This
9612 avoids the instructions to save, set up and restore frame pointers and
9613 makes an extra register available in leaf functions.  The option
9614 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9615 which might make debugging harder.
9616
9617 @item -mspecld-anomaly
9618 @opindex mspecld-anomaly
9619 When enabled, the compiler will ensure that the generated code does not
9620 contain speculative loads after jump instructions. If this option is used,
9621 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
9622
9623 @item -mno-specld-anomaly
9624 @opindex mno-specld-anomaly
9625 Don't generate extra code to prevent speculative loads from occurring.
9626
9627 @item -mcsync-anomaly
9628 @opindex mcsync-anomaly
9629 When enabled, the compiler will ensure that the generated code does not
9630 contain CSYNC or SSYNC instructions too soon after conditional branches.
9631 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
9632
9633 @item -mno-csync-anomaly
9634 @opindex mno-csync-anomaly
9635 Don't generate extra code to prevent CSYNC or SSYNC instructions from
9636 occurring too soon after a conditional branch.
9637
9638 @item -mlow-64k
9639 @opindex mlow-64k
9640 When enabled, the compiler is free to take advantage of the knowledge that
9641 the entire program fits into the low 64k of memory.
9642
9643 @item -mno-low-64k
9644 @opindex mno-low-64k
9645 Assume that the program is arbitrarily large.  This is the default.
9646
9647 @item -mstack-check-l1
9648 @opindex mstack-check-l1
9649 Do stack checking using information placed into L1 scratchpad memory by the
9650 uClinux kernel.
9651
9652 @item -mid-shared-library
9653 @opindex mid-shared-library
9654 Generate code that supports shared libraries via the library ID method.
9655 This allows for execute in place and shared libraries in an environment
9656 without virtual memory management.  This option implies @option{-fPIC}.
9657 With a @samp{bfin-elf} target, this option implies @option{-msim}.
9658
9659 @item -mno-id-shared-library
9660 @opindex mno-id-shared-library
9661 Generate code that doesn't assume ID based shared libraries are being used.
9662 This is the default.
9663
9664 @item -mleaf-id-shared-library
9665 @opindex mleaf-id-shared-library
9666 Generate code that supports shared libraries via the library ID method,
9667 but assumes that this library or executable won't link against any other
9668 ID shared libraries.  That allows the compiler to use faster code for jumps
9669 and calls.
9670
9671 @item -mno-leaf-id-shared-library
9672 @opindex mno-leaf-id-shared-library
9673 Do not assume that the code being compiled won't link against any ID shared
9674 libraries.  Slower code will be generated for jump and call insns.
9675
9676 @item -mshared-library-id=n
9677 @opindex mshared-library-id
9678 Specified the identification number of the ID based shared library being
9679 compiled.  Specifying a value of 0 will generate more compact code, specifying
9680 other values will force the allocation of that number to the current
9681 library but is no more space or time efficient than omitting this option.
9682
9683 @item -msep-data
9684 @opindex msep-data
9685 Generate code that allows the data segment to be located in a different
9686 area of memory from the text segment.  This allows for execute in place in
9687 an environment without virtual memory management by eliminating relocations
9688 against the text section.
9689
9690 @item -mno-sep-data
9691 @opindex mno-sep-data
9692 Generate code that assumes that the data segment follows the text segment.
9693 This is the default.
9694
9695 @item -mlong-calls
9696 @itemx -mno-long-calls
9697 @opindex mlong-calls
9698 @opindex mno-long-calls
9699 Tells the compiler to perform function calls by first loading the
9700 address of the function into a register and then performing a subroutine
9701 call on this register.  This switch is needed if the target function
9702 will lie outside of the 24 bit addressing range of the offset based
9703 version of subroutine call instruction.
9704
9705 This feature is not enabled by default.  Specifying
9706 @option{-mno-long-calls} will restore the default behavior.  Note these
9707 switches have no effect on how the compiler generates code to handle
9708 function calls via function pointers.
9709
9710 @item -mfast-fp
9711 @opindex mfast-fp
9712 Link with the fast floating-point library. This library relaxes some of
9713 the IEEE floating-point standard's rules for checking inputs against
9714 Not-a-Number (NAN), in the interest of performance.
9715
9716 @item -minline-plt
9717 @opindex minline-plt
9718 Enable inlining of PLT entries in function calls to functions that are
9719 not known to bind locally.  It has no effect without @option{-mfdpic}.
9720
9721 @item -mmulticore
9722 @opindex mmulticore
9723 Build standalone application for multicore Blackfin processor. Proper
9724 start files and link scripts will be used to support multicore.
9725 This option defines @code{__BFIN_MULTICORE}. It can only be used with
9726 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
9727 @option{-mcorea} or @option{-mcoreb}. If it's used without
9728 @option{-mcorea} or @option{-mcoreb}, single application/dual core
9729 programming model is used. In this model, the main function of Core B
9730 should be named as coreb_main. If it's used with @option{-mcorea} or
9731 @option{-mcoreb}, one application per core programming model is used.
9732 If this option is not used, single core application programming
9733 model is used.
9734
9735 @item -mcorea
9736 @opindex mcorea
9737 Build standalone application for Core A of BF561 when using
9738 one application per core programming model. Proper start files
9739 and link scripts will be used to support Core A. This option
9740 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
9741
9742 @item -mcoreb
9743 @opindex mcoreb
9744 Build standalone application for Core B of BF561 when using
9745 one application per core programming model. Proper start files
9746 and link scripts will be used to support Core B. This option
9747 defines @code{__BFIN_COREB}. When this option is used, coreb_main
9748 should be used instead of main. It must be used with
9749 @option{-mmulticore}.
9750
9751 @item -msdram
9752 @opindex msdram
9753 Build standalone application for SDRAM. Proper start files and
9754 link scripts will be used to put the application into SDRAM.
9755 Loader should initialize SDRAM before loading the application
9756 into SDRAM. This option defines @code{__BFIN_SDRAM}.
9757
9758 @item -micplb
9759 @opindex micplb
9760 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
9761 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
9762 are enabled; for standalone applications the default is off.
9763 @end table
9764
9765 @node CRIS Options
9766 @subsection CRIS Options
9767 @cindex CRIS Options
9768
9769 These options are defined specifically for the CRIS ports.
9770
9771 @table @gcctabopt
9772 @item -march=@var{architecture-type}
9773 @itemx -mcpu=@var{architecture-type}
9774 @opindex march
9775 @opindex mcpu
9776 Generate code for the specified architecture.  The choices for
9777 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
9778 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
9779 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
9780 @samp{v10}.
9781
9782 @item -mtune=@var{architecture-type}
9783 @opindex mtune
9784 Tune to @var{architecture-type} everything applicable about the generated
9785 code, except for the ABI and the set of available instructions.  The
9786 choices for @var{architecture-type} are the same as for
9787 @option{-march=@var{architecture-type}}.
9788
9789 @item -mmax-stack-frame=@var{n}
9790 @opindex mmax-stack-frame
9791 Warn when the stack frame of a function exceeds @var{n} bytes.
9792
9793 @item -metrax4
9794 @itemx -metrax100
9795 @opindex metrax4
9796 @opindex metrax100
9797 The options @option{-metrax4} and @option{-metrax100} are synonyms for
9798 @option{-march=v3} and @option{-march=v8} respectively.
9799
9800 @item -mmul-bug-workaround
9801 @itemx -mno-mul-bug-workaround
9802 @opindex mmul-bug-workaround
9803 @opindex mno-mul-bug-workaround
9804 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
9805 models where it applies.  This option is active by default.
9806
9807 @item -mpdebug
9808 @opindex mpdebug
9809 Enable CRIS-specific verbose debug-related information in the assembly
9810 code.  This option also has the effect to turn off the @samp{#NO_APP}
9811 formatted-code indicator to the assembler at the beginning of the
9812 assembly file.
9813
9814 @item -mcc-init
9815 @opindex mcc-init
9816 Do not use condition-code results from previous instruction; always emit
9817 compare and test instructions before use of condition codes.
9818
9819 @item -mno-side-effects
9820 @opindex mno-side-effects
9821 Do not emit instructions with side-effects in addressing modes other than
9822 post-increment.
9823
9824 @item -mstack-align
9825 @itemx -mno-stack-align
9826 @itemx -mdata-align
9827 @itemx -mno-data-align
9828 @itemx -mconst-align
9829 @itemx -mno-const-align
9830 @opindex mstack-align
9831 @opindex mno-stack-align
9832 @opindex mdata-align
9833 @opindex mno-data-align
9834 @opindex mconst-align
9835 @opindex mno-const-align
9836 These options (no-options) arranges (eliminate arrangements) for the
9837 stack-frame, individual data and constants to be aligned for the maximum
9838 single data access size for the chosen CPU model.  The default is to
9839 arrange for 32-bit alignment.  ABI details such as structure layout are
9840 not affected by these options.
9841
9842 @item -m32-bit
9843 @itemx -m16-bit
9844 @itemx -m8-bit
9845 @opindex m32-bit
9846 @opindex m16-bit
9847 @opindex m8-bit
9848 Similar to the stack- data- and const-align options above, these options
9849 arrange for stack-frame, writable data and constants to all be 32-bit,
9850 16-bit or 8-bit aligned.  The default is 32-bit alignment.
9851
9852 @item -mno-prologue-epilogue
9853 @itemx -mprologue-epilogue
9854 @opindex mno-prologue-epilogue
9855 @opindex mprologue-epilogue
9856 With @option{-mno-prologue-epilogue}, the normal function prologue and
9857 epilogue that sets up the stack-frame are omitted and no return
9858 instructions or return sequences are generated in the code.  Use this
9859 option only together with visual inspection of the compiled code: no
9860 warnings or errors are generated when call-saved registers must be saved,
9861 or storage for local variable needs to be allocated.
9862
9863 @item -mno-gotplt
9864 @itemx -mgotplt
9865 @opindex mno-gotplt
9866 @opindex mgotplt
9867 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
9868 instruction sequences that load addresses for functions from the PLT part
9869 of the GOT rather than (traditional on other architectures) calls to the
9870 PLT@.  The default is @option{-mgotplt}.
9871
9872 @item -melf
9873 @opindex melf
9874 Legacy no-op option only recognized with the cris-axis-elf and
9875 cris-axis-linux-gnu targets.
9876
9877 @item -mlinux
9878 @opindex mlinux
9879 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
9880
9881 @item -sim
9882 @opindex sim
9883 This option, recognized for the cris-axis-elf arranges
9884 to link with input-output functions from a simulator library.  Code,
9885 initialized data and zero-initialized data are allocated consecutively.
9886
9887 @item -sim2
9888 @opindex sim2
9889 Like @option{-sim}, but pass linker options to locate initialized data at
9890 0x40000000 and zero-initialized data at 0x80000000.
9891 @end table
9892
9893 @node CRX Options
9894 @subsection CRX Options
9895 @cindex CRX Options
9896
9897 These options are defined specifically for the CRX ports.
9898
9899 @table @gcctabopt
9900
9901 @item -mmac
9902 @opindex mmac
9903 Enable the use of multiply-accumulate instructions. Disabled by default.
9904
9905 @item -mpush-args
9906 @opindex mpush-args
9907 Push instructions will be used to pass outgoing arguments when functions
9908 are called. Enabled by default.
9909 @end table
9910
9911 @node Darwin Options
9912 @subsection Darwin Options
9913 @cindex Darwin options
9914
9915 These options are defined for all architectures running the Darwin operating
9916 system.
9917
9918 FSF GCC on Darwin does not create ``fat'' object files; it will create
9919 an object file for the single architecture that it was built to
9920 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
9921 @option{-arch} options are used; it does so by running the compiler or
9922 linker multiple times and joining the results together with
9923 @file{lipo}.
9924
9925 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
9926 @samp{i686}) is determined by the flags that specify the ISA
9927 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
9928 @option{-force_cpusubtype_ALL} option can be used to override this.
9929
9930 The Darwin tools vary in their behavior when presented with an ISA
9931 mismatch.  The assembler, @file{as}, will only permit instructions to
9932 be used that are valid for the subtype of the file it is generating,
9933 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
9934 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
9935 and print an error if asked to create a shared library with a less
9936 restrictive subtype than its input files (for instance, trying to put
9937 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
9938 for executables, @file{ld}, will quietly give the executable the most
9939 restrictive subtype of any of its input files.
9940
9941 @table @gcctabopt
9942 @item -F@var{dir}
9943 @opindex F
9944 Add the framework directory @var{dir} to the head of the list of
9945 directories to be searched for header files.  These directories are
9946 interleaved with those specified by @option{-I} options and are
9947 scanned in a left-to-right order.
9948
9949 A framework directory is a directory with frameworks in it.  A
9950 framework is a directory with a @samp{"Headers"} and/or
9951 @samp{"PrivateHeaders"} directory contained directly in it that ends
9952 in @samp{".framework"}.  The name of a framework is the name of this
9953 directory excluding the @samp{".framework"}.  Headers associated with
9954 the framework are found in one of those two directories, with
9955 @samp{"Headers"} being searched first.  A subframework is a framework
9956 directory that is in a framework's @samp{"Frameworks"} directory.
9957 Includes of subframework headers can only appear in a header of a
9958 framework that contains the subframework, or in a sibling subframework
9959 header.  Two subframeworks are siblings if they occur in the same
9960 framework.  A subframework should not have the same name as a
9961 framework, a warning will be issued if this is violated.  Currently a
9962 subframework cannot have subframeworks, in the future, the mechanism
9963 may be extended to support this.  The standard frameworks can be found
9964 in @samp{"/System/Library/Frameworks"} and
9965 @samp{"/Library/Frameworks"}.  An example include looks like
9966 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
9967 the name of the framework and header.h is found in the
9968 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
9969
9970 @item -iframework@var{dir}
9971 @opindex iframework
9972 Like @option{-F} except the directory is a treated as a system
9973 directory.  The main difference between this @option{-iframework} and
9974 @option{-F} is that with @option{-iframework} the compiler does not
9975 warn about constructs contained within header files found via
9976 @var{dir}.  This option is valid only for the C family of languages.
9977
9978 @item -gused
9979 @opindex gused
9980 Emit debugging information for symbols that are used.  For STABS
9981 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
9982 This is by default ON@.
9983
9984 @item -gfull
9985 @opindex gfull
9986 Emit debugging information for all symbols and types.
9987
9988 @item -mmacosx-version-min=@var{version}
9989 The earliest version of MacOS X that this executable will run on
9990 is @var{version}.  Typical values of @var{version} include @code{10.1},
9991 @code{10.2}, and @code{10.3.9}.
9992
9993 If the compiler was built to use the system's headers by default,
9994 then the default for this option is the system version on which the
9995 compiler is running, otherwise the default is to make choices which
9996 are compatible with as many systems and code bases as possible.
9997
9998 @item -mkernel
9999 @opindex mkernel
10000 Enable kernel development mode.  The @option{-mkernel} option sets
10001 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
10002 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
10003 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
10004 applicable.  This mode also sets @option{-mno-altivec},
10005 @option{-msoft-float}, @option{-fno-builtin} and
10006 @option{-mlong-branch} for PowerPC targets.
10007
10008 @item -mone-byte-bool
10009 @opindex mone-byte-bool
10010 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
10011 By default @samp{sizeof(bool)} is @samp{4} when compiling for
10012 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
10013 option has no effect on x86.
10014
10015 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
10016 to generate code that is not binary compatible with code generated
10017 without that switch.  Using this switch may require recompiling all
10018 other modules in a program, including system libraries.  Use this
10019 switch to conform to a non-default data model.
10020
10021 @item -mfix-and-continue
10022 @itemx -ffix-and-continue
10023 @itemx -findirect-data
10024 @opindex mfix-and-continue
10025 @opindex ffix-and-continue
10026 @opindex findirect-data
10027 Generate code suitable for fast turn around development.  Needed to
10028 enable gdb to dynamically load @code{.o} files into already running
10029 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
10030 are provided for backwards compatibility.
10031
10032 @item -all_load
10033 @opindex all_load
10034 Loads all members of static archive libraries.
10035 See man ld(1) for more information.
10036
10037 @item -arch_errors_fatal
10038 @opindex arch_errors_fatal
10039 Cause the errors having to do with files that have the wrong architecture
10040 to be fatal.
10041
10042 @item -bind_at_load
10043 @opindex bind_at_load
10044 Causes the output file to be marked such that the dynamic linker will
10045 bind all undefined references when the file is loaded or launched.
10046
10047 @item -bundle
10048 @opindex bundle
10049 Produce a Mach-o bundle format file.
10050 See man ld(1) for more information.
10051
10052 @item -bundle_loader @var{executable}
10053 @opindex bundle_loader
10054 This option specifies the @var{executable} that will be loading the build
10055 output file being linked.  See man ld(1) for more information.
10056
10057 @item -dynamiclib
10058 @opindex dynamiclib
10059 When passed this option, GCC will produce a dynamic library instead of
10060 an executable when linking, using the Darwin @file{libtool} command.
10061
10062 @item -force_cpusubtype_ALL
10063 @opindex force_cpusubtype_ALL
10064 This causes GCC's output file to have the @var{ALL} subtype, instead of
10065 one controlled by the @option{-mcpu} or @option{-march} option.
10066
10067 @item -allowable_client  @var{client_name}
10068 @itemx -client_name
10069 @itemx -compatibility_version
10070 @itemx -current_version
10071 @itemx -dead_strip
10072 @itemx -dependency-file
10073 @itemx -dylib_file
10074 @itemx -dylinker_install_name
10075 @itemx -dynamic
10076 @itemx -exported_symbols_list
10077 @itemx -filelist
10078 @itemx -flat_namespace
10079 @itemx -force_flat_namespace
10080 @itemx -headerpad_max_install_names
10081 @itemx -image_base
10082 @itemx -init
10083 @itemx -install_name
10084 @itemx -keep_private_externs
10085 @itemx -multi_module
10086 @itemx -multiply_defined
10087 @itemx -multiply_defined_unused
10088 @itemx -noall_load
10089 @itemx -no_dead_strip_inits_and_terms
10090 @itemx -nofixprebinding
10091 @itemx -nomultidefs
10092 @itemx -noprebind
10093 @itemx -noseglinkedit
10094 @itemx -pagezero_size
10095 @itemx -prebind
10096 @itemx -prebind_all_twolevel_modules
10097 @itemx -private_bundle
10098 @itemx -read_only_relocs
10099 @itemx -sectalign
10100 @itemx -sectobjectsymbols
10101 @itemx -whyload
10102 @itemx -seg1addr
10103 @itemx -sectcreate
10104 @itemx -sectobjectsymbols
10105 @itemx -sectorder
10106 @itemx -segaddr
10107 @itemx -segs_read_only_addr
10108 @itemx -segs_read_write_addr
10109 @itemx -seg_addr_table
10110 @itemx -seg_addr_table_filename
10111 @itemx -seglinkedit
10112 @itemx -segprot
10113 @itemx -segs_read_only_addr
10114 @itemx -segs_read_write_addr
10115 @itemx -single_module
10116 @itemx -static
10117 @itemx -sub_library
10118 @itemx -sub_umbrella
10119 @itemx -twolevel_namespace
10120 @itemx -umbrella
10121 @itemx -undefined
10122 @itemx -unexported_symbols_list
10123 @itemx -weak_reference_mismatches
10124 @itemx -whatsloaded
10125 @opindex allowable_client
10126 @opindex client_name
10127 @opindex compatibility_version
10128 @opindex current_version
10129 @opindex dead_strip
10130 @opindex dependency-file
10131 @opindex dylib_file
10132 @opindex dylinker_install_name
10133 @opindex dynamic
10134 @opindex exported_symbols_list
10135 @opindex filelist
10136 @opindex flat_namespace
10137 @opindex force_flat_namespace
10138 @opindex headerpad_max_install_names
10139 @opindex image_base
10140 @opindex init
10141 @opindex install_name
10142 @opindex keep_private_externs
10143 @opindex multi_module
10144 @opindex multiply_defined
10145 @opindex multiply_defined_unused
10146 @opindex noall_load
10147 @opindex no_dead_strip_inits_and_terms
10148 @opindex nofixprebinding
10149 @opindex nomultidefs
10150 @opindex noprebind
10151 @opindex noseglinkedit
10152 @opindex pagezero_size
10153 @opindex prebind
10154 @opindex prebind_all_twolevel_modules
10155 @opindex private_bundle
10156 @opindex read_only_relocs
10157 @opindex sectalign
10158 @opindex sectobjectsymbols
10159 @opindex whyload
10160 @opindex seg1addr
10161 @opindex sectcreate
10162 @opindex sectobjectsymbols
10163 @opindex sectorder
10164 @opindex segaddr
10165 @opindex segs_read_only_addr
10166 @opindex segs_read_write_addr
10167 @opindex seg_addr_table
10168 @opindex seg_addr_table_filename
10169 @opindex seglinkedit
10170 @opindex segprot
10171 @opindex segs_read_only_addr
10172 @opindex segs_read_write_addr
10173 @opindex single_module
10174 @opindex static
10175 @opindex sub_library
10176 @opindex sub_umbrella
10177 @opindex twolevel_namespace
10178 @opindex umbrella
10179 @opindex undefined
10180 @opindex unexported_symbols_list
10181 @opindex weak_reference_mismatches
10182 @opindex whatsloaded
10183 These options are passed to the Darwin linker.  The Darwin linker man page
10184 describes them in detail.
10185 @end table
10186
10187 @node DEC Alpha Options
10188 @subsection DEC Alpha Options
10189
10190 These @samp{-m} options are defined for the DEC Alpha implementations:
10191
10192 @table @gcctabopt
10193 @item -mno-soft-float
10194 @itemx -msoft-float
10195 @opindex mno-soft-float
10196 @opindex msoft-float
10197 Use (do not use) the hardware floating-point instructions for
10198 floating-point operations.  When @option{-msoft-float} is specified,
10199 functions in @file{libgcc.a} will be used to perform floating-point
10200 operations.  Unless they are replaced by routines that emulate the
10201 floating-point operations, or compiled in such a way as to call such
10202 emulations routines, these routines will issue floating-point
10203 operations.   If you are compiling for an Alpha without floating-point
10204 operations, you must ensure that the library is built so as not to call
10205 them.
10206
10207 Note that Alpha implementations without floating-point operations are
10208 required to have floating-point registers.
10209
10210 @item -mfp-reg
10211 @itemx -mno-fp-regs
10212 @opindex mfp-reg
10213 @opindex mno-fp-regs
10214 Generate code that uses (does not use) the floating-point register set.
10215 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
10216 register set is not used, floating point operands are passed in integer
10217 registers as if they were integers and floating-point results are passed
10218 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
10219 so any function with a floating-point argument or return value called by code
10220 compiled with @option{-mno-fp-regs} must also be compiled with that
10221 option.
10222
10223 A typical use of this option is building a kernel that does not use,
10224 and hence need not save and restore, any floating-point registers.
10225
10226 @item -mieee
10227 @opindex mieee
10228 The Alpha architecture implements floating-point hardware optimized for
10229 maximum performance.  It is mostly compliant with the IEEE floating
10230 point standard.  However, for full compliance, software assistance is
10231 required.  This option generates code fully IEEE compliant code
10232 @emph{except} that the @var{inexact-flag} is not maintained (see below).
10233 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
10234 defined during compilation.  The resulting code is less efficient but is
10235 able to correctly support denormalized numbers and exceptional IEEE
10236 values such as not-a-number and plus/minus infinity.  Other Alpha
10237 compilers call this option @option{-ieee_with_no_inexact}.
10238
10239 @item -mieee-with-inexact
10240 @opindex mieee-with-inexact
10241 This is like @option{-mieee} except the generated code also maintains
10242 the IEEE @var{inexact-flag}.  Turning on this option causes the
10243 generated code to implement fully-compliant IEEE math.  In addition to
10244 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
10245 macro.  On some Alpha implementations the resulting code may execute
10246 significantly slower than the code generated by default.  Since there is
10247 very little code that depends on the @var{inexact-flag}, you should
10248 normally not specify this option.  Other Alpha compilers call this
10249 option @option{-ieee_with_inexact}.
10250
10251 @item -mfp-trap-mode=@var{trap-mode}
10252 @opindex mfp-trap-mode
10253 This option controls what floating-point related traps are enabled.
10254 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
10255 The trap mode can be set to one of four values:
10256
10257 @table @samp
10258 @item n
10259 This is the default (normal) setting.  The only traps that are enabled
10260 are the ones that cannot be disabled in software (e.g., division by zero
10261 trap).
10262
10263 @item u
10264 In addition to the traps enabled by @samp{n}, underflow traps are enabled
10265 as well.
10266
10267 @item su
10268 Like @samp{u}, but the instructions are marked to be safe for software
10269 completion (see Alpha architecture manual for details).
10270
10271 @item sui
10272 Like @samp{su}, but inexact traps are enabled as well.
10273 @end table
10274
10275 @item -mfp-rounding-mode=@var{rounding-mode}
10276 @opindex mfp-rounding-mode
10277 Selects the IEEE rounding mode.  Other Alpha compilers call this option
10278 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
10279 of:
10280
10281 @table @samp
10282 @item n
10283 Normal IEEE rounding mode.  Floating point numbers are rounded towards
10284 the nearest machine number or towards the even machine number in case
10285 of a tie.
10286
10287 @item m
10288 Round towards minus infinity.
10289
10290 @item c
10291 Chopped rounding mode.  Floating point numbers are rounded towards zero.
10292
10293 @item d
10294 Dynamic rounding mode.  A field in the floating point control register
10295 (@var{fpcr}, see Alpha architecture reference manual) controls the
10296 rounding mode in effect.  The C library initializes this register for
10297 rounding towards plus infinity.  Thus, unless your program modifies the
10298 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
10299 @end table
10300
10301 @item -mtrap-precision=@var{trap-precision}
10302 @opindex mtrap-precision
10303 In the Alpha architecture, floating point traps are imprecise.  This
10304 means without software assistance it is impossible to recover from a
10305 floating trap and program execution normally needs to be terminated.
10306 GCC can generate code that can assist operating system trap handlers
10307 in determining the exact location that caused a floating point trap.
10308 Depending on the requirements of an application, different levels of
10309 precisions can be selected:
10310
10311 @table @samp
10312 @item p
10313 Program precision.  This option is the default and means a trap handler
10314 can only identify which program caused a floating point exception.
10315
10316 @item f
10317 Function precision.  The trap handler can determine the function that
10318 caused a floating point exception.
10319
10320 @item i
10321 Instruction precision.  The trap handler can determine the exact
10322 instruction that caused a floating point exception.
10323 @end table
10324
10325 Other Alpha compilers provide the equivalent options called
10326 @option{-scope_safe} and @option{-resumption_safe}.
10327
10328 @item -mieee-conformant
10329 @opindex mieee-conformant
10330 This option marks the generated code as IEEE conformant.  You must not
10331 use this option unless you also specify @option{-mtrap-precision=i} and either
10332 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
10333 is to emit the line @samp{.eflag 48} in the function prologue of the
10334 generated assembly file.  Under DEC Unix, this has the effect that
10335 IEEE-conformant math library routines will be linked in.
10336
10337 @item -mbuild-constants
10338 @opindex mbuild-constants
10339 Normally GCC examines a 32- or 64-bit integer constant to
10340 see if it can construct it from smaller constants in two or three
10341 instructions.  If it cannot, it will output the constant as a literal and
10342 generate code to load it from the data segment at runtime.
10343
10344 Use this option to require GCC to construct @emph{all} integer constants
10345 using code, even if it takes more instructions (the maximum is six).
10346
10347 You would typically use this option to build a shared library dynamic
10348 loader.  Itself a shared library, it must relocate itself in memory
10349 before it can find the variables and constants in its own data segment.
10350
10351 @item -malpha-as
10352 @itemx -mgas
10353 @opindex malpha-as
10354 @opindex mgas
10355 Select whether to generate code to be assembled by the vendor-supplied
10356 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
10357
10358 @item -mbwx
10359 @itemx -mno-bwx
10360 @itemx -mcix
10361 @itemx -mno-cix
10362 @itemx -mfix
10363 @itemx -mno-fix
10364 @itemx -mmax
10365 @itemx -mno-max
10366 @opindex mbwx
10367 @opindex mno-bwx
10368 @opindex mcix
10369 @opindex mno-cix
10370 @opindex mfix
10371 @opindex mno-fix
10372 @opindex mmax
10373 @opindex mno-max
10374 Indicate whether GCC should generate code to use the optional BWX,
10375 CIX, FIX and MAX instruction sets.  The default is to use the instruction
10376 sets supported by the CPU type specified via @option{-mcpu=} option or that
10377 of the CPU on which GCC was built if none was specified.
10378
10379 @item -mfloat-vax
10380 @itemx -mfloat-ieee
10381 @opindex mfloat-vax
10382 @opindex mfloat-ieee
10383 Generate code that uses (does not use) VAX F and G floating point
10384 arithmetic instead of IEEE single and double precision.
10385
10386 @item -mexplicit-relocs
10387 @itemx -mno-explicit-relocs
10388 @opindex mexplicit-relocs
10389 @opindex mno-explicit-relocs
10390 Older Alpha assemblers provided no way to generate symbol relocations
10391 except via assembler macros.  Use of these macros does not allow
10392 optimal instruction scheduling.  GNU binutils as of version 2.12
10393 supports a new syntax that allows the compiler to explicitly mark
10394 which relocations should apply to which instructions.  This option
10395 is mostly useful for debugging, as GCC detects the capabilities of
10396 the assembler when it is built and sets the default accordingly.
10397
10398 @item -msmall-data
10399 @itemx -mlarge-data
10400 @opindex msmall-data
10401 @opindex mlarge-data
10402 When @option{-mexplicit-relocs} is in effect, static data is
10403 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
10404 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
10405 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
10406 16-bit relocations off of the @code{$gp} register.  This limits the
10407 size of the small data area to 64KB, but allows the variables to be
10408 directly accessed via a single instruction.
10409
10410 The default is @option{-mlarge-data}.  With this option the data area
10411 is limited to just below 2GB@.  Programs that require more than 2GB of
10412 data must use @code{malloc} or @code{mmap} to allocate the data in the
10413 heap instead of in the program's data segment.
10414
10415 When generating code for shared libraries, @option{-fpic} implies
10416 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
10417
10418 @item -msmall-text
10419 @itemx -mlarge-text
10420 @opindex msmall-text
10421 @opindex mlarge-text
10422 When @option{-msmall-text} is used, the compiler assumes that the
10423 code of the entire program (or shared library) fits in 4MB, and is
10424 thus reachable with a branch instruction.  When @option{-msmall-data}
10425 is used, the compiler can assume that all local symbols share the
10426 same @code{$gp} value, and thus reduce the number of instructions
10427 required for a function call from 4 to 1.
10428
10429 The default is @option{-mlarge-text}.
10430
10431 @item -mcpu=@var{cpu_type}
10432 @opindex mcpu
10433 Set the instruction set and instruction scheduling parameters for
10434 machine type @var{cpu_type}.  You can specify either the @samp{EV}
10435 style name or the corresponding chip number.  GCC supports scheduling
10436 parameters for the EV4, EV5 and EV6 family of processors and will
10437 choose the default values for the instruction set from the processor
10438 you specify.  If you do not specify a processor type, GCC will default
10439 to the processor on which the compiler was built.
10440
10441 Supported values for @var{cpu_type} are
10442
10443 @table @samp
10444 @item ev4
10445 @itemx ev45
10446 @itemx 21064
10447 Schedules as an EV4 and has no instruction set extensions.
10448
10449 @item ev5
10450 @itemx 21164
10451 Schedules as an EV5 and has no instruction set extensions.
10452
10453 @item ev56
10454 @itemx 21164a
10455 Schedules as an EV5 and supports the BWX extension.
10456
10457 @item pca56
10458 @itemx 21164pc
10459 @itemx 21164PC
10460 Schedules as an EV5 and supports the BWX and MAX extensions.
10461
10462 @item ev6
10463 @itemx 21264
10464 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
10465
10466 @item ev67
10467 @itemx 21264a
10468 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
10469 @end table
10470
10471 Native Linux/GNU toolchains also support the value @samp{native},
10472 which selects the best architecture option for the host processor.
10473 @option{-mcpu=native} has no effect if GCC does not recognize
10474 the processor.
10475
10476 @item -mtune=@var{cpu_type}
10477 @opindex mtune
10478 Set only the instruction scheduling parameters for machine type
10479 @var{cpu_type}.  The instruction set is not changed.
10480
10481 Native Linux/GNU toolchains also support the value @samp{native},
10482 which selects the best architecture option for the host processor.
10483 @option{-mtune=native} has no effect if GCC does not recognize
10484 the processor.
10485
10486 @item -mmemory-latency=@var{time}
10487 @opindex mmemory-latency
10488 Sets the latency the scheduler should assume for typical memory
10489 references as seen by the application.  This number is highly
10490 dependent on the memory access patterns used by the application
10491 and the size of the external cache on the machine.
10492
10493 Valid options for @var{time} are
10494
10495 @table @samp
10496 @item @var{number}
10497 A decimal number representing clock cycles.
10498
10499 @item L1
10500 @itemx L2
10501 @itemx L3
10502 @itemx main
10503 The compiler contains estimates of the number of clock cycles for
10504 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
10505 (also called Dcache, Scache, and Bcache), as well as to main memory.
10506 Note that L3 is only valid for EV5.
10507
10508 @end table
10509 @end table
10510
10511 @node DEC Alpha/VMS Options
10512 @subsection DEC Alpha/VMS Options
10513
10514 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
10515
10516 @table @gcctabopt
10517 @item -mvms-return-codes
10518 @opindex mvms-return-codes
10519 Return VMS condition codes from main.  The default is to return POSIX
10520 style condition (e.g.@: error) codes.
10521 @end table
10522
10523 @node FR30 Options
10524 @subsection FR30 Options
10525 @cindex FR30 Options
10526
10527 These options are defined specifically for the FR30 port.
10528
10529 @table @gcctabopt
10530
10531 @item -msmall-model
10532 @opindex msmall-model
10533 Use the small address space model.  This can produce smaller code, but
10534 it does assume that all symbolic values and addresses will fit into a
10535 20-bit range.
10536
10537 @item -mno-lsim
10538 @opindex mno-lsim
10539 Assume that run-time support has been provided and so there is no need
10540 to include the simulator library (@file{libsim.a}) on the linker
10541 command line.
10542
10543 @end table
10544
10545 @node FRV Options
10546 @subsection FRV Options
10547 @cindex FRV Options
10548
10549 @table @gcctabopt
10550 @item -mgpr-32
10551 @opindex mgpr-32
10552
10553 Only use the first 32 general purpose registers.
10554
10555 @item -mgpr-64
10556 @opindex mgpr-64
10557
10558 Use all 64 general purpose registers.
10559
10560 @item -mfpr-32
10561 @opindex mfpr-32
10562
10563 Use only the first 32 floating point registers.
10564
10565 @item -mfpr-64
10566 @opindex mfpr-64
10567
10568 Use all 64 floating point registers
10569
10570 @item -mhard-float
10571 @opindex mhard-float
10572
10573 Use hardware instructions for floating point operations.
10574
10575 @item -msoft-float
10576 @opindex msoft-float
10577
10578 Use library routines for floating point operations.
10579
10580 @item -malloc-cc
10581 @opindex malloc-cc
10582
10583 Dynamically allocate condition code registers.
10584
10585 @item -mfixed-cc
10586 @opindex mfixed-cc
10587
10588 Do not try to dynamically allocate condition code registers, only
10589 use @code{icc0} and @code{fcc0}.
10590
10591 @item -mdword
10592 @opindex mdword
10593
10594 Change ABI to use double word insns.
10595
10596 @item -mno-dword
10597 @opindex mno-dword
10598
10599 Do not use double word instructions.
10600
10601 @item -mdouble
10602 @opindex mdouble
10603
10604 Use floating point double instructions.
10605
10606 @item -mno-double
10607 @opindex mno-double
10608
10609 Do not use floating point double instructions.
10610
10611 @item -mmedia
10612 @opindex mmedia
10613
10614 Use media instructions.
10615
10616 @item -mno-media
10617 @opindex mno-media
10618
10619 Do not use media instructions.
10620
10621 @item -mmuladd
10622 @opindex mmuladd
10623
10624 Use multiply and add/subtract instructions.
10625
10626 @item -mno-muladd
10627 @opindex mno-muladd
10628
10629 Do not use multiply and add/subtract instructions.
10630
10631 @item -mfdpic
10632 @opindex mfdpic
10633
10634 Select the FDPIC ABI, that uses function descriptors to represent
10635 pointers to functions.  Without any PIC/PIE-related options, it
10636 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
10637 assumes GOT entries and small data are within a 12-bit range from the
10638 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
10639 are computed with 32 bits.
10640 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10641
10642 @item -minline-plt
10643 @opindex minline-plt
10644
10645 Enable inlining of PLT entries in function calls to functions that are
10646 not known to bind locally.  It has no effect without @option{-mfdpic}.
10647 It's enabled by default if optimizing for speed and compiling for
10648 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
10649 optimization option such as @option{-O3} or above is present in the
10650 command line.
10651
10652 @item -mTLS
10653 @opindex mTLS
10654
10655 Assume a large TLS segment when generating thread-local code.
10656
10657 @item -mtls
10658 @opindex mtls
10659
10660 Do not assume a large TLS segment when generating thread-local code.
10661
10662 @item -mgprel-ro
10663 @opindex mgprel-ro
10664
10665 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
10666 that is known to be in read-only sections.  It's enabled by default,
10667 except for @option{-fpic} or @option{-fpie}: even though it may help
10668 make the global offset table smaller, it trades 1 instruction for 4.
10669 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
10670 one of which may be shared by multiple symbols, and it avoids the need
10671 for a GOT entry for the referenced symbol, so it's more likely to be a
10672 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
10673
10674 @item -multilib-library-pic
10675 @opindex multilib-library-pic
10676
10677 Link with the (library, not FD) pic libraries.  It's implied by
10678 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
10679 @option{-fpic} without @option{-mfdpic}.  You should never have to use
10680 it explicitly.
10681
10682 @item -mlinked-fp
10683 @opindex mlinked-fp
10684
10685 Follow the EABI requirement of always creating a frame pointer whenever
10686 a stack frame is allocated.  This option is enabled by default and can
10687 be disabled with @option{-mno-linked-fp}.
10688
10689 @item -mlong-calls
10690 @opindex mlong-calls
10691
10692 Use indirect addressing to call functions outside the current
10693 compilation unit.  This allows the functions to be placed anywhere
10694 within the 32-bit address space.
10695
10696 @item -malign-labels
10697 @opindex malign-labels
10698
10699 Try to align labels to an 8-byte boundary by inserting nops into the
10700 previous packet.  This option only has an effect when VLIW packing
10701 is enabled.  It doesn't create new packets; it merely adds nops to
10702 existing ones.
10703
10704 @item -mlibrary-pic
10705 @opindex mlibrary-pic
10706
10707 Generate position-independent EABI code.
10708
10709 @item -macc-4
10710 @opindex macc-4
10711
10712 Use only the first four media accumulator registers.
10713
10714 @item -macc-8
10715 @opindex macc-8
10716
10717 Use all eight media accumulator registers.
10718
10719 @item -mpack
10720 @opindex mpack
10721
10722 Pack VLIW instructions.
10723
10724 @item -mno-pack
10725 @opindex mno-pack
10726
10727 Do not pack VLIW instructions.
10728
10729 @item -mno-eflags
10730 @opindex mno-eflags
10731
10732 Do not mark ABI switches in e_flags.
10733
10734 @item -mcond-move
10735 @opindex mcond-move
10736
10737 Enable the use of conditional-move instructions (default).
10738
10739 This switch is mainly for debugging the compiler and will likely be removed
10740 in a future version.
10741
10742 @item -mno-cond-move
10743 @opindex mno-cond-move
10744
10745 Disable the use of conditional-move instructions.
10746
10747 This switch is mainly for debugging the compiler and will likely be removed
10748 in a future version.
10749
10750 @item -mscc
10751 @opindex mscc
10752
10753 Enable the use of conditional set instructions (default).
10754
10755 This switch is mainly for debugging the compiler and will likely be removed
10756 in a future version.
10757
10758 @item -mno-scc
10759 @opindex mno-scc
10760
10761 Disable the use of conditional set instructions.
10762
10763 This switch is mainly for debugging the compiler and will likely be removed
10764 in a future version.
10765
10766 @item -mcond-exec
10767 @opindex mcond-exec
10768
10769 Enable the use of conditional execution (default).
10770
10771 This switch is mainly for debugging the compiler and will likely be removed
10772 in a future version.
10773
10774 @item -mno-cond-exec
10775 @opindex mno-cond-exec
10776
10777 Disable the use of conditional execution.
10778
10779 This switch is mainly for debugging the compiler and will likely be removed
10780 in a future version.
10781
10782 @item -mvliw-branch
10783 @opindex mvliw-branch
10784
10785 Run a pass to pack branches into VLIW instructions (default).
10786
10787 This switch is mainly for debugging the compiler and will likely be removed
10788 in a future version.
10789
10790 @item -mno-vliw-branch
10791 @opindex mno-vliw-branch
10792
10793 Do not run a pass to pack branches into VLIW instructions.
10794
10795 This switch is mainly for debugging the compiler and will likely be removed
10796 in a future version.
10797
10798 @item -mmulti-cond-exec
10799 @opindex mmulti-cond-exec
10800
10801 Enable optimization of @code{&&} and @code{||} in conditional execution
10802 (default).
10803
10804 This switch is mainly for debugging the compiler and will likely be removed
10805 in a future version.
10806
10807 @item -mno-multi-cond-exec
10808 @opindex mno-multi-cond-exec
10809
10810 Disable optimization of @code{&&} and @code{||} in conditional execution.
10811
10812 This switch is mainly for debugging the compiler and will likely be removed
10813 in a future version.
10814
10815 @item -mnested-cond-exec
10816 @opindex mnested-cond-exec
10817
10818 Enable nested conditional execution optimizations (default).
10819
10820 This switch is mainly for debugging the compiler and will likely be removed
10821 in a future version.
10822
10823 @item -mno-nested-cond-exec
10824 @opindex mno-nested-cond-exec
10825
10826 Disable nested conditional execution optimizations.
10827
10828 This switch is mainly for debugging the compiler and will likely be removed
10829 in a future version.
10830
10831 @item -moptimize-membar
10832 @opindex moptimize-membar
10833
10834 This switch removes redundant @code{membar} instructions from the
10835 compiler generated code.  It is enabled by default.
10836
10837 @item -mno-optimize-membar
10838 @opindex mno-optimize-membar
10839
10840 This switch disables the automatic removal of redundant @code{membar}
10841 instructions from the generated code.
10842
10843 @item -mtomcat-stats
10844 @opindex mtomcat-stats
10845
10846 Cause gas to print out tomcat statistics.
10847
10848 @item -mcpu=@var{cpu}
10849 @opindex mcpu
10850
10851 Select the processor type for which to generate code.  Possible values are
10852 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
10853 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
10854
10855 @end table
10856
10857 @node GNU/Linux Options
10858 @subsection GNU/Linux Options
10859
10860 These @samp{-m} options are defined for GNU/Linux targets:
10861
10862 @table @gcctabopt
10863 @item -mglibc
10864 @opindex mglibc
10865 Use the GNU C library instead of uClibc.  This is the default except
10866 on @samp{*-*-linux-*uclibc*} targets.
10867
10868 @item -muclibc
10869 @opindex muclibc
10870 Use uClibc instead of the GNU C library.  This is the default on
10871 @samp{*-*-linux-*uclibc*} targets.
10872 @end table
10873
10874 @node H8/300 Options
10875 @subsection H8/300 Options
10876
10877 These @samp{-m} options are defined for the H8/300 implementations:
10878
10879 @table @gcctabopt
10880 @item -mrelax
10881 @opindex mrelax
10882 Shorten some address references at link time, when possible; uses the
10883 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
10884 ld, Using ld}, for a fuller description.
10885
10886 @item -mh
10887 @opindex mh
10888 Generate code for the H8/300H@.
10889
10890 @item -ms
10891 @opindex ms
10892 Generate code for the H8S@.
10893
10894 @item -mn
10895 @opindex mn
10896 Generate code for the H8S and H8/300H in the normal mode.  This switch
10897 must be used either with @option{-mh} or @option{-ms}.
10898
10899 @item -ms2600
10900 @opindex ms2600
10901 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
10902
10903 @item -mint32
10904 @opindex mint32
10905 Make @code{int} data 32 bits by default.
10906
10907 @item -malign-300
10908 @opindex malign-300
10909 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
10910 The default for the H8/300H and H8S is to align longs and floats on 4
10911 byte boundaries.
10912 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
10913 This option has no effect on the H8/300.
10914 @end table
10915
10916 @node HPPA Options
10917 @subsection HPPA Options
10918 @cindex HPPA Options
10919
10920 These @samp{-m} options are defined for the HPPA family of computers:
10921
10922 @table @gcctabopt
10923 @item -march=@var{architecture-type}
10924 @opindex march
10925 Generate code for the specified architecture.  The choices for
10926 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
10927 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
10928 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
10929 architecture option for your machine.  Code compiled for lower numbered
10930 architectures will run on higher numbered architectures, but not the
10931 other way around.
10932
10933 @item -mpa-risc-1-0
10934 @itemx -mpa-risc-1-1
10935 @itemx -mpa-risc-2-0
10936 @opindex mpa-risc-1-0
10937 @opindex mpa-risc-1-1
10938 @opindex mpa-risc-2-0
10939 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
10940
10941 @item -mbig-switch
10942 @opindex mbig-switch
10943 Generate code suitable for big switch tables.  Use this option only if
10944 the assembler/linker complain about out of range branches within a switch
10945 table.
10946
10947 @item -mjump-in-delay
10948 @opindex mjump-in-delay
10949 Fill delay slots of function calls with unconditional jump instructions
10950 by modifying the return pointer for the function call to be the target
10951 of the conditional jump.
10952
10953 @item -mdisable-fpregs
10954 @opindex mdisable-fpregs
10955 Prevent floating point registers from being used in any manner.  This is
10956 necessary for compiling kernels which perform lazy context switching of
10957 floating point registers.  If you use this option and attempt to perform
10958 floating point operations, the compiler will abort.
10959
10960 @item -mdisable-indexing
10961 @opindex mdisable-indexing
10962 Prevent the compiler from using indexing address modes.  This avoids some
10963 rather obscure problems when compiling MIG generated code under MACH@.
10964
10965 @item -mno-space-regs
10966 @opindex mno-space-regs
10967 Generate code that assumes the target has no space registers.  This allows
10968 GCC to generate faster indirect calls and use unscaled index address modes.
10969
10970 Such code is suitable for level 0 PA systems and kernels.
10971
10972 @item -mfast-indirect-calls
10973 @opindex mfast-indirect-calls
10974 Generate code that assumes calls never cross space boundaries.  This
10975 allows GCC to emit code which performs faster indirect calls.
10976
10977 This option will not work in the presence of shared libraries or nested
10978 functions.
10979
10980 @item -mfixed-range=@var{register-range}
10981 @opindex mfixed-range
10982 Generate code treating the given register range as fixed registers.
10983 A fixed register is one that the register allocator can not use.  This is
10984 useful when compiling kernel code.  A register range is specified as
10985 two registers separated by a dash.  Multiple register ranges can be
10986 specified separated by a comma.
10987
10988 @item -mlong-load-store
10989 @opindex mlong-load-store
10990 Generate 3-instruction load and store sequences as sometimes required by
10991 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
10992 the HP compilers.
10993
10994 @item -mportable-runtime
10995 @opindex mportable-runtime
10996 Use the portable calling conventions proposed by HP for ELF systems.
10997
10998 @item -mgas
10999 @opindex mgas
11000 Enable the use of assembler directives only GAS understands.
11001
11002 @item -mschedule=@var{cpu-type}
11003 @opindex mschedule
11004 Schedule code according to the constraints for the machine type
11005 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
11006 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
11007 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
11008 proper scheduling option for your machine.  The default scheduling is
11009 @samp{8000}.
11010
11011 @item -mlinker-opt
11012 @opindex mlinker-opt
11013 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
11014 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
11015 linkers in which they give bogus error messages when linking some programs.
11016
11017 @item -msoft-float
11018 @opindex msoft-float
11019 Generate output containing library calls for floating point.
11020 @strong{Warning:} the requisite libraries are not available for all HPPA
11021 targets.  Normally the facilities of the machine's usual C compiler are
11022 used, but this cannot be done directly in cross-compilation.  You must make
11023 your own arrangements to provide suitable library functions for
11024 cross-compilation.
11025
11026 @option{-msoft-float} changes the calling convention in the output file;
11027 therefore, it is only useful if you compile @emph{all} of a program with
11028 this option.  In particular, you need to compile @file{libgcc.a}, the
11029 library that comes with GCC, with @option{-msoft-float} in order for
11030 this to work.
11031
11032 @item -msio
11033 @opindex msio
11034 Generate the predefine, @code{_SIO}, for server IO@.  The default is
11035 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
11036 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
11037 options are available under HP-UX and HI-UX@.
11038
11039 @item -mgnu-ld
11040 @opindex mgnu-ld
11041 Use GNU ld specific options.  This passes @option{-shared} to ld when
11042 building a shared library.  It is the default when GCC is configured,
11043 explicitly or implicitly, with the GNU linker.  This option does not
11044 have any affect on which ld is called, it only changes what parameters
11045 are passed to that ld.  The ld that is called is determined by the
11046 @option{--with-ld} configure option, GCC's program search path, and
11047 finally by the user's @env{PATH}.  The linker used by GCC can be printed
11048 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
11049 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11050
11051 @item -mhp-ld
11052 @opindex mhp-ld
11053 Use HP ld specific options.  This passes @option{-b} to ld when building
11054 a shared library and passes @option{+Accept TypeMismatch} to ld on all
11055 links.  It is the default when GCC is configured, explicitly or
11056 implicitly, with the HP linker.  This option does not have any affect on
11057 which ld is called, it only changes what parameters are passed to that
11058 ld.  The ld that is called is determined by the @option{--with-ld}
11059 configure option, GCC's program search path, and finally by the user's
11060 @env{PATH}.  The linker used by GCC can be printed using @samp{which
11061 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
11062 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11063
11064 @item -mlong-calls
11065 @opindex mno-long-calls
11066 Generate code that uses long call sequences.  This ensures that a call
11067 is always able to reach linker generated stubs.  The default is to generate
11068 long calls only when the distance from the call site to the beginning
11069 of the function or translation unit, as the case may be, exceeds a
11070 predefined limit set by the branch type being used.  The limits for
11071 normal calls are 7,600,000 and 240,000 bytes, respectively for the
11072 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
11073 240,000 bytes.
11074
11075 Distances are measured from the beginning of functions when using the
11076 @option{-ffunction-sections} option, or when using the @option{-mgas}
11077 and @option{-mno-portable-runtime} options together under HP-UX with
11078 the SOM linker.
11079
11080 It is normally not desirable to use this option as it will degrade
11081 performance.  However, it may be useful in large applications,
11082 particularly when partial linking is used to build the application.
11083
11084 The types of long calls used depends on the capabilities of the
11085 assembler and linker, and the type of code being generated.  The
11086 impact on systems that support long absolute calls, and long pic
11087 symbol-difference or pc-relative calls should be relatively small.
11088 However, an indirect call is used on 32-bit ELF systems in pic code
11089 and it is quite long.
11090
11091 @item -munix=@var{unix-std}
11092 @opindex march
11093 Generate compiler predefines and select a startfile for the specified
11094 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
11095 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
11096 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
11097 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
11098 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
11099 and later.
11100
11101 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
11102 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
11103 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
11104 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
11105 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
11106 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
11107
11108 It is @emph{important} to note that this option changes the interfaces
11109 for various library routines.  It also affects the operational behavior
11110 of the C library.  Thus, @emph{extreme} care is needed in using this
11111 option.
11112
11113 Library code that is intended to operate with more than one UNIX
11114 standard must test, set and restore the variable @var{__xpg4_extended_mask}
11115 as appropriate.  Most GNU software doesn't provide this capability.
11116
11117 @item -nolibdld
11118 @opindex nolibdld
11119 Suppress the generation of link options to search libdld.sl when the
11120 @option{-static} option is specified on HP-UX 10 and later.
11121
11122 @item -static
11123 @opindex static
11124 The HP-UX implementation of setlocale in libc has a dependency on
11125 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
11126 when the @option{-static} option is specified, special link options
11127 are needed to resolve this dependency.
11128
11129 On HP-UX 10 and later, the GCC driver adds the necessary options to
11130 link with libdld.sl when the @option{-static} option is specified.
11131 This causes the resulting binary to be dynamic.  On the 64-bit port,
11132 the linkers generate dynamic binaries by default in any case.  The
11133 @option{-nolibdld} option can be used to prevent the GCC driver from
11134 adding these link options.
11135
11136 @item -threads
11137 @opindex threads
11138 Add support for multithreading with the @dfn{dce thread} library
11139 under HP-UX@.  This option sets flags for both the preprocessor and
11140 linker.
11141 @end table
11142
11143 @node i386 and x86-64 Options
11144 @subsection Intel 386 and AMD x86-64 Options
11145 @cindex i386 Options
11146 @cindex x86-64 Options
11147 @cindex Intel 386 Options
11148 @cindex AMD x86-64 Options
11149
11150 These @samp{-m} options are defined for the i386 and x86-64 family of
11151 computers:
11152
11153 @table @gcctabopt
11154 @item -mtune=@var{cpu-type}
11155 @opindex mtune
11156 Tune to @var{cpu-type} everything applicable about the generated code, except
11157 for the ABI and the set of available instructions.  The choices for
11158 @var{cpu-type} are:
11159 @table @emph
11160 @item generic
11161 Produce code optimized for the most common IA32/AMD64/EM64T processors.
11162 If you know the CPU on which your code will run, then you should use
11163 the corresponding @option{-mtune} option instead of
11164 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
11165 of your application will have, then you should use this option.
11166
11167 As new processors are deployed in the marketplace, the behavior of this
11168 option will change.  Therefore, if you upgrade to a newer version of
11169 GCC, the code generated option will change to reflect the processors
11170 that were most common when that version of GCC was released.
11171
11172 There is no @option{-march=generic} option because @option{-march}
11173 indicates the instruction set the compiler can use, and there is no
11174 generic instruction set applicable to all processors.  In contrast,
11175 @option{-mtune} indicates the processor (or, in this case, collection of
11176 processors) for which the code is optimized.
11177 @item native
11178 This selects the CPU to tune for at compilation time by determining
11179 the processor type of the compiling machine.  Using @option{-mtune=native}
11180 will produce code optimized for the local machine under the constraints
11181 of the selected instruction set.  Using @option{-march=native} will
11182 enable all instruction subsets supported by the local machine (hence
11183 the result might not run on different machines).
11184 @item i386
11185 Original Intel's i386 CPU@.
11186 @item i486
11187 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
11188 @item i586, pentium
11189 Intel Pentium CPU with no MMX support.
11190 @item pentium-mmx
11191 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
11192 @item pentiumpro
11193 Intel PentiumPro CPU@.
11194 @item i686
11195 Same as @code{generic}, but when used as @code{march} option, PentiumPro
11196 instruction set will be used, so the code will run on all i686 family chips.
11197 @item pentium2
11198 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
11199 @item pentium3, pentium3m
11200 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
11201 support.
11202 @item pentium-m
11203 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
11204 support.  Used by Centrino notebooks.
11205 @item pentium4, pentium4m
11206 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
11207 @item prescott
11208 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
11209 set support.
11210 @item nocona
11211 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
11212 SSE2 and SSE3 instruction set support.
11213 @item core2
11214 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11215 instruction set support.
11216 @item atom
11217 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11218 instruction set support.
11219 @item k6
11220 AMD K6 CPU with MMX instruction set support.
11221 @item k6-2, k6-3
11222 Improved versions of AMD K6 CPU with MMX and 3dNOW!@: instruction set support.
11223 @item athlon, athlon-tbird
11224 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and SSE prefetch instructions
11225 support.
11226 @item athlon-4, athlon-xp, athlon-mp
11227 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and full SSE
11228 instruction set support.
11229 @item k8, opteron, athlon64, athlon-fx
11230 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
11231 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW!@: and 64-bit instruction set extensions.)
11232 @item k8-sse3, opteron-sse3, athlon64-sse3
11233 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
11234 @item amdfam10, barcelona
11235 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
11236 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
11237 instruction set extensions.)
11238 @item winchip-c6
11239 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
11240 set support.
11241 @item winchip2
11242 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!@:
11243 instruction set support.
11244 @item c3
11245 Via C3 CPU with MMX and 3dNOW!@: instruction set support.  (No scheduling is
11246 implemented for this chip.)
11247 @item c3-2
11248 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
11249 implemented for this chip.)
11250 @item geode
11251 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
11252 @end table
11253
11254 While picking a specific @var{cpu-type} will schedule things appropriately
11255 for that particular chip, the compiler will not generate any code that
11256 does not run on the i386 without the @option{-march=@var{cpu-type}} option
11257 being used.
11258
11259 @item -march=@var{cpu-type}
11260 @opindex march
11261 Generate instructions for the machine type @var{cpu-type}.  The choices
11262 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
11263 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
11264
11265 @item -mcpu=@var{cpu-type}
11266 @opindex mcpu
11267 A deprecated synonym for @option{-mtune}.
11268
11269 @item -mfpmath=@var{unit}
11270 @opindex mfpmath
11271 Generate floating point arithmetics for selected unit @var{unit}.  The choices
11272 for @var{unit} are:
11273
11274 @table @samp
11275 @item 387
11276 Use the standard 387 floating point coprocessor present majority of chips and
11277 emulated otherwise.  Code compiled with this option will run almost everywhere.
11278 The temporary results are computed in 80bit precision instead of precision
11279 specified by the type resulting in slightly different results compared to most
11280 of other chips.  See @option{-ffloat-store} for more detailed description.
11281
11282 This is the default choice for i386 compiler.
11283
11284 @item sse
11285 Use scalar floating point instructions present in the SSE instruction set.
11286 This instruction set is supported by Pentium3 and newer chips, in the AMD line
11287 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
11288 instruction set supports only single precision arithmetics, thus the double and
11289 extended precision arithmetics is still done using 387.  Later version, present
11290 only in Pentium4 and the future AMD x86-64 chips supports double precision
11291 arithmetics too.
11292
11293 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
11294 or @option{-msse2} switches to enable SSE extensions and make this option
11295 effective.  For the x86-64 compiler, these extensions are enabled by default.
11296
11297 The resulting code should be considerably faster in the majority of cases and avoid
11298 the numerical instability problems of 387 code, but may break some existing
11299 code that expects temporaries to be 80bit.
11300
11301 This is the default choice for the x86-64 compiler.
11302
11303 @item sse,387
11304 @itemx sse+387
11305 @itemx both
11306 Attempt to utilize both instruction sets at once.  This effectively double the
11307 amount of available registers and on chips with separate execution units for
11308 387 and SSE the execution resources too.  Use this option with care, as it is
11309 still experimental, because the GCC register allocator does not model separate
11310 functional units well resulting in instable performance.
11311 @end table
11312
11313 @item -masm=@var{dialect}
11314 @opindex masm=@var{dialect}
11315 Output asm instructions using selected @var{dialect}.  Supported
11316 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
11317 not support @samp{intel}.
11318
11319 @item -mieee-fp
11320 @itemx -mno-ieee-fp
11321 @opindex mieee-fp
11322 @opindex mno-ieee-fp
11323 Control whether or not the compiler uses IEEE floating point
11324 comparisons.  These handle correctly the case where the result of a
11325 comparison is unordered.
11326
11327 @item -msoft-float
11328 @opindex msoft-float
11329 Generate output containing library calls for floating point.
11330 @strong{Warning:} the requisite libraries are not part of GCC@.
11331 Normally the facilities of the machine's usual C compiler are used, but
11332 this can't be done directly in cross-compilation.  You must make your
11333 own arrangements to provide suitable library functions for
11334 cross-compilation.
11335
11336 On machines where a function returns floating point results in the 80387
11337 register stack, some floating point opcodes may be emitted even if
11338 @option{-msoft-float} is used.
11339
11340 @item -mno-fp-ret-in-387
11341 @opindex mno-fp-ret-in-387
11342 Do not use the FPU registers for return values of functions.
11343
11344 The usual calling convention has functions return values of types
11345 @code{float} and @code{double} in an FPU register, even if there
11346 is no FPU@.  The idea is that the operating system should emulate
11347 an FPU@.
11348
11349 The option @option{-mno-fp-ret-in-387} causes such values to be returned
11350 in ordinary CPU registers instead.
11351
11352 @item -mno-fancy-math-387
11353 @opindex mno-fancy-math-387
11354 Some 387 emulators do not support the @code{sin}, @code{cos} and
11355 @code{sqrt} instructions for the 387.  Specify this option to avoid
11356 generating those instructions.  This option is the default on FreeBSD,
11357 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
11358 indicates that the target cpu will always have an FPU and so the
11359 instruction will not need emulation.  As of revision 2.6.1, these
11360 instructions are not generated unless you also use the
11361 @option{-funsafe-math-optimizations} switch.
11362
11363 @item -malign-double
11364 @itemx -mno-align-double
11365 @opindex malign-double
11366 @opindex mno-align-double
11367 Control whether GCC aligns @code{double}, @code{long double}, and
11368 @code{long long} variables on a two word boundary or a one word
11369 boundary.  Aligning @code{double} variables on a two word boundary will
11370 produce code that runs somewhat faster on a @samp{Pentium} at the
11371 expense of more memory.
11372
11373 On x86-64, @option{-malign-double} is enabled by default.
11374
11375 @strong{Warning:} if you use the @option{-malign-double} switch,
11376 structures containing the above types will be aligned differently than
11377 the published application binary interface specifications for the 386
11378 and will not be binary compatible with structures in code compiled
11379 without that switch.
11380
11381 @item -m96bit-long-double
11382 @itemx -m128bit-long-double
11383 @opindex m96bit-long-double
11384 @opindex m128bit-long-double
11385 These switches control the size of @code{long double} type.  The i386
11386 application binary interface specifies the size to be 96 bits,
11387 so @option{-m96bit-long-double} is the default in 32 bit mode.
11388
11389 Modern architectures (Pentium and newer) would prefer @code{long double}
11390 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
11391 conforming to the ABI, this would not be possible.  So specifying a
11392 @option{-m128bit-long-double} will align @code{long double}
11393 to a 16 byte boundary by padding the @code{long double} with an additional
11394 32 bit zero.
11395
11396 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
11397 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
11398
11399 Notice that neither of these options enable any extra precision over the x87
11400 standard of 80 bits for a @code{long double}.
11401
11402 @strong{Warning:} if you override the default value for your target ABI, the
11403 structures and arrays containing @code{long double} variables will change
11404 their size as well as function calling convention for function taking
11405 @code{long double} will be modified.  Hence they will not be binary
11406 compatible with arrays or structures in code compiled without that switch.
11407
11408 @item -mlarge-data-threshold=@var{number}
11409 @opindex mlarge-data-threshold=@var{number}
11410 When @option{-mcmodel=medium} is specified, the data greater than
11411 @var{threshold} are placed in large data section.  This value must be the
11412 same across all object linked into the binary and defaults to 65535.
11413
11414 @item -mrtd
11415 @opindex mrtd
11416 Use a different function-calling convention, in which functions that
11417 take a fixed number of arguments return with the @code{ret} @var{num}
11418 instruction, which pops their arguments while returning.  This saves one
11419 instruction in the caller since there is no need to pop the arguments
11420 there.
11421
11422 You can specify that an individual function is called with this calling
11423 sequence with the function attribute @samp{stdcall}.  You can also
11424 override the @option{-mrtd} option by using the function attribute
11425 @samp{cdecl}.  @xref{Function Attributes}.
11426
11427 @strong{Warning:} this calling convention is incompatible with the one
11428 normally used on Unix, so you cannot use it if you need to call
11429 libraries compiled with the Unix compiler.
11430
11431 Also, you must provide function prototypes for all functions that
11432 take variable numbers of arguments (including @code{printf});
11433 otherwise incorrect code will be generated for calls to those
11434 functions.
11435
11436 In addition, seriously incorrect code will result if you call a
11437 function with too many arguments.  (Normally, extra arguments are
11438 harmlessly ignored.)
11439
11440 @item -mregparm=@var{num}
11441 @opindex mregparm
11442 Control how many registers are used to pass integer arguments.  By
11443 default, no registers are used to pass arguments, and at most 3
11444 registers can be used.  You can control this behavior for a specific
11445 function by using the function attribute @samp{regparm}.
11446 @xref{Function Attributes}.
11447
11448 @strong{Warning:} if you use this switch, and
11449 @var{num} is nonzero, then you must build all modules with the same
11450 value, including any libraries.  This includes the system libraries and
11451 startup modules.
11452
11453 @item -msseregparm
11454 @opindex msseregparm
11455 Use SSE register passing conventions for float and double arguments
11456 and return values.  You can control this behavior for a specific
11457 function by using the function attribute @samp{sseregparm}.
11458 @xref{Function Attributes}.
11459
11460 @strong{Warning:} if you use this switch then you must build all
11461 modules with the same value, including any libraries.  This includes
11462 the system libraries and startup modules.
11463
11464 @item -mpc32
11465 @itemx -mpc64
11466 @itemx -mpc80
11467 @opindex mpc32
11468 @opindex mpc64
11469 @opindex mpc80
11470
11471 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
11472 is specified, the significands of results of floating-point operations are
11473 rounded to 24 bits (single precision); @option{-mpc64} rounds the
11474 significands of results of floating-point operations to 53 bits (double
11475 precision) and @option{-mpc80} rounds the significands of results of
11476 floating-point operations to 64 bits (extended double precision), which is
11477 the default.  When this option is used, floating-point operations in higher
11478 precisions are not available to the programmer without setting the FPU
11479 control word explicitly.
11480
11481 Setting the rounding of floating-point operations to less than the default
11482 80 bits can speed some programs by 2% or more.  Note that some mathematical
11483 libraries assume that extended precision (80 bit) floating-point operations
11484 are enabled by default; routines in such libraries could suffer significant
11485 loss of accuracy, typically through so-called "catastrophic cancellation",
11486 when this option is used to set the precision to less than extended precision.
11487
11488 @item -mstackrealign
11489 @opindex mstackrealign
11490 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
11491 option will generate an alternate prologue and epilogue that realigns the
11492 runtime stack if necessary.  This supports mixing legacy codes that keep
11493 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
11494 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
11495 applicable to individual functions.
11496
11497 @item -mpreferred-stack-boundary=@var{num}
11498 @opindex mpreferred-stack-boundary
11499 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
11500 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
11501 the default is 4 (16 bytes or 128 bits).
11502
11503 @item -mincoming-stack-boundary=@var{num}
11504 @opindex mincoming-stack-boundary
11505 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
11506 boundary.  If @option{-mincoming-stack-boundary} is not specified,
11507 the one specified by @option{-mpreferred-stack-boundary} will be used.
11508
11509 On Pentium and PentiumPro, @code{double} and @code{long double} values
11510 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
11511 suffer significant run time performance penalties.  On Pentium III, the
11512 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
11513 properly if it is not 16 byte aligned.
11514
11515 To ensure proper alignment of this values on the stack, the stack boundary
11516 must be as aligned as that required by any value stored on the stack.
11517 Further, every function must be generated such that it keeps the stack
11518 aligned.  Thus calling a function compiled with a higher preferred
11519 stack boundary from a function compiled with a lower preferred stack
11520 boundary will most likely misalign the stack.  It is recommended that
11521 libraries that use callbacks always use the default setting.
11522
11523 This extra alignment does consume extra stack space, and generally
11524 increases code size.  Code that is sensitive to stack space usage, such
11525 as embedded systems and operating system kernels, may want to reduce the
11526 preferred alignment to @option{-mpreferred-stack-boundary=2}.
11527
11528 @item -mmmx
11529 @itemx -mno-mmx
11530 @itemx -msse
11531 @itemx -mno-sse
11532 @itemx -msse2
11533 @itemx -mno-sse2
11534 @itemx -msse3
11535 @itemx -mno-sse3
11536 @itemx -mssse3
11537 @itemx -mno-ssse3
11538 @itemx -msse4.1
11539 @itemx -mno-sse4.1
11540 @itemx -msse4.2
11541 @itemx -mno-sse4.2
11542 @itemx -msse4
11543 @itemx -mno-sse4
11544 @itemx -mavx
11545 @itemx -mno-avx
11546 @itemx -maes
11547 @itemx -mno-aes
11548 @itemx -mpclmul
11549 @itemx -mno-pclmul
11550 @itemx -msse4a
11551 @itemx -mno-sse4a
11552 @itemx -msse5
11553 @itemx -mno-sse5
11554 @itemx -m3dnow
11555 @itemx -mno-3dnow
11556 @itemx -mpopcnt
11557 @itemx -mno-popcnt
11558 @itemx -mabm
11559 @itemx -mno-abm
11560 @opindex mmmx
11561 @opindex mno-mmx
11562 @opindex msse
11563 @opindex mno-sse
11564 @opindex m3dnow
11565 @opindex mno-3dnow
11566 These switches enable or disable the use of instructions in the MMX,
11567 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, SSE5, ABM or
11568 3DNow!@: extended instruction sets.
11569 These extensions are also available as built-in functions: see
11570 @ref{X86 Built-in Functions}, for details of the functions enabled and
11571 disabled by these switches.
11572
11573 To have SSE/SSE2 instructions generated automatically from floating-point
11574 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
11575
11576 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
11577 generates new AVX instructions or AVX equivalence for all SSEx instructions
11578 when needed.
11579
11580 These options will enable GCC to use these extended instructions in
11581 generated code, even without @option{-mfpmath=sse}.  Applications which
11582 perform runtime CPU detection must compile separate files for each
11583 supported architecture, using the appropriate flags.  In particular,
11584 the file containing the CPU detection code should be compiled without
11585 these options.
11586
11587 @item -mcld
11588 @opindex mcld
11589 This option instructs GCC to emit a @code{cld} instruction in the prologue
11590 of functions that use string instructions.  String instructions depend on
11591 the DF flag to select between autoincrement or autodecrement mode.  While the
11592 ABI specifies the DF flag to be cleared on function entry, some operating
11593 systems violate this specification by not clearing the DF flag in their
11594 exception dispatchers.  The exception handler can be invoked with the DF flag
11595 set which leads to wrong direction mode, when string instructions are used.
11596 This option can be enabled by default on 32-bit x86 targets by configuring
11597 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
11598 instructions can be suppressed with the @option{-mno-cld} compiler option
11599 in this case.
11600
11601 @item -mcx16
11602 @opindex mcx16
11603 This option will enable GCC to use CMPXCHG16B instruction in generated code.
11604 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
11605 data types.  This is useful for high resolution counters that could be updated
11606 by multiple processors (or cores).  This instruction is generated as part of
11607 atomic built-in functions: see @ref{Atomic Builtins} for details.
11608
11609 @item -msahf
11610 @opindex msahf
11611 This option will enable GCC to use SAHF instruction in generated 64-bit code.
11612 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
11613 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
11614 SAHF are load and store instructions, respectively, for certain status flags.
11615 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
11616 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
11617
11618 @item -mmovbe
11619 @opindex mmovbe
11620 This option will enable GCC to use movbe instruction to implement
11621 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
11622
11623 @item -mcrc32
11624 @opindex mcrc32
11625 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
11626 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
11627 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
11628
11629 @item -mrecip
11630 @opindex mrecip
11631 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
11632 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
11633 to increase precision instead of DIVSS and SQRTSS (and their vectorized
11634 variants) for single precision floating point arguments.  These instructions
11635 are generated only when @option{-funsafe-math-optimizations} is enabled
11636 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
11637 Note that while the throughput of the sequence is higher than the throughput
11638 of the non-reciprocal instruction, the precision of the sequence can be
11639 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
11640
11641 @item -mveclibabi=@var{type}
11642 @opindex mveclibabi
11643 Specifies the ABI type to use for vectorizing intrinsics using an
11644 external library.  Supported types are @code{svml} for the Intel short
11645 vector math library and @code{acml} for the AMD math core library style
11646 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
11647 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
11648 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
11649 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
11650 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
11651 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
11652 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
11653 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
11654 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
11655 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
11656 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
11657 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
11658 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
11659 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
11660 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
11661 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
11662 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
11663 compatible library will have to be specified at link time.
11664
11665 @item -mabi=@var{name}
11666 @opindex mabi
11667 Generate code for the specified calling convention.  Permissible values
11668 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
11669 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
11670 ABI when targeting Windows.  On all other systems, the default is the
11671 SYSV ABI.  You can control this behavior for a specific function by
11672 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
11673 @xref{Function Attributes}.
11674
11675 @item -mpush-args
11676 @itemx -mno-push-args
11677 @opindex mpush-args
11678 @opindex mno-push-args
11679 Use PUSH operations to store outgoing parameters.  This method is shorter
11680 and usually equally fast as method using SUB/MOV operations and is enabled
11681 by default.  In some cases disabling it may improve performance because of
11682 improved scheduling and reduced dependencies.
11683
11684 @item -maccumulate-outgoing-args
11685 @opindex maccumulate-outgoing-args
11686 If enabled, the maximum amount of space required for outgoing arguments will be
11687 computed in the function prologue.  This is faster on most modern CPUs
11688 because of reduced dependencies, improved scheduling and reduced stack usage
11689 when preferred stack boundary is not equal to 2.  The drawback is a notable
11690 increase in code size.  This switch implies @option{-mno-push-args}.
11691
11692 @item -mthreads
11693 @opindex mthreads
11694 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
11695 on thread-safe exception handling must compile and link all code with the
11696 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
11697 @option{-D_MT}; when linking, it links in a special thread helper library
11698 @option{-lmingwthrd} which cleans up per thread exception handling data.
11699
11700 @item -mno-align-stringops
11701 @opindex mno-align-stringops
11702 Do not align destination of inlined string operations.  This switch reduces
11703 code size and improves performance in case the destination is already aligned,
11704 but GCC doesn't know about it.
11705
11706 @item -minline-all-stringops
11707 @opindex minline-all-stringops
11708 By default GCC inlines string operations only when destination is known to be
11709 aligned at least to 4 byte boundary.  This enables more inlining, increase code
11710 size, but may improve performance of code that depends on fast memcpy, strlen
11711 and memset for short lengths.
11712
11713 @item -minline-stringops-dynamically
11714 @opindex minline-stringops-dynamically
11715 For string operation of unknown size, inline runtime checks so for small
11716 blocks inline code is used, while for large blocks library call is used.
11717
11718 @item -mstringop-strategy=@var{alg}
11719 @opindex mstringop-strategy=@var{alg}
11720 Overwrite internal decision heuristic about particular algorithm to inline
11721 string operation with.  The allowed values are @code{rep_byte},
11722 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
11723 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
11724 expanding inline loop, @code{libcall} for always expanding library call.
11725
11726 @item -momit-leaf-frame-pointer
11727 @opindex momit-leaf-frame-pointer
11728 Don't keep the frame pointer in a register for leaf functions.  This
11729 avoids the instructions to save, set up and restore frame pointers and
11730 makes an extra register available in leaf functions.  The option
11731 @option{-fomit-frame-pointer} removes the frame pointer for all functions
11732 which might make debugging harder.
11733
11734 @item -mtls-direct-seg-refs
11735 @itemx -mno-tls-direct-seg-refs
11736 @opindex mtls-direct-seg-refs
11737 Controls whether TLS variables may be accessed with offsets from the
11738 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
11739 or whether the thread base pointer must be added.  Whether or not this
11740 is legal depends on the operating system, and whether it maps the
11741 segment to cover the entire TLS area.
11742
11743 For systems that use GNU libc, the default is on.
11744
11745 @item -mfused-madd
11746 @itemx -mno-fused-madd
11747 @opindex mfused-madd
11748 Enable automatic generation of fused floating point multiply-add instructions
11749 if the ISA supports such instructions.  The -mfused-madd option is on by
11750 default.  The fused multiply-add instructions have a different
11751 rounding behavior compared to executing a multiply followed by an add.
11752
11753 @item -msse2avx
11754 @itemx -mno-sse2avx
11755 @opindex msse2avx
11756 Specify that the assembler should encode SSE instructions with VEX
11757 prefix.  The option @option{-mavx} turns this on by default.
11758 @end table
11759
11760 These @samp{-m} switches are supported in addition to the above
11761 on AMD x86-64 processors in 64-bit environments.
11762
11763 @table @gcctabopt
11764 @item -m32
11765 @itemx -m64
11766 @opindex m32
11767 @opindex m64
11768 Generate code for a 32-bit or 64-bit environment.
11769 The 32-bit environment sets int, long and pointer to 32 bits and
11770 generates code that runs on any i386 system.
11771 The 64-bit environment sets int to 32 bits and long and pointer
11772 to 64 bits and generates code for AMD's x86-64 architecture. For
11773 darwin only the -m64 option turns off the @option{-fno-pic} and
11774 @option{-mdynamic-no-pic} options.
11775
11776 @item -mno-red-zone
11777 @opindex mno-red-zone
11778 Do not use a so called red zone for x86-64 code.  The red zone is mandated
11779 by the x86-64 ABI, it is a 128-byte area beyond the location of the
11780 stack pointer that will not be modified by signal or interrupt handlers
11781 and therefore can be used for temporary data without adjusting the stack
11782 pointer.  The flag @option{-mno-red-zone} disables this red zone.
11783
11784 @item -mcmodel=small
11785 @opindex mcmodel=small
11786 Generate code for the small code model: the program and its symbols must
11787 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
11788 Programs can be statically or dynamically linked.  This is the default
11789 code model.
11790
11791 @item -mcmodel=kernel
11792 @opindex mcmodel=kernel
11793 Generate code for the kernel code model.  The kernel runs in the
11794 negative 2 GB of the address space.
11795 This model has to be used for Linux kernel code.
11796
11797 @item -mcmodel=medium
11798 @opindex mcmodel=medium
11799 Generate code for the medium model: The program is linked in the lower 2
11800 GB of the address space.  Small symbols are also placed there.  Symbols
11801 with sizes larger than @option{-mlarge-data-threshold} are put into
11802 large data or bss sections and can be located above 2GB.  Programs can
11803 be statically or dynamically linked.
11804
11805 @item -mcmodel=large
11806 @opindex mcmodel=large
11807 Generate code for the large model: This model makes no assumptions
11808 about addresses and sizes of sections.
11809 @end table
11810
11811 @node IA-64 Options
11812 @subsection IA-64 Options
11813 @cindex IA-64 Options
11814
11815 These are the @samp{-m} options defined for the Intel IA-64 architecture.
11816
11817 @table @gcctabopt
11818 @item -mbig-endian
11819 @opindex mbig-endian
11820 Generate code for a big endian target.  This is the default for HP-UX@.
11821
11822 @item -mlittle-endian
11823 @opindex mlittle-endian
11824 Generate code for a little endian target.  This is the default for AIX5
11825 and GNU/Linux.
11826
11827 @item -mgnu-as
11828 @itemx -mno-gnu-as
11829 @opindex mgnu-as
11830 @opindex mno-gnu-as
11831 Generate (or don't) code for the GNU assembler.  This is the default.
11832 @c Also, this is the default if the configure option @option{--with-gnu-as}
11833 @c is used.
11834
11835 @item -mgnu-ld
11836 @itemx -mno-gnu-ld
11837 @opindex mgnu-ld
11838 @opindex mno-gnu-ld
11839 Generate (or don't) code for the GNU linker.  This is the default.
11840 @c Also, this is the default if the configure option @option{--with-gnu-ld}
11841 @c is used.
11842
11843 @item -mno-pic
11844 @opindex mno-pic
11845 Generate code that does not use a global pointer register.  The result
11846 is not position independent code, and violates the IA-64 ABI@.
11847
11848 @item -mvolatile-asm-stop
11849 @itemx -mno-volatile-asm-stop
11850 @opindex mvolatile-asm-stop
11851 @opindex mno-volatile-asm-stop
11852 Generate (or don't) a stop bit immediately before and after volatile asm
11853 statements.
11854
11855 @item -mregister-names
11856 @itemx -mno-register-names
11857 @opindex mregister-names
11858 @opindex mno-register-names
11859 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
11860 the stacked registers.  This may make assembler output more readable.
11861
11862 @item -mno-sdata
11863 @itemx -msdata
11864 @opindex mno-sdata
11865 @opindex msdata
11866 Disable (or enable) optimizations that use the small data section.  This may
11867 be useful for working around optimizer bugs.
11868
11869 @item -mconstant-gp
11870 @opindex mconstant-gp
11871 Generate code that uses a single constant global pointer value.  This is
11872 useful when compiling kernel code.
11873
11874 @item -mauto-pic
11875 @opindex mauto-pic
11876 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
11877 This is useful when compiling firmware code.
11878
11879 @item -minline-float-divide-min-latency
11880 @opindex minline-float-divide-min-latency
11881 Generate code for inline divides of floating point values
11882 using the minimum latency algorithm.
11883
11884 @item -minline-float-divide-max-throughput
11885 @opindex minline-float-divide-max-throughput
11886 Generate code for inline divides of floating point values
11887 using the maximum throughput algorithm.
11888
11889 @item -mno-inline-float-divide
11890 @opindex mno-inline-float-divide
11891 Do not generate inline code for divides of floating point values.
11892
11893 @item -minline-int-divide-min-latency
11894 @opindex minline-int-divide-min-latency
11895 Generate code for inline divides of integer values
11896 using the minimum latency algorithm.
11897
11898 @item -minline-int-divide-max-throughput
11899 @opindex minline-int-divide-max-throughput
11900 Generate code for inline divides of integer values
11901 using the maximum throughput algorithm.
11902
11903 @item -mno-inline-int-divide
11904 @opindex mno-inline-int-divide
11905 Do not generate inline code for divides of integer values.
11906
11907 @item -minline-sqrt-min-latency
11908 @opindex minline-sqrt-min-latency
11909 Generate code for inline square roots
11910 using the minimum latency algorithm.
11911
11912 @item -minline-sqrt-max-throughput
11913 @opindex minline-sqrt-max-throughput
11914 Generate code for inline square roots
11915 using the maximum throughput algorithm.
11916
11917 @item -mno-inline-sqrt
11918 @opindex mno-inline-sqrt
11919 Do not generate inline code for sqrt.
11920
11921 @item -mfused-madd
11922 @itemx -mno-fused-madd
11923 @opindex mfused-madd
11924 @opindex mno-fused-madd
11925 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
11926 instructions.    The default is to use these instructions.
11927
11928 @item -mno-dwarf2-asm
11929 @itemx -mdwarf2-asm
11930 @opindex mno-dwarf2-asm
11931 @opindex mdwarf2-asm
11932 Don't (or do) generate assembler code for the DWARF2 line number debugging
11933 info.  This may be useful when not using the GNU assembler.
11934
11935 @item -mearly-stop-bits
11936 @itemx -mno-early-stop-bits
11937 @opindex mearly-stop-bits
11938 @opindex mno-early-stop-bits
11939 Allow stop bits to be placed earlier than immediately preceding the
11940 instruction that triggered the stop bit.  This can improve instruction
11941 scheduling, but does not always do so.
11942
11943 @item -mfixed-range=@var{register-range}
11944 @opindex mfixed-range
11945 Generate code treating the given register range as fixed registers.
11946 A fixed register is one that the register allocator can not use.  This is
11947 useful when compiling kernel code.  A register range is specified as
11948 two registers separated by a dash.  Multiple register ranges can be
11949 specified separated by a comma.
11950
11951 @item -mtls-size=@var{tls-size}
11952 @opindex mtls-size
11953 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
11954 64.
11955
11956 @item -mtune=@var{cpu-type}
11957 @opindex mtune
11958 Tune the instruction scheduling for a particular CPU, Valid values are
11959 itanium, itanium1, merced, itanium2, and mckinley.
11960
11961 @item -milp32
11962 @itemx -mlp64
11963 @opindex milp32
11964 @opindex mlp64
11965 Generate code for a 32-bit or 64-bit environment.
11966 The 32-bit environment sets int, long and pointer to 32 bits.
11967 The 64-bit environment sets int to 32 bits and long and pointer
11968 to 64 bits.  These are HP-UX specific flags.
11969
11970 @item -mno-sched-br-data-spec
11971 @itemx -msched-br-data-spec
11972 @opindex mno-sched-br-data-spec
11973 @opindex msched-br-data-spec
11974 (Dis/En)able data speculative scheduling before reload.
11975 This will result in generation of the ld.a instructions and
11976 the corresponding check instructions (ld.c / chk.a).
11977 The default is 'disable'.
11978
11979 @item -msched-ar-data-spec
11980 @itemx -mno-sched-ar-data-spec
11981 @opindex msched-ar-data-spec
11982 @opindex mno-sched-ar-data-spec
11983 (En/Dis)able data speculative scheduling after reload.
11984 This will result in generation of the ld.a instructions and
11985 the corresponding check instructions (ld.c / chk.a).
11986 The default is 'enable'.
11987
11988 @item -mno-sched-control-spec
11989 @itemx -msched-control-spec
11990 @opindex mno-sched-control-spec
11991 @opindex msched-control-spec
11992 (Dis/En)able control speculative scheduling.  This feature is
11993 available only during region scheduling (i.e.@: before reload).
11994 This will result in generation of the ld.s instructions and
11995 the corresponding check instructions chk.s .
11996 The default is 'disable'.
11997
11998 @item -msched-br-in-data-spec
11999 @itemx -mno-sched-br-in-data-spec
12000 @opindex msched-br-in-data-spec
12001 @opindex mno-sched-br-in-data-spec
12002 (En/Dis)able speculative scheduling of the instructions that
12003 are dependent on the data speculative loads before reload.
12004 This is effective only with @option{-msched-br-data-spec} enabled.
12005 The default is 'enable'.
12006
12007 @item -msched-ar-in-data-spec
12008 @itemx -mno-sched-ar-in-data-spec
12009 @opindex msched-ar-in-data-spec
12010 @opindex mno-sched-ar-in-data-spec
12011 (En/Dis)able speculative scheduling of the instructions that
12012 are dependent on the data speculative loads after reload.
12013 This is effective only with @option{-msched-ar-data-spec} enabled.
12014 The default is 'enable'.
12015
12016 @item -msched-in-control-spec
12017 @itemx -mno-sched-in-control-spec
12018 @opindex msched-in-control-spec
12019 @opindex mno-sched-in-control-spec
12020 (En/Dis)able speculative scheduling of the instructions that
12021 are dependent on the control speculative loads.
12022 This is effective only with @option{-msched-control-spec} enabled.
12023 The default is 'enable'.
12024
12025 @item -mno-sched-prefer-non-data-spec-insns
12026 @itemx -msched-prefer-non-data-spec-insns
12027 @opindex mno-sched-prefer-non-data-spec-insns
12028 @opindex msched-prefer-non-data-spec-insns
12029 If enabled, data speculative instructions will be chosen for schedule
12030 only if there are no other choices at the moment.  This will make
12031 the use of the data speculation much more conservative.
12032 The default is 'disable'.
12033
12034 @item -mno-sched-prefer-non-control-spec-insns
12035 @itemx -msched-prefer-non-control-spec-insns
12036 @opindex mno-sched-prefer-non-control-spec-insns
12037 @opindex msched-prefer-non-control-spec-insns
12038 If enabled, control speculative instructions will be chosen for schedule
12039 only if there are no other choices at the moment.  This will make
12040 the use of the control speculation much more conservative.
12041 The default is 'disable'.
12042
12043 @item -mno-sched-count-spec-in-critical-path
12044 @itemx -msched-count-spec-in-critical-path
12045 @opindex mno-sched-count-spec-in-critical-path
12046 @opindex msched-count-spec-in-critical-path
12047 If enabled, speculative dependencies will be considered during
12048 computation of the instructions priorities.  This will make the use of the
12049 speculation a bit more conservative.
12050 The default is 'disable'.
12051
12052 @item -msched-spec-ldc
12053 @opindex msched-spec-ldc
12054 Use a simple data speculation check.  This option is on by default.
12055
12056 @item -msched-control-spec-ldc
12057 @opindex msched-spec-ldc
12058 Use a simple check for control speculation.  This option is on by default.
12059
12060 @item -msched-stop-bits-after-every-cycle
12061 @opindex msched-stop-bits-after-every-cycle
12062 Place a stop bit after every cycle when scheduling.  This option is on
12063 by default.
12064
12065 @item -msched-fp-mem-deps-zero-cost
12066 @opindex msched-fp-mem-deps-zero-cost
12067 Assume that floating-point stores and loads are not likely to cause a conflict
12068 when placed into the same instruction group.  This option is disabled by
12069 default.
12070
12071 @item -msel-sched-dont-check-control-spec
12072 @opindex msel-sched-dont-check-control-spec
12073 Generate checks for control speculation in selective scheduling.
12074 This flag is disabled by default.
12075
12076 @item -msched-max-memory-insns=@var{max-insns}
12077 @opindex msched-max-memory-insns
12078 Limit on the number of memory insns per instruction group, giving lower
12079 priority to subsequent memory insns attempting to schedule in the same
12080 instruction group. Frequently useful to prevent cache bank conflicts.
12081 The default value is 1.
12082
12083 @item -msched-max-memory-insns-hard-limit
12084 @opindex msched-max-memory-insns-hard-limit
12085 Disallow more than `msched-max-memory-insns' in instruction group.
12086 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
12087 when limit is reached but may still schedule memory operations.
12088
12089 @end table
12090
12091 @node M32C Options
12092 @subsection M32C Options
12093 @cindex M32C options
12094
12095 @table @gcctabopt
12096 @item -mcpu=@var{name}
12097 @opindex mcpu=
12098 Select the CPU for which code is generated.  @var{name} may be one of
12099 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
12100 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
12101 the M32C/80 series.
12102
12103 @item -msim
12104 @opindex msim
12105 Specifies that the program will be run on the simulator.  This causes
12106 an alternate runtime library to be linked in which supports, for
12107 example, file I/O@.  You must not use this option when generating
12108 programs that will run on real hardware; you must provide your own
12109 runtime library for whatever I/O functions are needed.
12110
12111 @item -memregs=@var{number}
12112 @opindex memregs=
12113 Specifies the number of memory-based pseudo-registers GCC will use
12114 during code generation.  These pseudo-registers will be used like real
12115 registers, so there is a tradeoff between GCC's ability to fit the
12116 code into available registers, and the performance penalty of using
12117 memory instead of registers.  Note that all modules in a program must
12118 be compiled with the same value for this option.  Because of that, you
12119 must not use this option with the default runtime libraries gcc
12120 builds.
12121
12122 @end table
12123
12124 @node M32R/D Options
12125 @subsection M32R/D Options
12126 @cindex M32R/D options
12127
12128 These @option{-m} options are defined for Renesas M32R/D architectures:
12129
12130 @table @gcctabopt
12131 @item -m32r2
12132 @opindex m32r2
12133 Generate code for the M32R/2@.
12134
12135 @item -m32rx
12136 @opindex m32rx
12137 Generate code for the M32R/X@.
12138
12139 @item -m32r
12140 @opindex m32r
12141 Generate code for the M32R@.  This is the default.
12142
12143 @item -mmodel=small
12144 @opindex mmodel=small
12145 Assume all objects live in the lower 16MB of memory (so that their addresses
12146 can be loaded with the @code{ld24} instruction), and assume all subroutines
12147 are reachable with the @code{bl} instruction.
12148 This is the default.
12149
12150 The addressability of a particular object can be set with the
12151 @code{model} attribute.
12152
12153 @item -mmodel=medium
12154 @opindex mmodel=medium
12155 Assume objects may be anywhere in the 32-bit address space (the compiler
12156 will generate @code{seth/add3} instructions to load their addresses), and
12157 assume all subroutines are reachable with the @code{bl} instruction.
12158
12159 @item -mmodel=large
12160 @opindex mmodel=large
12161 Assume objects may be anywhere in the 32-bit address space (the compiler
12162 will generate @code{seth/add3} instructions to load their addresses), and
12163 assume subroutines may not be reachable with the @code{bl} instruction
12164 (the compiler will generate the much slower @code{seth/add3/jl}
12165 instruction sequence).
12166
12167 @item -msdata=none
12168 @opindex msdata=none
12169 Disable use of the small data area.  Variables will be put into
12170 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
12171 @code{section} attribute has been specified).
12172 This is the default.
12173
12174 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
12175 Objects may be explicitly put in the small data area with the
12176 @code{section} attribute using one of these sections.
12177
12178 @item -msdata=sdata
12179 @opindex msdata=sdata
12180 Put small global and static data in the small data area, but do not
12181 generate special code to reference them.
12182
12183 @item -msdata=use
12184 @opindex msdata=use
12185 Put small global and static data in the small data area, and generate
12186 special instructions to reference them.
12187
12188 @item -G @var{num}
12189 @opindex G
12190 @cindex smaller data references
12191 Put global and static objects less than or equal to @var{num} bytes
12192 into the small data or bss sections instead of the normal data or bss
12193 sections.  The default value of @var{num} is 8.
12194 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
12195 for this option to have any effect.
12196
12197 All modules should be compiled with the same @option{-G @var{num}} value.
12198 Compiling with different values of @var{num} may or may not work; if it
12199 doesn't the linker will give an error message---incorrect code will not be
12200 generated.
12201
12202 @item -mdebug
12203 @opindex mdebug
12204 Makes the M32R specific code in the compiler display some statistics
12205 that might help in debugging programs.
12206
12207 @item -malign-loops
12208 @opindex malign-loops
12209 Align all loops to a 32-byte boundary.
12210
12211 @item -mno-align-loops
12212 @opindex mno-align-loops
12213 Do not enforce a 32-byte alignment for loops.  This is the default.
12214
12215 @item -missue-rate=@var{number}
12216 @opindex missue-rate=@var{number}
12217 Issue @var{number} instructions per cycle.  @var{number} can only be 1
12218 or 2.
12219
12220 @item -mbranch-cost=@var{number}
12221 @opindex mbranch-cost=@var{number}
12222 @var{number} can only be 1 or 2.  If it is 1 then branches will be
12223 preferred over conditional code, if it is 2, then the opposite will
12224 apply.
12225
12226 @item -mflush-trap=@var{number}
12227 @opindex mflush-trap=@var{number}
12228 Specifies the trap number to use to flush the cache.  The default is
12229 12.  Valid numbers are between 0 and 15 inclusive.
12230
12231 @item -mno-flush-trap
12232 @opindex mno-flush-trap
12233 Specifies that the cache cannot be flushed by using a trap.
12234
12235 @item -mflush-func=@var{name}
12236 @opindex mflush-func=@var{name}
12237 Specifies the name of the operating system function to call to flush
12238 the cache.  The default is @emph{_flush_cache}, but a function call
12239 will only be used if a trap is not available.
12240
12241 @item -mno-flush-func
12242 @opindex mno-flush-func
12243 Indicates that there is no OS function for flushing the cache.
12244
12245 @end table
12246
12247 @node M680x0 Options
12248 @subsection M680x0 Options
12249 @cindex M680x0 options
12250
12251 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
12252 The default settings depend on which architecture was selected when
12253 the compiler was configured; the defaults for the most common choices
12254 are given below.
12255
12256 @table @gcctabopt
12257 @item -march=@var{arch}
12258 @opindex march
12259 Generate code for a specific M680x0 or ColdFire instruction set
12260 architecture.  Permissible values of @var{arch} for M680x0
12261 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
12262 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
12263 architectures are selected according to Freescale's ISA classification
12264 and the permissible values are: @samp{isaa}, @samp{isaaplus},
12265 @samp{isab} and @samp{isac}.
12266
12267 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
12268 code for a ColdFire target.  The @var{arch} in this macro is one of the
12269 @option{-march} arguments given above.
12270
12271 When used together, @option{-march} and @option{-mtune} select code
12272 that runs on a family of similar processors but that is optimized
12273 for a particular microarchitecture.
12274
12275 @item -mcpu=@var{cpu}
12276 @opindex mcpu
12277 Generate code for a specific M680x0 or ColdFire processor.
12278 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
12279 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
12280 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
12281 below, which also classifies the CPUs into families:
12282
12283 @multitable @columnfractions 0.20 0.80
12284 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
12285 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
12286 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
12287 @item @samp{5206e} @tab @samp{5206e}
12288 @item @samp{5208} @tab @samp{5207} @samp{5208}
12289 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
12290 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
12291 @item @samp{5216} @tab @samp{5214} @samp{5216}
12292 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
12293 @item @samp{5225} @tab @samp{5224} @samp{5225}
12294 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
12295 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
12296 @item @samp{5249} @tab @samp{5249}
12297 @item @samp{5250} @tab @samp{5250}
12298 @item @samp{5271} @tab @samp{5270} @samp{5271}
12299 @item @samp{5272} @tab @samp{5272}
12300 @item @samp{5275} @tab @samp{5274} @samp{5275}
12301 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
12302 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
12303 @item @samp{5307} @tab @samp{5307}
12304 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
12305 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
12306 @item @samp{5407} @tab @samp{5407}
12307 @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}
12308 @end multitable
12309
12310 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
12311 @var{arch} is compatible with @var{cpu}.  Other combinations of
12312 @option{-mcpu} and @option{-march} are rejected.
12313
12314 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
12315 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
12316 where the value of @var{family} is given by the table above.
12317
12318 @item -mtune=@var{tune}
12319 @opindex mtune
12320 Tune the code for a particular microarchitecture, within the
12321 constraints set by @option{-march} and @option{-mcpu}.
12322 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
12323 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
12324 and @samp{cpu32}.  The ColdFire microarchitectures
12325 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
12326
12327 You can also use @option{-mtune=68020-40} for code that needs
12328 to run relatively well on 68020, 68030 and 68040 targets.
12329 @option{-mtune=68020-60} is similar but includes 68060 targets
12330 as well.  These two options select the same tuning decisions as
12331 @option{-m68020-40} and @option{-m68020-60} respectively.
12332
12333 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
12334 when tuning for 680x0 architecture @var{arch}.  It also defines
12335 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
12336 option is used.  If gcc is tuning for a range of architectures,
12337 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
12338 it defines the macros for every architecture in the range.
12339
12340 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
12341 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
12342 of the arguments given above.
12343
12344 @item -m68000
12345 @itemx -mc68000
12346 @opindex m68000
12347 @opindex mc68000
12348 Generate output for a 68000.  This is the default
12349 when the compiler is configured for 68000-based systems.
12350 It is equivalent to @option{-march=68000}.
12351
12352 Use this option for microcontrollers with a 68000 or EC000 core,
12353 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
12354
12355 @item -m68010
12356 @opindex m68010
12357 Generate output for a 68010.  This is the default
12358 when the compiler is configured for 68010-based systems.
12359 It is equivalent to @option{-march=68010}.
12360
12361 @item -m68020
12362 @itemx -mc68020
12363 @opindex m68020
12364 @opindex mc68020
12365 Generate output for a 68020.  This is the default
12366 when the compiler is configured for 68020-based systems.
12367 It is equivalent to @option{-march=68020}.
12368
12369 @item -m68030
12370 @opindex m68030
12371 Generate output for a 68030.  This is the default when the compiler is
12372 configured for 68030-based systems.  It is equivalent to
12373 @option{-march=68030}.
12374
12375 @item -m68040
12376 @opindex m68040
12377 Generate output for a 68040.  This is the default when the compiler is
12378 configured for 68040-based systems.  It is equivalent to
12379 @option{-march=68040}.
12380
12381 This option inhibits the use of 68881/68882 instructions that have to be
12382 emulated by software on the 68040.  Use this option if your 68040 does not
12383 have code to emulate those instructions.
12384
12385 @item -m68060
12386 @opindex m68060
12387 Generate output for a 68060.  This is the default when the compiler is
12388 configured for 68060-based systems.  It is equivalent to
12389 @option{-march=68060}.
12390
12391 This option inhibits the use of 68020 and 68881/68882 instructions that
12392 have to be emulated by software on the 68060.  Use this option if your 68060
12393 does not have code to emulate those instructions.
12394
12395 @item -mcpu32
12396 @opindex mcpu32
12397 Generate output for a CPU32.  This is the default
12398 when the compiler is configured for CPU32-based systems.
12399 It is equivalent to @option{-march=cpu32}.
12400
12401 Use this option for microcontrollers with a
12402 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
12403 68336, 68340, 68341, 68349 and 68360.
12404
12405 @item -m5200
12406 @opindex m5200
12407 Generate output for a 520X ColdFire CPU@.  This is the default
12408 when the compiler is configured for 520X-based systems.
12409 It is equivalent to @option{-mcpu=5206}, and is now deprecated
12410 in favor of that option.
12411
12412 Use this option for microcontroller with a 5200 core, including
12413 the MCF5202, MCF5203, MCF5204 and MCF5206.
12414
12415 @item -m5206e
12416 @opindex m5206e
12417 Generate output for a 5206e ColdFire CPU@.  The option is now
12418 deprecated in favor of the equivalent @option{-mcpu=5206e}.
12419
12420 @item -m528x
12421 @opindex m528x
12422 Generate output for a member of the ColdFire 528X family.
12423 The option is now deprecated in favor of the equivalent
12424 @option{-mcpu=528x}.
12425
12426 @item -m5307
12427 @opindex m5307
12428 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
12429 in favor of the equivalent @option{-mcpu=5307}.
12430
12431 @item -m5407
12432 @opindex m5407
12433 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
12434 in favor of the equivalent @option{-mcpu=5407}.
12435
12436 @item -mcfv4e
12437 @opindex mcfv4e
12438 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
12439 This includes use of hardware floating point instructions.
12440 The option is equivalent to @option{-mcpu=547x}, and is now
12441 deprecated in favor of that option.
12442
12443 @item -m68020-40
12444 @opindex m68020-40
12445 Generate output for a 68040, without using any of the new instructions.
12446 This results in code which can run relatively efficiently on either a
12447 68020/68881 or a 68030 or a 68040.  The generated code does use the
12448 68881 instructions that are emulated on the 68040.
12449
12450 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
12451
12452 @item -m68020-60
12453 @opindex m68020-60
12454 Generate output for a 68060, without using any of the new instructions.
12455 This results in code which can run relatively efficiently on either a
12456 68020/68881 or a 68030 or a 68040.  The generated code does use the
12457 68881 instructions that are emulated on the 68060.
12458
12459 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
12460
12461 @item -mhard-float
12462 @itemx -m68881
12463 @opindex mhard-float
12464 @opindex m68881
12465 Generate floating-point instructions.  This is the default for 68020
12466 and above, and for ColdFire devices that have an FPU@.  It defines the
12467 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
12468 on ColdFire targets.
12469
12470 @item -msoft-float
12471 @opindex msoft-float
12472 Do not generate floating-point instructions; use library calls instead.
12473 This is the default for 68000, 68010, and 68832 targets.  It is also
12474 the default for ColdFire devices that have no FPU.
12475
12476 @item -mdiv
12477 @itemx -mno-div
12478 @opindex mdiv
12479 @opindex mno-div
12480 Generate (do not generate) ColdFire hardware divide and remainder
12481 instructions.  If @option{-march} is used without @option{-mcpu},
12482 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
12483 architectures.  Otherwise, the default is taken from the target CPU
12484 (either the default CPU, or the one specified by @option{-mcpu}).  For
12485 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
12486 @option{-mcpu=5206e}.
12487
12488 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
12489
12490 @item -mshort
12491 @opindex mshort
12492 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12493 Additionally, parameters passed on the stack are also aligned to a
12494 16-bit boundary even on targets whose API mandates promotion to 32-bit.
12495
12496 @item -mno-short
12497 @opindex mno-short
12498 Do not consider type @code{int} to be 16 bits wide.  This is the default.
12499
12500 @item -mnobitfield
12501 @itemx -mno-bitfield
12502 @opindex mnobitfield
12503 @opindex mno-bitfield
12504 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
12505 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
12506
12507 @item -mbitfield
12508 @opindex mbitfield
12509 Do use the bit-field instructions.  The @option{-m68020} option implies
12510 @option{-mbitfield}.  This is the default if you use a configuration
12511 designed for a 68020.
12512
12513 @item -mrtd
12514 @opindex mrtd
12515 Use a different function-calling convention, in which functions
12516 that take a fixed number of arguments return with the @code{rtd}
12517 instruction, which pops their arguments while returning.  This
12518 saves one instruction in the caller since there is no need to pop
12519 the arguments there.
12520
12521 This calling convention is incompatible with the one normally
12522 used on Unix, so you cannot use it if you need to call libraries
12523 compiled with the Unix compiler.
12524
12525 Also, you must provide function prototypes for all functions that
12526 take variable numbers of arguments (including @code{printf});
12527 otherwise incorrect code will be generated for calls to those
12528 functions.
12529
12530 In addition, seriously incorrect code will result if you call a
12531 function with too many arguments.  (Normally, extra arguments are
12532 harmlessly ignored.)
12533
12534 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
12535 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
12536
12537 @item -mno-rtd
12538 @opindex mno-rtd
12539 Do not use the calling conventions selected by @option{-mrtd}.
12540 This is the default.
12541
12542 @item -malign-int
12543 @itemx -mno-align-int
12544 @opindex malign-int
12545 @opindex mno-align-int
12546 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
12547 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
12548 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
12549 Aligning variables on 32-bit boundaries produces code that runs somewhat
12550 faster on processors with 32-bit busses at the expense of more memory.
12551
12552 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
12553 align structures containing the above types  differently than
12554 most published application binary interface specifications for the m68k.
12555
12556 @item -mpcrel
12557 @opindex mpcrel
12558 Use the pc-relative addressing mode of the 68000 directly, instead of
12559 using a global offset table.  At present, this option implies @option{-fpic},
12560 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
12561 not presently supported with @option{-mpcrel}, though this could be supported for
12562 68020 and higher processors.
12563
12564 @item -mno-strict-align
12565 @itemx -mstrict-align
12566 @opindex mno-strict-align
12567 @opindex mstrict-align
12568 Do not (do) assume that unaligned memory references will be handled by
12569 the system.
12570
12571 @item -msep-data
12572 Generate code that allows the data segment to be located in a different
12573 area of memory from the text segment.  This allows for execute in place in
12574 an environment without virtual memory management.  This option implies
12575 @option{-fPIC}.
12576
12577 @item -mno-sep-data
12578 Generate code that assumes that the data segment follows the text segment.
12579 This is the default.
12580
12581 @item -mid-shared-library
12582 Generate code that supports shared libraries via the library ID method.
12583 This allows for execute in place and shared libraries in an environment
12584 without virtual memory management.  This option implies @option{-fPIC}.
12585
12586 @item -mno-id-shared-library
12587 Generate code that doesn't assume ID based shared libraries are being used.
12588 This is the default.
12589
12590 @item -mshared-library-id=n
12591 Specified the identification number of the ID based shared library being
12592 compiled.  Specifying a value of 0 will generate more compact code, specifying
12593 other values will force the allocation of that number to the current
12594 library but is no more space or time efficient than omitting this option.
12595
12596 @item -mxgot
12597 @itemx -mno-xgot
12598 @opindex mxgot
12599 @opindex mno-xgot
12600 When generating position-independent code for ColdFire, generate code
12601 that works if the GOT has more than 8192 entries.  This code is
12602 larger and slower than code generated without this option.  On M680x0
12603 processors, this option is not needed; @option{-fPIC} suffices.
12604
12605 GCC normally uses a single instruction to load values from the GOT@.
12606 While this is relatively efficient, it only works if the GOT
12607 is smaller than about 64k.  Anything larger causes the linker
12608 to report an error such as:
12609
12610 @cindex relocation truncated to fit (ColdFire)
12611 @smallexample
12612 relocation truncated to fit: R_68K_GOT16O foobar
12613 @end smallexample
12614
12615 If this happens, you should recompile your code with @option{-mxgot}.
12616 It should then work with very large GOTs.  However, code generated with
12617 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
12618 the value of a global symbol.
12619
12620 Note that some linkers, including newer versions of the GNU linker,
12621 can create multiple GOTs and sort GOT entries.  If you have such a linker,
12622 you should only need to use @option{-mxgot} when compiling a single
12623 object file that accesses more than 8192 GOT entries.  Very few do.
12624
12625 These options have no effect unless GCC is generating
12626 position-independent code.
12627
12628 @end table
12629
12630 @node M68hc1x Options
12631 @subsection M68hc1x Options
12632 @cindex M68hc1x options
12633
12634 These are the @samp{-m} options defined for the 68hc11 and 68hc12
12635 microcontrollers.  The default values for these options depends on
12636 which style of microcontroller was selected when the compiler was configured;
12637 the defaults for the most common choices are given below.
12638
12639 @table @gcctabopt
12640 @item -m6811
12641 @itemx -m68hc11
12642 @opindex m6811
12643 @opindex m68hc11
12644 Generate output for a 68HC11.  This is the default
12645 when the compiler is configured for 68HC11-based systems.
12646
12647 @item -m6812
12648 @itemx -m68hc12
12649 @opindex m6812
12650 @opindex m68hc12
12651 Generate output for a 68HC12.  This is the default
12652 when the compiler is configured for 68HC12-based systems.
12653
12654 @item -m68S12
12655 @itemx -m68hcs12
12656 @opindex m68S12
12657 @opindex m68hcs12
12658 Generate output for a 68HCS12.
12659
12660 @item -mauto-incdec
12661 @opindex mauto-incdec
12662 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
12663 addressing modes.
12664
12665 @item -minmax
12666 @itemx -mnominmax
12667 @opindex minmax
12668 @opindex mnominmax
12669 Enable the use of 68HC12 min and max instructions.
12670
12671 @item -mlong-calls
12672 @itemx -mno-long-calls
12673 @opindex mlong-calls
12674 @opindex mno-long-calls
12675 Treat all calls as being far away (near).  If calls are assumed to be
12676 far away, the compiler will use the @code{call} instruction to
12677 call a function and the @code{rtc} instruction for returning.
12678
12679 @item -mshort
12680 @opindex mshort
12681 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12682
12683 @item -msoft-reg-count=@var{count}
12684 @opindex msoft-reg-count
12685 Specify the number of pseudo-soft registers which are used for the
12686 code generation.  The maximum number is 32.  Using more pseudo-soft
12687 register may or may not result in better code depending on the program.
12688 The default is 4 for 68HC11 and 2 for 68HC12.
12689
12690 @end table
12691
12692 @node MCore Options
12693 @subsection MCore Options
12694 @cindex MCore options
12695
12696 These are the @samp{-m} options defined for the Motorola M*Core
12697 processors.
12698
12699 @table @gcctabopt
12700
12701 @item -mhardlit
12702 @itemx -mno-hardlit
12703 @opindex mhardlit
12704 @opindex mno-hardlit
12705 Inline constants into the code stream if it can be done in two
12706 instructions or less.
12707
12708 @item -mdiv
12709 @itemx -mno-div
12710 @opindex mdiv
12711 @opindex mno-div
12712 Use the divide instruction.  (Enabled by default).
12713
12714 @item -mrelax-immediate
12715 @itemx -mno-relax-immediate
12716 @opindex mrelax-immediate
12717 @opindex mno-relax-immediate
12718 Allow arbitrary sized immediates in bit operations.
12719
12720 @item -mwide-bitfields
12721 @itemx -mno-wide-bitfields
12722 @opindex mwide-bitfields
12723 @opindex mno-wide-bitfields
12724 Always treat bit-fields as int-sized.
12725
12726 @item -m4byte-functions
12727 @itemx -mno-4byte-functions
12728 @opindex m4byte-functions
12729 @opindex mno-4byte-functions
12730 Force all functions to be aligned to a four byte boundary.
12731
12732 @item -mcallgraph-data
12733 @itemx -mno-callgraph-data
12734 @opindex mcallgraph-data
12735 @opindex mno-callgraph-data
12736 Emit callgraph information.
12737
12738 @item -mslow-bytes
12739 @itemx -mno-slow-bytes
12740 @opindex mslow-bytes
12741 @opindex mno-slow-bytes
12742 Prefer word access when reading byte quantities.
12743
12744 @item -mlittle-endian
12745 @itemx -mbig-endian
12746 @opindex mlittle-endian
12747 @opindex mbig-endian
12748 Generate code for a little endian target.
12749
12750 @item -m210
12751 @itemx -m340
12752 @opindex m210
12753 @opindex m340
12754 Generate code for the 210 processor.
12755
12756 @item -mno-lsim
12757 @opindex mno-lsim
12758 Assume that run-time support has been provided and so omit the
12759 simulator library (@file{libsim.a)} from the linker command line.
12760
12761 @item -mstack-increment=@var{size}
12762 @opindex mstack-increment
12763 Set the maximum amount for a single stack increment operation.  Large
12764 values can increase the speed of programs which contain functions
12765 that need a large amount of stack space, but they can also trigger a
12766 segmentation fault if the stack is extended too much.  The default
12767 value is 0x1000.
12768
12769 @end table
12770
12771 @node MeP Options
12772 @subsection MeP Options
12773 @cindex MeP options
12774
12775 @table @gcctabopt
12776
12777 @item -mabsdiff
12778 @opindex mabsdiff
12779 Enables the @code{abs} instruction, which is the absolute difference
12780 between two registers.
12781
12782 @item -mall-opts
12783 @opindex mall-opts
12784 Enables all the optional instructions - average, multiply, divide, bit
12785 operations, leading zero, absolute difference, min/max, clip, and
12786 saturation.
12787
12788
12789 @item -maverage
12790 @opindex maverage
12791 Enables the @code{ave} instruction, which computes the average of two
12792 registers.
12793
12794 @item -mbased=@var{n}
12795 @opindex mbased=
12796 Variables of size @var{n} bytes or smaller will be placed in the
12797 @code{.based} section by default.  Based variables use the @code{$tp}
12798 register as a base register, and there is a 128 byte limit to the
12799 @code{.based} section.
12800
12801 @item -mbitops
12802 @opindex mbitops
12803 Enables the bit operation instructions - bit test (@code{btstm}), set
12804 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
12805 test-and-set (@code{tas}).
12806
12807 @item -mc=@var{name}
12808 @opindex mc=
12809 Selects which section constant data will be placed in.  @var{name} may
12810 be @code{tiny}, @code{near}, or @code{far}.
12811
12812 @item -mclip
12813 @opindex mclip
12814 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
12815 useful unless you also provide @code{-mminmax}.
12816
12817 @item -mconfig=@var{name}
12818 @opindex mconfig=
12819 Selects one of the build-in core configurations.  Each MeP chip has
12820 one or more modules in it; each module has a core CPU and a variety of
12821 coprocessors, optional instructions, and peripherals.  The
12822 @code{MeP-Integrator} tool, not part of GCC, provides these
12823 configurations through this option; using this option is the same as
12824 using all the corresponding command line options.  The default
12825 configuration is @code{default}.
12826
12827 @item -mcop
12828 @opindex mcop
12829 Enables the coprocessor instructions.  By default, this is a 32-bit
12830 coprocessor.  Note that the coprocessor is normally enabled via the
12831 @code{-mconfig=} option.
12832
12833 @item -mcop32
12834 @opindex mcop32
12835 Enables the 32-bit coprocessor's instructions.
12836
12837 @item -mcop64
12838 @opindex mcop64
12839 Enables the 64-bit coprocessor's instructions.
12840
12841 @item -mivc2
12842 @opindex mivc2
12843 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
12844
12845 @item -mdc
12846 @opindex mdc
12847 Causes constant variables to be placed in the @code{.near} section.
12848
12849 @item -mdiv
12850 @opindex mdiv
12851 Enables the @code{div} and @code{divu} instructions.
12852
12853 @item -meb
12854 @opindex meb
12855 Generate big-endian code.
12856
12857 @item -mel
12858 @opindex mel
12859 Generate little-endian code.
12860
12861 @item -mio-volatile
12862 @opindex mio-volatile
12863 Tells the compiler that any variable marked with the @code{io}
12864 attribute is to be considered volatile.
12865
12866 @item -ml
12867 @opindex ml
12868 Causes variables to be assigned to the @code{.far} section by default.
12869
12870 @item -mleadz
12871 @opindex mleadz
12872 Enables the @code{leadz} (leading zero) instruction.
12873
12874 @item -mm
12875 @opindex mm
12876 Causes variables to be assigned to the @code{.near} section by default.
12877
12878 @item -mminmax
12879 @opindex mminmax
12880 Enables the @code{min} and @code{max} instructions.
12881
12882 @item -mmult
12883 @opindex mmult
12884 Enables the multiplication and multiply-accumulate instructions.
12885
12886 @item -mno-opts
12887 @opindex mno-opts
12888 Disables all the optional instructions enabled by @code{-mall-opts}.
12889
12890 @item -mrepeat
12891 @opindex mrepeat
12892 Enables the @code{repeat} and @code{erepeat} instructions, used for
12893 low-overhead looping.
12894
12895 @item -ms
12896 @opindex ms
12897 Causes all variables to default to the @code{.tiny} section.  Note
12898 that there is a 65536 byte limit to this section.  Accesses to these
12899 variables use the @code{%gp} base register.
12900
12901 @item -msatur
12902 @opindex msatur
12903 Enables the saturation instructions.  Note that the compiler does not
12904 currently generate these itself, but this option is included for
12905 compatibility with other tools, like @code{as}.
12906
12907 @item -msdram
12908 @opindex msdram
12909 Link the SDRAM-based runtime instead of the default ROM-based runtime.
12910
12911 @item -msim
12912 @opindex msim
12913 Link the simulator runtime libraries.
12914
12915 @item -msimnovec
12916 @opindex msimnovec
12917 Link the simulator runtime libraries, excluding built-in support
12918 for reset and exception vectors and tables.
12919
12920 @item -mtf
12921 @opindex mtf
12922 Causes all functions to default to the @code{.far} section.  Without
12923 this option, functions default to the @code{.near} section.
12924
12925 @item -mtiny=@var{n}
12926 @opindex mtiny=
12927 Variables that are @var{n} bytes or smaller will be allocated to the
12928 @code{.tiny} section.  These variables use the @code{$gp} base
12929 register.  The default for this option is 4, but note that there's a
12930 65536 byte limit to the @code{.tiny} section.
12931
12932 @end table
12933
12934 @node MIPS Options
12935 @subsection MIPS Options
12936 @cindex MIPS options
12937
12938 @table @gcctabopt
12939
12940 @item -EB
12941 @opindex EB
12942 Generate big-endian code.
12943
12944 @item -EL
12945 @opindex EL
12946 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
12947 configurations.
12948
12949 @item -march=@var{arch}
12950 @opindex march
12951 Generate code that will run on @var{arch}, which can be the name of a
12952 generic MIPS ISA, or the name of a particular processor.
12953 The ISA names are:
12954 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
12955 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
12956 The processor names are:
12957 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
12958 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
12959 @samp{5kc}, @samp{5kf},
12960 @samp{20kc},
12961 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
12962 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
12963 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
12964 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
12965 @samp{loongson2e}, @samp{loongson2f},
12966 @samp{m4k},
12967 @samp{octeon},
12968 @samp{orion},
12969 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
12970 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
12971 @samp{rm7000}, @samp{rm9000},
12972 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
12973 @samp{sb1},
12974 @samp{sr71000},
12975 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
12976 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
12977 and @samp{xlr}.
12978 The special value @samp{from-abi} selects the
12979 most compatible architecture for the selected ABI (that is,
12980 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
12981
12982 Native Linux/GNU toolchains also support the value @samp{native},
12983 which selects the best architecture option for the host processor.
12984 @option{-march=native} has no effect if GCC does not recognize
12985 the processor.
12986
12987 In processor names, a final @samp{000} can be abbreviated as @samp{k}
12988 (for example, @samp{-march=r2k}).  Prefixes are optional, and
12989 @samp{vr} may be written @samp{r}.
12990
12991 Names of the form @samp{@var{n}f2_1} refer to processors with
12992 FPUs clocked at half the rate of the core, names of the form
12993 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
12994 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
12995 processors with FPUs clocked a ratio of 3:2 with respect to the core.
12996 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
12997 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
12998 accepted as synonyms for @samp{@var{n}f1_1}.
12999
13000 GCC defines two macros based on the value of this option.  The first
13001 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
13002 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
13003 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
13004 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
13005 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
13006
13007 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
13008 above.  In other words, it will have the full prefix and will not
13009 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
13010 the macro names the resolved architecture (either @samp{"mips1"} or
13011 @samp{"mips3"}).  It names the default architecture when no
13012 @option{-march} option is given.
13013
13014 @item -mtune=@var{arch}
13015 @opindex mtune
13016 Optimize for @var{arch}.  Among other things, this option controls
13017 the way instructions are scheduled, and the perceived cost of arithmetic
13018 operations.  The list of @var{arch} values is the same as for
13019 @option{-march}.
13020
13021 When this option is not used, GCC will optimize for the processor
13022 specified by @option{-march}.  By using @option{-march} and
13023 @option{-mtune} together, it is possible to generate code that will
13024 run on a family of processors, but optimize the code for one
13025 particular member of that family.
13026
13027 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
13028 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
13029 @samp{-march} ones described above.
13030
13031 @item -mips1
13032 @opindex mips1
13033 Equivalent to @samp{-march=mips1}.
13034
13035 @item -mips2
13036 @opindex mips2
13037 Equivalent to @samp{-march=mips2}.
13038
13039 @item -mips3
13040 @opindex mips3
13041 Equivalent to @samp{-march=mips3}.
13042
13043 @item -mips4
13044 @opindex mips4
13045 Equivalent to @samp{-march=mips4}.
13046
13047 @item -mips32
13048 @opindex mips32
13049 Equivalent to @samp{-march=mips32}.
13050
13051 @item -mips32r2
13052 @opindex mips32r2
13053 Equivalent to @samp{-march=mips32r2}.
13054
13055 @item -mips64
13056 @opindex mips64
13057 Equivalent to @samp{-march=mips64}.
13058
13059 @item -mips64r2
13060 @opindex mips64r2
13061 Equivalent to @samp{-march=mips64r2}.
13062
13063 @item -mips16
13064 @itemx -mno-mips16
13065 @opindex mips16
13066 @opindex mno-mips16
13067 Generate (do not generate) MIPS16 code.  If GCC is targetting a
13068 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
13069
13070 MIPS16 code generation can also be controlled on a per-function basis
13071 by means of @code{mips16} and @code{nomips16} attributes.
13072 @xref{Function Attributes}, for more information.
13073
13074 @item -mflip-mips16
13075 @opindex mflip-mips16
13076 Generate MIPS16 code on alternating functions.  This option is provided
13077 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
13078 not intended for ordinary use in compiling user code.
13079
13080 @item -minterlink-mips16
13081 @itemx -mno-interlink-mips16
13082 @opindex minterlink-mips16
13083 @opindex mno-interlink-mips16
13084 Require (do not require) that non-MIPS16 code be link-compatible with
13085 MIPS16 code.
13086
13087 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
13088 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
13089 therefore disables direct jumps unless GCC knows that the target of the
13090 jump is not MIPS16.
13091
13092 @item -mabi=32
13093 @itemx -mabi=o64
13094 @itemx -mabi=n32
13095 @itemx -mabi=64
13096 @itemx -mabi=eabi
13097 @opindex mabi=32
13098 @opindex mabi=o64
13099 @opindex mabi=n32
13100 @opindex mabi=64
13101 @opindex mabi=eabi
13102 Generate code for the given ABI@.
13103
13104 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
13105 generates 64-bit code when you select a 64-bit architecture, but you
13106 can use @option{-mgp32} to get 32-bit code instead.
13107
13108 For information about the O64 ABI, see
13109 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
13110
13111 GCC supports a variant of the o32 ABI in which floating-point registers
13112 are 64 rather than 32 bits wide.  You can select this combination with
13113 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
13114 and @samp{mfhc1} instructions and is therefore only supported for
13115 MIPS32R2 processors.
13116
13117 The register assignments for arguments and return values remain the
13118 same, but each scalar value is passed in a single 64-bit register
13119 rather than a pair of 32-bit registers.  For example, scalar
13120 floating-point values are returned in @samp{$f0} only, not a
13121 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
13122 remains the same, but all 64 bits are saved.
13123
13124 @item -mabicalls
13125 @itemx -mno-abicalls
13126 @opindex mabicalls
13127 @opindex mno-abicalls
13128 Generate (do not generate) code that is suitable for SVR4-style
13129 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
13130 systems.
13131
13132 @item -mshared
13133 @itemx -mno-shared
13134 Generate (do not generate) code that is fully position-independent,
13135 and that can therefore be linked into shared libraries.  This option
13136 only affects @option{-mabicalls}.
13137
13138 All @option{-mabicalls} code has traditionally been position-independent,
13139 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
13140 as an extension, the GNU toolchain allows executables to use absolute
13141 accesses for locally-binding symbols.  It can also use shorter GP
13142 initialization sequences and generate direct calls to locally-defined
13143 functions.  This mode is selected by @option{-mno-shared}.
13144
13145 @option{-mno-shared} depends on binutils 2.16 or higher and generates
13146 objects that can only be linked by the GNU linker.  However, the option
13147 does not affect the ABI of the final executable; it only affects the ABI
13148 of relocatable objects.  Using @option{-mno-shared} will generally make
13149 executables both smaller and quicker.
13150
13151 @option{-mshared} is the default.
13152
13153 @item -mplt
13154 @itemx -mno-plt
13155 @opindex mplt
13156 @opindex mno-plt
13157 Assume (do not assume) that the static and dynamic linkers
13158 support PLTs and copy relocations.  This option only affects
13159 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
13160 has no effect without @samp{-msym32}.
13161
13162 You can make @option{-mplt} the default by configuring
13163 GCC with @option{--with-mips-plt}.  The default is
13164 @option{-mno-plt} otherwise.
13165
13166 @item -mxgot
13167 @itemx -mno-xgot
13168 @opindex mxgot
13169 @opindex mno-xgot
13170 Lift (do not lift) the usual restrictions on the size of the global
13171 offset table.
13172
13173 GCC normally uses a single instruction to load values from the GOT@.
13174 While this is relatively efficient, it will only work if the GOT
13175 is smaller than about 64k.  Anything larger will cause the linker
13176 to report an error such as:
13177
13178 @cindex relocation truncated to fit (MIPS)
13179 @smallexample
13180 relocation truncated to fit: R_MIPS_GOT16 foobar
13181 @end smallexample
13182
13183 If this happens, you should recompile your code with @option{-mxgot}.
13184 It should then work with very large GOTs, although it will also be
13185 less efficient, since it will take three instructions to fetch the
13186 value of a global symbol.
13187
13188 Note that some linkers can create multiple GOTs.  If you have such a
13189 linker, you should only need to use @option{-mxgot} when a single object
13190 file accesses more than 64k's worth of GOT entries.  Very few do.
13191
13192 These options have no effect unless GCC is generating position
13193 independent code.
13194
13195 @item -mgp32
13196 @opindex mgp32
13197 Assume that general-purpose registers are 32 bits wide.
13198
13199 @item -mgp64
13200 @opindex mgp64
13201 Assume that general-purpose registers are 64 bits wide.
13202
13203 @item -mfp32
13204 @opindex mfp32
13205 Assume that floating-point registers are 32 bits wide.
13206
13207 @item -mfp64
13208 @opindex mfp64
13209 Assume that floating-point registers are 64 bits wide.
13210
13211 @item -mhard-float
13212 @opindex mhard-float
13213 Use floating-point coprocessor instructions.
13214
13215 @item -msoft-float
13216 @opindex msoft-float
13217 Do not use floating-point coprocessor instructions.  Implement
13218 floating-point calculations using library calls instead.
13219
13220 @item -msingle-float
13221 @opindex msingle-float
13222 Assume that the floating-point coprocessor only supports single-precision
13223 operations.
13224
13225 @item -mdouble-float
13226 @opindex mdouble-float
13227 Assume that the floating-point coprocessor supports double-precision
13228 operations.  This is the default.
13229
13230 @item -mllsc
13231 @itemx -mno-llsc
13232 @opindex mllsc
13233 @opindex mno-llsc
13234 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
13235 implement atomic memory built-in functions.  When neither option is
13236 specified, GCC will use the instructions if the target architecture
13237 supports them.
13238
13239 @option{-mllsc} is useful if the runtime environment can emulate the
13240 instructions and @option{-mno-llsc} can be useful when compiling for
13241 nonstandard ISAs.  You can make either option the default by
13242 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
13243 respectively.  @option{--with-llsc} is the default for some
13244 configurations; see the installation documentation for details.
13245
13246 @item -mdsp
13247 @itemx -mno-dsp
13248 @opindex mdsp
13249 @opindex mno-dsp
13250 Use (do not use) revision 1 of the MIPS DSP ASE@.
13251 @xref{MIPS DSP Built-in Functions}.  This option defines the
13252 preprocessor macro @samp{__mips_dsp}.  It also defines
13253 @samp{__mips_dsp_rev} to 1.
13254
13255 @item -mdspr2
13256 @itemx -mno-dspr2
13257 @opindex mdspr2
13258 @opindex mno-dspr2
13259 Use (do not use) revision 2 of the MIPS DSP ASE@.
13260 @xref{MIPS DSP Built-in Functions}.  This option defines the
13261 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
13262 It also defines @samp{__mips_dsp_rev} to 2.
13263
13264 @item -msmartmips
13265 @itemx -mno-smartmips
13266 @opindex msmartmips
13267 @opindex mno-smartmips
13268 Use (do not use) the MIPS SmartMIPS ASE.
13269
13270 @item -mpaired-single
13271 @itemx -mno-paired-single
13272 @opindex mpaired-single
13273 @opindex mno-paired-single
13274 Use (do not use) paired-single floating-point instructions.
13275 @xref{MIPS Paired-Single Support}.  This option requires
13276 hardware floating-point support to be enabled.
13277
13278 @item -mdmx
13279 @itemx -mno-mdmx
13280 @opindex mdmx
13281 @opindex mno-mdmx
13282 Use (do not use) MIPS Digital Media Extension instructions.
13283 This option can only be used when generating 64-bit code and requires
13284 hardware floating-point support to be enabled.
13285
13286 @item -mips3d
13287 @itemx -mno-mips3d
13288 @opindex mips3d
13289 @opindex mno-mips3d
13290 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
13291 The option @option{-mips3d} implies @option{-mpaired-single}.
13292
13293 @item -mmt
13294 @itemx -mno-mt
13295 @opindex mmt
13296 @opindex mno-mt
13297 Use (do not use) MT Multithreading instructions.
13298
13299 @item -mlong64
13300 @opindex mlong64
13301 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
13302 an explanation of the default and the way that the pointer size is
13303 determined.
13304
13305 @item -mlong32
13306 @opindex mlong32
13307 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
13308
13309 The default size of @code{int}s, @code{long}s and pointers depends on
13310 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
13311 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
13312 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
13313 or the same size as integer registers, whichever is smaller.
13314
13315 @item -msym32
13316 @itemx -mno-sym32
13317 @opindex msym32
13318 @opindex mno-sym32
13319 Assume (do not assume) that all symbols have 32-bit values, regardless
13320 of the selected ABI@.  This option is useful in combination with
13321 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
13322 to generate shorter and faster references to symbolic addresses.
13323
13324 @item -G @var{num}
13325 @opindex G
13326 Put definitions of externally-visible data in a small data section
13327 if that data is no bigger than @var{num} bytes.  GCC can then access
13328 the data more efficiently; see @option{-mgpopt} for details.
13329
13330 The default @option{-G} option depends on the configuration.
13331
13332 @item -mlocal-sdata
13333 @itemx -mno-local-sdata
13334 @opindex mlocal-sdata
13335 @opindex mno-local-sdata
13336 Extend (do not extend) the @option{-G} behavior to local data too,
13337 such as to static variables in C@.  @option{-mlocal-sdata} is the
13338 default for all configurations.
13339
13340 If the linker complains that an application is using too much small data,
13341 you might want to try rebuilding the less performance-critical parts with
13342 @option{-mno-local-sdata}.  You might also want to build large
13343 libraries with @option{-mno-local-sdata}, so that the libraries leave
13344 more room for the main program.
13345
13346 @item -mextern-sdata
13347 @itemx -mno-extern-sdata
13348 @opindex mextern-sdata
13349 @opindex mno-extern-sdata
13350 Assume (do not assume) that externally-defined data will be in
13351 a small data section if that data is within the @option{-G} limit.
13352 @option{-mextern-sdata} is the default for all configurations.
13353
13354 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
13355 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
13356 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
13357 is placed in a small data section.  If @var{Var} is defined by another
13358 module, you must either compile that module with a high-enough
13359 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
13360 definition.  If @var{Var} is common, you must link the application
13361 with a high-enough @option{-G} setting.
13362
13363 The easiest way of satisfying these restrictions is to compile
13364 and link every module with the same @option{-G} option.  However,
13365 you may wish to build a library that supports several different
13366 small data limits.  You can do this by compiling the library with
13367 the highest supported @option{-G} setting and additionally using
13368 @option{-mno-extern-sdata} to stop the library from making assumptions
13369 about externally-defined data.
13370
13371 @item -mgpopt
13372 @itemx -mno-gpopt
13373 @opindex mgpopt
13374 @opindex mno-gpopt
13375 Use (do not use) GP-relative accesses for symbols that are known to be
13376 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
13377 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
13378 configurations.
13379
13380 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
13381 might not hold the value of @code{_gp}.  For example, if the code is
13382 part of a library that might be used in a boot monitor, programs that
13383 call boot monitor routines will pass an unknown value in @code{$gp}.
13384 (In such situations, the boot monitor itself would usually be compiled
13385 with @option{-G0}.)
13386
13387 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
13388 @option{-mno-extern-sdata}.
13389
13390 @item -membedded-data
13391 @itemx -mno-embedded-data
13392 @opindex membedded-data
13393 @opindex mno-embedded-data
13394 Allocate variables to the read-only data section first if possible, then
13395 next in the small data section if possible, otherwise in data.  This gives
13396 slightly slower code than the default, but reduces the amount of RAM required
13397 when executing, and thus may be preferred for some embedded systems.
13398
13399 @item -muninit-const-in-rodata
13400 @itemx -mno-uninit-const-in-rodata
13401 @opindex muninit-const-in-rodata
13402 @opindex mno-uninit-const-in-rodata
13403 Put uninitialized @code{const} variables in the read-only data section.
13404 This option is only meaningful in conjunction with @option{-membedded-data}.
13405
13406 @item -mcode-readable=@var{setting}
13407 @opindex mcode-readable
13408 Specify whether GCC may generate code that reads from executable sections.
13409 There are three possible settings:
13410
13411 @table @gcctabopt
13412 @item -mcode-readable=yes
13413 Instructions may freely access executable sections.  This is the
13414 default setting.
13415
13416 @item -mcode-readable=pcrel
13417 MIPS16 PC-relative load instructions can access executable sections,
13418 but other instructions must not do so.  This option is useful on 4KSc
13419 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
13420 It is also useful on processors that can be configured to have a dual
13421 instruction/data SRAM interface and that, like the M4K, automatically
13422 redirect PC-relative loads to the instruction RAM.
13423
13424 @item -mcode-readable=no
13425 Instructions must not access executable sections.  This option can be
13426 useful on targets that are configured to have a dual instruction/data
13427 SRAM interface but that (unlike the M4K) do not automatically redirect
13428 PC-relative loads to the instruction RAM.
13429 @end table
13430
13431 @item -msplit-addresses
13432 @itemx -mno-split-addresses
13433 @opindex msplit-addresses
13434 @opindex mno-split-addresses
13435 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
13436 relocation operators.  This option has been superseded by
13437 @option{-mexplicit-relocs} but is retained for backwards compatibility.
13438
13439 @item -mexplicit-relocs
13440 @itemx -mno-explicit-relocs
13441 @opindex mexplicit-relocs
13442 @opindex mno-explicit-relocs
13443 Use (do not use) assembler relocation operators when dealing with symbolic
13444 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
13445 is to use assembler macros instead.
13446
13447 @option{-mexplicit-relocs} is the default if GCC was configured
13448 to use an assembler that supports relocation operators.
13449
13450 @item -mcheck-zero-division
13451 @itemx -mno-check-zero-division
13452 @opindex mcheck-zero-division
13453 @opindex mno-check-zero-division
13454 Trap (do not trap) on integer division by zero.
13455
13456 The default is @option{-mcheck-zero-division}.
13457
13458 @item -mdivide-traps
13459 @itemx -mdivide-breaks
13460 @opindex mdivide-traps
13461 @opindex mdivide-breaks
13462 MIPS systems check for division by zero by generating either a
13463 conditional trap or a break instruction.  Using traps results in
13464 smaller code, but is only supported on MIPS II and later.  Also, some
13465 versions of the Linux kernel have a bug that prevents trap from
13466 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
13467 allow conditional traps on architectures that support them and
13468 @option{-mdivide-breaks} to force the use of breaks.
13469
13470 The default is usually @option{-mdivide-traps}, but this can be
13471 overridden at configure time using @option{--with-divide=breaks}.
13472 Divide-by-zero checks can be completely disabled using
13473 @option{-mno-check-zero-division}.
13474
13475 @item -mmemcpy
13476 @itemx -mno-memcpy
13477 @opindex mmemcpy
13478 @opindex mno-memcpy
13479 Force (do not force) the use of @code{memcpy()} for non-trivial block
13480 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
13481 most constant-sized copies.
13482
13483 @item -mlong-calls
13484 @itemx -mno-long-calls
13485 @opindex mlong-calls
13486 @opindex mno-long-calls
13487 Disable (do not disable) use of the @code{jal} instruction.  Calling
13488 functions using @code{jal} is more efficient but requires the caller
13489 and callee to be in the same 256 megabyte segment.
13490
13491 This option has no effect on abicalls code.  The default is
13492 @option{-mno-long-calls}.
13493
13494 @item -mmad
13495 @itemx -mno-mad
13496 @opindex mmad
13497 @opindex mno-mad
13498 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
13499 instructions, as provided by the R4650 ISA@.
13500
13501 @item -mfused-madd
13502 @itemx -mno-fused-madd
13503 @opindex mfused-madd
13504 @opindex mno-fused-madd
13505 Enable (disable) use of the floating point multiply-accumulate
13506 instructions, when they are available.  The default is
13507 @option{-mfused-madd}.
13508
13509 When multiply-accumulate instructions are used, the intermediate
13510 product is calculated to infinite precision and is not subject to
13511 the FCSR Flush to Zero bit.  This may be undesirable in some
13512 circumstances.
13513
13514 @item -nocpp
13515 @opindex nocpp
13516 Tell the MIPS assembler to not run its preprocessor over user
13517 assembler files (with a @samp{.s} suffix) when assembling them.
13518
13519 @item -mfix-r4000
13520 @itemx -mno-fix-r4000
13521 @opindex mfix-r4000
13522 @opindex mno-fix-r4000
13523 Work around certain R4000 CPU errata:
13524 @itemize @minus
13525 @item
13526 A double-word or a variable shift may give an incorrect result if executed
13527 immediately after starting an integer division.
13528 @item
13529 A double-word or a variable shift may give an incorrect result if executed
13530 while an integer multiplication is in progress.
13531 @item
13532 An integer division may give an incorrect result if started in a delay slot
13533 of a taken branch or a jump.
13534 @end itemize
13535
13536 @item -mfix-r4400
13537 @itemx -mno-fix-r4400
13538 @opindex mfix-r4400
13539 @opindex mno-fix-r4400
13540 Work around certain R4400 CPU errata:
13541 @itemize @minus
13542 @item
13543 A double-word or a variable shift may give an incorrect result if executed
13544 immediately after starting an integer division.
13545 @end itemize
13546
13547 @item -mfix-r10000
13548 @itemx -mno-fix-r10000
13549 @opindex mfix-r10000
13550 @opindex mno-fix-r10000
13551 Work around certain R10000 errata:
13552 @itemize @minus
13553 @item
13554 @code{ll}/@code{sc} sequences may not behave atomically on revisions
13555 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
13556 @end itemize
13557
13558 This option can only be used if the target architecture supports
13559 branch-likely instructions.  @option{-mfix-r10000} is the default when
13560 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
13561 otherwise.
13562
13563 @item -mfix-vr4120
13564 @itemx -mno-fix-vr4120
13565 @opindex mfix-vr4120
13566 Work around certain VR4120 errata:
13567 @itemize @minus
13568 @item
13569 @code{dmultu} does not always produce the correct result.
13570 @item
13571 @code{div} and @code{ddiv} do not always produce the correct result if one
13572 of the operands is negative.
13573 @end itemize
13574 The workarounds for the division errata rely on special functions in
13575 @file{libgcc.a}.  At present, these functions are only provided by
13576 the @code{mips64vr*-elf} configurations.
13577
13578 Other VR4120 errata require a nop to be inserted between certain pairs of
13579 instructions.  These errata are handled by the assembler, not by GCC itself.
13580
13581 @item -mfix-vr4130
13582 @opindex mfix-vr4130
13583 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
13584 workarounds are implemented by the assembler rather than by GCC,
13585 although GCC will avoid using @code{mflo} and @code{mfhi} if the
13586 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
13587 instructions are available instead.
13588
13589 @item -mfix-sb1
13590 @itemx -mno-fix-sb1
13591 @opindex mfix-sb1
13592 Work around certain SB-1 CPU core errata.
13593 (This flag currently works around the SB-1 revision 2
13594 ``F1'' and ``F2'' floating point errata.)
13595
13596 @item -mr10k-cache-barrier=@var{setting}
13597 @opindex mr10k-cache-barrier
13598 Specify whether GCC should insert cache barriers to avoid the
13599 side-effects of speculation on R10K processors.
13600
13601 In common with many processors, the R10K tries to predict the outcome
13602 of a conditional branch and speculatively executes instructions from
13603 the ``taken'' branch.  It later aborts these instructions if the
13604 predicted outcome was wrong.  However, on the R10K, even aborted
13605 instructions can have side effects.
13606
13607 This problem only affects kernel stores and, depending on the system,
13608 kernel loads.  As an example, a speculatively-executed store may load
13609 the target memory into cache and mark the cache line as dirty, even if
13610 the store itself is later aborted.  If a DMA operation writes to the
13611 same area of memory before the ``dirty'' line is flushed, the cached
13612 data will overwrite the DMA-ed data.  See the R10K processor manual
13613 for a full description, including other potential problems.
13614
13615 One workaround is to insert cache barrier instructions before every memory
13616 access that might be speculatively executed and that might have side
13617 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
13618 controls GCC's implementation of this workaround.  It assumes that
13619 aborted accesses to any byte in the following regions will not have
13620 side effects:
13621
13622 @enumerate
13623 @item
13624 the memory occupied by the current function's stack frame;
13625
13626 @item
13627 the memory occupied by an incoming stack argument;
13628
13629 @item
13630 the memory occupied by an object with a link-time-constant address.
13631 @end enumerate
13632
13633 It is the kernel's responsibility to ensure that speculative
13634 accesses to these regions are indeed safe.
13635
13636 If the input program contains a function declaration such as:
13637
13638 @smallexample
13639 void foo (void);
13640 @end smallexample
13641
13642 then the implementation of @code{foo} must allow @code{j foo} and
13643 @code{jal foo} to be executed speculatively.  GCC honors this
13644 restriction for functions it compiles itself.  It expects non-GCC
13645 functions (such as hand-written assembly code) to do the same.
13646
13647 The option has three forms:
13648
13649 @table @gcctabopt
13650 @item -mr10k-cache-barrier=load-store
13651 Insert a cache barrier before a load or store that might be
13652 speculatively executed and that might have side effects even
13653 if aborted.
13654
13655 @item -mr10k-cache-barrier=store
13656 Insert a cache barrier before a store that might be speculatively
13657 executed and that might have side effects even if aborted.
13658
13659 @item -mr10k-cache-barrier=none
13660 Disable the insertion of cache barriers.  This is the default setting.
13661 @end table
13662
13663 @item -mflush-func=@var{func}
13664 @itemx -mno-flush-func
13665 @opindex mflush-func
13666 Specifies the function to call to flush the I and D caches, or to not
13667 call any such function.  If called, the function must take the same
13668 arguments as the common @code{_flush_func()}, that is, the address of the
13669 memory range for which the cache is being flushed, the size of the
13670 memory range, and the number 3 (to flush both caches).  The default
13671 depends on the target GCC was configured for, but commonly is either
13672 @samp{_flush_func} or @samp{__cpu_flush}.
13673
13674 @item mbranch-cost=@var{num}
13675 @opindex mbranch-cost
13676 Set the cost of branches to roughly @var{num} ``simple'' instructions.
13677 This cost is only a heuristic and is not guaranteed to produce
13678 consistent results across releases.  A zero cost redundantly selects
13679 the default, which is based on the @option{-mtune} setting.
13680
13681 @item -mbranch-likely
13682 @itemx -mno-branch-likely
13683 @opindex mbranch-likely
13684 @opindex mno-branch-likely
13685 Enable or disable use of Branch Likely instructions, regardless of the
13686 default for the selected architecture.  By default, Branch Likely
13687 instructions may be generated if they are supported by the selected
13688 architecture.  An exception is for the MIPS32 and MIPS64 architectures
13689 and processors which implement those architectures; for those, Branch
13690 Likely instructions will not be generated by default because the MIPS32
13691 and MIPS64 architectures specifically deprecate their use.
13692
13693 @item -mfp-exceptions
13694 @itemx -mno-fp-exceptions
13695 @opindex mfp-exceptions
13696 Specifies whether FP exceptions are enabled.  This affects how we schedule
13697 FP instructions for some processors.  The default is that FP exceptions are
13698 enabled.
13699
13700 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
13701 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
13702 FP pipe.
13703
13704 @item -mvr4130-align
13705 @itemx -mno-vr4130-align
13706 @opindex mvr4130-align
13707 The VR4130 pipeline is two-way superscalar, but can only issue two
13708 instructions together if the first one is 8-byte aligned.  When this
13709 option is enabled, GCC will align pairs of instructions that it
13710 thinks should execute in parallel.
13711
13712 This option only has an effect when optimizing for the VR4130.
13713 It normally makes code faster, but at the expense of making it bigger.
13714 It is enabled by default at optimization level @option{-O3}.
13715 @end table
13716
13717 @node MMIX Options
13718 @subsection MMIX Options
13719 @cindex MMIX Options
13720
13721 These options are defined for the MMIX:
13722
13723 @table @gcctabopt
13724 @item -mlibfuncs
13725 @itemx -mno-libfuncs
13726 @opindex mlibfuncs
13727 @opindex mno-libfuncs
13728 Specify that intrinsic library functions are being compiled, passing all
13729 values in registers, no matter the size.
13730
13731 @item -mepsilon
13732 @itemx -mno-epsilon
13733 @opindex mepsilon
13734 @opindex mno-epsilon
13735 Generate floating-point comparison instructions that compare with respect
13736 to the @code{rE} epsilon register.
13737
13738 @item -mabi=mmixware
13739 @itemx -mabi=gnu
13740 @opindex mabi=mmixware
13741 @opindex mabi=gnu
13742 Generate code that passes function parameters and return values that (in
13743 the called function) are seen as registers @code{$0} and up, as opposed to
13744 the GNU ABI which uses global registers @code{$231} and up.
13745
13746 @item -mzero-extend
13747 @itemx -mno-zero-extend
13748 @opindex mzero-extend
13749 @opindex mno-zero-extend
13750 When reading data from memory in sizes shorter than 64 bits, use (do not
13751 use) zero-extending load instructions by default, rather than
13752 sign-extending ones.
13753
13754 @item -mknuthdiv
13755 @itemx -mno-knuthdiv
13756 @opindex mknuthdiv
13757 @opindex mno-knuthdiv
13758 Make the result of a division yielding a remainder have the same sign as
13759 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
13760 remainder follows the sign of the dividend.  Both methods are
13761 arithmetically valid, the latter being almost exclusively used.
13762
13763 @item -mtoplevel-symbols
13764 @itemx -mno-toplevel-symbols
13765 @opindex mtoplevel-symbols
13766 @opindex mno-toplevel-symbols
13767 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
13768 code can be used with the @code{PREFIX} assembly directive.
13769
13770 @item -melf
13771 @opindex melf
13772 Generate an executable in the ELF format, rather than the default
13773 @samp{mmo} format used by the @command{mmix} simulator.
13774
13775 @item -mbranch-predict
13776 @itemx -mno-branch-predict
13777 @opindex mbranch-predict
13778 @opindex mno-branch-predict
13779 Use (do not use) the probable-branch instructions, when static branch
13780 prediction indicates a probable branch.
13781
13782 @item -mbase-addresses
13783 @itemx -mno-base-addresses
13784 @opindex mbase-addresses
13785 @opindex mno-base-addresses
13786 Generate (do not generate) code that uses @emph{base addresses}.  Using a
13787 base address automatically generates a request (handled by the assembler
13788 and the linker) for a constant to be set up in a global register.  The
13789 register is used for one or more base address requests within the range 0
13790 to 255 from the value held in the register.  The generally leads to short
13791 and fast code, but the number of different data items that can be
13792 addressed is limited.  This means that a program that uses lots of static
13793 data may require @option{-mno-base-addresses}.
13794
13795 @item -msingle-exit
13796 @itemx -mno-single-exit
13797 @opindex msingle-exit
13798 @opindex mno-single-exit
13799 Force (do not force) generated code to have a single exit point in each
13800 function.
13801 @end table
13802
13803 @node MN10300 Options
13804 @subsection MN10300 Options
13805 @cindex MN10300 options
13806
13807 These @option{-m} options are defined for Matsushita MN10300 architectures:
13808
13809 @table @gcctabopt
13810 @item -mmult-bug
13811 @opindex mmult-bug
13812 Generate code to avoid bugs in the multiply instructions for the MN10300
13813 processors.  This is the default.
13814
13815 @item -mno-mult-bug
13816 @opindex mno-mult-bug
13817 Do not generate code to avoid bugs in the multiply instructions for the
13818 MN10300 processors.
13819
13820 @item -mam33
13821 @opindex mam33
13822 Generate code which uses features specific to the AM33 processor.
13823
13824 @item -mno-am33
13825 @opindex mno-am33
13826 Do not generate code which uses features specific to the AM33 processor.  This
13827 is the default.
13828
13829 @item -mreturn-pointer-on-d0
13830 @opindex mreturn-pointer-on-d0
13831 When generating a function which returns a pointer, return the pointer
13832 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
13833 only in a0, and attempts to call such functions without a prototype
13834 would result in errors.  Note that this option is on by default; use
13835 @option{-mno-return-pointer-on-d0} to disable it.
13836
13837 @item -mno-crt0
13838 @opindex mno-crt0
13839 Do not link in the C run-time initialization object file.
13840
13841 @item -mrelax
13842 @opindex mrelax
13843 Indicate to the linker that it should perform a relaxation optimization pass
13844 to shorten branches, calls and absolute memory addresses.  This option only
13845 has an effect when used on the command line for the final link step.
13846
13847 This option makes symbolic debugging impossible.
13848 @end table
13849
13850 @node PDP-11 Options
13851 @subsection PDP-11 Options
13852 @cindex PDP-11 Options
13853
13854 These options are defined for the PDP-11:
13855
13856 @table @gcctabopt
13857 @item -mfpu
13858 @opindex mfpu
13859 Use hardware FPP floating point.  This is the default.  (FIS floating
13860 point on the PDP-11/40 is not supported.)
13861
13862 @item -msoft-float
13863 @opindex msoft-float
13864 Do not use hardware floating point.
13865
13866 @item -mac0
13867 @opindex mac0
13868 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
13869
13870 @item -mno-ac0
13871 @opindex mno-ac0
13872 Return floating-point results in memory.  This is the default.
13873
13874 @item -m40
13875 @opindex m40
13876 Generate code for a PDP-11/40.
13877
13878 @item -m45
13879 @opindex m45
13880 Generate code for a PDP-11/45.  This is the default.
13881
13882 @item -m10
13883 @opindex m10
13884 Generate code for a PDP-11/10.
13885
13886 @item -mbcopy-builtin
13887 @opindex mbcopy-builtin
13888 Use inline @code{movmemhi} patterns for copying memory.  This is the
13889 default.
13890
13891 @item -mbcopy
13892 @opindex mbcopy
13893 Do not use inline @code{movmemhi} patterns for copying memory.
13894
13895 @item -mint16
13896 @itemx -mno-int32
13897 @opindex mint16
13898 @opindex mno-int32
13899 Use 16-bit @code{int}.  This is the default.
13900
13901 @item -mint32
13902 @itemx -mno-int16
13903 @opindex mint32
13904 @opindex mno-int16
13905 Use 32-bit @code{int}.
13906
13907 @item -mfloat64
13908 @itemx -mno-float32
13909 @opindex mfloat64
13910 @opindex mno-float32
13911 Use 64-bit @code{float}.  This is the default.
13912
13913 @item -mfloat32
13914 @itemx -mno-float64
13915 @opindex mfloat32
13916 @opindex mno-float64
13917 Use 32-bit @code{float}.
13918
13919 @item -mabshi
13920 @opindex mabshi
13921 Use @code{abshi2} pattern.  This is the default.
13922
13923 @item -mno-abshi
13924 @opindex mno-abshi
13925 Do not use @code{abshi2} pattern.
13926
13927 @item -mbranch-expensive
13928 @opindex mbranch-expensive
13929 Pretend that branches are expensive.  This is for experimenting with
13930 code generation only.
13931
13932 @item -mbranch-cheap
13933 @opindex mbranch-cheap
13934 Do not pretend that branches are expensive.  This is the default.
13935
13936 @item -msplit
13937 @opindex msplit
13938 Generate code for a system with split I&D@.
13939
13940 @item -mno-split
13941 @opindex mno-split
13942 Generate code for a system without split I&D@.  This is the default.
13943
13944 @item -munix-asm
13945 @opindex munix-asm
13946 Use Unix assembler syntax.  This is the default when configured for
13947 @samp{pdp11-*-bsd}.
13948
13949 @item -mdec-asm
13950 @opindex mdec-asm
13951 Use DEC assembler syntax.  This is the default when configured for any
13952 PDP-11 target other than @samp{pdp11-*-bsd}.
13953 @end table
13954
13955 @node picoChip Options
13956 @subsection picoChip Options
13957 @cindex picoChip options
13958
13959 These @samp{-m} options are defined for picoChip implementations:
13960
13961 @table @gcctabopt
13962
13963 @item -mae=@var{ae_type}
13964 @opindex mcpu
13965 Set the instruction set, register set, and instruction scheduling
13966 parameters for array element type @var{ae_type}.  Supported values
13967 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
13968
13969 @option{-mae=ANY} selects a completely generic AE type.  Code
13970 generated with this option will run on any of the other AE types.  The
13971 code will not be as efficient as it would be if compiled for a specific
13972 AE type, and some types of operation (e.g., multiplication) will not
13973 work properly on all types of AE.
13974
13975 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
13976 for compiled code, and is the default.
13977
13978 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
13979 option may suffer from poor performance of byte (char) manipulation,
13980 since the DSP AE does not provide hardware support for byte load/stores.
13981
13982 @item -msymbol-as-address
13983 Enable the compiler to directly use a symbol name as an address in a
13984 load/store instruction, without first loading it into a
13985 register.  Typically, the use of this option will generate larger
13986 programs, which run faster than when the option isn't used.  However, the
13987 results vary from program to program, so it is left as a user option,
13988 rather than being permanently enabled.
13989
13990 @item -mno-inefficient-warnings
13991 Disables warnings about the generation of inefficient code.  These
13992 warnings can be generated, for example, when compiling code which
13993 performs byte-level memory operations on the MAC AE type.  The MAC AE has
13994 no hardware support for byte-level memory operations, so all byte
13995 load/stores must be synthesized from word load/store operations.  This is
13996 inefficient and a warning will be generated indicating to the programmer
13997 that they should rewrite the code to avoid byte operations, or to target
13998 an AE type which has the necessary hardware support.  This option enables
13999 the warning to be turned off.
14000
14001 @end table
14002
14003 @node PowerPC Options
14004 @subsection PowerPC Options
14005 @cindex PowerPC options
14006
14007 These are listed under @xref{RS/6000 and PowerPC Options}.
14008
14009 @node RS/6000 and PowerPC Options
14010 @subsection IBM RS/6000 and PowerPC Options
14011 @cindex RS/6000 and PowerPC Options
14012 @cindex IBM RS/6000 and PowerPC Options
14013
14014 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
14015 @table @gcctabopt
14016 @item -mpower
14017 @itemx -mno-power
14018 @itemx -mpower2
14019 @itemx -mno-power2
14020 @itemx -mpowerpc
14021 @itemx -mno-powerpc
14022 @itemx -mpowerpc-gpopt
14023 @itemx -mno-powerpc-gpopt
14024 @itemx -mpowerpc-gfxopt
14025 @itemx -mno-powerpc-gfxopt
14026 @itemx -mpowerpc64
14027 @itemx -mno-powerpc64
14028 @itemx -mmfcrf
14029 @itemx -mno-mfcrf
14030 @itemx -mpopcntb
14031 @itemx -mno-popcntb
14032 @itemx -mfprnd
14033 @itemx -mno-fprnd
14034 @itemx -mcmpb
14035 @itemx -mno-cmpb
14036 @itemx -mmfpgpr
14037 @itemx -mno-mfpgpr
14038 @itemx -mhard-dfp
14039 @itemx -mno-hard-dfp
14040 @opindex mpower
14041 @opindex mno-power
14042 @opindex mpower2
14043 @opindex mno-power2
14044 @opindex mpowerpc
14045 @opindex mno-powerpc
14046 @opindex mpowerpc-gpopt
14047 @opindex mno-powerpc-gpopt
14048 @opindex mpowerpc-gfxopt
14049 @opindex mno-powerpc-gfxopt
14050 @opindex mpowerpc64
14051 @opindex mno-powerpc64
14052 @opindex mmfcrf
14053 @opindex mno-mfcrf
14054 @opindex mpopcntb
14055 @opindex mno-popcntb
14056 @opindex mfprnd
14057 @opindex mno-fprnd
14058 @opindex mcmpb
14059 @opindex mno-cmpb
14060 @opindex mmfpgpr
14061 @opindex mno-mfpgpr
14062 @opindex mhard-dfp
14063 @opindex mno-hard-dfp
14064 GCC supports two related instruction set architectures for the
14065 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
14066 instructions supported by the @samp{rios} chip set used in the original
14067 RS/6000 systems and the @dfn{PowerPC} instruction set is the
14068 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
14069 the IBM 4xx, 6xx, and follow-on microprocessors.
14070
14071 Neither architecture is a subset of the other.  However there is a
14072 large common subset of instructions supported by both.  An MQ
14073 register is included in processors supporting the POWER architecture.
14074
14075 You use these options to specify which instructions are available on the
14076 processor you are using.  The default value of these options is
14077 determined when configuring GCC@.  Specifying the
14078 @option{-mcpu=@var{cpu_type}} overrides the specification of these
14079 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
14080 rather than the options listed above.
14081
14082 The @option{-mpower} option allows GCC to generate instructions that
14083 are found only in the POWER architecture and to use the MQ register.
14084 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
14085 to generate instructions that are present in the POWER2 architecture but
14086 not the original POWER architecture.
14087
14088 The @option{-mpowerpc} option allows GCC to generate instructions that
14089 are found only in the 32-bit subset of the PowerPC architecture.
14090 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
14091 GCC to use the optional PowerPC architecture instructions in the
14092 General Purpose group, including floating-point square root.  Specifying
14093 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
14094 use the optional PowerPC architecture instructions in the Graphics
14095 group, including floating-point select.
14096
14097 The @option{-mmfcrf} option allows GCC to generate the move from
14098 condition register field instruction implemented on the POWER4
14099 processor and other processors that support the PowerPC V2.01
14100 architecture.
14101 The @option{-mpopcntb} option allows GCC to generate the popcount and
14102 double precision FP reciprocal estimate instruction implemented on the
14103 POWER5 processor and other processors that support the PowerPC V2.02
14104 architecture.
14105 The @option{-mfprnd} option allows GCC to generate the FP round to
14106 integer instructions implemented on the POWER5+ processor and other
14107 processors that support the PowerPC V2.03 architecture.
14108 The @option{-mcmpb} option allows GCC to generate the compare bytes
14109 instruction implemented on the POWER6 processor and other processors
14110 that support the PowerPC V2.05 architecture.
14111 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
14112 general purpose register instructions implemented on the POWER6X
14113 processor and other processors that support the extended PowerPC V2.05
14114 architecture.
14115 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
14116 point instructions implemented on some POWER processors.
14117
14118 The @option{-mpowerpc64} option allows GCC to generate the additional
14119 64-bit instructions that are found in the full PowerPC64 architecture
14120 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
14121 @option{-mno-powerpc64}.
14122
14123 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
14124 will use only the instructions in the common subset of both
14125 architectures plus some special AIX common-mode calls, and will not use
14126 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
14127 permits GCC to use any instruction from either architecture and to
14128 allow use of the MQ register; specify this for the Motorola MPC601.
14129
14130 @item -mnew-mnemonics
14131 @itemx -mold-mnemonics
14132 @opindex mnew-mnemonics
14133 @opindex mold-mnemonics
14134 Select which mnemonics to use in the generated assembler code.  With
14135 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
14136 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
14137 assembler mnemonics defined for the POWER architecture.  Instructions
14138 defined in only one architecture have only one mnemonic; GCC uses that
14139 mnemonic irrespective of which of these options is specified.
14140
14141 GCC defaults to the mnemonics appropriate for the architecture in
14142 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
14143 value of these option.  Unless you are building a cross-compiler, you
14144 should normally not specify either @option{-mnew-mnemonics} or
14145 @option{-mold-mnemonics}, but should instead accept the default.
14146
14147 @item -mcpu=@var{cpu_type}
14148 @opindex mcpu
14149 Set architecture type, register usage, choice of mnemonics, and
14150 instruction scheduling parameters for machine type @var{cpu_type}.
14151 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
14152 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
14153 @samp{505}, @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
14154 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
14155 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
14156 @samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
14157 @samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
14158 @samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
14159 @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
14160 @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
14161 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
14162
14163 @option{-mcpu=common} selects a completely generic processor.  Code
14164 generated under this option will run on any POWER or PowerPC processor.
14165 GCC will use only the instructions in the common subset of both
14166 architectures, and will not use the MQ register.  GCC assumes a generic
14167 processor model for scheduling purposes.
14168
14169 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
14170 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
14171 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
14172 types, with an appropriate, generic processor model assumed for
14173 scheduling purposes.
14174
14175 The other options specify a specific processor.  Code generated under
14176 those options will run best on that processor, and may not run at all on
14177 others.
14178
14179 The @option{-mcpu} options automatically enable or disable the
14180 following options:
14181
14182 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
14183 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
14184 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
14185 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
14186
14187 The particular options set for any particular CPU will vary between
14188 compiler versions, depending on what setting seems to produce optimal
14189 code for that CPU; it doesn't necessarily reflect the actual hardware's
14190 capabilities.  If you wish to set an individual option to a particular
14191 value, you may specify it after the @option{-mcpu} option, like
14192 @samp{-mcpu=970 -mno-altivec}.
14193
14194 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
14195 not enabled or disabled by the @option{-mcpu} option at present because
14196 AIX does not have full support for these options.  You may still
14197 enable or disable them individually if you're sure it'll work in your
14198 environment.
14199
14200 @item -mtune=@var{cpu_type}
14201 @opindex mtune
14202 Set the instruction scheduling parameters for machine type
14203 @var{cpu_type}, but do not set the architecture type, register usage, or
14204 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
14205 values for @var{cpu_type} are used for @option{-mtune} as for
14206 @option{-mcpu}.  If both are specified, the code generated will use the
14207 architecture, registers, and mnemonics set by @option{-mcpu}, but the
14208 scheduling parameters set by @option{-mtune}.
14209
14210 @item -mswdiv
14211 @itemx -mno-swdiv
14212 @opindex mswdiv
14213 @opindex mno-swdiv
14214 Generate code to compute division as reciprocal estimate and iterative
14215 refinement, creating opportunities for increased throughput.  This
14216 feature requires: optional PowerPC Graphics instruction set for single
14217 precision and FRE instruction for double precision, assuming divides
14218 cannot generate user-visible traps, and the domain values not include
14219 Infinities, denormals or zero denominator.
14220
14221 @item -maltivec
14222 @itemx -mno-altivec
14223 @opindex maltivec
14224 @opindex mno-altivec
14225 Generate code that uses (does not use) AltiVec instructions, and also
14226 enable the use of built-in functions that allow more direct access to
14227 the AltiVec instruction set.  You may also need to set
14228 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
14229 enhancements.
14230
14231 @item -mvrsave
14232 @itemx -mno-vrsave
14233 @opindex mvrsave
14234 @opindex mno-vrsave
14235 Generate VRSAVE instructions when generating AltiVec code.
14236
14237 @item -mgen-cell-microcode
14238 @opindex mgen-cell-microcode
14239 Generate Cell microcode instructions
14240
14241 @item -mwarn-cell-microcode
14242 @opindex mwarn-cell-microcode
14243 Warning when a Cell microcode instruction is going to emitted.  An example
14244 of a Cell microcode instruction is a variable shift.
14245
14246 @item -msecure-plt
14247 @opindex msecure-plt
14248 Generate code that allows ld and ld.so to build executables and shared
14249 libraries with non-exec .plt and .got sections.  This is a PowerPC
14250 32-bit SYSV ABI option.
14251
14252 @item -mbss-plt
14253 @opindex mbss-plt
14254 Generate code that uses a BSS .plt section that ld.so fills in, and
14255 requires .plt and .got sections that are both writable and executable.
14256 This is a PowerPC 32-bit SYSV ABI option.
14257
14258 @item -misel
14259 @itemx -mno-isel
14260 @opindex misel
14261 @opindex mno-isel
14262 This switch enables or disables the generation of ISEL instructions.
14263
14264 @item -misel=@var{yes/no}
14265 This switch has been deprecated.  Use @option{-misel} and
14266 @option{-mno-isel} instead.
14267
14268 @item -mspe
14269 @itemx -mno-spe
14270 @opindex mspe
14271 @opindex mno-spe
14272 This switch enables or disables the generation of SPE simd
14273 instructions.
14274
14275 @item -mpaired
14276 @itemx -mno-paired
14277 @opindex mpaired
14278 @opindex mno-paired
14279 This switch enables or disables the generation of PAIRED simd
14280 instructions.
14281
14282 @item -mspe=@var{yes/no}
14283 This option has been deprecated.  Use @option{-mspe} and
14284 @option{-mno-spe} instead.
14285
14286 @item -mfloat-gprs=@var{yes/single/double/no}
14287 @itemx -mfloat-gprs
14288 @opindex mfloat-gprs
14289 This switch enables or disables the generation of floating point
14290 operations on the general purpose registers for architectures that
14291 support it.
14292
14293 The argument @var{yes} or @var{single} enables the use of
14294 single-precision floating point operations.
14295
14296 The argument @var{double} enables the use of single and
14297 double-precision floating point operations.
14298
14299 The argument @var{no} disables floating point operations on the
14300 general purpose registers.
14301
14302 This option is currently only available on the MPC854x.
14303
14304 @item -m32
14305 @itemx -m64
14306 @opindex m32
14307 @opindex m64
14308 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
14309 targets (including GNU/Linux).  The 32-bit environment sets int, long
14310 and pointer to 32 bits and generates code that runs on any PowerPC
14311 variant.  The 64-bit environment sets int to 32 bits and long and
14312 pointer to 64 bits, and generates code for PowerPC64, as for
14313 @option{-mpowerpc64}.
14314
14315 @item -mfull-toc
14316 @itemx -mno-fp-in-toc
14317 @itemx -mno-sum-in-toc
14318 @itemx -mminimal-toc
14319 @opindex mfull-toc
14320 @opindex mno-fp-in-toc
14321 @opindex mno-sum-in-toc
14322 @opindex mminimal-toc
14323 Modify generation of the TOC (Table Of Contents), which is created for
14324 every executable file.  The @option{-mfull-toc} option is selected by
14325 default.  In that case, GCC will allocate at least one TOC entry for
14326 each unique non-automatic variable reference in your program.  GCC
14327 will also place floating-point constants in the TOC@.  However, only
14328 16,384 entries are available in the TOC@.
14329
14330 If you receive a linker error message that saying you have overflowed
14331 the available TOC space, you can reduce the amount of TOC space used
14332 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
14333 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
14334 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
14335 generate code to calculate the sum of an address and a constant at
14336 run-time instead of putting that sum into the TOC@.  You may specify one
14337 or both of these options.  Each causes GCC to produce very slightly
14338 slower and larger code at the expense of conserving TOC space.
14339
14340 If you still run out of space in the TOC even when you specify both of
14341 these options, specify @option{-mminimal-toc} instead.  This option causes
14342 GCC to make only one TOC entry for every file.  When you specify this
14343 option, GCC will produce code that is slower and larger but which
14344 uses extremely little TOC space.  You may wish to use this option
14345 only on files that contain less frequently executed code.
14346
14347 @item -maix64
14348 @itemx -maix32
14349 @opindex maix64
14350 @opindex maix32
14351 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
14352 @code{long} type, and the infrastructure needed to support them.
14353 Specifying @option{-maix64} implies @option{-mpowerpc64} and
14354 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
14355 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
14356
14357 @item -mxl-compat
14358 @itemx -mno-xl-compat
14359 @opindex mxl-compat
14360 @opindex mno-xl-compat
14361 Produce code that conforms more closely to IBM XL compiler semantics
14362 when using AIX-compatible ABI@.  Pass floating-point arguments to
14363 prototyped functions beyond the register save area (RSA) on the stack
14364 in addition to argument FPRs.  Do not assume that most significant
14365 double in 128-bit long double value is properly rounded when comparing
14366 values and converting to double.  Use XL symbol names for long double
14367 support routines.
14368
14369 The AIX calling convention was extended but not initially documented to
14370 handle an obscure K&R C case of calling a function that takes the
14371 address of its arguments with fewer arguments than declared.  IBM XL
14372 compilers access floating point arguments which do not fit in the
14373 RSA from the stack when a subroutine is compiled without
14374 optimization.  Because always storing floating-point arguments on the
14375 stack is inefficient and rarely needed, this option is not enabled by
14376 default and only is necessary when calling subroutines compiled by IBM
14377 XL compilers without optimization.
14378
14379 @item -mpe
14380 @opindex mpe
14381 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
14382 application written to use message passing with special startup code to
14383 enable the application to run.  The system must have PE installed in the
14384 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
14385 must be overridden with the @option{-specs=} option to specify the
14386 appropriate directory location.  The Parallel Environment does not
14387 support threads, so the @option{-mpe} option and the @option{-pthread}
14388 option are incompatible.
14389
14390 @item -malign-natural
14391 @itemx -malign-power
14392 @opindex malign-natural
14393 @opindex malign-power
14394 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
14395 @option{-malign-natural} overrides the ABI-defined alignment of larger
14396 types, such as floating-point doubles, on their natural size-based boundary.
14397 The option @option{-malign-power} instructs GCC to follow the ABI-specified
14398 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
14399
14400 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
14401 is not supported.
14402
14403 @item -msoft-float
14404 @itemx -mhard-float
14405 @opindex msoft-float
14406 @opindex mhard-float
14407 Generate code that does not use (uses) the floating-point register set.
14408 Software floating point emulation is provided if you use the
14409 @option{-msoft-float} option, and pass the option to GCC when linking.
14410
14411 @item -msingle-float
14412 @itemx -mdouble-float
14413 @opindex msingle-float
14414 @opindex mdouble-float
14415 Generate code for single or double-precision floating point operations.
14416 @option{-mdouble-float} implies @option{-msingle-float}.
14417
14418 @item -msimple-fpu
14419 @opindex msimple-fpu
14420 Do not generate sqrt and div instructions for hardware floating point unit.
14421
14422 @item -mfpu
14423 @opindex mfpu
14424 Specify type of floating point unit.  Valid values are @var{sp_lite}
14425 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
14426 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
14427 and @var{dp_full} (equivalent to -mdouble-float).
14428
14429 @item -mxilinx-fpu
14430 @opindex mxilinx-fpu
14431 Perform optimizations for floating point unit on Xilinx PPC 405/440.
14432
14433 @item -mmultiple
14434 @itemx -mno-multiple
14435 @opindex mmultiple
14436 @opindex mno-multiple
14437 Generate code that uses (does not use) the load multiple word
14438 instructions and the store multiple word instructions.  These
14439 instructions are generated by default on POWER systems, and not
14440 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
14441 endian PowerPC systems, since those instructions do not work when the
14442 processor is in little endian mode.  The exceptions are PPC740 and
14443 PPC750 which permit the instructions usage in little endian mode.
14444
14445 @item -mstring
14446 @itemx -mno-string
14447 @opindex mstring
14448 @opindex mno-string
14449 Generate code that uses (does not use) the load string instructions
14450 and the store string word instructions to save multiple registers and
14451 do small block moves.  These instructions are generated by default on
14452 POWER systems, and not generated on PowerPC systems.  Do not use
14453 @option{-mstring} on little endian PowerPC systems, since those
14454 instructions do not work when the processor is in little endian mode.
14455 The exceptions are PPC740 and PPC750 which permit the instructions
14456 usage in little endian mode.
14457
14458 @item -mupdate
14459 @itemx -mno-update
14460 @opindex mupdate
14461 @opindex mno-update
14462 Generate code that uses (does not use) the load or store instructions
14463 that update the base register to the address of the calculated memory
14464 location.  These instructions are generated by default.  If you use
14465 @option{-mno-update}, there is a small window between the time that the
14466 stack pointer is updated and the address of the previous frame is
14467 stored, which means code that walks the stack frame across interrupts or
14468 signals may get corrupted data.
14469
14470 @item -mavoid-indexed-addresses
14471 @item -mno-avoid-indexed-addresses
14472 @opindex mavoid-indexed-addresses
14473 @opindex mno-avoid-indexed-addresses
14474 Generate code that tries to avoid (not avoid) the use of indexed load
14475 or store instructions. These instructions can incur a performance
14476 penalty on Power6 processors in certain situations, such as when
14477 stepping through large arrays that cross a 16M boundary.  This option
14478 is enabled by default when targetting Power6 and disabled otherwise.
14479
14480 @item -mfused-madd
14481 @itemx -mno-fused-madd
14482 @opindex mfused-madd
14483 @opindex mno-fused-madd
14484 Generate code that uses (does not use) the floating point multiply and
14485 accumulate instructions.  These instructions are generated by default if
14486 hardware floating is used.
14487
14488 @item -mmulhw
14489 @itemx -mno-mulhw
14490 @opindex mmulhw
14491 @opindex mno-mulhw
14492 Generate code that uses (does not use) the half-word multiply and
14493 multiply-accumulate instructions on the IBM 405, 440 and 464 processors.
14494 These instructions are generated by default when targetting those
14495 processors.
14496
14497 @item -mdlmzb
14498 @itemx -mno-dlmzb
14499 @opindex mdlmzb
14500 @opindex mno-dlmzb
14501 Generate code that uses (does not use) the string-search @samp{dlmzb}
14502 instruction on the IBM 405, 440 and 464 processors.  This instruction is
14503 generated by default when targetting those processors.
14504
14505 @item -mno-bit-align
14506 @itemx -mbit-align
14507 @opindex mno-bit-align
14508 @opindex mbit-align
14509 On System V.4 and embedded PowerPC systems do not (do) force structures
14510 and unions that contain bit-fields to be aligned to the base type of the
14511 bit-field.
14512
14513 For example, by default a structure containing nothing but 8
14514 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
14515 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
14516 the structure would be aligned to a 1 byte boundary and be one byte in
14517 size.
14518
14519 @item -mno-strict-align
14520 @itemx -mstrict-align
14521 @opindex mno-strict-align
14522 @opindex mstrict-align
14523 On System V.4 and embedded PowerPC systems do not (do) assume that
14524 unaligned memory references will be handled by the system.
14525
14526 @item -mrelocatable
14527 @itemx -mno-relocatable
14528 @opindex mrelocatable
14529 @opindex mno-relocatable
14530 On embedded PowerPC systems generate code that allows (does not allow)
14531 the program to be relocated to a different address at runtime.  If you
14532 use @option{-mrelocatable} on any module, all objects linked together must
14533 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
14534
14535 @item -mrelocatable-lib
14536 @itemx -mno-relocatable-lib
14537 @opindex mrelocatable-lib
14538 @opindex mno-relocatable-lib
14539 On embedded PowerPC systems generate code that allows (does not allow)
14540 the program to be relocated to a different address at runtime.  Modules
14541 compiled with @option{-mrelocatable-lib} can be linked with either modules
14542 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
14543 with modules compiled with the @option{-mrelocatable} options.
14544
14545 @item -mno-toc
14546 @itemx -mtoc
14547 @opindex mno-toc
14548 @opindex mtoc
14549 On System V.4 and embedded PowerPC systems do not (do) assume that
14550 register 2 contains a pointer to a global area pointing to the addresses
14551 used in the program.
14552
14553 @item -mlittle
14554 @itemx -mlittle-endian
14555 @opindex mlittle
14556 @opindex mlittle-endian
14557 On System V.4 and embedded PowerPC systems compile code for the
14558 processor in little endian mode.  The @option{-mlittle-endian} option is
14559 the same as @option{-mlittle}.
14560
14561 @item -mbig
14562 @itemx -mbig-endian
14563 @opindex mbig
14564 @opindex mbig-endian
14565 On System V.4 and embedded PowerPC systems compile code for the
14566 processor in big endian mode.  The @option{-mbig-endian} option is
14567 the same as @option{-mbig}.
14568
14569 @item -mdynamic-no-pic
14570 @opindex mdynamic-no-pic
14571 On Darwin and Mac OS X systems, compile code so that it is not
14572 relocatable, but that its external references are relocatable.  The
14573 resulting code is suitable for applications, but not shared
14574 libraries.
14575
14576 @item -mprioritize-restricted-insns=@var{priority}
14577 @opindex mprioritize-restricted-insns
14578 This option controls the priority that is assigned to
14579 dispatch-slot restricted instructions during the second scheduling
14580 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
14581 @var{no/highest/second-highest} priority to dispatch slot restricted
14582 instructions.
14583
14584 @item -msched-costly-dep=@var{dependence_type}
14585 @opindex msched-costly-dep
14586 This option controls which dependences are considered costly
14587 by the target during instruction scheduling.  The argument
14588 @var{dependence_type} takes one of the following values:
14589 @var{no}: no dependence is costly,
14590 @var{all}: all dependences are costly,
14591 @var{true_store_to_load}: a true dependence from store to load is costly,
14592 @var{store_to_load}: any dependence from store to load is costly,
14593 @var{number}: any dependence which latency >= @var{number} is costly.
14594
14595 @item -minsert-sched-nops=@var{scheme}
14596 @opindex minsert-sched-nops
14597 This option controls which nop insertion scheme will be used during
14598 the second scheduling pass.  The argument @var{scheme} takes one of the
14599 following values:
14600 @var{no}: Don't insert nops.
14601 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
14602 according to the scheduler's grouping.
14603 @var{regroup_exact}: Insert nops to force costly dependent insns into
14604 separate groups.  Insert exactly as many nops as needed to force an insn
14605 to a new group, according to the estimated processor grouping.
14606 @var{number}: Insert nops to force costly dependent insns into
14607 separate groups.  Insert @var{number} nops to force an insn to a new group.
14608
14609 @item -mcall-sysv
14610 @opindex mcall-sysv
14611 On System V.4 and embedded PowerPC systems compile code using calling
14612 conventions that adheres to the March 1995 draft of the System V
14613 Application Binary Interface, PowerPC processor supplement.  This is the
14614 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
14615
14616 @item -mcall-sysv-eabi
14617 @itemx -mcall-eabi
14618 @opindex mcall-sysv-eabi
14619 @opindex mcall-eabi
14620 Specify both @option{-mcall-sysv} and @option{-meabi} options.
14621
14622 @item -mcall-sysv-noeabi
14623 @opindex mcall-sysv-noeabi
14624 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
14625
14626 @item -mcall-aixdesc
14627 @opindex m
14628 On System V.4 and embedded PowerPC systems compile code for the AIX
14629 operating system.
14630
14631 @item -mcall-linux
14632 @opindex mcall-linux
14633 On System V.4 and embedded PowerPC systems compile code for the
14634 Linux-based GNU system.
14635
14636 @item -mcall-gnu
14637 @opindex mcall-gnu
14638 On System V.4 and embedded PowerPC systems compile code for the
14639 Hurd-based GNU system.
14640
14641 @item -mcall-freebsd
14642 @opindex mcall-freebsd
14643 On System V.4 and embedded PowerPC systems compile code for the
14644 FreeBSD operating system.
14645
14646 @item -mcall-netbsd
14647 @opindex mcall-netbsd
14648 On System V.4 and embedded PowerPC systems compile code for the
14649 NetBSD operating system.
14650
14651 @item -mcall-openbsd
14652 @opindex mcall-netbsd
14653 On System V.4 and embedded PowerPC systems compile code for the
14654 OpenBSD operating system.
14655
14656 @item -maix-struct-return
14657 @opindex maix-struct-return
14658 Return all structures in memory (as specified by the AIX ABI)@.
14659
14660 @item -msvr4-struct-return
14661 @opindex msvr4-struct-return
14662 Return structures smaller than 8 bytes in registers (as specified by the
14663 SVR4 ABI)@.
14664
14665 @item -mabi=@var{abi-type}
14666 @opindex mabi
14667 Extend the current ABI with a particular extension, or remove such extension.
14668 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
14669 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
14670
14671 @item -mabi=spe
14672 @opindex mabi=spe
14673 Extend the current ABI with SPE ABI extensions.  This does not change
14674 the default ABI, instead it adds the SPE ABI extensions to the current
14675 ABI@.
14676
14677 @item -mabi=no-spe
14678 @opindex mabi=no-spe
14679 Disable Booke SPE ABI extensions for the current ABI@.
14680
14681 @item -mabi=ibmlongdouble
14682 @opindex mabi=ibmlongdouble
14683 Change the current ABI to use IBM extended precision long double.
14684 This is a PowerPC 32-bit SYSV ABI option.
14685
14686 @item -mabi=ieeelongdouble
14687 @opindex mabi=ieeelongdouble
14688 Change the current ABI to use IEEE extended precision long double.
14689 This is a PowerPC 32-bit Linux ABI option.
14690
14691 @item -mprototype
14692 @itemx -mno-prototype
14693 @opindex mprototype
14694 @opindex mno-prototype
14695 On System V.4 and embedded PowerPC systems assume that all calls to
14696 variable argument functions are properly prototyped.  Otherwise, the
14697 compiler must insert an instruction before every non prototyped call to
14698 set or clear bit 6 of the condition code register (@var{CR}) to
14699 indicate whether floating point values were passed in the floating point
14700 registers in case the function takes a variable arguments.  With
14701 @option{-mprototype}, only calls to prototyped variable argument functions
14702 will set or clear the bit.
14703
14704 @item -msim
14705 @opindex msim
14706 On embedded PowerPC systems, assume that the startup module is called
14707 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
14708 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
14709 configurations.
14710
14711 @item -mmvme
14712 @opindex mmvme
14713 On embedded PowerPC systems, assume that the startup module is called
14714 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
14715 @file{libc.a}.
14716
14717 @item -mads
14718 @opindex mads
14719 On embedded PowerPC systems, assume that the startup module is called
14720 @file{crt0.o} and the standard C libraries are @file{libads.a} and
14721 @file{libc.a}.
14722
14723 @item -myellowknife
14724 @opindex myellowknife
14725 On embedded PowerPC systems, assume that the startup module is called
14726 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
14727 @file{libc.a}.
14728
14729 @item -mvxworks
14730 @opindex mvxworks
14731 On System V.4 and embedded PowerPC systems, specify that you are
14732 compiling for a VxWorks system.
14733
14734 @item -memb
14735 @opindex memb
14736 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
14737 header to indicate that @samp{eabi} extended relocations are used.
14738
14739 @item -meabi
14740 @itemx -mno-eabi
14741 @opindex meabi
14742 @opindex mno-eabi
14743 On System V.4 and embedded PowerPC systems do (do not) adhere to the
14744 Embedded Applications Binary Interface (eabi) which is a set of
14745 modifications to the System V.4 specifications.  Selecting @option{-meabi}
14746 means that the stack is aligned to an 8 byte boundary, a function
14747 @code{__eabi} is called to from @code{main} to set up the eabi
14748 environment, and the @option{-msdata} option can use both @code{r2} and
14749 @code{r13} to point to two separate small data areas.  Selecting
14750 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
14751 do not call an initialization function from @code{main}, and the
14752 @option{-msdata} option will only use @code{r13} to point to a single
14753 small data area.  The @option{-meabi} option is on by default if you
14754 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
14755
14756 @item -msdata=eabi
14757 @opindex msdata=eabi
14758 On System V.4 and embedded PowerPC systems, put small initialized
14759 @code{const} global and static data in the @samp{.sdata2} section, which
14760 is pointed to by register @code{r2}.  Put small initialized
14761 non-@code{const} global and static data in the @samp{.sdata} section,
14762 which is pointed to by register @code{r13}.  Put small uninitialized
14763 global and static data in the @samp{.sbss} section, which is adjacent to
14764 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
14765 incompatible with the @option{-mrelocatable} option.  The
14766 @option{-msdata=eabi} option also sets the @option{-memb} option.
14767
14768 @item -msdata=sysv
14769 @opindex msdata=sysv
14770 On System V.4 and embedded PowerPC systems, put small global and static
14771 data in the @samp{.sdata} section, which is pointed to by register
14772 @code{r13}.  Put small uninitialized global and static data in the
14773 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
14774 The @option{-msdata=sysv} option is incompatible with the
14775 @option{-mrelocatable} option.
14776
14777 @item -msdata=default
14778 @itemx -msdata
14779 @opindex msdata=default
14780 @opindex msdata
14781 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
14782 compile code the same as @option{-msdata=eabi}, otherwise compile code the
14783 same as @option{-msdata=sysv}.
14784
14785 @item -msdata=data
14786 @opindex msdata=data
14787 On System V.4 and embedded PowerPC systems, put small global
14788 data in the @samp{.sdata} section.  Put small uninitialized global
14789 data in the @samp{.sbss} section.  Do not use register @code{r13}
14790 to address small data however.  This is the default behavior unless
14791 other @option{-msdata} options are used.
14792
14793 @item -msdata=none
14794 @itemx -mno-sdata
14795 @opindex msdata=none
14796 @opindex mno-sdata
14797 On embedded PowerPC systems, put all initialized global and static data
14798 in the @samp{.data} section, and all uninitialized data in the
14799 @samp{.bss} section.
14800
14801 @item -G @var{num}
14802 @opindex G
14803 @cindex smaller data references (PowerPC)
14804 @cindex .sdata/.sdata2 references (PowerPC)
14805 On embedded PowerPC systems, put global and static items less than or
14806 equal to @var{num} bytes into the small data or bss sections instead of
14807 the normal data or bss section.  By default, @var{num} is 8.  The
14808 @option{-G @var{num}} switch is also passed to the linker.
14809 All modules should be compiled with the same @option{-G @var{num}} value.
14810
14811 @item -mregnames
14812 @itemx -mno-regnames
14813 @opindex mregnames
14814 @opindex mno-regnames
14815 On System V.4 and embedded PowerPC systems do (do not) emit register
14816 names in the assembly language output using symbolic forms.
14817
14818 @item -mlongcall
14819 @itemx -mno-longcall
14820 @opindex mlongcall
14821 @opindex mno-longcall
14822 By default assume that all calls are far away so that a longer more
14823 expensive calling sequence is required.  This is required for calls
14824 further than 32 megabytes (33,554,432 bytes) from the current location.
14825 A short call will be generated if the compiler knows
14826 the call cannot be that far away.  This setting can be overridden by
14827 the @code{shortcall} function attribute, or by @code{#pragma
14828 longcall(0)}.
14829
14830 Some linkers are capable of detecting out-of-range calls and generating
14831 glue code on the fly.  On these systems, long calls are unnecessary and
14832 generate slower code.  As of this writing, the AIX linker can do this,
14833 as can the GNU linker for PowerPC/64.  It is planned to add this feature
14834 to the GNU linker for 32-bit PowerPC systems as well.
14835
14836 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
14837 callee, L42'', plus a ``branch island'' (glue code).  The two target
14838 addresses represent the callee and the ``branch island''.  The
14839 Darwin/PPC linker will prefer the first address and generate a ``bl
14840 callee'' if the PPC ``bl'' instruction will reach the callee directly;
14841 otherwise, the linker will generate ``bl L42'' to call the ``branch
14842 island''.  The ``branch island'' is appended to the body of the
14843 calling function; it computes the full 32-bit address of the callee
14844 and jumps to it.
14845
14846 On Mach-O (Darwin) systems, this option directs the compiler emit to
14847 the glue for every direct call, and the Darwin linker decides whether
14848 to use or discard it.
14849
14850 In the future, we may cause GCC to ignore all longcall specifications
14851 when the linker is known to generate glue.
14852
14853 @item -mtls-markers
14854 @itemx -mno-tls-markers
14855 @opindex mtls-markers
14856 @opindex mno-tls-markers
14857 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
14858 specifying the function argument.  The relocation allows ld to
14859 reliably associate function call with argument setup instructions for
14860 TLS optimization, which in turn allows gcc to better schedule the
14861 sequence.
14862
14863 @item -pthread
14864 @opindex pthread
14865 Adds support for multithreading with the @dfn{pthreads} library.
14866 This option sets flags for both the preprocessor and linker.
14867
14868 @end table
14869
14870 @node S/390 and zSeries Options
14871 @subsection S/390 and zSeries Options
14872 @cindex S/390 and zSeries Options
14873
14874 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
14875
14876 @table @gcctabopt
14877 @item -mhard-float
14878 @itemx -msoft-float
14879 @opindex mhard-float
14880 @opindex msoft-float
14881 Use (do not use) the hardware floating-point instructions and registers
14882 for floating-point operations.  When @option{-msoft-float} is specified,
14883 functions in @file{libgcc.a} will be used to perform floating-point
14884 operations.  When @option{-mhard-float} is specified, the compiler
14885 generates IEEE floating-point instructions.  This is the default.
14886
14887 @item -mhard-dfp
14888 @itemx -mno-hard-dfp
14889 @opindex mhard-dfp
14890 @opindex mno-hard-dfp
14891 Use (do not use) the hardware decimal-floating-point instructions for
14892 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
14893 specified, functions in @file{libgcc.a} will be used to perform
14894 decimal-floating-point operations.  When @option{-mhard-dfp} is
14895 specified, the compiler generates decimal-floating-point hardware
14896 instructions.  This is the default for @option{-march=z9-ec} or higher.
14897
14898 @item -mlong-double-64
14899 @itemx -mlong-double-128
14900 @opindex mlong-double-64
14901 @opindex mlong-double-128
14902 These switches control the size of @code{long double} type. A size
14903 of 64bit makes the @code{long double} type equivalent to the @code{double}
14904 type. This is the default.
14905
14906 @item -mbackchain
14907 @itemx -mno-backchain
14908 @opindex mbackchain
14909 @opindex mno-backchain
14910 Store (do not store) the address of the caller's frame as backchain pointer
14911 into the callee's stack frame.
14912 A backchain may be needed to allow debugging using tools that do not understand
14913 DWARF-2 call frame information.
14914 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
14915 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
14916 the backchain is placed into the topmost word of the 96/160 byte register
14917 save area.
14918
14919 In general, code compiled with @option{-mbackchain} is call-compatible with
14920 code compiled with @option{-mmo-backchain}; however, use of the backchain
14921 for debugging purposes usually requires that the whole binary is built with
14922 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
14923 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14924 to build a linux kernel use @option{-msoft-float}.
14925
14926 The default is to not maintain the backchain.
14927
14928 @item -mpacked-stack
14929 @itemx -mno-packed-stack
14930 @opindex mpacked-stack
14931 @opindex mno-packed-stack
14932 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
14933 specified, the compiler uses the all fields of the 96/160 byte register save
14934 area only for their default purpose; unused fields still take up stack space.
14935 When @option{-mpacked-stack} is specified, register save slots are densely
14936 packed at the top of the register save area; unused space is reused for other
14937 purposes, allowing for more efficient use of the available stack space.
14938 However, when @option{-mbackchain} is also in effect, the topmost word of
14939 the save area is always used to store the backchain, and the return address
14940 register is always saved two words below the backchain.
14941
14942 As long as the stack frame backchain is not used, code generated with
14943 @option{-mpacked-stack} is call-compatible with code generated with
14944 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
14945 S/390 or zSeries generated code that uses the stack frame backchain at run
14946 time, not just for debugging purposes.  Such code is not call-compatible
14947 with code compiled with @option{-mpacked-stack}.  Also, note that the
14948 combination of @option{-mbackchain},
14949 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14950 to build a linux kernel use @option{-msoft-float}.
14951
14952 The default is to not use the packed stack layout.
14953
14954 @item -msmall-exec
14955 @itemx -mno-small-exec
14956 @opindex msmall-exec
14957 @opindex mno-small-exec
14958 Generate (or do not generate) code using the @code{bras} instruction
14959 to do subroutine calls.
14960 This only works reliably if the total executable size does not
14961 exceed 64k.  The default is to use the @code{basr} instruction instead,
14962 which does not have this limitation.
14963
14964 @item -m64
14965 @itemx -m31
14966 @opindex m64
14967 @opindex m31
14968 When @option{-m31} is specified, generate code compliant to the
14969 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
14970 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
14971 particular to generate 64-bit instructions.  For the @samp{s390}
14972 targets, the default is @option{-m31}, while the @samp{s390x}
14973 targets default to @option{-m64}.
14974
14975 @item -mzarch
14976 @itemx -mesa
14977 @opindex mzarch
14978 @opindex mesa
14979 When @option{-mzarch} is specified, generate code using the
14980 instructions available on z/Architecture.
14981 When @option{-mesa} is specified, generate code using the
14982 instructions available on ESA/390.  Note that @option{-mesa} is
14983 not possible with @option{-m64}.
14984 When generating code compliant to the GNU/Linux for S/390 ABI,
14985 the default is @option{-mesa}.  When generating code compliant
14986 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
14987
14988 @item -mmvcle
14989 @itemx -mno-mvcle
14990 @opindex mmvcle
14991 @opindex mno-mvcle
14992 Generate (or do not generate) code using the @code{mvcle} instruction
14993 to perform block moves.  When @option{-mno-mvcle} is specified,
14994 use a @code{mvc} loop instead.  This is the default unless optimizing for
14995 size.
14996
14997 @item -mdebug
14998 @itemx -mno-debug
14999 @opindex mdebug
15000 @opindex mno-debug
15001 Print (or do not print) additional debug information when compiling.
15002 The default is to not print debug information.
15003
15004 @item -march=@var{cpu-type}
15005 @opindex march
15006 Generate code that will run on @var{cpu-type}, which is the name of a system
15007 representing a certain processor type.  Possible values for
15008 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
15009 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
15010 When generating code using the instructions available on z/Architecture,
15011 the default is @option{-march=z900}.  Otherwise, the default is
15012 @option{-march=g5}.
15013
15014 @item -mtune=@var{cpu-type}
15015 @opindex mtune
15016 Tune to @var{cpu-type} everything applicable about the generated code,
15017 except for the ABI and the set of available instructions.
15018 The list of @var{cpu-type} values is the same as for @option{-march}.
15019 The default is the value used for @option{-march}.
15020
15021 @item -mtpf-trace
15022 @itemx -mno-tpf-trace
15023 @opindex mtpf-trace
15024 @opindex mno-tpf-trace
15025 Generate code that adds (does not add) in TPF OS specific branches to trace
15026 routines in the operating system.  This option is off by default, even
15027 when compiling for the TPF OS@.
15028
15029 @item -mfused-madd
15030 @itemx -mno-fused-madd
15031 @opindex mfused-madd
15032 @opindex mno-fused-madd
15033 Generate code that uses (does not use) the floating point multiply and
15034 accumulate instructions.  These instructions are generated by default if
15035 hardware floating point is used.
15036
15037 @item -mwarn-framesize=@var{framesize}
15038 @opindex mwarn-framesize
15039 Emit a warning if the current function exceeds the given frame size.  Because
15040 this is a compile time check it doesn't need to be a real problem when the program
15041 runs.  It is intended to identify functions which most probably cause
15042 a stack overflow.  It is useful to be used in an environment with limited stack
15043 size e.g.@: the linux kernel.
15044
15045 @item -mwarn-dynamicstack
15046 @opindex mwarn-dynamicstack
15047 Emit a warning if the function calls alloca or uses dynamically
15048 sized arrays.  This is generally a bad idea with a limited stack size.
15049
15050 @item -mstack-guard=@var{stack-guard}
15051 @itemx -mstack-size=@var{stack-size}
15052 @opindex mstack-guard
15053 @opindex mstack-size
15054 If these options are provided the s390 back end emits additional instructions in
15055 the function prologue which trigger a trap if the stack size is @var{stack-guard}
15056 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
15057 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
15058 the frame size of the compiled function is chosen.
15059 These options are intended to be used to help debugging stack overflow problems.
15060 The additionally emitted code causes only little overhead and hence can also be
15061 used in production like systems without greater performance degradation.  The given
15062 values have to be exact powers of 2 and @var{stack-size} has to be greater than
15063 @var{stack-guard} without exceeding 64k.
15064 In order to be efficient the extra code makes the assumption that the stack starts
15065 at an address aligned to the value given by @var{stack-size}.
15066 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
15067 @end table
15068
15069 @node Score Options
15070 @subsection Score Options
15071 @cindex Score Options
15072
15073 These options are defined for Score implementations:
15074
15075 @table @gcctabopt
15076 @item -meb
15077 @opindex meb
15078 Compile code for big endian mode.  This is the default.
15079
15080 @item -mel
15081 @opindex mel
15082 Compile code for little endian mode.
15083
15084 @item -mnhwloop
15085 @opindex mnhwloop
15086 Disable generate bcnz instruction.
15087
15088 @item -muls
15089 @opindex muls
15090 Enable generate unaligned load and store instruction.
15091
15092 @item -mmac
15093 @opindex mmac
15094 Enable the use of multiply-accumulate instructions. Disabled by default.
15095
15096 @item -mscore5
15097 @opindex mscore5
15098 Specify the SCORE5 as the target architecture.
15099
15100 @item -mscore5u
15101 @opindex mscore5u
15102 Specify the SCORE5U of the target architecture.
15103
15104 @item -mscore7
15105 @opindex mscore7
15106 Specify the SCORE7 as the target architecture. This is the default.
15107
15108 @item -mscore7d
15109 @opindex mscore7d
15110 Specify the SCORE7D as the target architecture.
15111 @end table
15112
15113 @node SH Options
15114 @subsection SH Options
15115
15116 These @samp{-m} options are defined for the SH implementations:
15117
15118 @table @gcctabopt
15119 @item -m1
15120 @opindex m1
15121 Generate code for the SH1.
15122
15123 @item -m2
15124 @opindex m2
15125 Generate code for the SH2.
15126
15127 @item -m2e
15128 Generate code for the SH2e.
15129
15130 @item -m2a-nofpu
15131 @opindex m2a-nofpu
15132 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
15133 that the floating-point unit is not used.
15134
15135 @item -m2a-single-only
15136 @opindex m2a-single-only
15137 Generate code for the SH2a-FPU, in such a way that no double-precision
15138 floating point operations are used.
15139
15140 @item -m2a-single
15141 @opindex m2a-single
15142 Generate code for the SH2a-FPU assuming the floating-point unit is in
15143 single-precision mode by default.
15144
15145 @item -m2a
15146 @opindex m2a
15147 Generate code for the SH2a-FPU assuming the floating-point unit is in
15148 double-precision mode by default.
15149
15150 @item -m3
15151 @opindex m3
15152 Generate code for the SH3.
15153
15154 @item -m3e
15155 @opindex m3e
15156 Generate code for the SH3e.
15157
15158 @item -m4-nofpu
15159 @opindex m4-nofpu
15160 Generate code for the SH4 without a floating-point unit.
15161
15162 @item -m4-single-only
15163 @opindex m4-single-only
15164 Generate code for the SH4 with a floating-point unit that only
15165 supports single-precision arithmetic.
15166
15167 @item -m4-single
15168 @opindex m4-single
15169 Generate code for the SH4 assuming the floating-point unit is in
15170 single-precision mode by default.
15171
15172 @item -m4
15173 @opindex m4
15174 Generate code for the SH4.
15175
15176 @item -m4a-nofpu
15177 @opindex m4a-nofpu
15178 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
15179 floating-point unit is not used.
15180
15181 @item -m4a-single-only
15182 @opindex m4a-single-only
15183 Generate code for the SH4a, in such a way that no double-precision
15184 floating point operations are used.
15185
15186 @item -m4a-single
15187 @opindex m4a-single
15188 Generate code for the SH4a assuming the floating-point unit is in
15189 single-precision mode by default.
15190
15191 @item -m4a
15192 @opindex m4a
15193 Generate code for the SH4a.
15194
15195 @item -m4al
15196 @opindex m4al
15197 Same as @option{-m4a-nofpu}, except that it implicitly passes
15198 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
15199 instructions at the moment.
15200
15201 @item -mb
15202 @opindex mb
15203 Compile code for the processor in big endian mode.
15204
15205 @item -ml
15206 @opindex ml
15207 Compile code for the processor in little endian mode.
15208
15209 @item -mdalign
15210 @opindex mdalign
15211 Align doubles at 64-bit boundaries.  Note that this changes the calling
15212 conventions, and thus some functions from the standard C library will
15213 not work unless you recompile it first with @option{-mdalign}.
15214
15215 @item -mrelax
15216 @opindex mrelax
15217 Shorten some address references at link time, when possible; uses the
15218 linker option @option{-relax}.
15219
15220 @item -mbigtable
15221 @opindex mbigtable
15222 Use 32-bit offsets in @code{switch} tables.  The default is to use
15223 16-bit offsets.
15224
15225 @item -mbitops
15226 @opindex mbitops
15227 Enable the use of bit manipulation instructions on SH2A.
15228
15229 @item -mhitachi
15230 @opindex mhitachi
15231 Comply with the calling conventions defined by Renesas.
15232
15233 @item -mrenesas
15234 @opindex mhitachi
15235 Comply with the calling conventions defined by Renesas.
15236
15237 @item -mno-renesas
15238 @opindex mhitachi
15239 Comply with the calling conventions defined for GCC before the Renesas
15240 conventions were available.  This option is the default for all
15241 targets of the SH toolchain except for @samp{sh-symbianelf}.
15242
15243 @item -mnomacsave
15244 @opindex mnomacsave
15245 Mark the @code{MAC} register as call-clobbered, even if
15246 @option{-mhitachi} is given.
15247
15248 @item -mieee
15249 @opindex mieee
15250 Increase IEEE-compliance of floating-point code.
15251 At the moment, this is equivalent to @option{-fno-finite-math-only}.
15252 When generating 16 bit SH opcodes, getting IEEE-conforming results for
15253 comparisons of NANs / infinities incurs extra overhead in every
15254 floating point comparison, therefore the default is set to
15255 @option{-ffinite-math-only}.
15256
15257 @item -minline-ic_invalidate
15258 @opindex minline-ic_invalidate
15259 Inline code to invalidate instruction cache entries after setting up
15260 nested function trampolines.
15261 This option has no effect if -musermode is in effect and the selected
15262 code generation option (e.g. -m4) does not allow the use of the icbi
15263 instruction.
15264 If the selected code generation option does not allow the use of the icbi
15265 instruction, and -musermode is not in effect, the inlined code will
15266 manipulate the instruction cache address array directly with an associative
15267 write.  This not only requires privileged mode, but it will also
15268 fail if the cache line had been mapped via the TLB and has become unmapped.
15269
15270 @item -misize
15271 @opindex misize
15272 Dump instruction size and location in the assembly code.
15273
15274 @item -mpadstruct
15275 @opindex mpadstruct
15276 This option is deprecated.  It pads structures to multiple of 4 bytes,
15277 which is incompatible with the SH ABI@.
15278
15279 @item -mspace
15280 @opindex mspace
15281 Optimize for space instead of speed.  Implied by @option{-Os}.
15282
15283 @item -mprefergot
15284 @opindex mprefergot
15285 When generating position-independent code, emit function calls using
15286 the Global Offset Table instead of the Procedure Linkage Table.
15287
15288 @item -musermode
15289 @opindex musermode
15290 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
15291 if the inlined code would not work in user mode.
15292 This is the default when the target is @code{sh-*-linux*}.
15293
15294 @item -multcost=@var{number}
15295 @opindex multcost=@var{number}
15296 Set the cost to assume for a multiply insn.
15297
15298 @item -mdiv=@var{strategy}
15299 @opindex mdiv=@var{strategy}
15300 Set the division strategy to use for SHmedia code.  @var{strategy} must be
15301 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
15302 inv:call2, inv:fp .
15303 "fp" performs the operation in floating point.  This has a very high latency,
15304 but needs only a few instructions, so it might be a good choice if
15305 your code has enough easily exploitable ILP to allow the compiler to
15306 schedule the floating point instructions together with other instructions.
15307 Division by zero causes a floating point exception.
15308 "inv" uses integer operations to calculate the inverse of the divisor,
15309 and then multiplies the dividend with the inverse.  This strategy allows
15310 cse and hoisting of the inverse calculation.  Division by zero calculates
15311 an unspecified result, but does not trap.
15312 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
15313 have been found, or if the entire operation has been hoisted to the same
15314 place, the last stages of the inverse calculation are intertwined with the
15315 final multiply to reduce the overall latency, at the expense of using a few
15316 more instructions, and thus offering fewer scheduling opportunities with
15317 other code.
15318 "call" calls a library function that usually implements the inv:minlat
15319 strategy.
15320 This gives high code density for m5-*media-nofpu compilations.
15321 "call2" uses a different entry point of the same library function, where it
15322 assumes that a pointer to a lookup table has already been set up, which
15323 exposes the pointer load to cse / code hoisting optimizations.
15324 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
15325 code generation, but if the code stays unoptimized, revert to the "call",
15326 "call2", or "fp" strategies, respectively.  Note that the
15327 potentially-trapping side effect of division by zero is carried by a
15328 separate instruction, so it is possible that all the integer instructions
15329 are hoisted out, but the marker for the side effect stays where it is.
15330 A recombination to fp operations or a call is not possible in that case.
15331 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
15332 that the inverse calculation was nor separated from the multiply, they speed
15333 up division where the dividend fits into 20 bits (plus sign where applicable),
15334 by inserting a test to skip a number of operations in this case; this test
15335 slows down the case of larger dividends.  inv20u assumes the case of a such
15336 a small dividend to be unlikely, and inv20l assumes it to be likely.
15337
15338 @item -mdivsi3_libfunc=@var{name}
15339 @opindex mdivsi3_libfunc=@var{name}
15340 Set the name of the library function used for 32 bit signed division to
15341 @var{name}.  This only affect the name used in the call and inv:call
15342 division strategies, and the compiler will still expect the same
15343 sets of input/output/clobbered registers as if this option was not present.
15344
15345 @item -mfixed-range=@var{register-range}
15346 @opindex mfixed-range
15347 Generate code treating the given register range as fixed registers.
15348 A fixed register is one that the register allocator can not use.  This is
15349 useful when compiling kernel code.  A register range is specified as
15350 two registers separated by a dash.  Multiple register ranges can be
15351 specified separated by a comma.
15352
15353 @item -madjust-unroll
15354 @opindex madjust-unroll
15355 Throttle unrolling to avoid thrashing target registers.
15356 This option only has an effect if the gcc code base supports the
15357 TARGET_ADJUST_UNROLL_MAX target hook.
15358
15359 @item -mindexed-addressing
15360 @opindex mindexed-addressing
15361 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
15362 This is only safe if the hardware and/or OS implement 32 bit wrap-around
15363 semantics for the indexed addressing mode.  The architecture allows the
15364 implementation of processors with 64 bit MMU, which the OS could use to
15365 get 32 bit addressing, but since no current hardware implementation supports
15366 this or any other way to make the indexed addressing mode safe to use in
15367 the 32 bit ABI, the default is -mno-indexed-addressing.
15368
15369 @item -mgettrcost=@var{number}
15370 @opindex mgettrcost=@var{number}
15371 Set the cost assumed for the gettr instruction to @var{number}.
15372 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
15373
15374 @item -mpt-fixed
15375 @opindex mpt-fixed
15376 Assume pt* instructions won't trap.  This will generally generate better
15377 scheduled code, but is unsafe on current hardware.  The current architecture
15378 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
15379 This has the unintentional effect of making it unsafe to schedule ptabs /
15380 ptrel before a branch, or hoist it out of a loop.  For example,
15381 __do_global_ctors, a part of libgcc that runs constructors at program
15382 startup, calls functions in a list which is delimited by @minus{}1.  With the
15383 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
15384 That means that all the constructors will be run a bit quicker, but when
15385 the loop comes to the end of the list, the program crashes because ptabs
15386 loads @minus{}1 into a target register.  Since this option is unsafe for any
15387 hardware implementing the current architecture specification, the default
15388 is -mno-pt-fixed.  Unless the user specifies a specific cost with
15389 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
15390 this deters register allocation using target registers for storing
15391 ordinary integers.
15392
15393 @item -minvalid-symbols
15394 @opindex minvalid-symbols
15395 Assume symbols might be invalid.  Ordinary function symbols generated by
15396 the compiler will always be valid to load with movi/shori/ptabs or
15397 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
15398 to generate symbols that will cause ptabs / ptrel to trap.
15399 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
15400 It will then prevent cross-basic-block cse, hoisting and most scheduling
15401 of symbol loads.  The default is @option{-mno-invalid-symbols}.
15402 @end table
15403
15404 @node SPARC Options
15405 @subsection SPARC Options
15406 @cindex SPARC options
15407
15408 These @samp{-m} options are supported on the SPARC:
15409
15410 @table @gcctabopt
15411 @item -mno-app-regs
15412 @itemx -mapp-regs
15413 @opindex mno-app-regs
15414 @opindex mapp-regs
15415 Specify @option{-mapp-regs} to generate output using the global registers
15416 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
15417 is the default.
15418
15419 To be fully SVR4 ABI compliant at the cost of some performance loss,
15420 specify @option{-mno-app-regs}.  You should compile libraries and system
15421 software with this option.
15422
15423 @item -mfpu
15424 @itemx -mhard-float
15425 @opindex mfpu
15426 @opindex mhard-float
15427 Generate output containing floating point instructions.  This is the
15428 default.
15429
15430 @item -mno-fpu
15431 @itemx -msoft-float
15432 @opindex mno-fpu
15433 @opindex msoft-float
15434 Generate output containing library calls for floating point.
15435 @strong{Warning:} the requisite libraries are not available for all SPARC
15436 targets.  Normally the facilities of the machine's usual C compiler are
15437 used, but this cannot be done directly in cross-compilation.  You must make
15438 your own arrangements to provide suitable library functions for
15439 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
15440 @samp{sparclite-*-*} do provide software floating point support.
15441
15442 @option{-msoft-float} changes the calling convention in the output file;
15443 therefore, it is only useful if you compile @emph{all} of a program with
15444 this option.  In particular, you need to compile @file{libgcc.a}, the
15445 library that comes with GCC, with @option{-msoft-float} in order for
15446 this to work.
15447
15448 @item -mhard-quad-float
15449 @opindex mhard-quad-float
15450 Generate output containing quad-word (long double) floating point
15451 instructions.
15452
15453 @item -msoft-quad-float
15454 @opindex msoft-quad-float
15455 Generate output containing library calls for quad-word (long double)
15456 floating point instructions.  The functions called are those specified
15457 in the SPARC ABI@.  This is the default.
15458
15459 As of this writing, there are no SPARC implementations that have hardware
15460 support for the quad-word floating point instructions.  They all invoke
15461 a trap handler for one of these instructions, and then the trap handler
15462 emulates the effect of the instruction.  Because of the trap handler overhead,
15463 this is much slower than calling the ABI library routines.  Thus the
15464 @option{-msoft-quad-float} option is the default.
15465
15466 @item -mno-unaligned-doubles
15467 @itemx -munaligned-doubles
15468 @opindex mno-unaligned-doubles
15469 @opindex munaligned-doubles
15470 Assume that doubles have 8 byte alignment.  This is the default.
15471
15472 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
15473 alignment only if they are contained in another type, or if they have an
15474 absolute address.  Otherwise, it assumes they have 4 byte alignment.
15475 Specifying this option avoids some rare compatibility problems with code
15476 generated by other compilers.  It is not the default because it results
15477 in a performance loss, especially for floating point code.
15478
15479 @item -mno-faster-structs
15480 @itemx -mfaster-structs
15481 @opindex mno-faster-structs
15482 @opindex mfaster-structs
15483 With @option{-mfaster-structs}, the compiler assumes that structures
15484 should have 8 byte alignment.  This enables the use of pairs of
15485 @code{ldd} and @code{std} instructions for copies in structure
15486 assignment, in place of twice as many @code{ld} and @code{st} pairs.
15487 However, the use of this changed alignment directly violates the SPARC
15488 ABI@.  Thus, it's intended only for use on targets where the developer
15489 acknowledges that their resulting code will not be directly in line with
15490 the rules of the ABI@.
15491
15492 @item -mimpure-text
15493 @opindex mimpure-text
15494 @option{-mimpure-text}, used in addition to @option{-shared}, tells
15495 the compiler to not pass @option{-z text} to the linker when linking a
15496 shared object.  Using this option, you can link position-dependent
15497 code into a shared object.
15498
15499 @option{-mimpure-text} suppresses the ``relocations remain against
15500 allocatable but non-writable sections'' linker error message.
15501 However, the necessary relocations will trigger copy-on-write, and the
15502 shared object is not actually shared across processes.  Instead of
15503 using @option{-mimpure-text}, you should compile all source code with
15504 @option{-fpic} or @option{-fPIC}.
15505
15506 This option is only available on SunOS and Solaris.
15507
15508 @item -mcpu=@var{cpu_type}
15509 @opindex mcpu
15510 Set the instruction set, register set, and instruction scheduling parameters
15511 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
15512 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
15513 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
15514 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
15515 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
15516
15517 Default instruction scheduling parameters are used for values that select
15518 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
15519 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
15520
15521 Here is a list of each supported architecture and their supported
15522 implementations.
15523
15524 @smallexample
15525     v7:             cypress
15526     v8:             supersparc, hypersparc
15527     sparclite:      f930, f934, sparclite86x
15528     sparclet:       tsc701
15529     v9:             ultrasparc, ultrasparc3, niagara, niagara2
15530 @end smallexample
15531
15532 By default (unless configured otherwise), GCC generates code for the V7
15533 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
15534 additionally optimizes it for the Cypress CY7C602 chip, as used in the
15535 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
15536 SPARCStation 1, 2, IPX etc.
15537
15538 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
15539 architecture.  The only difference from V7 code is that the compiler emits
15540 the integer multiply and integer divide instructions which exist in SPARC-V8
15541 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
15542 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
15543 2000 series.
15544
15545 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
15546 the SPARC architecture.  This adds the integer multiply, integer divide step
15547 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
15548 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
15549 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
15550 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
15551 MB86934 chip, which is the more recent SPARClite with FPU@.
15552
15553 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
15554 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
15555 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
15556 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
15557 optimizes it for the TEMIC SPARClet chip.
15558
15559 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
15560 architecture.  This adds 64-bit integer and floating-point move instructions,
15561 3 additional floating-point condition code registers and conditional move
15562 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
15563 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
15564 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
15565 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
15566 @option{-mcpu=niagara}, the compiler additionally optimizes it for
15567 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
15568 additionally optimizes it for Sun UltraSPARC T2 chips.
15569
15570 @item -mtune=@var{cpu_type}
15571 @opindex mtune
15572 Set the instruction scheduling parameters for machine type
15573 @var{cpu_type}, but do not set the instruction set or register set that the
15574 option @option{-mcpu=@var{cpu_type}} would.
15575
15576 The same values for @option{-mcpu=@var{cpu_type}} can be used for
15577 @option{-mtune=@var{cpu_type}}, but the only useful values are those
15578 that select a particular cpu implementation.  Those are @samp{cypress},
15579 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
15580 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
15581 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
15582
15583 @item -mv8plus
15584 @itemx -mno-v8plus
15585 @opindex mv8plus
15586 @opindex mno-v8plus
15587 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
15588 difference from the V8 ABI is that the global and out registers are
15589 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
15590 mode for all SPARC-V9 processors.
15591
15592 @item -mvis
15593 @itemx -mno-vis
15594 @opindex mvis
15595 @opindex mno-vis
15596 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
15597 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
15598 @end table
15599
15600 These @samp{-m} options are supported in addition to the above
15601 on SPARC-V9 processors in 64-bit environments:
15602
15603 @table @gcctabopt
15604 @item -mlittle-endian
15605 @opindex mlittle-endian
15606 Generate code for a processor running in little-endian mode.  It is only
15607 available for a few configurations and most notably not on Solaris and Linux.
15608
15609 @item -m32
15610 @itemx -m64
15611 @opindex m32
15612 @opindex m64
15613 Generate code for a 32-bit or 64-bit environment.
15614 The 32-bit environment sets int, long and pointer to 32 bits.
15615 The 64-bit environment sets int to 32 bits and long and pointer
15616 to 64 bits.
15617
15618 @item -mcmodel=medlow
15619 @opindex mcmodel=medlow
15620 Generate code for the Medium/Low code model: 64-bit addresses, programs
15621 must be linked in the low 32 bits of memory.  Programs can be statically
15622 or dynamically linked.
15623
15624 @item -mcmodel=medmid
15625 @opindex mcmodel=medmid
15626 Generate code for the Medium/Middle code model: 64-bit addresses, programs
15627 must be linked in the low 44 bits of memory, the text and data segments must
15628 be less than 2GB in size and the data segment must be located within 2GB of
15629 the text segment.
15630
15631 @item -mcmodel=medany
15632 @opindex mcmodel=medany
15633 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
15634 may be linked anywhere in memory, the text and data segments must be less
15635 than 2GB in size and the data segment must be located within 2GB of the
15636 text segment.
15637
15638 @item -mcmodel=embmedany
15639 @opindex mcmodel=embmedany
15640 Generate code for the Medium/Anywhere code model for embedded systems:
15641 64-bit addresses, the text and data segments must be less than 2GB in
15642 size, both starting anywhere in memory (determined at link time).  The
15643 global register %g4 points to the base of the data segment.  Programs
15644 are statically linked and PIC is not supported.
15645
15646 @item -mstack-bias
15647 @itemx -mno-stack-bias
15648 @opindex mstack-bias
15649 @opindex mno-stack-bias
15650 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
15651 frame pointer if present, are offset by @minus{}2047 which must be added back
15652 when making stack frame references.  This is the default in 64-bit mode.
15653 Otherwise, assume no such offset is present.
15654 @end table
15655
15656 These switches are supported in addition to the above on Solaris:
15657
15658 @table @gcctabopt
15659 @item -threads
15660 @opindex threads
15661 Add support for multithreading using the Solaris threads library.  This
15662 option sets flags for both the preprocessor and linker.  This option does
15663 not affect the thread safety of object code produced by the compiler or
15664 that of libraries supplied with it.
15665
15666 @item -pthreads
15667 @opindex pthreads
15668 Add support for multithreading using the POSIX threads library.  This
15669 option sets flags for both the preprocessor and linker.  This option does
15670 not affect the thread safety of object code produced  by the compiler or
15671 that of libraries supplied with it.
15672
15673 @item -pthread
15674 @opindex pthread
15675 This is a synonym for @option{-pthreads}.
15676 @end table
15677
15678 @node SPU Options
15679 @subsection SPU Options
15680 @cindex SPU options
15681
15682 These @samp{-m} options are supported on the SPU:
15683
15684 @table @gcctabopt
15685 @item -mwarn-reloc
15686 @itemx -merror-reloc
15687 @opindex mwarn-reloc
15688 @opindex merror-reloc
15689
15690 The loader for SPU does not handle dynamic relocations.  By default, GCC
15691 will give an error when it generates code that requires a dynamic
15692 relocation.  @option{-mno-error-reloc} disables the error,
15693 @option{-mwarn-reloc} will generate a warning instead.
15694
15695 @item -msafe-dma
15696 @itemx -munsafe-dma
15697 @opindex msafe-dma
15698 @opindex munsafe-dma
15699
15700 Instructions which initiate or test completion of DMA must not be
15701 reordered with respect to loads and stores of the memory which is being
15702 accessed.  Users typically address this problem using the volatile
15703 keyword, but that can lead to inefficient code in places where the
15704 memory is known to not change.  Rather than mark the memory as volatile
15705 we treat the DMA instructions as potentially effecting all memory.  With
15706 @option{-munsafe-dma} users must use the volatile keyword to protect
15707 memory accesses.
15708
15709 @item -mbranch-hints
15710 @opindex mbranch-hints
15711
15712 By default, GCC will generate a branch hint instruction to avoid
15713 pipeline stalls for always taken or probably taken branches.  A hint
15714 will not be generated closer than 8 instructions away from its branch.
15715 There is little reason to disable them, except for debugging purposes,
15716 or to make an object a little bit smaller.
15717
15718 @item -msmall-mem
15719 @itemx -mlarge-mem
15720 @opindex msmall-mem
15721 @opindex mlarge-mem
15722
15723 By default, GCC generates code assuming that addresses are never larger
15724 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
15725 a full 32 bit address.
15726
15727 @item -mstdmain
15728 @opindex mstdmain
15729
15730 By default, GCC links against startup code that assumes the SPU-style
15731 main function interface (which has an unconventional parameter list).
15732 With @option{-mstdmain}, GCC will link your program against startup
15733 code that assumes a C99-style interface to @code{main}, including a
15734 local copy of @code{argv} strings.
15735
15736 @item -mfixed-range=@var{register-range}
15737 @opindex mfixed-range
15738 Generate code treating the given register range as fixed registers.
15739 A fixed register is one that the register allocator can not use.  This is
15740 useful when compiling kernel code.  A register range is specified as
15741 two registers separated by a dash.  Multiple register ranges can be
15742 specified separated by a comma.
15743
15744 @item -mdual-nops
15745 @itemx -mdual-nops=@var{n}
15746 @opindex mdual-nops
15747 By default, GCC will insert nops to increase dual issue when it expects
15748 it to increase performance.  @var{n} can be a value from 0 to 10.  A
15749 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
15750 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
15751
15752 @item -mhint-max-nops=@var{n}
15753 @opindex mhint-max-nops
15754 Maximum number of nops to insert for a branch hint.  A branch hint must
15755 be at least 8 instructions away from the branch it is effecting.  GCC
15756 will insert up to @var{n} nops to enforce this, otherwise it will not
15757 generate the branch hint.
15758
15759 @item -mhint-max-distance=@var{n}
15760 @opindex mhint-max-distance
15761 The encoding of the branch hint instruction limits the hint to be within
15762 256 instructions of the branch it is effecting.  By default, GCC makes
15763 sure it is within 125.
15764
15765 @item -msafe-hints
15766 @opindex msafe-hints
15767 Work around a hardware bug which causes the SPU to stall indefinitely.
15768 By default, GCC will insert the @code{hbrp} instruction to make sure
15769 this stall won't happen.
15770
15771 @end table
15772
15773 @node System V Options
15774 @subsection Options for System V
15775
15776 These additional options are available on System V Release 4 for
15777 compatibility with other compilers on those systems:
15778
15779 @table @gcctabopt
15780 @item -G
15781 @opindex G
15782 Create a shared object.
15783 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
15784
15785 @item -Qy
15786 @opindex Qy
15787 Identify the versions of each tool used by the compiler, in a
15788 @code{.ident} assembler directive in the output.
15789
15790 @item -Qn
15791 @opindex Qn
15792 Refrain from adding @code{.ident} directives to the output file (this is
15793 the default).
15794
15795 @item -YP,@var{dirs}
15796 @opindex YP
15797 Search the directories @var{dirs}, and no others, for libraries
15798 specified with @option{-l}.
15799
15800 @item -Ym,@var{dir}
15801 @opindex Ym
15802 Look in the directory @var{dir} to find the M4 preprocessor.
15803 The assembler uses this option.
15804 @c This is supposed to go with a -Yd for predefined M4 macro files, but
15805 @c the generic assembler that comes with Solaris takes just -Ym.
15806 @end table
15807
15808 @node V850 Options
15809 @subsection V850 Options
15810 @cindex V850 Options
15811
15812 These @samp{-m} options are defined for V850 implementations:
15813
15814 @table @gcctabopt
15815 @item -mlong-calls
15816 @itemx -mno-long-calls
15817 @opindex mlong-calls
15818 @opindex mno-long-calls
15819 Treat all calls as being far away (near).  If calls are assumed to be
15820 far away, the compiler will always load the functions address up into a
15821 register, and call indirect through the pointer.
15822
15823 @item -mno-ep
15824 @itemx -mep
15825 @opindex mno-ep
15826 @opindex mep
15827 Do not optimize (do optimize) basic blocks that use the same index
15828 pointer 4 or more times to copy pointer into the @code{ep} register, and
15829 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
15830 option is on by default if you optimize.
15831
15832 @item -mno-prolog-function
15833 @itemx -mprolog-function
15834 @opindex mno-prolog-function
15835 @opindex mprolog-function
15836 Do not use (do use) external functions to save and restore registers
15837 at the prologue and epilogue of a function.  The external functions
15838 are slower, but use less code space if more than one function saves
15839 the same number of registers.  The @option{-mprolog-function} option
15840 is on by default if you optimize.
15841
15842 @item -mspace
15843 @opindex mspace
15844 Try to make the code as small as possible.  At present, this just turns
15845 on the @option{-mep} and @option{-mprolog-function} options.
15846
15847 @item -mtda=@var{n}
15848 @opindex mtda
15849 Put static or global variables whose size is @var{n} bytes or less into
15850 the tiny data area that register @code{ep} points to.  The tiny data
15851 area can hold up to 256 bytes in total (128 bytes for byte references).
15852
15853 @item -msda=@var{n}
15854 @opindex msda
15855 Put static or global variables whose size is @var{n} bytes or less into
15856 the small data area that register @code{gp} points to.  The small data
15857 area can hold up to 64 kilobytes.
15858
15859 @item -mzda=@var{n}
15860 @opindex mzda
15861 Put static or global variables whose size is @var{n} bytes or less into
15862 the first 32 kilobytes of memory.
15863
15864 @item -mv850
15865 @opindex mv850
15866 Specify that the target processor is the V850.
15867
15868 @item -mbig-switch
15869 @opindex mbig-switch
15870 Generate code suitable for big switch tables.  Use this option only if
15871 the assembler/linker complain about out of range branches within a switch
15872 table.
15873
15874 @item -mapp-regs
15875 @opindex mapp-regs
15876 This option will cause r2 and r5 to be used in the code generated by
15877 the compiler.  This setting is the default.
15878
15879 @item -mno-app-regs
15880 @opindex mno-app-regs
15881 This option will cause r2 and r5 to be treated as fixed registers.
15882
15883 @item -mv850e1
15884 @opindex mv850e1
15885 Specify that the target processor is the V850E1.  The preprocessor
15886 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
15887 this option is used.
15888
15889 @item -mv850e
15890 @opindex mv850e
15891 Specify that the target processor is the V850E@.  The preprocessor
15892 constant @samp{__v850e__} will be defined if this option is used.
15893
15894 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
15895 are defined then a default target processor will be chosen and the
15896 relevant @samp{__v850*__} preprocessor constant will be defined.
15897
15898 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
15899 defined, regardless of which processor variant is the target.
15900
15901 @item -mdisable-callt
15902 @opindex mdisable-callt
15903 This option will suppress generation of the CALLT instruction for the
15904 v850e and v850e1 flavors of the v850 architecture.  The default is
15905 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
15906
15907 @end table
15908
15909 @node VAX Options
15910 @subsection VAX Options
15911 @cindex VAX options
15912
15913 These @samp{-m} options are defined for the VAX:
15914
15915 @table @gcctabopt
15916 @item -munix
15917 @opindex munix
15918 Do not output certain jump instructions (@code{aobleq} and so on)
15919 that the Unix assembler for the VAX cannot handle across long
15920 ranges.
15921
15922 @item -mgnu
15923 @opindex mgnu
15924 Do output those jump instructions, on the assumption that you
15925 will assemble with the GNU assembler.
15926
15927 @item -mg
15928 @opindex mg
15929 Output code for g-format floating point numbers instead of d-format.
15930 @end table
15931
15932 @node VxWorks Options
15933 @subsection VxWorks Options
15934 @cindex VxWorks Options
15935
15936 The options in this section are defined for all VxWorks targets.
15937 Options specific to the target hardware are listed with the other
15938 options for that target.
15939
15940 @table @gcctabopt
15941 @item -mrtp
15942 @opindex mrtp
15943 GCC can generate code for both VxWorks kernels and real time processes
15944 (RTPs).  This option switches from the former to the latter.  It also
15945 defines the preprocessor macro @code{__RTP__}.
15946
15947 @item -non-static
15948 @opindex non-static
15949 Link an RTP executable against shared libraries rather than static
15950 libraries.  The options @option{-static} and @option{-shared} can
15951 also be used for RTPs (@pxref{Link Options}); @option{-static}
15952 is the default.
15953
15954 @item -Bstatic
15955 @itemx -Bdynamic
15956 @opindex Bstatic
15957 @opindex Bdynamic
15958 These options are passed down to the linker.  They are defined for
15959 compatibility with Diab.
15960
15961 @item -Xbind-lazy
15962 @opindex Xbind-lazy
15963 Enable lazy binding of function calls.  This option is equivalent to
15964 @option{-Wl,-z,now} and is defined for compatibility with Diab.
15965
15966 @item -Xbind-now
15967 @opindex Xbind-now
15968 Disable lazy binding of function calls.  This option is the default and
15969 is defined for compatibility with Diab.
15970 @end table
15971
15972 @node x86-64 Options
15973 @subsection x86-64 Options
15974 @cindex x86-64 options
15975
15976 These are listed under @xref{i386 and x86-64 Options}.
15977
15978 @node i386 and x86-64 Windows Options
15979 @subsection i386 and x86-64 Windows Options
15980 @cindex i386 and x86-64 Windows Options
15981
15982 These additional options are available for Windows targets:
15983
15984 @table @gcctabopt
15985 @item -mconsole
15986 @opindex mconsole
15987 This option is available for Cygwin and MinGW targets.  It
15988 specifies that a console application is to be generated, by
15989 instructing the linker to set the PE header subsystem type
15990 required for console applications.
15991 This is the default behavior for Cygwin and MinGW targets.
15992
15993 @item -mcygwin
15994 @opindex mcygwin
15995 This option is available for Cygwin targets.  It specifies that
15996 the Cygwin internal interface is to be used for predefined
15997 preprocessor macros, C runtime libraries and related linker
15998 paths and options.  For Cygwin targets this is the default behavior.
15999 This option is deprecated and will be removed in a future release.
16000
16001 @item -mno-cygwin
16002 @opindex mno-cygwin
16003 This option is available for Cygwin targets.  It specifies that
16004 the MinGW internal interface is to be used instead of Cygwin's, by
16005 setting MinGW-related predefined macros and linker paths and default
16006 library options.
16007 This option is deprecated and will be removed in a future release.
16008
16009 @item -mdll
16010 @opindex mdll
16011 This option is available for Cygwin and MinGW targets.  It
16012 specifies that a DLL - a dynamic link library - is to be
16013 generated, enabling the selection of the required runtime
16014 startup object and entry point.
16015
16016 @item -mnop-fun-dllimport
16017 @opindex mnop-fun-dllimport
16018 This option is available for Cygwin and MinGW targets.  It
16019 specifies that the dllimport attribute should be ignored.
16020
16021 @item -mthread
16022 @opindex mthread
16023 This option is available for MinGW targets. It specifies
16024 that MinGW-specific thread support is to be used.
16025
16026 @item -municode
16027 @opindex municode
16028 This option is available for mingw-w64 targets.  It specifies
16029 that the UNICODE macro is getting pre-defined and that the
16030 unicode capable runtime startup code is choosen.
16031
16032 @item -mwin32
16033 @opindex mwin32
16034 This option is available for Cygwin and MinGW targets.  It
16035 specifies that the typical Windows pre-defined macros are to
16036 be set in the pre-processor, but does not influence the choice
16037 of runtime library/startup code.
16038
16039 @item -mwindows
16040 @opindex mwindows
16041 This option is available for Cygwin and MinGW targets.  It
16042 specifies that a GUI application is to be generated by
16043 instructing the linker to set the PE header subsystem type
16044 appropriately.
16045
16046 @item -mpe-aligned-commons
16047 @opindex mpe-aligned-commons
16048 This option is available for Cygwin and MinGW targets.  It
16049 specifies that the GNU extension to the PE file format that
16050 permits the correct alignment of COMMON variables should be
16051 used when generating code.  It will be enabled by default if
16052 GCC detects that the target assembler found during configuration
16053 supports the feature.
16054 @end table
16055
16056 See also under @ref{i386 and x86-64 Options} for standard options.
16057
16058 @node Xstormy16 Options
16059 @subsection Xstormy16 Options
16060 @cindex Xstormy16 Options
16061
16062 These options are defined for Xstormy16:
16063
16064 @table @gcctabopt
16065 @item -msim
16066 @opindex msim
16067 Choose startup files and linker script suitable for the simulator.
16068 @end table
16069
16070 @node Xtensa Options
16071 @subsection Xtensa Options
16072 @cindex Xtensa Options
16073
16074 These options are supported for Xtensa targets:
16075
16076 @table @gcctabopt
16077 @item -mconst16
16078 @itemx -mno-const16
16079 @opindex mconst16
16080 @opindex mno-const16
16081 Enable or disable use of @code{CONST16} instructions for loading
16082 constant values.  The @code{CONST16} instruction is currently not a
16083 standard option from Tensilica.  When enabled, @code{CONST16}
16084 instructions are always used in place of the standard @code{L32R}
16085 instructions.  The use of @code{CONST16} is enabled by default only if
16086 the @code{L32R} instruction is not available.
16087
16088 @item -mfused-madd
16089 @itemx -mno-fused-madd
16090 @opindex mfused-madd
16091 @opindex mno-fused-madd
16092 Enable or disable use of fused multiply/add and multiply/subtract
16093 instructions in the floating-point option.  This has no effect if the
16094 floating-point option is not also enabled.  Disabling fused multiply/add
16095 and multiply/subtract instructions forces the compiler to use separate
16096 instructions for the multiply and add/subtract operations.  This may be
16097 desirable in some cases where strict IEEE 754-compliant results are
16098 required: the fused multiply add/subtract instructions do not round the
16099 intermediate result, thereby producing results with @emph{more} bits of
16100 precision than specified by the IEEE standard.  Disabling fused multiply
16101 add/subtract instructions also ensures that the program output is not
16102 sensitive to the compiler's ability to combine multiply and add/subtract
16103 operations.
16104
16105 @item -mserialize-volatile
16106 @itemx -mno-serialize-volatile
16107 @opindex mserialize-volatile
16108 @opindex mno-serialize-volatile
16109 When this option is enabled, GCC inserts @code{MEMW} instructions before
16110 @code{volatile} memory references to guarantee sequential consistency.
16111 The default is @option{-mserialize-volatile}.  Use
16112 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
16113
16114 @item -mtext-section-literals
16115 @itemx -mno-text-section-literals
16116 @opindex mtext-section-literals
16117 @opindex mno-text-section-literals
16118 Control the treatment of literal pools.  The default is
16119 @option{-mno-text-section-literals}, which places literals in a separate
16120 section in the output file.  This allows the literal pool to be placed
16121 in a data RAM/ROM, and it also allows the linker to combine literal
16122 pools from separate object files to remove redundant literals and
16123 improve code size.  With @option{-mtext-section-literals}, the literals
16124 are interspersed in the text section in order to keep them as close as
16125 possible to their references.  This may be necessary for large assembly
16126 files.
16127
16128 @item -mtarget-align
16129 @itemx -mno-target-align
16130 @opindex mtarget-align
16131 @opindex mno-target-align
16132 When this option is enabled, GCC instructs the assembler to
16133 automatically align instructions to reduce branch penalties at the
16134 expense of some code density.  The assembler attempts to widen density
16135 instructions to align branch targets and the instructions following call
16136 instructions.  If there are not enough preceding safe density
16137 instructions to align a target, no widening will be performed.  The
16138 default is @option{-mtarget-align}.  These options do not affect the
16139 treatment of auto-aligned instructions like @code{LOOP}, which the
16140 assembler will always align, either by widening density instructions or
16141 by inserting no-op instructions.
16142
16143 @item -mlongcalls
16144 @itemx -mno-longcalls
16145 @opindex mlongcalls
16146 @opindex mno-longcalls
16147 When this option is enabled, GCC instructs the assembler to translate
16148 direct calls to indirect calls unless it can determine that the target
16149 of a direct call is in the range allowed by the call instruction.  This
16150 translation typically occurs for calls to functions in other source
16151 files.  Specifically, the assembler translates a direct @code{CALL}
16152 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
16153 The default is @option{-mno-longcalls}.  This option should be used in
16154 programs where the call target can potentially be out of range.  This
16155 option is implemented in the assembler, not the compiler, so the
16156 assembly code generated by GCC will still show direct call
16157 instructions---look at the disassembled object code to see the actual
16158 instructions.  Note that the assembler will use an indirect call for
16159 every cross-file call, not just those that really will be out of range.
16160 @end table
16161
16162 @node zSeries Options
16163 @subsection zSeries Options
16164 @cindex zSeries options
16165
16166 These are listed under @xref{S/390 and zSeries Options}.
16167
16168 @node Code Gen Options
16169 @section Options for Code Generation Conventions
16170 @cindex code generation conventions
16171 @cindex options, code generation
16172 @cindex run-time options
16173
16174 These machine-independent options control the interface conventions
16175 used in code generation.
16176
16177 Most of them have both positive and negative forms; the negative form
16178 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
16179 one of the forms is listed---the one which is not the default.  You
16180 can figure out the other form by either removing @samp{no-} or adding
16181 it.
16182
16183 @table @gcctabopt
16184 @item -fbounds-check
16185 @opindex fbounds-check
16186 For front-ends that support it, generate additional code to check that
16187 indices used to access arrays are within the declared range.  This is
16188 currently only supported by the Java and Fortran front-ends, where
16189 this option defaults to true and false respectively.
16190
16191 @item -ftrapv
16192 @opindex ftrapv
16193 This option generates traps for signed overflow on addition, subtraction,
16194 multiplication operations.
16195
16196 @item -fwrapv
16197 @opindex fwrapv
16198 This option instructs the compiler to assume that signed arithmetic
16199 overflow of addition, subtraction and multiplication wraps around
16200 using twos-complement representation.  This flag enables some optimizations
16201 and disables others.  This option is enabled by default for the Java
16202 front-end, as required by the Java language specification.
16203
16204 @item -fexceptions
16205 @opindex fexceptions
16206 Enable exception handling.  Generates extra code needed to propagate
16207 exceptions.  For some targets, this implies GCC will generate frame
16208 unwind information for all functions, which can produce significant data
16209 size overhead, although it does not affect execution.  If you do not
16210 specify this option, GCC will enable it by default for languages like
16211 C++ which normally require exception handling, and disable it for
16212 languages like C that do not normally require it.  However, you may need
16213 to enable this option when compiling C code that needs to interoperate
16214 properly with exception handlers written in C++.  You may also wish to
16215 disable this option if you are compiling older C++ programs that don't
16216 use exception handling.
16217
16218 @item -fnon-call-exceptions
16219 @opindex fnon-call-exceptions
16220 Generate code that allows trapping instructions to throw exceptions.
16221 Note that this requires platform-specific runtime support that does
16222 not exist everywhere.  Moreover, it only allows @emph{trapping}
16223 instructions to throw exceptions, i.e.@: memory references or floating
16224 point instructions.  It does not allow exceptions to be thrown from
16225 arbitrary signal handlers such as @code{SIGALRM}.
16226
16227 @item -funwind-tables
16228 @opindex funwind-tables
16229 Similar to @option{-fexceptions}, except that it will just generate any needed
16230 static data, but will not affect the generated code in any other way.
16231 You will normally not enable this option; instead, a language processor
16232 that needs this handling would enable it on your behalf.
16233
16234 @item -fasynchronous-unwind-tables
16235 @opindex fasynchronous-unwind-tables
16236 Generate unwind table in dwarf2 format, if supported by target machine.  The
16237 table is exact at each instruction boundary, so it can be used for stack
16238 unwinding from asynchronous events (such as debugger or garbage collector).
16239
16240 @item -fpcc-struct-return
16241 @opindex fpcc-struct-return
16242 Return ``short'' @code{struct} and @code{union} values in memory like
16243 longer ones, rather than in registers.  This convention is less
16244 efficient, but it has the advantage of allowing intercallability between
16245 GCC-compiled files and files compiled with other compilers, particularly
16246 the Portable C Compiler (pcc).
16247
16248 The precise convention for returning structures in memory depends
16249 on the target configuration macros.
16250
16251 Short structures and unions are those whose size and alignment match
16252 that of some integer type.
16253
16254 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
16255 switch is not binary compatible with code compiled with the
16256 @option{-freg-struct-return} switch.
16257 Use it to conform to a non-default application binary interface.
16258
16259 @item -freg-struct-return
16260 @opindex freg-struct-return
16261 Return @code{struct} and @code{union} values in registers when possible.
16262 This is more efficient for small structures than
16263 @option{-fpcc-struct-return}.
16264
16265 If you specify neither @option{-fpcc-struct-return} nor
16266 @option{-freg-struct-return}, GCC defaults to whichever convention is
16267 standard for the target.  If there is no standard convention, GCC
16268 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
16269 the principal compiler.  In those cases, we can choose the standard, and
16270 we chose the more efficient register return alternative.
16271
16272 @strong{Warning:} code compiled with the @option{-freg-struct-return}
16273 switch is not binary compatible with code compiled with the
16274 @option{-fpcc-struct-return} switch.
16275 Use it to conform to a non-default application binary interface.
16276
16277 @item -fshort-enums
16278 @opindex fshort-enums
16279 Allocate to an @code{enum} type only as many bytes as it needs for the
16280 declared range of possible values.  Specifically, the @code{enum} type
16281 will be equivalent to the smallest integer type which has enough room.
16282
16283 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
16284 code that is not binary compatible with code generated without that switch.
16285 Use it to conform to a non-default application binary interface.
16286
16287 @item -fshort-double
16288 @opindex fshort-double
16289 Use the same size for @code{double} as for @code{float}.
16290
16291 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
16292 code that is not binary compatible with code generated without that switch.
16293 Use it to conform to a non-default application binary interface.
16294
16295 @item -fshort-wchar
16296 @opindex fshort-wchar
16297 Override the underlying type for @samp{wchar_t} to be @samp{short
16298 unsigned int} instead of the default for the target.  This option is
16299 useful for building programs to run under WINE@.
16300
16301 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
16302 code that is not binary compatible with code generated without that switch.
16303 Use it to conform to a non-default application binary interface.
16304
16305 @item -fno-common
16306 @opindex fno-common
16307 In C code, controls the placement of uninitialized global variables.
16308 Unix C compilers have traditionally permitted multiple definitions of
16309 such variables in different compilation units by placing the variables
16310 in a common block.
16311 This is the behavior specified by @option{-fcommon}, and is the default
16312 for GCC on most targets.
16313 On the other hand, this behavior is not required by ISO C, and on some
16314 targets may carry a speed or code size penalty on variable references.
16315 The @option{-fno-common} option specifies that the compiler should place
16316 uninitialized global variables in the data section of the object file,
16317 rather than generating them as common blocks.
16318 This has the effect that if the same variable is declared
16319 (without @code{extern}) in two different compilations,
16320 you will get a multiple-definition error when you link them.
16321 In this case, you must compile with @option{-fcommon} instead.
16322 Compiling with @option{-fno-common} is useful on targets for which
16323 it provides better performance, or if you wish to verify that the
16324 program will work on other systems which always treat uninitialized
16325 variable declarations this way.
16326
16327 @item -fno-ident
16328 @opindex fno-ident
16329 Ignore the @samp{#ident} directive.
16330
16331 @item -finhibit-size-directive
16332 @opindex finhibit-size-directive
16333 Don't output a @code{.size} assembler directive, or anything else that
16334 would cause trouble if the function is split in the middle, and the
16335 two halves are placed at locations far apart in memory.  This option is
16336 used when compiling @file{crtstuff.c}; you should not need to use it
16337 for anything else.
16338
16339 @item -fverbose-asm
16340 @opindex fverbose-asm
16341 Put extra commentary information in the generated assembly code to
16342 make it more readable.  This option is generally only of use to those
16343 who actually need to read the generated assembly code (perhaps while
16344 debugging the compiler itself).
16345
16346 @option{-fno-verbose-asm}, the default, causes the
16347 extra information to be omitted and is useful when comparing two assembler
16348 files.
16349
16350 @item -frecord-gcc-switches
16351 @opindex frecord-gcc-switches
16352 This switch causes the command line that was used to invoke the
16353 compiler to be recorded into the object file that is being created.
16354 This switch is only implemented on some targets and the exact format
16355 of the recording is target and binary file format dependent, but it
16356 usually takes the form of a section containing ASCII text.  This
16357 switch is related to the @option{-fverbose-asm} switch, but that
16358 switch only records information in the assembler output file as
16359 comments, so it never reaches the object file.
16360
16361 @item -fpic
16362 @opindex fpic
16363 @cindex global offset table
16364 @cindex PIC
16365 Generate position-independent code (PIC) suitable for use in a shared
16366 library, if supported for the target machine.  Such code accesses all
16367 constant addresses through a global offset table (GOT)@.  The dynamic
16368 loader resolves the GOT entries when the program starts (the dynamic
16369 loader is not part of GCC; it is part of the operating system).  If
16370 the GOT size for the linked executable exceeds a machine-specific
16371 maximum size, you get an error message from the linker indicating that
16372 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
16373 instead.  (These maximums are 8k on the SPARC and 32k
16374 on the m68k and RS/6000.  The 386 has no such limit.)
16375
16376 Position-independent code requires special support, and therefore works
16377 only on certain machines.  For the 386, GCC supports PIC for System V
16378 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
16379 position-independent.
16380
16381 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
16382 are defined to 1.
16383
16384 @item -fPIC
16385 @opindex fPIC
16386 If supported for the target machine, emit position-independent code,
16387 suitable for dynamic linking and avoiding any limit on the size of the
16388 global offset table.  This option makes a difference on the m68k,
16389 PowerPC and SPARC@.
16390
16391 Position-independent code requires special support, and therefore works
16392 only on certain machines.
16393
16394 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
16395 are defined to 2.
16396
16397 @item -fpie
16398 @itemx -fPIE
16399 @opindex fpie
16400 @opindex fPIE
16401 These options are similar to @option{-fpic} and @option{-fPIC}, but
16402 generated position independent code can be only linked into executables.
16403 Usually these options are used when @option{-pie} GCC option will be
16404 used during linking.
16405
16406 @option{-fpie} and @option{-fPIE} both define the macros
16407 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
16408 for @option{-fpie} and 2 for @option{-fPIE}.
16409
16410 @item -fno-jump-tables
16411 @opindex fno-jump-tables
16412 Do not use jump tables for switch statements even where it would be
16413 more efficient than other code generation strategies.  This option is
16414 of use in conjunction with @option{-fpic} or @option{-fPIC} for
16415 building code which forms part of a dynamic linker and cannot
16416 reference the address of a jump table.  On some targets, jump tables
16417 do not require a GOT and this option is not needed.
16418
16419 @item -ffixed-@var{reg}
16420 @opindex ffixed
16421 Treat the register named @var{reg} as a fixed register; generated code
16422 should never refer to it (except perhaps as a stack pointer, frame
16423 pointer or in some other fixed role).
16424
16425 @var{reg} must be the name of a register.  The register names accepted
16426 are machine-specific and are defined in the @code{REGISTER_NAMES}
16427 macro in the machine description macro file.
16428
16429 This flag does not have a negative form, because it specifies a
16430 three-way choice.
16431
16432 @item -fcall-used-@var{reg}
16433 @opindex fcall-used
16434 Treat the register named @var{reg} as an allocable register that is
16435 clobbered by function calls.  It may be allocated for temporaries or
16436 variables that do not live across a call.  Functions compiled this way
16437 will not save and restore the register @var{reg}.
16438
16439 It is an error to used this flag with the frame pointer or stack pointer.
16440 Use of this flag for other registers that have fixed pervasive roles in
16441 the machine's execution model will produce disastrous results.
16442
16443 This flag does not have a negative form, because it specifies a
16444 three-way choice.
16445
16446 @item -fcall-saved-@var{reg}
16447 @opindex fcall-saved
16448 Treat the register named @var{reg} as an allocable register saved by
16449 functions.  It may be allocated even for temporaries or variables that
16450 live across a call.  Functions compiled this way will save and restore
16451 the register @var{reg} if they use it.
16452
16453 It is an error to used this flag with the frame pointer or stack pointer.
16454 Use of this flag for other registers that have fixed pervasive roles in
16455 the machine's execution model will produce disastrous results.
16456
16457 A different sort of disaster will result from the use of this flag for
16458 a register in which function values may be returned.
16459
16460 This flag does not have a negative form, because it specifies a
16461 three-way choice.
16462
16463 @item -fpack-struct[=@var{n}]
16464 @opindex fpack-struct
16465 Without a value specified, pack all structure members together without
16466 holes.  When a value is specified (which must be a small power of two), pack
16467 structure members according to this value, representing the maximum
16468 alignment (that is, objects with default alignment requirements larger than
16469 this will be output potentially unaligned at the next fitting location.
16470
16471 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
16472 code that is not binary compatible with code generated without that switch.
16473 Additionally, it makes the code suboptimal.
16474 Use it to conform to a non-default application binary interface.
16475
16476 @item -finstrument-functions
16477 @opindex finstrument-functions
16478 Generate instrumentation calls for entry and exit to functions.  Just
16479 after function entry and just before function exit, the following
16480 profiling functions will be called with the address of the current
16481 function and its call site.  (On some platforms,
16482 @code{__builtin_return_address} does not work beyond the current
16483 function, so the call site information may not be available to the
16484 profiling functions otherwise.)
16485
16486 @smallexample
16487 void __cyg_profile_func_enter (void *this_fn,
16488                                void *call_site);
16489 void __cyg_profile_func_exit  (void *this_fn,
16490                                void *call_site);
16491 @end smallexample
16492
16493 The first argument is the address of the start of the current function,
16494 which may be looked up exactly in the symbol table.
16495
16496 This instrumentation is also done for functions expanded inline in other
16497 functions.  The profiling calls will indicate where, conceptually, the
16498 inline function is entered and exited.  This means that addressable
16499 versions of such functions must be available.  If all your uses of a
16500 function are expanded inline, this may mean an additional expansion of
16501 code size.  If you use @samp{extern inline} in your C code, an
16502 addressable version of such functions must be provided.  (This is
16503 normally the case anyways, but if you get lucky and the optimizer always
16504 expands the functions inline, you might have gotten away without
16505 providing static copies.)
16506
16507 A function may be given the attribute @code{no_instrument_function}, in
16508 which case this instrumentation will not be done.  This can be used, for
16509 example, for the profiling functions listed above, high-priority
16510 interrupt routines, and any functions from which the profiling functions
16511 cannot safely be called (perhaps signal handlers, if the profiling
16512 routines generate output or allocate memory).
16513
16514 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
16515 @opindex finstrument-functions-exclude-file-list
16516
16517 Set the list of functions that are excluded from instrumentation (see
16518 the description of @code{-finstrument-functions}).  If the file that
16519 contains a function definition matches with one of @var{file}, then
16520 that function is not instrumented.  The match is done on substrings:
16521 if the @var{file} parameter is a substring of the file name, it is
16522 considered to be a match.
16523
16524 For example,
16525 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
16526 will exclude any inline function defined in files whose pathnames
16527 contain @code{/bits/stl} or @code{include/sys}.
16528
16529 If, for some reason, you want to include letter @code{','} in one of
16530 @var{sym}, write @code{'\,'}. For example,
16531 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
16532 (note the single quote surrounding the option).
16533
16534 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
16535 @opindex finstrument-functions-exclude-function-list
16536
16537 This is similar to @code{-finstrument-functions-exclude-file-list},
16538 but this option sets the list of function names to be excluded from
16539 instrumentation.  The function name to be matched is its user-visible
16540 name, such as @code{vector<int> blah(const vector<int> &)}, not the
16541 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
16542 match is done on substrings: if the @var{sym} parameter is a substring
16543 of the function name, it is considered to be a match.  For C99 and C++
16544 extended identifiers, the function name must be given in UTF-8, not
16545 using universal character names.
16546
16547 @item -fstack-check
16548 @opindex fstack-check
16549 Generate code to verify that you do not go beyond the boundary of the
16550 stack.  You should specify this flag if you are running in an
16551 environment with multiple threads, but only rarely need to specify it in
16552 a single-threaded environment since stack overflow is automatically
16553 detected on nearly all systems if there is only one stack.
16554
16555 Note that this switch does not actually cause checking to be done; the
16556 operating system or the language runtime must do that.  The switch causes
16557 generation of code to ensure that they see the stack being extended.
16558
16559 You can additionally specify a string parameter: @code{no} means no
16560 checking, @code{generic} means force the use of old-style checking,
16561 @code{specific} means use the best checking method and is equivalent
16562 to bare @option{-fstack-check}.
16563
16564 Old-style checking is a generic mechanism that requires no specific
16565 target support in the compiler but comes with the following drawbacks:
16566
16567 @enumerate
16568 @item
16569 Modified allocation strategy for large objects: they will always be
16570 allocated dynamically if their size exceeds a fixed threshold.
16571
16572 @item
16573 Fixed limit on the size of the static frame of functions: when it is
16574 topped by a particular function, stack checking is not reliable and
16575 a warning is issued by the compiler.
16576
16577 @item
16578 Inefficiency: because of both the modified allocation strategy and the
16579 generic implementation, the performances of the code are hampered.
16580 @end enumerate
16581
16582 Note that old-style stack checking is also the fallback method for
16583 @code{specific} if no target support has been added in the compiler.
16584
16585 @item -fstack-limit-register=@var{reg}
16586 @itemx -fstack-limit-symbol=@var{sym}
16587 @itemx -fno-stack-limit
16588 @opindex fstack-limit-register
16589 @opindex fstack-limit-symbol
16590 @opindex fno-stack-limit
16591 Generate code to ensure that the stack does not grow beyond a certain value,
16592 either the value of a register or the address of a symbol.  If the stack
16593 would grow beyond the value, a signal is raised.  For most targets,
16594 the signal is raised before the stack overruns the boundary, so
16595 it is possible to catch the signal without taking special precautions.
16596
16597 For instance, if the stack starts at absolute address @samp{0x80000000}
16598 and grows downwards, you can use the flags
16599 @option{-fstack-limit-symbol=__stack_limit} and
16600 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
16601 of 128KB@.  Note that this may only work with the GNU linker.
16602
16603 @cindex aliasing of parameters
16604 @cindex parameters, aliased
16605 @item -fargument-alias
16606 @itemx -fargument-noalias
16607 @itemx -fargument-noalias-global
16608 @itemx -fargument-noalias-anything
16609 @opindex fargument-alias
16610 @opindex fargument-noalias
16611 @opindex fargument-noalias-global
16612 @opindex fargument-noalias-anything
16613 Specify the possible relationships among parameters and between
16614 parameters and global data.
16615
16616 @option{-fargument-alias} specifies that arguments (parameters) may
16617 alias each other and may alias global storage.@*
16618 @option{-fargument-noalias} specifies that arguments do not alias
16619 each other, but may alias global storage.@*
16620 @option{-fargument-noalias-global} specifies that arguments do not
16621 alias each other and do not alias global storage.
16622 @option{-fargument-noalias-anything} specifies that arguments do not
16623 alias any other storage.
16624
16625 Each language will automatically use whatever option is required by
16626 the language standard.  You should not need to use these options yourself.
16627
16628 @item -fleading-underscore
16629 @opindex fleading-underscore
16630 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
16631 change the way C symbols are represented in the object file.  One use
16632 is to help link with legacy assembly code.
16633
16634 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
16635 generate code that is not binary compatible with code generated without that
16636 switch.  Use it to conform to a non-default application binary interface.
16637 Not all targets provide complete support for this switch.
16638
16639 @item -ftls-model=@var{model}
16640 @opindex ftls-model
16641 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
16642 The @var{model} argument should be one of @code{global-dynamic},
16643 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
16644
16645 The default without @option{-fpic} is @code{initial-exec}; with
16646 @option{-fpic} the default is @code{global-dynamic}.
16647
16648 @item -fvisibility=@var{default|internal|hidden|protected}
16649 @opindex fvisibility
16650 Set the default ELF image symbol visibility to the specified option---all
16651 symbols will be marked with this unless overridden within the code.
16652 Using this feature can very substantially improve linking and
16653 load times of shared object libraries, produce more optimized
16654 code, provide near-perfect API export and prevent symbol clashes.
16655 It is @strong{strongly} recommended that you use this in any shared objects
16656 you distribute.
16657
16658 Despite the nomenclature, @code{default} always means public ie;
16659 available to be linked against from outside the shared object.
16660 @code{protected} and @code{internal} are pretty useless in real-world
16661 usage so the only other commonly used option will be @code{hidden}.
16662 The default if @option{-fvisibility} isn't specified is
16663 @code{default}, i.e., make every
16664 symbol public---this causes the same behavior as previous versions of
16665 GCC@.
16666
16667 A good explanation of the benefits offered by ensuring ELF
16668 symbols have the correct visibility is given by ``How To Write
16669 Shared Libraries'' by Ulrich Drepper (which can be found at
16670 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
16671 solution made possible by this option to marking things hidden when
16672 the default is public is to make the default hidden and mark things
16673 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
16674 and @code{__attribute__ ((visibility("default")))} instead of
16675 @code{__declspec(dllexport)} you get almost identical semantics with
16676 identical syntax.  This is a great boon to those working with
16677 cross-platform projects.
16678
16679 For those adding visibility support to existing code, you may find
16680 @samp{#pragma GCC visibility} of use.  This works by you enclosing
16681 the declarations you wish to set visibility for with (for example)
16682 @samp{#pragma GCC visibility push(hidden)} and
16683 @samp{#pragma GCC visibility pop}.
16684 Bear in mind that symbol visibility should be viewed @strong{as
16685 part of the API interface contract} and thus all new code should
16686 always specify visibility when it is not the default ie; declarations
16687 only for use within the local DSO should @strong{always} be marked explicitly
16688 as hidden as so to avoid PLT indirection overheads---making this
16689 abundantly clear also aids readability and self-documentation of the code.
16690 Note that due to ISO C++ specification requirements, operator new and
16691 operator delete must always be of default visibility.
16692
16693 Be aware that headers from outside your project, in particular system
16694 headers and headers from any other library you use, may not be
16695 expecting to be compiled with visibility other than the default.  You
16696 may need to explicitly say @samp{#pragma GCC visibility push(default)}
16697 before including any such headers.
16698
16699 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
16700 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
16701 no modifications.  However, this means that calls to @samp{extern}
16702 functions with no explicit visibility will use the PLT, so it is more
16703 effective to use @samp{__attribute ((visibility))} and/or
16704 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
16705 declarations should be treated as hidden.
16706
16707 Note that @samp{-fvisibility} does affect C++ vague linkage
16708 entities. This means that, for instance, an exception class that will
16709 be thrown between DSOs must be explicitly marked with default
16710 visibility so that the @samp{type_info} nodes will be unified between
16711 the DSOs.
16712
16713 An overview of these techniques, their benefits and how to use them
16714 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
16715
16716 @end table
16717
16718 @c man end
16719
16720 @node Environment Variables
16721 @section Environment Variables Affecting GCC
16722 @cindex environment variables
16723
16724 @c man begin ENVIRONMENT
16725 This section describes several environment variables that affect how GCC
16726 operates.  Some of them work by specifying directories or prefixes to use
16727 when searching for various kinds of files.  Some are used to specify other
16728 aspects of the compilation environment.
16729
16730 Note that you can also specify places to search using options such as
16731 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
16732 take precedence over places specified using environment variables, which
16733 in turn take precedence over those specified by the configuration of GCC@.
16734 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
16735 GNU Compiler Collection (GCC) Internals}.
16736
16737 @table @env
16738 @item LANG
16739 @itemx LC_CTYPE
16740 @c @itemx LC_COLLATE
16741 @itemx LC_MESSAGES
16742 @c @itemx LC_MONETARY
16743 @c @itemx LC_NUMERIC
16744 @c @itemx LC_TIME
16745 @itemx LC_ALL
16746 @findex LANG
16747 @findex LC_CTYPE
16748 @c @findex LC_COLLATE
16749 @findex LC_MESSAGES
16750 @c @findex LC_MONETARY
16751 @c @findex LC_NUMERIC
16752 @c @findex LC_TIME
16753 @findex LC_ALL
16754 @cindex locale
16755 These environment variables control the way that GCC uses
16756 localization information that allow GCC to work with different
16757 national conventions.  GCC inspects the locale categories
16758 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
16759 so.  These locale categories can be set to any value supported by your
16760 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
16761 Kingdom encoded in UTF-8.
16762
16763 The @env{LC_CTYPE} environment variable specifies character
16764 classification.  GCC uses it to determine the character boundaries in
16765 a string; this is needed for some multibyte encodings that contain quote
16766 and escape characters that would otherwise be interpreted as a string
16767 end or escape.
16768
16769 The @env{LC_MESSAGES} environment variable specifies the language to
16770 use in diagnostic messages.
16771
16772 If the @env{LC_ALL} environment variable is set, it overrides the value
16773 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
16774 and @env{LC_MESSAGES} default to the value of the @env{LANG}
16775 environment variable.  If none of these variables are set, GCC
16776 defaults to traditional C English behavior.
16777
16778 @item TMPDIR
16779 @findex TMPDIR
16780 If @env{TMPDIR} is set, it specifies the directory to use for temporary
16781 files.  GCC uses temporary files to hold the output of one stage of
16782 compilation which is to be used as input to the next stage: for example,
16783 the output of the preprocessor, which is the input to the compiler
16784 proper.
16785
16786 @item GCC_EXEC_PREFIX
16787 @findex GCC_EXEC_PREFIX
16788 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
16789 names of the subprograms executed by the compiler.  No slash is added
16790 when this prefix is combined with the name of a subprogram, but you can
16791 specify a prefix that ends with a slash if you wish.
16792
16793 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
16794 an appropriate prefix to use based on the pathname it was invoked with.
16795
16796 If GCC cannot find the subprogram using the specified prefix, it
16797 tries looking in the usual places for the subprogram.
16798
16799 The default value of @env{GCC_EXEC_PREFIX} is
16800 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
16801 the installed compiler. In many cases @var{prefix} is the value
16802 of @code{prefix} when you ran the @file{configure} script.
16803
16804 Other prefixes specified with @option{-B} take precedence over this prefix.
16805
16806 This prefix is also used for finding files such as @file{crt0.o} that are
16807 used for linking.
16808
16809 In addition, the prefix is used in an unusual way in finding the
16810 directories to search for header files.  For each of the standard
16811 directories whose name normally begins with @samp{/usr/local/lib/gcc}
16812 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
16813 replacing that beginning with the specified prefix to produce an
16814 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
16815 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
16816 These alternate directories are searched first; the standard directories
16817 come next. If a standard directory begins with the configured
16818 @var{prefix} then the value of @var{prefix} is replaced by
16819 @env{GCC_EXEC_PREFIX} when looking for header files.
16820
16821 @item COMPILER_PATH
16822 @findex COMPILER_PATH
16823 The value of @env{COMPILER_PATH} is a colon-separated list of
16824 directories, much like @env{PATH}.  GCC tries the directories thus
16825 specified when searching for subprograms, if it can't find the
16826 subprograms using @env{GCC_EXEC_PREFIX}.
16827
16828 @item LIBRARY_PATH
16829 @findex LIBRARY_PATH
16830 The value of @env{LIBRARY_PATH} is a colon-separated list of
16831 directories, much like @env{PATH}.  When configured as a native compiler,
16832 GCC tries the directories thus specified when searching for special
16833 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
16834 using GCC also uses these directories when searching for ordinary
16835 libraries for the @option{-l} option (but directories specified with
16836 @option{-L} come first).
16837
16838 @item LANG
16839 @findex LANG
16840 @cindex locale definition
16841 This variable is used to pass locale information to the compiler.  One way in
16842 which this information is used is to determine the character set to be used
16843 when character literals, string literals and comments are parsed in C and C++.
16844 When the compiler is configured to allow multibyte characters,
16845 the following values for @env{LANG} are recognized:
16846
16847 @table @samp
16848 @item C-JIS
16849 Recognize JIS characters.
16850 @item C-SJIS
16851 Recognize SJIS characters.
16852 @item C-EUCJP
16853 Recognize EUCJP characters.
16854 @end table
16855
16856 If @env{LANG} is not defined, or if it has some other value, then the
16857 compiler will use mblen and mbtowc as defined by the default locale to
16858 recognize and translate multibyte characters.
16859 @end table
16860
16861 @noindent
16862 Some additional environments variables affect the behavior of the
16863 preprocessor.
16864
16865 @include cppenv.texi
16866
16867 @c man end
16868
16869 @node Precompiled Headers
16870 @section Using Precompiled Headers
16871 @cindex precompiled headers
16872 @cindex speed of compilation
16873
16874 Often large projects have many header files that are included in every
16875 source file.  The time the compiler takes to process these header files
16876 over and over again can account for nearly all of the time required to
16877 build the project.  To make builds faster, GCC allows users to
16878 `precompile' a header file; then, if builds can use the precompiled
16879 header file they will be much faster.
16880
16881 To create a precompiled header file, simply compile it as you would any
16882 other file, if necessary using the @option{-x} option to make the driver
16883 treat it as a C or C++ header file.  You will probably want to use a
16884 tool like @command{make} to keep the precompiled header up-to-date when
16885 the headers it contains change.
16886
16887 A precompiled header file will be searched for when @code{#include} is
16888 seen in the compilation.  As it searches for the included file
16889 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
16890 compiler looks for a precompiled header in each directory just before it
16891 looks for the include file in that directory.  The name searched for is
16892 the name specified in the @code{#include} with @samp{.gch} appended.  If
16893 the precompiled header file can't be used, it is ignored.
16894
16895 For instance, if you have @code{#include "all.h"}, and you have
16896 @file{all.h.gch} in the same directory as @file{all.h}, then the
16897 precompiled header file will be used if possible, and the original
16898 header will be used otherwise.
16899
16900 Alternatively, you might decide to put the precompiled header file in a
16901 directory and use @option{-I} to ensure that directory is searched
16902 before (or instead of) the directory containing the original header.
16903 Then, if you want to check that the precompiled header file is always
16904 used, you can put a file of the same name as the original header in this
16905 directory containing an @code{#error} command.
16906
16907 This also works with @option{-include}.  So yet another way to use
16908 precompiled headers, good for projects not designed with precompiled
16909 header files in mind, is to simply take most of the header files used by
16910 a project, include them from another header file, precompile that header
16911 file, and @option{-include} the precompiled header.  If the header files
16912 have guards against multiple inclusion, they will be skipped because
16913 they've already been included (in the precompiled header).
16914
16915 If you need to precompile the same header file for different
16916 languages, targets, or compiler options, you can instead make a
16917 @emph{directory} named like @file{all.h.gch}, and put each precompiled
16918 header in the directory, perhaps using @option{-o}.  It doesn't matter
16919 what you call the files in the directory, every precompiled header in
16920 the directory will be considered.  The first precompiled header
16921 encountered in the directory that is valid for this compilation will
16922 be used; they're searched in no particular order.
16923
16924 There are many other possibilities, limited only by your imagination,
16925 good sense, and the constraints of your build system.
16926
16927 A precompiled header file can be used only when these conditions apply:
16928
16929 @itemize
16930 @item
16931 Only one precompiled header can be used in a particular compilation.
16932
16933 @item
16934 A precompiled header can't be used once the first C token is seen.  You
16935 can have preprocessor directives before a precompiled header; you can
16936 even include a precompiled header from inside another header, so long as
16937 there are no C tokens before the @code{#include}.
16938
16939 @item
16940 The precompiled header file must be produced for the same language as
16941 the current compilation.  You can't use a C precompiled header for a C++
16942 compilation.
16943
16944 @item
16945 The precompiled header file must have been produced by the same compiler
16946 binary as the current compilation is using.
16947
16948 @item
16949 Any macros defined before the precompiled header is included must
16950 either be defined in the same way as when the precompiled header was
16951 generated, or must not affect the precompiled header, which usually
16952 means that they don't appear in the precompiled header at all.
16953
16954 The @option{-D} option is one way to define a macro before a
16955 precompiled header is included; using a @code{#define} can also do it.
16956 There are also some options that define macros implicitly, like
16957 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
16958 defined this way.
16959
16960 @item If debugging information is output when using the precompiled
16961 header, using @option{-g} or similar, the same kind of debugging information
16962 must have been output when building the precompiled header.  However,
16963 a precompiled header built using @option{-g} can be used in a compilation
16964 when no debugging information is being output.
16965
16966 @item The same @option{-m} options must generally be used when building
16967 and using the precompiled header.  @xref{Submodel Options},
16968 for any cases where this rule is relaxed.
16969
16970 @item Each of the following options must be the same when building and using
16971 the precompiled header:
16972
16973 @gccoptlist{-fexceptions}
16974
16975 @item
16976 Some other command-line options starting with @option{-f},
16977 @option{-p}, or @option{-O} must be defined in the same way as when
16978 the precompiled header was generated.  At present, it's not clear
16979 which options are safe to change and which are not; the safest choice
16980 is to use exactly the same options when generating and using the
16981 precompiled header.  The following are known to be safe:
16982
16983 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
16984 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
16985 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
16986 -pedantic-errors}
16987
16988 @end itemize
16989
16990 For all of these except the last, the compiler will automatically
16991 ignore the precompiled header if the conditions aren't met.  If you
16992 find an option combination that doesn't work and doesn't cause the
16993 precompiled header to be ignored, please consider filing a bug report,
16994 see @ref{Bugs}.
16995
16996 If you do use differing options when generating and using the
16997 precompiled header, the actual behavior will be a mixture of the
16998 behavior for the options.  For instance, if you use @option{-g} to
16999 generate the precompiled header but not when using it, you may or may
17000 not get debugging information for routines in the precompiled header.